Skip to content

Commit

Permalink
cprnc should not be injecting its ctests into host projects
Browse files Browse the repository at this point in the history
  • Loading branch information
jgfouca committed Feb 2, 2024
1 parent 3cee6af commit f6055eb
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
cmake_minimum_required (VERSION 3.14)

if (NOT DEFINED PROJECT_NAME)
set(CPRNC_STANDALONE TRUE)
endif()

project (cprnc Fortran C)
include (CheckFunctionExists)
include (ExternalProject)
Expand Down Expand Up @@ -95,9 +100,11 @@ set_property(TARGET cprnc PROPERTY POSITION_INDEPENDENT_CODE ON)
target_link_libraries (cprnc
PUBLIC ${NetCDF_Fortran_LIBRARIES} ${NetCDF_C_LIBRARIES} ${NetCDF_LIBRARIES})


enable_testing()
add_test(NAME run_tests COMMAND run_tests -outdir tmp)
# We do not want cprnc injecting ctests into parent projects
if (CPRNC_STANDALONE)
enable_testing()
add_test(NAME run_tests COMMAND run_tests -outdir tmp)
endif()

#==============================================================================
# DEFINE THE INSTALL
Expand Down

0 comments on commit f6055eb

Please sign in to comment.