Read-only mirrors. Development, issues and pull requests are on GitHub.

summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorMartin Hořeňovský2024-10-27 23:07:51 +0100
committerMartin Hořeňovský2024-10-27 23:07:55 +0100
commit9c5a4cf44e494bbd2e5dac151c400b3f4a4c9cbc (patch)
treebb45a499dcd4b1353408c15c11d5fcb8d1768332
parente26028880790addff43cc5546de1e39214d86a04 (diff)
downloadcatch3-9c5a4cf44e494bbd2e5dac151c400b3f4a4c9cbc.tar.gz
Enable CMake project folders for better target organization
Closes #2917
-rw-r--r--CMakeLists.txt7
-rw-r--r--tests/ExtraTests/CMakeLists.txt1
2 files changed, 6 insertions, 2 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 7bad26c3..6c24e1d1 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -8,6 +8,8 @@ else()
set(NOT_SUBPROJECT OFF)
endif()
+set_property(GLOBAL PROPERTY USE_FOLDERS ON)
+
option(CATCH_INSTALL_DOCS "Install documentation alongside library" ON)
option(CATCH_INSTALL_EXTRAS "Install extras (CMake scripts, debugger helpers) alongside library" ON)
option(CATCH_DEVELOPMENT_BUILD "Build tests, enable warnings, enable Werror, etc" OFF)
@@ -41,7 +43,6 @@ project(Catch2
DESCRIPTION "A modern, C++-native, unit test framework."
)
-
# Provide path for scripts. We first add path to the scripts we don't use,
# but projects including us might, and set the path up to parent scope.
# Then we also add path that we use to configure the project, but is of
@@ -86,18 +87,22 @@ if (BUILD_TESTING AND CATCH_BUILD_TESTING AND NOT_SUBPROJECT)
if (NOT PYTHONINTERP_FOUND)
message(FATAL_ERROR "Python not found, but required for tests")
endif()
+ set(CMAKE_FOLDER "tests")
add_subdirectory(tests)
endif()
if(CATCH_BUILD_EXAMPLES)
+ set(CMAKE_FOLDER "Examples")
add_subdirectory(examples)
endif()
if(CATCH_BUILD_EXTRA_TESTS)
+ set(CMAKE_FOLDER "tests/ExtraTests")
add_subdirectory(tests/ExtraTests)
endif()
if(CATCH_BUILD_FUZZERS)
+ set(CMAKE_FOLDER "fuzzing")
add_subdirectory(fuzzing)
endif()
diff --git a/tests/ExtraTests/CMakeLists.txt b/tests/ExtraTests/CMakeLists.txt
index 9f6d8173..a7268e54 100644
--- a/tests/ExtraTests/CMakeLists.txt
+++ b/tests/ExtraTests/CMakeLists.txt
@@ -8,7 +8,6 @@ project( Catch2ExtraTests LANGUAGES CXX )
message( STATUS "Extra tests included" )
-
add_test(
NAME TestShardingIntegration
COMMAND ${PYTHON_EXECUTABLE} ${CATCH_DIR}/tests/TestScripts/testSharding.py $<TARGET_FILE:SelfTest>