You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

31 lines
833 B

  1. cmake_minimum_required(VERSION 2.6)
  2. project(sylvan C)
  3. set(CMAKE_C_FLAGS "-g -O3 -Wextra -Wall -Werror -fno-strict-aliasing -std=gnu11")
  4. include_directories(.)
  5. add_executable(mc mc.c getrss.h getrss.c)
  6. target_link_libraries(mc sylvan)
  7. add_executable(lddmc lddmc.c getrss.h getrss.c)
  8. target_link_libraries(lddmc sylvan)
  9. include(CheckIncludeFiles)
  10. check_include_files("gperftools/profiler.h" HAVE_PROFILER)
  11. if(HAVE_PROFILER)
  12. set_target_properties(mc PROPERTIES COMPILE_DEFINITIONS "HAVE_PROFILER")
  13. target_link_libraries(mc profiler)
  14. set_target_properties(lddmc PROPERTIES COMPILE_DEFINITIONS "HAVE_PROFILER")
  15. target_link_libraries(lddmc profiler)
  16. endif()
  17. if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
  18. # add argp library for OSX
  19. target_link_libraries(mc argp)
  20. target_link_libraries(lddmc argp)
  21. endif()