CMakeLists.txt 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  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 "POSIX locking mechanisms: " ${HAVE_LOCKS})
  28. if(BLOCKS_ORGANIZATION STREQUAL "dll")
  29. message(STATUS "Block organization: Doubly-Linked Lists")
  30. else(BLOCKS_ORGANIZATION STREQUAL "dll")
  31. message(STATUS "Block organization: Singly-Linked Lists")
  32. endif(BLOCKS_ORGANIZATION STREQUAL "dll")
  33. message(STATUS "Predefined lists of fixed-sized blocks: " ${WITH_FIXED_LISTS})
  34. message(STATUS "Heap Ownership per Block: " ${WITH_OWNERSHIP})
  35. message(STATUS "Have statistics: " ${WITH_STATS})
  36. message(STATUS "Have knobs: " ${WITH_KNOBS})
  37. message(STATUS "Coalescing: " ${WITH_COALESCING})
  38. if(MAX_COALESCE_SIZE)
  39. if(WITH_COALESCING STREQUAL "fixed")
  40. message(STATUS " with max. coalescing size: " ${MAX_COALESCE_SIZE} " bytes")
  41. elseif(WITH_COALESCING STREQUAL "variable")
  42. message(STATUS " with initial max. coalescing size: " ${MAX_COALESCE_SIZE}
  43. " bytes")
  44. endif(WITH_COALESCING STREQUAL "fixed")
  45. endif(MAX_COALESCE_SIZE)
  46. message(STATUS "Splitting: " ${WITH_SPLITTING})
  47. if(MIN_SPLITTING_SIZE)
  48. if(WITH_SPLITTING STREQUAL "fixed")
  49. message(STATUS " with min. spliting size: " ${MIN_SPLITTING_SIZE} " bytes")
  50. elseif(WITH_SPLITTING STREQUAL "variable")
  51. message(STATUS " with initial min. spliting size: "
  52. ${MIN_SPLITTING_SIZE} " bytes")
  53. endif(WITH_SPLITTING STREQUAL "fixed")
  54. endif(MIN_SPLITTING_SIZE)
  55. message(STATUS "Adaptivity: " ${WITH_ADAPTIVITY})
  56. message(STATUS "********************************************")