CMakeLists.txt 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  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.cxx
  8. testRST.cxx
  9. testString.cxx
  10. testSystemTools.cxx
  11. testUTF8.cxx
  12. testXMLParser.cxx
  13. testXMLSafe.cxx
  14. testFindPackageCommand.cxx
  15. testUVRAII.cxx
  16. )
  17. set(testRST_ARGS ${CMAKE_CURRENT_SOURCE_DIR})
  18. if(WIN32)
  19. list(APPEND CMakeLib_TESTS
  20. testVisualStudioSlnParser.cxx
  21. )
  22. configure_file(${CMAKE_CURRENT_SOURCE_DIR}/testVisualStudioSlnParser.h.in
  23. ${CMAKE_CURRENT_BINARY_DIR}/testVisualStudioSlnParser.h @ONLY)
  24. endif()
  25. configure_file(${CMAKE_CURRENT_SOURCE_DIR}/testXMLParser.h.in
  26. ${CMAKE_CURRENT_BINARY_DIR}/testXMLParser.h @ONLY)
  27. create_test_sourcelist(CMakeLib_TEST_SRCS CMakeLibTests.cxx ${CMakeLib_TESTS})
  28. add_executable(CMakeLibTests ${CMakeLib_TEST_SRCS})
  29. target_link_libraries(CMakeLibTests CMakeLib)
  30. set_property(TARGET CMakeLibTests PROPERTY C_CLANG_TIDY "")
  31. set_property(TARGET CMakeLibTests PROPERTY CXX_CLANG_TIDY "")
  32. add_executable(testEncoding testEncoding.cxx)
  33. target_link_libraries(testEncoding cmsys)
  34. foreach(testfile ${CMakeLib_TESTS})
  35. get_filename_component(test "${testfile}" NAME_WE)
  36. add_test(CMakeLib.${test} CMakeLibTests ${test} ${${test}_ARGS})
  37. endforeach()
  38. if(TEST_CompileCommandOutput)
  39. add_executable(runcompilecommands run_compile_commands.cxx)
  40. target_link_libraries(runcompilecommands CMakeLib)
  41. endif()
  42. add_subdirectory(PseudoMemcheck)
  43. add_executable(testAffinity testAffinity.cxx)
  44. target_link_libraries(testAffinity CMakeLib)