Skip to content

Commit

Permalink
Sacado: Add TRIBITS_TESTONLY_LIB to non-TriBITS targets (TriBITSPub/T…
Browse files Browse the repository at this point in the history
…riBITS#299)

The updated version of TriBITS using modern CMake for TriBITSPub/TriBITS#299
creates a ${PACKAGE_NAME}_all_libs library target (used to create an ALIAS
${PACKAGE_NAME}::all_libs library target) from all of the targets under a
package's base CMakeLists.txt file that don't have the TRIBITS_TESTONLY_LIB
property set to TRUE.  The tribits_add_library( ... TESTONLY ... ) function
call automatically sets this property but if a package uses raw CMake to
create targets (like Sacado is doing here with GoogleTest), then one must set
the TRIBITS_TESTONLY_LIB property or one must create the
${PACKAGE_NAME}_all_libs and ${PACKAGE_NAME}::all_libs targets manually.
Small price to pay on the path to making TriBITS more flexible and allowing
raw CMake target formation.
  • Loading branch information
bartlettroscoe committed Oct 29, 2021
1 parent efad248 commit b6837af
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions packages/sacado/test/GTestSuite/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ SET(gtest_disable_pthreads ON CACHE BOOL "Disable uses of pthreads in gtest")

# Configure googletest
add_subdirectory(googletest)
set_target_properties(sacado-gtest gtest_main PROPERTIES
TRIBITS_TESTONLY_LIB TRUE)

INCLUDE_DIRECTORIES(${PACKAGE_SOURCE_DIR}/Fad)
INCLUDE_DIRECTORIES(${PACKAGE_SOURCE_DIR}/test/utils)
Expand Down

0 comments on commit b6837af

Please sign in to comment.