Skip to content

Commit

Permalink
Add ENV{BOOST_ROOT} hint to CMake find_package for backwards compatib…
Browse files Browse the repository at this point in the history
…ility
  • Loading branch information
Pansysk75 committed Sep 11, 2024
1 parent 2208267 commit a4ad166
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 16 deletions.
29 changes: 15 additions & 14 deletions cmake/HPX_GeneratePackageUtils.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -243,16 +243,21 @@ function(hpx_sanitize_usage_requirements property is_build)
endfunction(hpx_sanitize_usage_requirements)

function(hpx_filter_language_flags cflag_list)
set(_cflag_list "${${cflag_list}}")
# We are always in CXX, so replace conditional values with the values themselves
string(REGEX REPLACE "\\$<\\$<COMPILE_LANGUAGE:CXX>:([^>]*)>?" "\\1" _cflag_list "${_cflag_list}")
# Remove conditional values for other languages
string(REGEX REPLACE "\\$<\\$<COMPILE_LANGUAGE:[^>]*>:([^>]*)>?" "" _cflag_list "${_cflag_list}")

set(${cflag_list}
${_cflag_list}
PARENT_SCOPE
)
set(_cflag_list "${${cflag_list}}")
# We are always in CXX, so replace conditional values with the values
# themselves
string(REGEX REPLACE "\\$<\\$<COMPILE_LANGUAGE:CXX>:([^>]*)>?" "\\1"
_cflag_list "${_cflag_list}"
)
# Remove conditional values for other languages
string(REGEX REPLACE "\\$<\\$<COMPILE_LANGUAGE:[^>]*>:([^>]*)>?" ""
_cflag_list "${_cflag_list}"
)

set(${cflag_list}
${_cflag_list}
PARENT_SCOPE
)
endfunction(hpx_filter_language_flags)

# Append the corresponding (-D, -I) flags for the compilation
Expand Down Expand Up @@ -393,10 +398,6 @@ function(hpx_generate_pkgconfig_from_target target template is_build)

string(TOLOWER ${CMAKE_BUILD_TYPE} build_type)

# Print hpx_library_list and hpx_cflags_list
message(STATUS "hpx_library_list: ${hpx_library_list}")
message(STATUS "hpx_cflags_list: ${hpx_cflags_list}")

configure_file(
cmake/templates/${template}.pc.in
${OUTPUT_DIR}${template}_${build_type}.pc.in @ONLY ESCAPE_QUOTES
Expand Down
5 changes: 3 additions & 2 deletions cmake/HPX_SetupBoost.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ if(NOT TARGET hpx_dependencies_boost)

find_package(
Boost ${Boost_MINIMUM_VERSION} NO_POLICY_SCOPE REQUIRED
COMPONENTS ${__boost_libraries} HINTS ${HPX_BOOST_ROOT}
COMPONENTS ${__boost_libraries} HINTS ${HPX_BOOST_ROOT} $ENV{BOOST_ROOT}
)

add_library(hpx_dependencies_boost INTERFACE IMPORTED)
Expand Down Expand Up @@ -82,7 +82,8 @@ if(NOT TARGET hpx_dependencies_boost)
)

# Need to explicitly list header-only dependencies, since Cmake-Boost has
# installs each library's headers individually, as opposed to b2-built Boost.
# installs each library's headers individually, as opposed to b2-built
# Boost.
set(__boost_libraries
${__boost_libraries}
accumulators
Expand Down

0 comments on commit a4ad166

Please sign in to comment.