project (dmmlib C) cmake_minimum_required (VERSION 2.6) set(APPLICATION_NAME ${PROJECT_NAME}) set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/Modules) include(DefineInstallationPaths) 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 -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}) if(NOT WITH_SYSTEM_CALLS STREQUAL "none") message(STATUS "Requesting blocks multiple of: " ${SYS_ALLOC_SIZE} " bytes") endif(NOT WITH_SYSTEM_CALLS STREQUAL "none") message(STATUS "POSIX locking mechanisms: " ${HAVE_LOCKS}) message(STATUS "Raw blocks type: " ${RAW_BLOCKS_TYPE}) if(RAW_BLOCKS_TYPE STREQUAL "freelist") 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 "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") if(COALESCE_AFTER_SPLIT) message(STATUS "Coalesce after split: " ${COALESCE_AFTER_SPLIT}) endif(COALESCE_AFTER_SPLIT) endif(MIN_SPLITTING_SIZE) endif(RAW_BLOCKS_TYPE STREQUAL "freelist") message(STATUS "Have statistics: " ${STATS}) message(STATUS "Requested Size per Block: " ${REQUEST_SIZE_INFO}) message(STATUS "Support for debug functions: " ${WITH_DEBUG}) message(STATUS "Adaptivity: " ${WITH_ADAPTIVITY}) message(STATUS "Support for realloc(): " ${WITH_REALLOC}) message(STATUS "********************************************")