Skip to content

Commit

Permalink
cmake:SC_BUILD_TESTING to allow parent project control
Browse files Browse the repository at this point in the history
by using a more specific name like "SC_BUILD_TESTING" instead of
"BUILD_TESTING" this allows parent projects like p4est and Forestclaw
to select which tests to build and run. This avoids outdated test
dependencies causing a top-level project to fail build/test.
  • Loading branch information
scivision committed Jan 7, 2024
1 parent 910274a commit 4993984
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -67,15 +67,15 @@ install(TARGETS sc EXPORT ${PROJECT_NAME}-targets)

add_subdirectory(src)

if(BUILD_TESTING)
if(SC_BUILD_TESTING)
include(cmake/valgrind.cmake)

if(CMAKE_VERSION VERSION_GREATER_EQUAL 3.22)
add_subdirectory(example)
endif()

add_subdirectory(test)
endif(BUILD_TESTING)
endif()

# --- packaging

Expand Down
2 changes: 1 addition & 1 deletion cmake/options.cmake
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
option(mpi "use MPI library" off)
option(openmp "use OpenMP" off)
option(zlib "build ZLIB" off)
option(BUILD_TESTING "build libsc self-tests" on)
option(SC_BUILD_TESTING "build libsc self-tests" on)
option(TEST_WITH_VALGRIND "run self-tests with valgrind" OFF)
option(BUILD_SHARED_LIBS "build shared libsc")
option(CMAKE_TLS_VERIFY "verify TLS certificate" on)
Expand Down

0 comments on commit 4993984

Please sign in to comment.