-
Notifications
You must be signed in to change notification settings - Fork 83
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
cmake: fix static library build (vcpkg) (#1096)
* cmake: fix static library build (vcpkg) * fix cmakelint * revert install cmake/re-config.cmake
- Loading branch information
Showing
2 changed files
with
33 additions
and
4 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
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 +1,23 @@ | ||
include("${CMAKE_CURRENT_LIST_DIR}/libre.cmake") | ||
if("@LIBRE_BUILD_STATIC@") | ||
include(CMakeFindDependencyMacro) | ||
find_dependency(Threads) | ||
if("@USE_OPENSSL@") | ||
find_dependency(OpenSSL) | ||
endif() | ||
if("@ZLIB_FOUND@") | ||
find_dependency(ZLIB) | ||
endif() | ||
endif() | ||
|
||
include("${CMAKE_CURRENT_LIST_DIR}/libre-targets.cmake") | ||
|
||
# convenience target libre::libre for uniform usage | ||
if(NOT TARGET libre::libre) | ||
if(TARGET libre::re_shared AND (BUILD_SHARED_LIBS OR NOT TARGET libre::re)) | ||
add_library(libre::libre INTERFACE IMPORTED) | ||
set_target_properties(libre::libre PROPERTIES INTERFACE_LINK_LIBRARIES libre::re_shared) | ||
elseif(TARGET libre::re AND (NOT BUILD_SHARED_LIBS OR NOT TARGET libre::re_shared)) | ||
add_library(libre::libre INTERFACE IMPORTED) | ||
set_target_properties(libre::libre PROPERTIES INTERFACE_LINK_LIBRARIES libre::re) | ||
endif() | ||
endif() |