diff options
author | Yann Collet <yann.collet.73@gmail.com> | 2015-12-16 09:55:07 (GMT) |
---|---|---|
committer | Yann Collet <yann.collet.73@gmail.com> | 2015-12-16 09:55:07 (GMT) |
commit | d67ae8fe41cb616345fa349e072b32655ef10be8 (patch) | |
tree | a6133c813d3fe7f17c0e75c2bbf70db5ebbe7184 | |
parent | 495ea43d94e1613af17e76eea0efeb025ca2978b (diff) | |
parent | 4c9d851ebaa7e44f642449375b04846adffe0b8f (diff) | |
download | lz4-d67ae8fe41cb616345fa349e072b32655ef10be8.zip lz4-d67ae8fe41cb616345fa349e072b32655ef10be8.tar.gz lz4-d67ae8fe41cb616345fa349e072b32655ef10be8.tar.bz2 |
Merge pull request #172 from psteinb/add_static_cmake
added static build target for OSX and Linux to cmake
-rw-r--r-- | cmake_unofficial/CMakeLists.txt | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/cmake_unofficial/CMakeLists.txt b/cmake_unofficial/CMakeLists.txt index 502a43e..57f7947 100644 --- a/cmake_unofficial/CMakeLists.txt +++ b/cmake_unofficial/CMakeLists.txt @@ -43,14 +43,26 @@ if(BUILD_TOOLS) endif() if(BUILD_LIBS) - add_library(liblz4 SHARED ${LZ4_SRCS_LIB}) - + + + SET(LIBS_TARGETS "") + IF(NOT WIN32) + add_library(liblz4 SHARED ${LZ4_SRCS_LIB}) + add_library(liblz4_static STATIC ${LZ4_SRCS_LIB}) + SET_TARGET_PROPERTIES(liblz4_static PROPERTIES OUTPUT_NAME lz4) + SET(LIBS_TARGETS liblz4 liblz4_static) + ELSE(NOT WIN32) + add_library(liblz4 STATIC ${LZ4_SRCS_LIB}) + SET(LIBS_TARGETS liblz4) + ENDIF(NOT WIN32) + set_target_properties(liblz4 PROPERTIES OUTPUT_NAME lz4 SOVERSION "${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}" ) - install(TARGETS liblz4 + install(TARGETS ${LIBS_TARGETS} + RUNTIME DESTINATION lib #on Windows: cmake considers dlls as runtime component LIBRARY DESTINATION lib ARCHIVE DESTINATION lib ) |