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 20, 2024
1 parent b98428c commit 80cc29b
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 7 deletions.
13 changes: 10 additions & 3 deletions cmake/HPX_SetupBoost.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,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 +110,13 @@ 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 CONFIG QUIET)
if(NOT Boost_FOUND)
find_package(Boost ${Boost_MINIMUM_VERSION} NO_POLICY_SCOPE MODULE REQUIRED)
set(HPX_FIND_BOOST_PACKAGE_MODE MODULE)
else()
set(HPX_FIND_BOOST_PACKAGE_MODE CONFIG)
endif()
if(NOT Boost_VERSION_STRING)
set(Boost_VERSION_STRING
"${Boost_MAJOR_VERSION}.${Boost_MINOR_VERSION}.${Boost_SUBMINOR_VERSION}"
Expand Down Expand Up @@ -142,8 +149,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 80cc29b

Please sign in to comment.