CMakeLists.txt 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. foreach (_retval 0 1)
  2. configure_file("${CMAKE_CURRENT_SOURCE_DIR}/memtester.cxx.in" "${CMAKE_CURRENT_BINARY_DIR}/ret${_retval}.cxx" @ONLY)
  3. endforeach ()
  4. include_directories(${CMake_SOURCE_DIR}/Source ${CMake_BINARY_DIR}/Source)
  5. # create binaries that we will use as a pseudo memory checker
  6. add_executable(pseudo_valgrind "${CMAKE_CURRENT_BINARY_DIR}/ret0.cxx")
  7. set_target_properties(pseudo_valgrind PROPERTIES OUTPUT_NAME valgrind)
  8. target_link_libraries(pseudo_valgrind CMakeLib)
  9. add_executable(pseudo_purify "${CMAKE_CURRENT_BINARY_DIR}/ret0.cxx")
  10. set_target_properties(pseudo_purify PROPERTIES OUTPUT_NAME purify)
  11. target_link_libraries(pseudo_purify CMakeLib)
  12. add_executable(pseudo_BC "${CMAKE_CURRENT_BINARY_DIR}/ret0.cxx")
  13. set_target_properties(pseudo_BC PROPERTIES OUTPUT_NAME BC)
  14. target_link_libraries(pseudo_BC CMakeLib)
  15. # binary to be used as pre- and post-memcheck command that fails
  16. add_executable(memcheck_fail "${CMAKE_CURRENT_BINARY_DIR}/ret1.cxx")
  17. target_link_libraries(memcheck_fail CMakeLib)
  18. # Binaries that are used as memchecker that do not write the expected
  19. # output file. Need to be in their own subdirectory as they have the
  20. # same filenames.
  21. add_subdirectory(NoLog)
  22. # Xcode 2.x forgets to create the output directory before linking
  23. # the individual architectures.
  24. if(CMAKE_OSX_ARCHITECTURES AND XCODE AND NOT "${XCODE_VERSION}" MATCHES "^[^12]")
  25. foreach(t
  26. memcheck_fail
  27. pseudo_BC
  28. pseudo_purify
  29. pseudo_valgrind
  30. )
  31. add_custom_command(TARGET ${t}
  32. PRE_BUILD COMMAND ${CMAKE_COMMAND} -E make_directory "${CMAKE_CFG_INTDIR}"
  33. )
  34. endforeach()
  35. endif()