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)
