Skip to content

Commit

Permalink
Add public headers installation for WIN32 (#40)
Browse files Browse the repository at this point in the history
* 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 <[email protected]>

Co-authored-by: Petr Pučil <[email protected]>
  • Loading branch information
N-Nagorny and generalmimon authored Jul 1, 2021
1 parent 71c9929 commit cb09b3a
Showing 1 changed file with 8 additions and 9 deletions.
17 changes: 8 additions & 9 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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})

Expand All @@ -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
)

0 comments on commit cb09b3a

Please sign in to comment.