project (dmmlib C) cmake_minimum_required (VERSION 2.6) set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/Modules) include(DefineOptions.cmake) include(MacroEnsureOutOfSourceBuild) macro_ensure_out_of_source_build("${PROJECT_NAME} requires an out of source build. Please create a separate build directory and run 'cmake /path/to/${PROJECT_NAME} [options]' there.") configure_file ( "${PROJECT_SOURCE_DIR}/dmm_config.h.in" "${PROJECT_BINARY_DIR}/dmm_config.h" ) include_directories("${PROJECT_BINARY_DIR}") #add_subdirectory(src) set(DMMLIB_SHARED_LIBRARY dmm_shared CACHE INTERNAL "dmmlib shared library" ) set(dmmlib_SRCS block_header.c coalesce.c custom_free.c custom_malloc.c dmm_adaptor.c dmm_init.c other.c sys_alloc.c ) if (HAVE_LOCKS) set(dmmlib_SRCS ${dmmlib_SRCS} posix_lock.c ) endif (HAVE_LOCKS) add_library(${DMMLIB_SHARED_LIBRARY} SHARED ${dmmlib_SRCS})