From cb09b3a84c7e905c6a3fecfe9617cf864d9af781 Mon Sep 17 00:00:00 2001 From: N-Nagorny Date: Thu, 1 Jul 2021 16:10:17 +0300 Subject: [PATCH] Add public headers installation for WIN32 (#40) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Add public headers installation for WIN32 * Adapt shared library building for Windows * Remove default paths from installation rules * Remove platform branching * Turn back default paths for installation rules * Reorder installation rules Co-authored-by: Petr Pučil Co-authored-by: Petr Pučil --- CMakeLists.txt | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 1d9ebf8..7f72825 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -27,6 +27,8 @@ set (SOURCES set(STRING_ENCODING_TYPE "ICONV" CACHE STRING "Set the way strings have to be encoded (ICONV|NONE|...)") +set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON) + add_library (${PROJECT_NAME} SHARED ${HEADERS} ${SOURCES}) set_property(TARGET ${PROJECT_NAME} PROPERTY PUBLIC_HEADER ${HEADERS}) @@ -49,12 +51,9 @@ else() # User action requested endif() -if (WIN32) - install(TARGETS ${PROJECT_NAME} - RUNTIME DESTINATION lib) -else() - install (TARGETS ${PROJECT_NAME} - LIBRARY DESTINATION lib - PUBLIC_HEADER DESTINATION include/kaitai - ) -endif() +install(TARGETS ${PROJECT_NAME} + ARCHIVE DESTINATION lib + LIBRARY DESTINATION lib + RUNTIME DESTINATION bin + PUBLIC_HEADER DESTINATION include/kaitai +)