mirror of https://github.com/microsoft/vcpkg.git
59 lines
2.2 KiB
Diff
59 lines
2.2 KiB
Diff
diff --git a/cmake/libaec-config.cmake.in b/cmake/libaec-config.cmake.in
|
|
index 11ac99e..03b96aa 100644
|
|
--- a/cmake/libaec-config.cmake.in
|
|
+++ b/cmake/libaec-config.cmake.in
|
|
@@ -36,7 +36,7 @@ if (libaec_USE_STATIC_LIBS OR (NOT DEFINED libaec_USE_STATIC_LIBS AND NOT "@BUIL
|
|
endif ()
|
|
else ()
|
|
find_library(libaec_LIBRARY NAMES aec DOC "AEC library")
|
|
- find_library(SZIP_LIBRARY NAMES sz szip DOC "SZIP compatible version of the AEC library")
|
|
+ find_library(SZIP_LIBRARY NAMES sz szip NAMES_PER_DIR DOC "SZIP compatible version of the AEC library")
|
|
endif ()
|
|
|
|
# Check version here
|
|
@@ -55,6 +55,7 @@ find_package_handle_standard_args(libaec
|
|
)
|
|
|
|
if (libaec_FOUND)
|
|
+ if(0)
|
|
if (libaec_USE_STATIC_LIBS)
|
|
add_library(libaec::aec STATIC IMPORTED)
|
|
else ()
|
|
@@ -87,6 +88,8 @@ if (libaec_FOUND)
|
|
IMPORTED_LOCATION "${SZIP_LIBRARY}"
|
|
INTERFACE_INCLUDE_DIRECTORIES "${SZIP_INCLUDE_DIR}"
|
|
)
|
|
+ endif()
|
|
+ include("${CMAKE_CURRENT_LIST_DIR}/@PROJECT_NAME@-targets.cmake")
|
|
|
|
# Set SZIP variables.
|
|
set(SZIP_FOUND TRUE)
|
|
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
|
|
index b2aeb6c..1fb3b6d 100644
|
|
--- a/src/CMakeLists.txt
|
|
+++ b/src/CMakeLists.txt
|
|
@@ -77,9 +77,22 @@ set_target_properties(aec sz
|
|
|
|
if(BUILD_SHARED_LIBS)
|
|
set(install_targets aec_shared sz_shared)
|
|
+ set_target_properties(aec_shared PROPERTIES EXPORT_NAME aec INTERFACE_COMPILE_DEFINITIONS LIBAEC_SHARED)
|
|
+ set_target_properties(sz_shared PROPERTIES EXPORT_NAME sz INTERFACE_COMPILE_DEFINITIONS LIBAEC_SHARED)
|
|
set_target_properties(aec_static graec sz_static PROPERTIES EXCLUDE_FROM_ALL 1)
|
|
else()
|
|
set(install_targets aec_static sz_static)
|
|
+ set_target_properties(aec_static PROPERTIES EXPORT_NAME aec PUBLIC_HEADER "${CMAKE_CURRENT_BINARY_DIR}/../include/libaec.h")
|
|
+ set_target_properties(sz_static PROPERTIES EXPORT_NAME sz PUBLIC_HEADER ../include/szlib.h)
|
|
set_target_properties(aec_shared graec sz_shared PROPERTIES EXCLUDE_FROM_ALL 1)
|
|
endif()
|
|
-install(TARGETS ${install_targets})
|
|
+set_target_properties(aec PROPERTIES EXPORT_NAME aec_obj)
|
|
+set_target_properties(sz PROPERTIES EXPORT_NAME sz_obj)
|
|
+install(TARGETS ${install_targets} aec sz
|
|
+ EXPORT ${PROJECT_NAME}-targets
|
|
+)
|
|
+install(
|
|
+ EXPORT ${PROJECT_NAME}-targets
|
|
+ NAMESPACE ${PROJECT_NAME}::
|
|
+ DESTINATION cmake
|
|
+)
|