🛠️🐜 Antkeeper superbuild with dependencies included https://antkeeper.com
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

35 lines
1.3 KiB

  1. if (CXXOPTS_BUILD_TESTS)
  2. add_executable(options_test main.cpp options.cpp)
  3. target_link_libraries(options_test cxxopts)
  4. add_test(options options_test)
  5. # test if the targets are findable from the build directory
  6. add_test(find-package-test ${CMAKE_CTEST_COMMAND}
  7. -C ${CMAKE_BUILD_TYPE}
  8. --build-and-test
  9. "${CMAKE_CURRENT_SOURCE_DIR}/find-package-test"
  10. "${CMAKE_CURRENT_BINARY_DIR}/find-package-test"
  11. --build-generator ${CMAKE_GENERATOR}
  12. --build-makeprogram ${CMAKE_MAKE_PROGRAM}
  13. --build-options
  14. "-DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER}"
  15. "-DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}"
  16. "-Dcxxopts_DIR=${PROJECT_BINARY_DIR}"
  17. )
  18. # test if the targets are findable when add_subdirectory is used
  19. add_test(add-subdirectory-test ${CMAKE_CTEST_COMMAND}
  20. -C ${CMAKE_BUILD_TYPE}
  21. --build-and-test
  22. "${CMAKE_CURRENT_SOURCE_DIR}/add-subdirectory-test"
  23. "${CMAKE_CURRENT_BINARY_DIR}/add-subdirectory-test"
  24. --build-generator ${CMAKE_GENERATOR}
  25. --build-makeprogram ${CMAKE_MAKE_PROGRAM}
  26. --build-options
  27. "-DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER}"
  28. "-DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}"
  29. )
  30. add_executable(link_test link_a.cpp link_b.cpp)
  31. target_link_libraries(link_test cxxopts)
  32. endif()