From ee44b0db0f5299125935fe344f9ebb5c754c3320 Mon Sep 17 00:00:00 2001 From: Mohammad Nejati Date: Wed, 27 Nov 2024 13:43:44 +0000 Subject: [PATCH] Make CMakeLists.txt compatible with version 3.8 Make call to target_sources conditional Replace $ expressions with individual ones --- CMakeLists.txt | 10 ++++++---- test/CMakeLists.txt | 10 ++++++---- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index fd432df3f2..f6d714bbe3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -149,11 +149,13 @@ add_library(Boost::beast ALIAS boost_beast) target_include_directories(boost_beast INTERFACE include) target_link_libraries(boost_beast INTERFACE ${BOOST_BEAST_DEPENDENCIES}) target_compile_features(boost_beast INTERFACE cxx_std_11) -file(GLOB_RECURSE BOOST_BEAST_HEADERS CONFIGURE_DEPENDS include/boost/*.hpp) -set_property(GLOBAL PROPERTY USE_FOLDERS ON) -source_group(TREE ${CMAKE_CURRENT_SOURCE_DIR}/include/boost PREFIX "" FILES ${BOOST_BEAST_HEADERS}) -target_sources(boost_beast PRIVATE ${BOOST_BEAST_HEADERS} build.jam) +if (BOOST_BEAST_IS_ROOT) + file(GLOB_RECURSE BOOST_BEAST_HEADERS CONFIGURE_DEPENDS include/boost/*.hpp) + set_property(GLOBAL PROPERTY USE_FOLDERS ON) + source_group(TREE ${CMAKE_CURRENT_SOURCE_DIR}/include/boost PREFIX "" FILES ${BOOST_BEAST_HEADERS}) + target_sources(boost_beast PRIVATE ${BOOST_BEAST_HEADERS} build.jam) +endif () #------------------------------------------------- # # Tests diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index ead3766632..5a50a11ea0 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -67,10 +67,12 @@ add_library(lib-zlib STATIC extern/zlib-1.2.12/uncompr.c extern/zlib-1.2.12/zutil.c) target_compile_options(lib-zlib PRIVATE - $<$:-w> - $<$:/wd4127> - $<$:/wd4244> - $<$:/wd4131>) + $<$:-w> + $<$:-w> + $<$:-w> + $<$:/wd4127> + $<$:/wd4244> + $<$:/wd4131>) target_include_directories(lib-zlib PUBLIC extern/zlib-1.2.12) set_target_properties(lib-zlib PROPERTIES FOLDER "static-libs")