build(cmake): isolate test-only dependencies

This commit is contained in:
KOKO\Mimi
2026-07-30 13:21:40 +09:00
parent 85b580bb23
commit 202e66c862
5 changed files with 42 additions and 6 deletions
+10 -4
View File
@@ -12,7 +12,10 @@ set(MKL_THREADING tbb_thread)
find_package(MKL CONFIG REQUIRED)
find_package(TBB CONFIG REQUIRED COMPONENTS tbb)
find_package(HDF5 CONFIG REQUIRED COMPONENTS C shared)
find_package(GTest CONFIG REQUIRED)
if(BUILD_TESTING)
find_package(GTest CONFIG REQUIRED)
endif()
function(fesa_require_imported_target target_name)
if(NOT TARGET "${target_name}")
@@ -36,9 +39,12 @@ endfunction()
fesa_require_imported_target(MKL::MKL)
fesa_require_imported_target(TBB::tbb)
fesa_require_imported_target(hdf5::hdf5-shared)
fesa_require_imported_target(GTest::gtest_main)
fesa_require_imported_target(GTest::gtest)
fesa_require_imported_target(GTest::gmock)
if(BUILD_TESTING)
fesa_require_imported_target(GTest::gtest_main)
fesa_require_imported_target(GTest::gtest)
fesa_require_imported_target(GTest::gmock)
endif()
add_library(HDF5::HDF5 INTERFACE IMPORTED GLOBAL)
set_property(