2009-12-08 11:44:50 -05:00
|
|
|
include_directories(
|
|
|
|
${CMAKE_CURRENT_BINARY_DIR}
|
|
|
|
${CMake_BINARY_DIR}/Source
|
|
|
|
${CMake_SOURCE_DIR}/Source
|
|
|
|
)
|
|
|
|
|
|
|
|
set(CMakeLib_TESTS
|
2011-12-23 15:08:47 -05:00
|
|
|
testGeneratedFileStream
|
2013-09-30 20:30:57 -04:00
|
|
|
testRST
|
2011-12-23 15:41:38 -05:00
|
|
|
testSystemTools
|
2009-12-08 15:44:22 -05:00
|
|
|
testUTF8
|
2009-12-08 11:44:50 -05:00
|
|
|
testXMLParser
|
2009-12-08 15:44:45 -05:00
|
|
|
testXMLSafe
|
2009-12-08 11:44:50 -05:00
|
|
|
)
|
|
|
|
|
2014-06-06 10:39:45 -04:00
|
|
|
set(testRST_ARGS ${CMAKE_CURRENT_SOURCE_DIR})
|
|
|
|
|
2013-10-11 00:02:24 +02:00
|
|
|
if(WIN32)
|
2013-01-08 14:10:42 +01:00
|
|
|
list(APPEND CMakeLib_TESTS
|
|
|
|
testVisualStudioSlnParser
|
|
|
|
)
|
|
|
|
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/testVisualStudioSlnParser.h.in
|
|
|
|
${CMAKE_CURRENT_BINARY_DIR}/testVisualStudioSlnParser.h @ONLY)
|
|
|
|
endif()
|
|
|
|
|
2009-12-08 11:44:50 -05: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 10:56:30 -05: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 11:44:50 -05:00
|
|
|
foreach(test ${CMakeLib_TESTS})
|
2014-06-06 10:39:45 -04:00
|
|
|
add_test(CMakeLib.${test} CMakeLibTests ${test} ${${test}_ARGS})
|
2009-12-08 11:44:50 -05:00
|
|
|
endforeach()
|
2011-03-31 16:55:00 -07:00
|
|
|
|
2011-04-25 10:16:01 -07:00
|
|
|
if(TEST_CompileCommandOutput)
|
|
|
|
add_executable(runcompilecommands run_compile_commands.cxx)
|
|
|
|
target_link_libraries(runcompilecommands CMakeLib)
|
|
|
|
endif()
|