aboutsummaryrefslogtreecommitdiff
path: root/ports/blosc/0002-export-blosc-config.patch
blob: 31297f732d62c699eb45f82222b06c8b35532ecc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
diff --git a/blosc/CMakeLists.txt b/blosc/CMakeLists.txt
index f4e5c29..24641ad 100644
--- a/blosc/CMakeLists.txt
+++ b/blosc/CMakeLists.txt
@@ -122,14 +122,14 @@ endif (NOT DEACTIVATE_ZSTD)
 
 # targets
 if (BUILD_SHARED)
-    add_library(blosc_shared SHARED ${SOURCES})
-    set_target_properties(blosc_shared PROPERTIES OUTPUT_NAME blosc)
-    set_target_properties(blosc_shared PROPERTIES
+    add_library(blosc SHARED ${SOURCES})
+    #set_target_properties(blosc_shared PROPERTIES OUTPUT_NAME blosc)
+    set_target_properties(blosc PROPERTIES
             VERSION ${version_string}
             SOVERSION 1  # Change this when an ABI change happens
         )
     set_property(
-        TARGET blosc_shared
+        TARGET blosc
         APPEND PROPERTY COMPILE_DEFINITIONS BLOSC_SHARED_LIBRARY)
 endif()
 
@@ -192,8 +192,8 @@ if (BUILD_TESTS)
 endif()
 
 if (BUILD_SHARED)
-    target_link_libraries(blosc_shared ${LIBS})
-    target_include_directories(blosc_shared PUBLIC ${BLOSC_INCLUDE_DIRS})
+    target_link_libraries(blosc ${LIBS})
+    target_include_directories(blosc PUBLIC $<INSTALL_INTERFACE:include> $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>)
 endif()
 
 if (BUILD_TESTS)
@@ -202,22 +202,24 @@ if (BUILD_TESTS)
 endif()
 
 if(BUILD_STATIC)
-    add_library(blosc_static STATIC ${SOURCES})
-    set_target_properties(blosc_static PROPERTIES OUTPUT_NAME blosc)
+    add_library(blosc STATIC ${SOURCES})
+    #set_target_properties(blosc_static PROPERTIES OUTPUT_NAME blosc)
     if (MSVC)
-        set_target_properties(blosc_static PROPERTIES PREFIX lib)
+        #set_target_properties(blosc_static PROPERTIES PREFIX lib)
     endif()
-    target_link_libraries(blosc_static ${LIBS})
-    target_include_directories(blosc_static PUBLIC ${BLOSC_INCLUDE_DIRS})
+    target_link_libraries(blosc ${LIBS})
+    target_include_directories(blosc PUBLIC $<INSTALL_INTERFACE:include> $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>)
 endif(BUILD_STATIC)
 
 # install
 if(BLOSC_INSTALL)
     install(FILES blosc.h blosc-export.h DESTINATION include COMPONENT DEV)
     if(BUILD_SHARED)
-        install(TARGETS blosc_shared LIBRARY DESTINATION ${lib_dir} ARCHIVE DESTINATION ${lib_dir} RUNTIME DESTINATION bin COMPONENT LIB)
+        install(TARGETS blosc EXPORT blosc-config RUNTIME DESTINATION bin ARCHIVE DESTINATION lib LIBRARY DESTINATION lib)
     endif(BUILD_SHARED)
     if(BUILD_STATIC)
-        install(TARGETS blosc_static LIBRARY DESTINATION ${lib_dir} ARCHIVE DESTINATION ${lib_dir} RUNTIME DESTINATION bin COMPONENT DEV)
+        install(TARGETS blosc EXPORT blosc-config RUNTIME DESTINATION bin ARCHIVE DESTINATION lib LIBRARY DESTINATION lib)
     endif(BUILD_STATIC)
 endif(BLOSC_INSTALL)
+
+install(EXPORT blosc-config DESTINATION share/cmake/blosc)