Skip to content

Commit

Permalink
Cleanup previous patch adapting to CMake V3.27
Browse files Browse the repository at this point in the history
  • Loading branch information
hkaiser committed Aug 20, 2023
1 parent 557b87d commit 6b4ae35
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 15 deletions.
2 changes: 1 addition & 1 deletion cmake/templates/HPXConfig.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ endif()
# find_package.
if(HPX_COMMAND_LINE_HANDLING_WITH_JSON_CONFIGURATION_FILES)
if(HPX_WITH_FETCH_JSON)
include("${CMAKE_CURRENT_LIST_DIR}/HPXJSONTarget.cmake")
include("${CMAKE_CURRENT_LIST_DIR}/HPXJsonTarget.cmake")
else()
set(HPX_JSON_ROOT "@Json_ROOT@")
include(HPX_SetupJSON)
Expand Down
8 changes: 5 additions & 3 deletions docs/sphinx/releases/whats_new_1_10_0.rst
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
..
..
Copyright (C) 2007-2023 Hartmut Kaiser
SPDX-License-Identifier: BSL-1.0
Expand All @@ -17,9 +17,11 @@ General changes
Breaking changes
================

- The CMake configuration keys ``SOMELIB_ROOT`` (e.g., ``BOOST_ROOT``) has been
- The |cmake| configuration keys ``SOMELIB_ROOT`` (e.g., ``BOOST_ROOT``) have been
renamed to ``Somelib_ROOT`` (e.g., ``Boost_ROOT``) to avoid warnings when using
newer versions of CMake. Please update your scripts accordingly.
newer versions of |cmake|. Please update your scripts accordingly. For now, the
old variable names are re-assigned to the new names and unset in the |cmake|
cache.

Closed issues
=============
Expand Down
2 changes: 1 addition & 1 deletion libs/core/command_line_handling_local/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ set(command_line_handling_local_sources

if(HPX_COMMAND_LINE_HANDLING_WITH_JSON_CONFIGURATION_FILES)
include(HPX_SetupJSON)
set(command_line_handling_local_dependencies JSON::json)
set(command_line_handling_local_dependencies Json::json)

set(command_line_handling_local_headers
${command_line_handling_local_headers}
Expand Down
20 changes: 10 additions & 10 deletions libs/core/command_line_handling_local/cmake/HPX_SetupJSON.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ endif()

if(NOT HPX_WITH_FETCH_JSON)
find_package(nlohmann_json 3.2.0 REQUIRED)
elseif(NOT TARGET JSON::json)
elseif(NOT TARGET Json::json)
if(NOT HPX_WITH_JSON_TAG)
set(HPX_WITH_JSON_TAG "v3.11.2")
endif()
Expand All @@ -26,7 +26,7 @@ elseif(NOT TARGET JSON::json)
)
else()
hpx_info(
"HPX_WITH_FETCH_JSON=${HPX_WITH_FETCH_JSON}, JSON will be fetched using CMake's FetchContent and installed alongside HPX (HPX_WITH_Json_TAG=${HPX_WITH_Json_TAG})"
"HPX_WITH_FETCH_JSON=${HPX_WITH_FETCH_JSON}, JSON will be fetched using CMake's FetchContent and installed alongside HPX (HPX_WITH_JSON_TAG=${HPX_WITH_JSON_TAG})"
)
endif()

Expand All @@ -45,11 +45,11 @@ elseif(NOT TARGET JSON::json)
json SYSTEM INTERFACE $<BUILD_INTERFACE:${Json_ROOT}/include>
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
)
target_compile_definitions(json INTERFACE Json_HAS_CPP_17)
target_compile_definitions(json INTERFACE JSON_HAS_CPP_17)

install(
TARGETS json
EXPORT HPXJSONTarget
EXPORT HPXJsonTarget
COMPONENT core
)

Expand All @@ -63,17 +63,17 @@ elseif(NOT TARGET JSON::json)

export(
TARGETS json
NAMESPACE JSON::
FILE "${CMAKE_BINARY_DIR}/lib/cmake/${HPX_PACKAGE_NAME}/HPXJSONTarget.cmake"
NAMESPACE Json::
FILE "${CMAKE_BINARY_DIR}/lib/cmake/${HPX_PACKAGE_NAME}/HPXJsonTarget.cmake"
)

install(
EXPORT HPXJSONTarget
NAMESPACE JSON::
FILE HPXJSONTarget.cmake
EXPORT HPXJsonTarget
NAMESPACE Json::
FILE HPXJsonTarget.cmake
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/${HPX_PACKAGE_NAME}
COMPONENT cmake
)

add_library(JSON::json ALIAS json)
add_library(Json::json ALIAS json)
endif()

0 comments on commit 6b4ae35

Please sign in to comment.