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)'

This commit is contained in:
Braden Ganetsky
2025-10-18 23:36:13 -05:00
parent 1b89cbb265
commit 37bd215777

View File

@@ -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)
source_group(TREE ${PROJECT_SOURCE_DIR}/include FILES ${boost_unordered_IDEFILES} PREFIX "Header Files")
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")
endif()
if(MSVC)
target_sources(boost_unordered PUBLIC extra/boost_unordered.natvis)
endif()
target_compile_features(boost_unordered INTERFACE cxx_std_11)