-
Notifications
You must be signed in to change notification settings - Fork 6.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[kealib] Cleanup, fix CMake config (#35461)
- Loading branch information
Showing
8 changed files
with
74 additions
and
74 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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,43 @@ | ||
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt | ||
index a9b19fe..3ab09c1 100644 | ||
--- a/src/CMakeLists.txt | ||
+++ b/src/CMakeLists.txt | ||
@@ -54,21 +54,8 @@ set_target_properties(${LIBKEA_LIB_NAME} | ||
) | ||
|
||
add_library(Kealib INTERFACE) | ||
-target_include_directories(Kealib INTERFACE | ||
- $<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/include> | ||
- $<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}/include> | ||
- $<INSTALL_INTERFACE:include> | ||
-) | ||
-# TODO: a better way?? | ||
-if(MSVC) | ||
- target_link_libraries(Kealib INTERFACE | ||
- $<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}/libkea${CMAKE_IMPORT_LIBRARY_SUFFIX}> | ||
- $<INSTALL_INTERFACE:${CMAKE_INSTALL_PREFIX}/lib/libkea${CMAKE_IMPORT_LIBRARY_SUFFIX}>) | ||
-else() | ||
- target_link_libraries(Kealib INTERFACE | ||
- $<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}/libkea${CMAKE_SHARED_LIBRARY_SUFFIX}> | ||
- $<INSTALL_INTERFACE:${CMAKE_INSTALL_PREFIX}/lib/libkea${CMAKE_SHARED_LIBRARY_SUFFIX}>) | ||
-endif(MSVC) | ||
+target_include_directories(Kealib INTERFACE $<INSTALL_INTERFACE:include>) | ||
+target_link_libraries(Kealib INTERFACE ${LIBKEA_LIB_NAME}) | ||
############################################################################### | ||
|
||
############################################################################### | ||
diff --git a/src/Config.cmake.in b/src/Config.cmake.in | ||
index 7de44f9..8a7bb8c 100644 | ||
--- a/src/Config.cmake.in | ||
+++ b/src/Config.cmake.in | ||
@@ -1,5 +1,10 @@ | ||
@PACKAGE_INIT@ | ||
|
||
+# FindHDF5.cmake may expose exported targets in HDF5_LIBRARIES. | ||
+include(CMakeFindDependencyMacro) | ||
+set(HDF5_USE_STATIC_LIBRARIES "@HDF5_USE_STATIC_LIBRARIES@") | ||
+find_dependency(HDF5) | ||
+ | ||
include("${CMAKE_CURRENT_LIST_DIR}/libkeaTargets.cmake") | ||
|
||
check_required_components(libkea) |
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,14 @@ | ||
diff --git a/CMakeLists.txt b/CMakeLists.txt | ||
index 90f64d6..17f2929 100644 | ||
--- a/CMakeLists.txt | ||
+++ b/CMakeLists.txt | ||
@@ -222,9 +222,7 @@ add_test(NAME test1 COMMAND src/test1) | ||
############################################################################### | ||
# Installation | ||
if(MSVC) | ||
- install (FILES "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_BINARY_DIR}/kea-config.bat" DESTINATION bin PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE) | ||
else() | ||
- install (FILES "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_BINARY_DIR}/kea-config" DESTINATION bin PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE) | ||
endif(MSVC) | ||
install (FILES "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_HEADER_DIR}/libkea/kea-config.h" DESTINATION include/libkea) | ||
############################################################################### |
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 |
---|---|---|
@@ -0,0 +1,4 @@ | ||
kealib provides CMake targets: | ||
|
||
find_package(libkea CONFIG REQUIRED) | ||
target_link_libraries(main PRIVATE libkea::Kealib) |
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
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