Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
R
rapidjson
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
pirvi-public
rapidjson
Commits
30f54566
Unverified
Commit
30f54566
authored
Aug 14, 2023
by
Milo Yip
Committed by
GitHub
Aug 14, 2023
Browse files
Options
Downloads
Plain Diff
Merge pull request #1901 from JackBoosY/master
Use modern cmake function export to generate target
parents
516d0473
52dd9470
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
CMakeLists.txt
+14
-5
14 additions, 5 deletions
CMakeLists.txt
RapidJSONConfig.cmake.in
+5
-11
5 additions, 11 deletions
RapidJSONConfig.cmake.in
with
19 additions
and
16 deletions
CMakeLists.txt
+
14
−
5
View file @
30f54566
...
...
@@ -195,6 +195,11 @@ install(FILES readme.md
DESTINATION
"
${
DOC_INSTALL_DIR
}
"
COMPONENT doc
)
# Add an interface target to export it
add_library
(
RapidJSON INTERFACE
)
target_include_directories
(
RapidJSON INTERFACE $<INSTALL_INTERFACE:include/rapidjson>
)
install
(
DIRECTORY include/rapidjson
DESTINATION
"
${
INCLUDE_INSTALL_DIR
}
"
COMPONENT dev
)
...
...
@@ -221,6 +226,7 @@ SET( CONFIG_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR})
SET
(
CONFIG_DIR
${
CMAKE_CURRENT_BINARY_DIR
}
)
SET
(
${
PROJECT_NAME
}
_INCLUDE_DIR
"
\$
{
${
PROJECT_NAME
}
_SOURCE_DIR}/include"
)
INCLUDE
(
CMakePackageConfigHelpers
)
CONFIGURE_FILE
(
${
CMAKE_CURRENT_SOURCE_DIR
}
/
${
PROJECT_NAME
}
Config.cmake.in
${
CMAKE_CURRENT_BINARY_DIR
}
/
${
PROJECT_NAME
}
Config.cmake @ONLY
)
CONFIGURE_FILE
(
${
CMAKE_CURRENT_SOURCE_DIR
}
/
${
PROJECT_NAME
}
ConfigVersion.cmake.in
...
...
@@ -248,4 +254,7 @@ IF(CMAKE_INSTALL_DIR)
${
CMAKE_CURRENT_BINARY_DIR
}
/
${
PROJECT_NAME
}
ConfigVersion.cmake
DESTINATION
"
${
CMAKE_INSTALL_DIR
}
"
COMPONENT dev
)
INSTALL
(
TARGETS RapidJSON EXPORT RapidJSON-targets
)
INSTALL
(
EXPORT RapidJSON-targets DESTINATION
${
CMAKE_INSTALL_DIR
}
)
ENDIF
()
This diff is collapsed.
Click to expand it.
RapidJSONConfig.cmake.in
+
5
−
11
View file @
30f54566
################################################################################
# CMake minimum version required
cmake_minimum_required(VERSION 3.0
)
@PACKAGE_INIT@
include ("${CMAKE_CURRENT_LIST_DIR}/RapidJSON-targets.cmake"
)
################################################################################
# RapidJSON source dir
...
...
@@ -14,12 +14,6 @@ set( RapidJSON_DIR "@CONFIG_DIR@")
# Compute paths
get_filename_component(RapidJSON_CMAKE_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH)
set( RapidJSON_INCLUDE_DIR "@RapidJSON_INCLUDE_DIR@" )
set( RapidJSON_INCLUDE_DIRS "@RapidJSON_INCLUDE_DIR@" )
message(STATUS "RapidJSON found. Headers: ${RapidJSON_INCLUDE_DIRS}")
get_target_property(RapidJSON_INCLUDE_DIR RapidJSON INTERFACE_INCLUDE_DIRECTORIES)
if(NOT TARGET rapidjson)
add_library(rapidjson INTERFACE IMPORTED)
set_property(TARGET rapidjson PROPERTY
INTERFACE_INCLUDE_DIRECTORIES ${RapidJSON_INCLUDE_DIRS})
endif()
set( RapidJSON_INCLUDE_DIRS ${RapidJSON_INCLUDE_DIR} )
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment