Skip to content

Commit 7eda52e

Browse files
authored
Correct CMake version check; VERSION_GREATER 3.18 is true for 3.18.1 (#45)
Also move block before `add_subdirectory(test)` and remove extraneous `**` implied by `GLOB_RECURSE`.
1 parent 8a16729 commit 7eda52e

1 file changed

Lines changed: 7 additions & 7 deletions

File tree

CMakeLists.txt

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,17 +24,17 @@ target_link_libraries(boost_bloom
2424

2525
target_compile_features(boost_bloom INTERFACE cxx_std_11)
2626

27-
if(BUILD_TESTING AND EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/test/CMakeLists.txt")
27+
if(NOT CMAKE_VERSION VERSION_LESS 3.19 AND CMAKE_GENERATOR MATCHES "Visual Studio")
2828

29-
add_subdirectory(test)
29+
file(GLOB_RECURSE boost_bloom_IDEFILES CONFIGURE_DEPENDS "include/*.hpp")
30+
source_group(TREE ${PROJECT_SOURCE_DIR}/include FILES ${boost_bloom_IDEFILES} PREFIX "Header Files")
31+
list(APPEND boost_bloom_IDEFILES extra/boost_bloom.natvis)
32+
target_sources(boost_bloom PRIVATE ${boost_bloom_IDEFILES})
3033

3134
endif()
3235

33-
if(CMAKE_VERSION VERSION_GREATER 3.18 AND CMAKE_GENERATOR MATCHES "Visual Studio")
36+
if(BUILD_TESTING AND EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/test/CMakeLists.txt")
3437

35-
file(GLOB_RECURSE boost_bloom_IDEFILES CONFIGURE_DEPENDS "include/**/*.hpp")
36-
source_group(TREE ${PROJECT_SOURCE_DIR}/include FILES ${boost_bloom_IDEFILES} PREFIX "Header Files")
37-
list(APPEND boost_bloom_IDEFILES extra/boost_bloom.natvis)
38-
target_sources(boost_bloom PRIVATE ${boost_bloom_IDEFILES})
38+
add_subdirectory(test)
3939

4040
endif()

0 commit comments

Comments
 (0)