File tree 2 files changed +14
-8
lines changed
2 files changed +14
-8
lines changed Original file line number Diff line number Diff line change @@ -495,13 +495,19 @@ else() # Raw CMake Project
495
495
496
496
if (Compadre_EXAMPLES AND Compadre_TESTS)
497
497
if (NOT Trilinos_PREFIX)
498
- if (NOT TARGET gtest)
499
- # gtest from kokkos
500
- add_library (gtest
501
- kokkos/tpls/gtest/gtest/gtest-all .cc
502
- )
503
- target_include_directories (gtest PUBLIC kokkos/tpls/gtest)
504
- endif ()
498
+ # gtest from kokkos
499
+ # based on kokkos-kernels/CMakeLists.txt
500
+ SET (GTEST_SOURCE_DIR ${PROJECT_SOURCE_DIR} /kokkos/tpls/gtest)
501
+ message (STATUS "GTEST:: ${GTEST_SOURCE_DIR} " )
502
+ add_library (compadre_gtest
503
+ ${GTEST_SOURCE_DIR} /gtest/gtest-all .cc
504
+ )
505
+ target_include_directories (compadre_gtest PUBLIC ${GTEST_SOURCE_DIR} /gtest)
506
+ # Disables pthreads, this is a problem for serial builds in Trilinos & Sierra if it's enabled.
507
+ TARGET_COMPILE_DEFINITIONS (compadre_gtest PUBLIC "-DGTEST_HAS_PTHREAD=0" )
508
+ TARGET_INCLUDE_DIRECTORIES (compadre_gtest PUBLIC $<BUILD_INTERFACE:${GTEST_SOURCE_DIR} >)
509
+ #Gtest minimally requires C++11
510
+ TARGET_COMPILE_FEATURES (compadre_gtest PUBLIC cxx_std_11)
505
511
endif ()
506
512
endif ()
507
513
Original file line number Diff line number Diff line change @@ -48,7 +48,7 @@ if (Compadre_EXAMPLES)
48
48
ENDIF ()
49
49
else ()
50
50
add_exe_w_compadre(UnitTests Compadre_UnitTests.cpp)
51
- TARGET_LINK_LIBRARIES (UnitTests PRIVATE gtest )
51
+ TARGET_LINK_LIBRARIES (UnitTests PRIVATE compadre_gtest )
52
52
ADD_TEST (CompadreGtests UnitTests)
53
53
endif ()
54
54
SET_TESTS_PROPERTIES (CompadreGtests PROPERTIES SKIP_REGULAR_EXPRESSION "MISSING_GTEST" LABELS "Gtest;UnitTest;unittest;Unit;unit" )
You can’t perform that action at this time.
0 commit comments