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.") if(CMAKE_COMPILER_IS_GNUCC AND LINUXTEST) add_definitions(-std=c99) set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra -pedantic -Wshadow -Wpointer-arith -Wcast-align -Wwrite-strings -Wmissing-prototypes -Wmissing-declarations -Wredundant-decls -Wnested-externs -Winline -Wno-long-long -Wuninitialized -Wconversion -Wstrict-prototypes") endif(CMAKE_COMPILER_IS_GNUCC AND LINUXTEST) configure_file ( "${PROJECT_SOURCE_DIR}/dmm_config.h.in" "${PROJECT_BINARY_DIR}/dmm_config.h" ) include_directories("${PROJECT_BINARY_DIR}") add_subdirectory(include) add_subdirectory(src) if (WITH_EXAMPLES) add_subdirectory(examples) endif (WITH_EXAMPLES) if (WITH_DOC) add_subdirectory(doc) endif (WITH_DOC) message(STATUS "********************************************") message(STATUS "********** ${PROJECT_NAME} build options : **********") message(STATUS "OS call for memory requests: " ${WITH_SYSTEM_CALLS}) message(STATUS "POSIX locking mechanisms: " ${HAVE_LOCKS}) message(STATUS "Number of heaps per allocator: " ${NUM_HEAPS}) if(BLOCKS_ORGANIZATION STREQUAL "dll") message(STATUS "Block organization: Doubly-Linked Lists") else(BLOCKS_ORGANIZATION STREQUAL "dll") message(STATUS "Block organization: Singly-Linked Lists") endif(BLOCKS_ORGANIZATION STREQUAL "dll") if(SORT_POLICY STREQUAL "lifo") message(STATUS "Block sorting policy: LIFO-ordered") elseif(SORT_POLICY STREQUAL "fifo") message(STATUS "Block sorting policy: FIFO-ordered") elseif(SORT_POLICY STREQUAL "size") message(STATUS "Block sorting policy: Size-ordered") elseif(SORT_POLICY STREQUAL "address") message(STATUS "Block sorting policy: Address-ordered") endif(SORT_POLICY STREQUAL "lifo") message(STATUS "Predefined lists of fixed-sized blocks: " ${WITH_FIXED_LISTS}) message(STATUS "Requested Size per Block: " ${REQUEST_SIZE_INFO}) message(STATUS "Heap Ownership per Block: " ${WITH_OWNERSHIP}) message(STATUS "Have statistics: " ${WITH_STATS}) if (WITH_STATS) message(STATUS "Count memory accesses: " ${COUNT_ACCESSES}) message(STATUS "Count hops per request: " ${COUNT_HOPS}) endif (WITH_STATS) message(STATUS "Have knobs: " ${WITH_KNOBS}) message(STATUS "Search policy: " ${SEARCH_POLICY}) if(ALLOC_VAR_FIT OR HEAP_VAR_FIT) message(STATUS "Initial search policy: " ${INITIAL_SEARCH_POLICY}) endif(ALLOC_VAR_FIT OR HEAP_VAR_FIT) if(GOOD_FIT) message(STATUS "Acceptable fit percentage: " ${FIT_PERCENTAGE}) endif(GOOD_FIT) message(STATUS "Coalescing: " ${WITH_COALESCING}) if(MAX_COALESCE_SIZE) if(WITH_COALESCING STREQUAL "fixed") message(STATUS " with max. coalescing size: " ${MAX_COALESCE_SIZE} " bytes") elseif(WITH_COALESCING STREQUAL "variable") message(STATUS " with initial max. coalescing size: " ${MAX_COALESCE_SIZE} " bytes") endif(WITH_COALESCING STREQUAL "fixed") endif(MAX_COALESCE_SIZE) message(STATUS "Splitting: " ${WITH_SPLITTING}) if(MIN_SPLITTING_SIZE) if(WITH_SPLITTING STREQUAL "fixed") message(STATUS " with min. spliting size: " ${MIN_SPLITTING_SIZE} " bytes") elseif(WITH_SPLITTING STREQUAL "variable") message(STATUS " with initial min. spliting size: " ${MIN_SPLITTING_SIZE} " bytes") endif(WITH_SPLITTING STREQUAL "fixed") endif(MIN_SPLITTING_SIZE) message(STATUS "Adaptivity: " ${WITH_ADAPTIVITY}) message(STATUS "Support for realloc(): " ${WITH_REALLOC}) message(STATUS "********************************************")