refactor(cmake): use PROJECT_SOURCE_DIR and PROJECT_BINARY_DIR

- CMAKE_SOURCE_DIR and CMAKE_BINARY_DIR point to the top-level project
  and break add_subdirectory() and FetchContent
- Find the helper modules relative to the CMakeLists.txt that includes them
- Replace @CMAKE_BINARY_DIR@ in the example test scripts

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
Claude
2026-11-09 22:43:43 +00:00
committed by Dennis Klein
parent ba286b4449
commit 0dfbb73d86
20 changed files with 37 additions and 38 deletions

View File

@@ -93,7 +93,7 @@ function(add_testsuite suitename)
set(testsuite_RUN_SERIAL OFF)
endif()
gtest_discover_tests(${target}
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
WORKING_DIRECTORY ${PROJECT_BINARY_DIR}
TEST_PREFIX ${suitename}.
NO_PRETTY_VALUES
PROPERTIES RUN_SERIAL ${testsuite_RUN_SERIAL}