From d411f3a57029b1d710d859d592dde0ffa475dc0e Mon Sep 17 00:00:00 2001 From: aiab Date: Thu, 16 Aug 2018 10:33:01 +0200 Subject: [PATCH 1/2] fix shared dll issue on windows not exporting definitions --- CMakeLists.txt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 12e04e8..c616f4c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -152,6 +152,10 @@ else() set_target_properties(freespace PROPERTIES PREFIX "lib") + if (LIBFREESPACE_LIB_TYPE STREQUAL "SHARED") + add_definitions(-DLIBFREESPACE_EXPORTS) + set_target_properties(freespace PROPERTIES IMPORT_PREFIX "lib") + endif() IF (CMAKE_SIZEOF_VOID_P EQUAL 8) # Means we are using 64-bit set(_hid ${WINDDK_WIN7_X64_HID_LIB}) From a6de6672c87f09448f717b730cff8735e8156c66 Mon Sep 17 00:00:00 2001 From: aiab Date: Thu, 16 Aug 2018 10:33:59 +0200 Subject: [PATCH 2/2] add shared library binary in install and package --- CMakeLists.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index c616f4c..4e60fb8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -248,6 +248,9 @@ add_subdirectory(doc) if (NOT LIBFREESPACE_CUSTOM_INSTALL_RULES) if (NOT LIBFREESPACE_CODECS_ONLY) install(TARGETS freespace LIBRARY DESTINATION lib ARCHIVE DESTINATION lib) + if (LIBFREESPACE_LIB_TYPE STREQUAL "SHARED") + install(TARGETS freespace RUNTIME DESTINATION bin LIBRARY DESTINATION bin) + endif() set_target_properties(freespace PROPERTIES VERSION ${PROJECT_VERSION_STRING} SOVERSION ${PROJECT_VERSION_MAJOR} )