Skip to content

Commit 9c5a4cf

Browse files
committed
Enable CMake project folders for better target organization
Closes #2917
1 parent e260288 commit 9c5a4cf

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

CMakeLists.txt

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ else()
88
set(NOT_SUBPROJECT OFF)
99
endif()
1010

11+
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
12+
1113
option(CATCH_INSTALL_DOCS "Install documentation alongside library" ON)
1214
option(CATCH_INSTALL_EXTRAS "Install extras (CMake scripts, debugger helpers) alongside library" ON)
1315
option(CATCH_DEVELOPMENT_BUILD "Build tests, enable warnings, enable Werror, etc" OFF)
@@ -41,7 +43,6 @@ project(Catch2
4143
DESCRIPTION "A modern, C++-native, unit test framework."
4244
)
4345

44-
4546
# Provide path for scripts. We first add path to the scripts we don't use,
4647
# but projects including us might, and set the path up to parent scope.
4748
# 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)
8687
if (NOT PYTHONINTERP_FOUND)
8788
message(FATAL_ERROR "Python not found, but required for tests")
8889
endif()
90+
set(CMAKE_FOLDER "tests")
8991
add_subdirectory(tests)
9092
endif()
9193

9294
if(CATCH_BUILD_EXAMPLES)
95+
set(CMAKE_FOLDER "Examples")
9396
add_subdirectory(examples)
9497
endif()
9598

9699
if(CATCH_BUILD_EXTRA_TESTS)
100+
set(CMAKE_FOLDER "tests/ExtraTests")
97101
add_subdirectory(tests/ExtraTests)
98102
endif()
99103

100104
if(CATCH_BUILD_FUZZERS)
105+
set(CMAKE_FOLDER "fuzzing")
101106
add_subdirectory(fuzzing)
102107
endif()
103108

tests/ExtraTests/CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ project( Catch2ExtraTests LANGUAGES CXX )
88

99
message( STATUS "Extra tests included" )
1010

11-
1211
add_test(
1312
NAME TestShardingIntegration
1413
COMMAND ${PYTHON_EXECUTABLE} ${CATCH_DIR}/tests/TestScripts/testSharding.py $<TARGET_FILE:SelfTest>

0 commit comments

Comments
 (0)