From 37bd2157772032307c6d866d1f95ee16a4fef255 Mon Sep 17 00:00:00 2001 From: Braden Ganetsky Date: Sat, 18 Oct 2025 23:36:13 -0500 Subject: [PATCH] Grab the list of IDE files in the CMake regardless of generator, as this is a no-op when the generator doesn't support it, however still gate the natvis file behind 'if(MSVC)' --- CMakeLists.txt | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 63c4e3da..058f6a78 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -23,13 +23,17 @@ target_link_libraries(boost_unordered Boost::throw_exception ) -if(CMAKE_VERSION VERSION_GREATER 3.18 AND CMAKE_GENERATOR MATCHES "Visual Studio") - +if(CMAKE_VERSION VERSION_GREATER_EQUAL 3.12) file(GLOB_RECURSE boost_unordered_IDEFILES CONFIGURE_DEPENDS include/*.hpp) +else() + file(GLOB_RECURSE boost_unordered_IDEFILES include/*.hpp) +endif() +target_sources(boost_unordered PRIVATE ${boost_unordered_IDEFILES}) +if(CMAKE_VERSION VERSION_GREATER_EQUAL 3.18) source_group(TREE ${PROJECT_SOURCE_DIR}/include FILES ${boost_unordered_IDEFILES} PREFIX "Header Files") - target_sources(boost_unordered PRIVATE ${boost_unordered_IDEFILES}) +endif() +if(MSVC) target_sources(boost_unordered PUBLIC extra/boost_unordered.natvis) - endif() target_compile_features(boost_unordered INTERFACE cxx_std_11)