File: cmake-debian-updates

package info (click to toggle)
libkqueue 2.3.1-1.1~exp1
  • links: PTS, VCS
  • area: main
  • in suites: experimental
  • size: 792 kB
  • sloc: ansic: 9,341; makefile: 68; perl: 22; sh: 7
file content (61 lines) | stat: -rw-r--r-- 2,273 bytes parent folder | download
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
Description: Update CMake config for debian package
 A few updates to the CMakeLists.txt file to be more relevant for the
 Debian package.
Author: Matthew Newton <matthew-git@newtoncomputing.co.uk>
Last-Update: 2019-01-15

Index: libkqueue-2.3.1/CMakeLists.txt
===================================================================
--- libkqueue-2.3.1.orig/CMakeLists.txt
+++ libkqueue-2.3.1/CMakeLists.txt
@@ -120,22 +120,28 @@ else()
 endif()
 
 add_library(kqueue ${LIBRARY_TYPE} ${LIBKQUEUE_SOURCES} ${LIBKQUEUE_HEADERS})
-set_target_properties(kqueue PROPERTIES DEBUG_POSTFIX "d")
+set_target_properties(kqueue PROPERTIES DEBUG_POSTFIX "d" SOVERSION 0)
+
+add_library(kqueue_static STATIC ${LIBKQUEUE_SOURCES} ${LIBKQUEUE_HEADERS})
+set_target_properties(kqueue_static PROPERTIES DEBUG_POSTFIX "d" OUTPUT_NAME kqueue)
 
 if(WIN32)
   target_compile_definitions(kqueue PRIVATE _USRDLL;_WINDLL)
   target_compile_definitions(kqueue PRIVATE _CRT_SECURE_NO_WARNINGS)
 else()
   target_compile_definitions(kqueue PRIVATE _XOPEN_SOURCE=600)
+  target_compile_definitions(kqueue_static PRIVATE _XOPEN_SOURCE=600)
 endif()
 
 target_include_directories(kqueue PRIVATE include)
 if(NOT WIN32)
   target_include_directories(kqueue PRIVATE src/common)
+  target_include_directories(kqueue_static PRIVATE src/common include)
 endif()
 
 if(CMAKE_C_COMPILER_ID MATCHES GNU)
   target_compile_options(kqueue PRIVATE -Wall -Werror)
+  target_compile_options(kqueue_static PRIVATE -Wall -Werror)
 endif()
 if(MINGW AND CMAKE_C_COMPILER_ID MATCHES GNU)
   target_compile_options(kqueue PRIVATE -march=i486)
@@ -145,6 +151,7 @@ if(WIN32)
   target_link_libraries(kqueue PRIVATE Ws2_32)
 endif()
 target_link_libraries(kqueue PRIVATE Threads::Threads)
+target_link_libraries(kqueue_static PRIVATE Threads::Threads)
 
 if(ENABLE_TESTING)
   add_subdirectory(test)
@@ -164,10 +171,10 @@ set(CPACK_RPM_EXCLUDE_FROM_AUTO_FILELIST
 install(FILES
           "include/sys/event.h"
         DESTINATION
-          "${CMAKE_INSTALL_FULL_INCLUDEDIR}/sys"
+          "${CMAKE_INSTALL_FULL_INCLUDEDIR}/kqueue/sys"
         COMPONENT headers)
 install(TARGETS
-          kqueue
+          kqueue kqueue_static
         DESTINATION
           "${CMAKE_INSTALL_FULL_LIBDIR}"
         COMPONENT libraries)