CMakeLists.txt 3.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. project (dmmlib C)
  2. cmake_minimum_required (VERSION 2.6)
  3. set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/Modules)
  4. include(DefineOptions.cmake)
  5. include(MacroEnsureOutOfSourceBuild)
  6. 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.")
  7. if(CMAKE_COMPILER_IS_GNUCC AND LINUXTEST)
  8. add_definitions(-std=c99)
  9. 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")
  10. endif(CMAKE_COMPILER_IS_GNUCC AND LINUXTEST)
  11. configure_file (
  12. "${PROJECT_SOURCE_DIR}/dmm_config.h.in"
  13. "${PROJECT_BINARY_DIR}/dmm_config.h"
  14. )
  15. include_directories("${PROJECT_BINARY_DIR}")
  16. add_subdirectory(include)
  17. add_subdirectory(src)
  18. if (WITH_EXAMPLES)
  19. add_subdirectory(examples)
  20. endif (WITH_EXAMPLES)
  21. if (WITH_DOC)
  22. add_subdirectory(doc)
  23. endif (WITH_DOC)
  24. message(STATUS "********************************************")
  25. message(STATUS "********** ${PROJECT_NAME} build options : **********")
  26. message(STATUS "Memory space awareness: " ${WITH_MEMORY_SPACE_AWARENESS})
  27. message(STATUS "OS call for memory requests: " ${WITH_SYSTEM_CALLS})
  28. message(STATUS "POSIX locking mechanisms: " ${HAVE_LOCKS})
  29. if(BLOCKS_ORGANIZATION STREQUAL "dll")
  30. message(STATUS "Block organization: Doubly-Linked Lists")
  31. else(BLOCKS_ORGANIZATION STREQUAL "dll")
  32. message(STATUS "Block organization: Singly-Linked Lists")
  33. endif(BLOCKS_ORGANIZATION STREQUAL "dll")
  34. message(STATUS "Predefined lists of fixed-sized blocks: " ${WITH_FIXED_LISTS})
  35. message(STATUS "Heap Ownership per Block: " ${WITH_OWNERSHIP})
  36. message(STATUS "Have statistics: " ${WITH_STATS})
  37. message(STATUS "Have knobs: " ${WITH_KNOBS})
  38. message(STATUS "Search policy: " ${SEARCH_POLICY})
  39. if(ALLOC_VAR_FIT OR HEAP_VAR_FIT)
  40. message(STATUS "Initial search policy: " ${INITIAL_SEARCH_POLICY})
  41. endif(ALLOC_VAR_FIT OR HEAP_VAR_FIT)
  42. if(GOOD_FIT)
  43. message(STATUS "Acceptable fit percentage: " ${FIT_PERCENTAGE})
  44. endif(GOOD_FIT)
  45. message(STATUS "Coalescing: " ${WITH_COALESCING})
  46. if(MAX_COALESCE_SIZE)
  47. if(WITH_COALESCING STREQUAL "fixed")
  48. message(STATUS " with max. coalescing size: " ${MAX_COALESCE_SIZE} " bytes")
  49. elseif(WITH_COALESCING STREQUAL "variable")
  50. message(STATUS " with initial max. coalescing size: " ${MAX_COALESCE_SIZE}
  51. " bytes")
  52. endif(WITH_COALESCING STREQUAL "fixed")
  53. endif(MAX_COALESCE_SIZE)
  54. message(STATUS "Splitting: " ${WITH_SPLITTING})
  55. if(MIN_SPLITTING_SIZE)
  56. if(WITH_SPLITTING STREQUAL "fixed")
  57. message(STATUS " with min. spliting size: " ${MIN_SPLITTING_SIZE} " bytes")
  58. elseif(WITH_SPLITTING STREQUAL "variable")
  59. message(STATUS " with initial min. spliting size: "
  60. ${MIN_SPLITTING_SIZE} " bytes")
  61. endif(WITH_SPLITTING STREQUAL "fixed")
  62. endif(MIN_SPLITTING_SIZE)
  63. message(STATUS "Adaptivity: " ${WITH_ADAPTIVITY})
  64. message(STATUS "Support for realloc(): " ${WITH_REALLOC})
  65. message(STATUS "Replace function calls: " ${REPLACE_MALLOC})
  66. message(STATUS "********************************************")