Skip to content

Commit f05f059

Browse files
committed
Use a single source_group call for all sources
1 parent ce4e8e5 commit f05f059

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

CMakeLists.txt

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,17 +25,19 @@ if(CMAKE_VERSION VERSION_GREATER 3.18)
2525

2626
file(GLOB_RECURSE headers CONFIGURE_DEPENDS include/*.hpp)
2727
target_sources(boost_assert PRIVATE ${headers})
28-
source_group(TREE ${PROJECT_SOURCE_DIR} FILES ${headers})
2928
unset(headers)
3029

3130
if(MSVC)
3231

3332
# Only Visual Studio needs this, but the generator may also be Ninja
3433
target_sources(boost_assert PUBLIC extra/boost_assert.natvis)
35-
source_group(TREE ${PROJECT_SOURCE_DIR} FILES extra/boost_assert.natvis)
3634

3735
endif()
3836

37+
get_target_property(sources boost_assert SOURCES)
38+
source_group(TREE ${PROJECT_SOURCE_DIR} FILES ${sources})
39+
unset(sources)
40+
3941
endif()
4042

4143
# BUILD_TESTING is the standard CTest variable that enables testing

0 commit comments

Comments
 (0)