-
Notifications
You must be signed in to change notification settings - Fork 6.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[nsync] Export cmake targets (#23811)
* [nsync] Export cmake targets * version * Forgot the patch * version * Also export the include path * version
- Loading branch information
Showing
5 changed files
with
63 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
diff --git a/CMakeLists.txt b/CMakeLists.txt | ||
index 328f9b6..6a71b5b 100644 | ||
--- a/CMakeLists.txt | ||
+++ b/CMakeLists.txt | ||
@@ -41,6 +41,9 @@ function (set_cpp_target tgtname files) | ||
"${PROJECT_SOURCE_DIR}/platform/c++11.futex" | ||
) | ||
endif () | ||
+ | ||
+ target_include_directories("${tgtname}" PUBLIC $<INSTALL_INTERFACE:include>) | ||
+ | ||
|
||
target_compile_definitions ("${tgtname}" PRIVATE "${NSYNC_CPP_DEFINITIONS}") | ||
|
||
@@ -399,14 +402,19 @@ endif () | ||
# By default, install nsync always | ||
# set (CMAKE_SKIP_INSTALL_ALL_DEPENDENCY ON) | ||
|
||
-install (TARGETS nsync | ||
+install (TARGETS nsync EXPORT unofficial-nsyncConfig | ||
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT RuntimeLibraries | ||
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT Development) | ||
|
||
-install (TARGETS nsync_cpp OPTIONAL | ||
+install (TARGETS nsync_cpp OPTIONAL EXPORT unofficial-nsyncConfig | ||
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT RuntimeLibraries | ||
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT Development) | ||
|
||
+install(EXPORT unofficial-nsyncConfig | ||
+ NAMESPACE unofficial::nsync:: | ||
+ DESTINATION share/unofficial-nsync | ||
+) | ||
+ | ||
set (NSYNC_INCLUDES | ||
"public/nsync.h" | ||
"public/nsync_atomic.h" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,18 @@ | ||
{ | ||
"name": "nsync", | ||
"version": "1.24.0", | ||
"port-version": 1, | ||
"description": "nsync is a C library that exports various synchronization primitives, such as mutexes", | ||
"homepage": "https://github.com/google/nsync" | ||
"homepage": "https://github.com/google/nsync", | ||
"license": "Apache-2.0", | ||
"dependencies": [ | ||
{ | ||
"name": "vcpkg-cmake", | ||
"host": true | ||
}, | ||
{ | ||
"name": "vcpkg-cmake-config", | ||
"host": true | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters