2012-09-30 20:21:18 +04:00
|
|
|
foreach (_retval 0 1)
|
2013-05-05 19:00:24 +04:00
|
|
|
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/memtester.cxx.in" "${CMAKE_CURRENT_BINARY_DIR}/ret${_retval}.cxx" @ONLY)
|
2012-09-30 20:21:18 +04:00
|
|
|
endforeach ()
|
|
|
|
|
2013-05-05 19:00:24 +04:00
|
|
|
include_directories(${CMake_SOURCE_DIR}/Source ${CMake_BINARY_DIR}/Source)
|
|
|
|
|
2012-09-30 20:21:18 +04:00
|
|
|
# create binaries that we will use as a pseudo memory checker
|
2013-05-05 19:00:24 +04:00
|
|
|
add_executable(pseudo_valgrind "${CMAKE_CURRENT_BINARY_DIR}/ret0.cxx")
|
2012-09-30 20:21:18 +04:00
|
|
|
set_target_properties(pseudo_valgrind PROPERTIES OUTPUT_NAME valgrind)
|
2013-05-05 19:00:24 +04:00
|
|
|
target_link_libraries(pseudo_valgrind CMakeLib)
|
2012-09-30 20:21:18 +04:00
|
|
|
|
2013-05-05 19:00:24 +04:00
|
|
|
add_executable(pseudo_purify "${CMAKE_CURRENT_BINARY_DIR}/ret0.cxx")
|
2012-09-30 20:21:18 +04:00
|
|
|
set_target_properties(pseudo_purify PROPERTIES OUTPUT_NAME purify)
|
2013-05-05 19:00:24 +04:00
|
|
|
target_link_libraries(pseudo_purify CMakeLib)
|
|
|
|
add_executable(pseudo_BC "${CMAKE_CURRENT_BINARY_DIR}/ret0.cxx")
|
2012-09-30 20:21:18 +04:00
|
|
|
set_target_properties(pseudo_BC PROPERTIES OUTPUT_NAME BC)
|
2013-05-05 19:00:24 +04:00
|
|
|
target_link_libraries(pseudo_BC CMakeLib)
|
2012-09-30 20:21:18 +04:00
|
|
|
|
|
|
|
# binary to be used as pre- and post-memcheck command that fails
|
2013-05-05 19:00:24 +04:00
|
|
|
add_executable(memcheck_fail "${CMAKE_CURRENT_BINARY_DIR}/ret1.cxx")
|
|
|
|
target_link_libraries(memcheck_fail CMakeLib)
|
|
|
|
|
2013-05-06 15:09:22 +04:00
|
|
|
# Binaries that are used as memchecker that do not write the expected
|
|
|
|
# output file. Need to be in their own subdirectory as they have the
|
|
|
|
# same filenames.
|
2014-12-16 21:59:22 +03:00
|
|
|
add_subdirectory(NoLog)
|
2013-05-06 15:09:22 +04:00
|
|
|
|
2014-03-26 23:07:32 +04:00
|
|
|
# Xcode 2.x forgets to create the output directory before linking
|
|
|
|
# the individual architectures.
|
|
|
|
if(CMAKE_OSX_ARCHITECTURES AND XCODE AND NOT "${XCODE_VERSION}" MATCHES "^[^12]")
|
|
|
|
foreach(t
|
|
|
|
memcheck_fail
|
|
|
|
pseudo_BC
|
|
|
|
pseudo_purify
|
|
|
|
pseudo_valgrind
|
|
|
|
)
|
|
|
|
add_custom_command(TARGET ${t}
|
|
|
|
PRE_BUILD COMMAND ${CMAKE_COMMAND} -E make_directory "${CMAKE_CFG_INTDIR}"
|
|
|
|
)
|
|
|
|
endforeach()
|
|
|
|
endif()
|