CMakeLists.txt 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. include_directories(
  2. ${CMAKE_CURRENT_BINARY_DIR}
  3. ${CMake_BINARY_DIR}/Source
  4. ${CMake_SOURCE_DIR}/Source
  5. )
  6. set(CMakeLib_TESTS
  7. testGeneratedFileStream
  8. testSystemTools
  9. testUTF8
  10. testXMLParser
  11. testXMLSafe
  12. )
  13. configure_file(${CMAKE_CURRENT_SOURCE_DIR}/testXMLParser.h.in
  14. ${CMAKE_CURRENT_BINARY_DIR}/testXMLParser.h @ONLY)
  15. create_test_sourcelist(CMakeLib_TEST_SRCS CMakeLibTests.cxx ${CMakeLib_TESTS})
  16. add_executable(CMakeLibTests ${CMakeLib_TEST_SRCS})
  17. target_link_libraries(CMakeLibTests CMakeLib)
  18. # Xcode 2.x forgets to create the output directory before linking
  19. # the individual architectures.
  20. if(CMAKE_OSX_ARCHITECTURES AND XCODE
  21. AND NOT "${XCODE_VERSION}" MATCHES "^[^12]")
  22. add_custom_command(
  23. TARGET CMakeLibTests
  24. PRE_BUILD COMMAND ${CMAKE_COMMAND} -E make_directory "${CMAKE_CFG_INTDIR}"
  25. )
  26. endif()
  27. foreach(test ${CMakeLib_TESTS})
  28. add_test(CMakeLib.${test} CMakeLibTests ${test})
  29. endforeach()
  30. if(TEST_CompileCommandOutput)
  31. add_executable(runcompilecommands run_compile_commands.cxx)
  32. target_link_libraries(runcompilecommands CMakeLib)
  33. endif()