2009-12-08 19:44:50 +03:00
|
|
|
include_directories(
|
|
|
|
${CMAKE_CURRENT_BINARY_DIR}
|
|
|
|
${CMake_BINARY_DIR}/Source
|
|
|
|
${CMake_SOURCE_DIR}/Source
|
|
|
|
)
|
|
|
|
|
|
|
|
set(CMakeLib_TESTS
|
2009-12-08 23:44:22 +03:00
|
|
|
testUTF8
|
2009-12-08 19:44:50 +03:00
|
|
|
testXMLParser
|
2009-12-08 23:44:45 +03:00
|
|
|
testXMLSafe
|
2009-12-08 19:44:50 +03:00
|
|
|
)
|
|
|
|
|
|
|
|
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/testXMLParser.h.in
|
|
|
|
${CMAKE_CURRENT_BINARY_DIR}/testXMLParser.h @ONLY)
|
|
|
|
|
|
|
|
create_test_sourcelist(CMakeLib_TEST_SRCS CMakeLibTests.cxx ${CMakeLib_TESTS})
|
|
|
|
add_executable(CMakeLibTests ${CMakeLib_TEST_SRCS})
|
|
|
|
target_link_libraries(CMakeLibTests CMakeLib)
|
|
|
|
|
2009-12-09 18:56:30 +03: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]")
|
|
|
|
add_custom_command(
|
|
|
|
TARGET CMakeLibTests
|
|
|
|
PRE_BUILD COMMAND ${CMAKE_COMMAND} -E make_directory "${CMAKE_CFG_INTDIR}"
|
|
|
|
)
|
|
|
|
endif()
|
|
|
|
|
2009-12-08 19:44:50 +03:00
|
|
|
foreach(test ${CMakeLib_TESTS})
|
|
|
|
add_test(CMakeLib.${test} CMakeLibTests ${test})
|
|
|
|
endforeach()
|
2011-04-01 03:55:00 +04:00
|
|
|
|
2011-04-25 21:16:01 +04:00
|
|
|
if(TEST_CompileCommandOutput)
|
|
|
|
add_executable(runcompilecommands run_compile_commands.cxx)
|
|
|
|
target_link_libraries(runcompilecommands CMakeLib)
|
|
|
|
endif()
|