mirror of
https://github.com/microsoft/vcpkg.git
synced 2024-12-12 07:29:17 +08:00
9e672f506d
- [x] Changes comply with the [maintainer guide](https://github.com/microsoft/vcpkg-docs/blob/main/vcpkg/contributing/maintainer-guide.md). - [x] SHA512s are updated for each updated download. - [x] The "supports" clause reflects platforms that may be fixed by this new version. - [x] Any fixed [CI baseline](https://github.com/microsoft/vcpkg/blob/master/scripts/ci.baseline.txt) entries are removed from that file. - [x] Any patches that are no longer applied are deleted from the port's directory. - [x] The version database is fixed by rerunning `./vcpkg x-add-version --all` and committing the result. - [x] Only one version is added to each modified port's versions file.
50 lines
1.7 KiB
Diff
50 lines
1.7 KiB
Diff
diff --git a/CMakeLists.txt b/CMakeLists.txt
|
|
index 2429881..a816142 100644
|
|
--- a/CMakeLists.txt
|
|
+++ b/CMakeLists.txt
|
|
@@ -30,7 +30,7 @@ message(STATUS "xtl v${${PROJECT_NAME}_VERSION}")
|
|
# ============
|
|
|
|
if(NOT TARGET nlohmann_json)
|
|
- find_package(nlohmann_json QUIET)
|
|
+ find_package(nlohmann_json CONFIG REQUIRED)
|
|
endif()
|
|
|
|
# Build
|
|
@@ -85,6 +85,7 @@ set_target_properties(xtl
|
|
endif()
|
|
|
|
target_compile_features(xtl INTERFACE cxx_std_14)
|
|
+target_link_libraries(xtl INTERFACE nlohmann_json::nlohmann_json)
|
|
|
|
option(BUILD_TESTS "xtl test suite" OFF)
|
|
option(DOWNLOAD_GTEST "build gtest from downloaded sources" OFF)
|
|
@@ -119,7 +120,7 @@ install(FILES ${XTL_HEADERS}
|
|
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/xtl)
|
|
endif()
|
|
|
|
-set(XTL_CMAKECONFIG_INSTALL_DIR "${CMAKE_INSTALL_DATAROOTDIR}/cmake/${PROJECT_NAME}" CACHE
|
|
+set(XTL_CMAKECONFIG_INSTALL_DIR "${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}" CACHE
|
|
STRING "install path for xtlConfig.cmake")
|
|
|
|
configure_package_config_file(${PROJECT_NAME}Config.cmake.in
|
|
@@ -154,4 +155,4 @@ configure_file(${PROJECT_NAME}.pc.in
|
|
"${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}.pc"
|
|
@ONLY)
|
|
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}.pc"
|
|
- DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/pkgconfig/")
|
|
+ DESTINATION "${CMAKE_INSTALL_LIBDIR}/pkgconfig/")
|
|
diff --git a/xtlConfig.cmake.in b/xtlConfig.cmake.in
|
|
index 936eef1..ef392c6 100644
|
|
--- a/xtlConfig.cmake.in
|
|
+++ b/xtlConfig.cmake.in
|
|
@@ -13,6 +13,8 @@
|
|
# xtl_INCLUDE_DIRS - the directory containing xtl headers
|
|
# xtl_LIBRARY - empty
|
|
|
|
+include(CMakeFindDependencyMacro)
|
|
+find_dependency(nlohmann_json)
|
|
@PACKAGE_INIT@
|
|
|
|
if(NOT TARGET @PROJECT_NAME@)
|