Skip to content

Commit

Permalink
Fix CMake warning issued since CMake V3.30
Browse files Browse the repository at this point in the history
  • Loading branch information
hkaiser committed Nov 19, 2024
1 parent b98428c commit 806f6fc
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 7 deletions.
14 changes: 11 additions & 3 deletions cmake/HPX_SetupBoost.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,10 @@ if(HPX_WITH_FETCH_BOOST)
"${CMAKE_BINARY_DIR}/_deps/boost-src"
CACHE INTERNAL ""
)

set(HPX_FIND_BOOST_PACKAGE_MODE MODULE)
else()
set(HPX_FIND_BOOST_PACKAGE_MODE CONFIG)
endif()

# In case find_package(HPX) is called multiple times
Expand All @@ -82,6 +86,7 @@ if(NOT TARGET hpx_dependencies_boost)
# cmake-format: off
set(Boost_ADDITIONAL_VERSIONS
${Boost_ADDITIONAL_VERSIONS}
"1.86.0" "1.86"
"1.85.0" "1.85"
"1.84.0" "1.84"
"1.83.0" "1.83"
Expand Down Expand Up @@ -109,7 +114,10 @@ if(NOT TARGET hpx_dependencies_boost)
hpx_set_cmake_policy(CMP0167 OLD) # use CMake's FindBoost for now

# Find the headers and get the version
find_package(Boost ${Boost_MINIMUM_VERSION} NO_POLICY_SCOPE MODULE REQUIRED)
find_package(
Boost ${Boost_MINIMUM_VERSION} NO_POLICY_SCOPE
${HPX_FIND_BOOST_PACKAGE_MODE} REQUIRED
)
if(NOT Boost_VERSION_STRING)
set(Boost_VERSION_STRING
"${Boost_MAJOR_VERSION}.${Boost_MINOR_VERSION}.${Boost_SUBMINOR_VERSION}"
Expand Down Expand Up @@ -142,8 +150,8 @@ if(NOT TARGET hpx_dependencies_boost)
endif()

find_package(
Boost ${Boost_MINIMUM_VERSION} NO_POLICY_SCOPE MODULE REQUIRED
COMPONENTS ${__boost_libraries}
Boost ${Boost_MINIMUM_VERSION} NO_POLICY_SCOPE
${HPX_FIND_BOOST_PACKAGE_MODE} REQUIRED COMPONENTS ${__boost_libraries}
)

if(NOT Boost_FOUND)
Expand Down
4 changes: 2 additions & 2 deletions cmake/HPX_SetupBoostFilesystem.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ if(HPX_FILESYSTEM_WITH_BOOST_FILESYSTEM_COMPATIBILITY)
hpx_set_cmake_policy(CMP0167 OLD) # use CMake's FindBoost for now

find_package(
Boost ${Boost_MINIMUM_VERSION} NO_POLICY_SCOPE MODULE
COMPONENTS filesystem
Boost ${Boost_MINIMUM_VERSION} NO_POLICY_SCOPE
${HPX_FIND_BOOST_PACKAGE_MODE} COMPONENTS filesystem
)

if(NOT Boost_FILESYSTEM_FOUND)
Expand Down
3 changes: 2 additions & 1 deletion cmake/HPX_SetupBoostIostreams.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ if((HPX_WITH_COMPRESSION_BZIP2
hpx_set_cmake_policy(CMP0167 OLD) # use CMake's FindBoost for now

find_package(
Boost ${Boost_MINIMUM_VERSION} NO_POLICY_SCOPE MODULE COMPONENTS iostreams
Boost ${Boost_MINIMUM_VERSION} NO_POLICY_SCOPE
${HPX_FIND_BOOST_PACKAGE_MODE} COMPONENTS iostreams
)

if(Boost_IOSTREAMS_FOUND)
Expand Down
3 changes: 2 additions & 1 deletion cmake/HPX_SetupBoostRegex.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ if(NOT TARGET Boost::regex)
hpx_set_cmake_policy(CMP0167 OLD) # use CMake's FindBoost for now

find_package(
Boost ${Boost_MINIMUM_VERSION} NO_POLICY_SCOPE MODULE COMPONENTS regex
Boost ${Boost_MINIMUM_VERSION} NO_POLICY_SCOPE
${HPX_FIND_BOOST_PACKAGE_MODE} COMPONENTS regex
)

if(Boost_REGEX_FOUND)
Expand Down

0 comments on commit 806f6fc

Please sign in to comment.