CMake Improvements: Fix ENABLE_STATIC_LIB option, and renames static library with _static suffix to differentiate between shared library .lib file on Windows.

This commit is contained in:
Micah Snyder 2020-02-19 22:05:10 -05:00
parent b850a926ba
commit b715457c1e

View File

@ -261,10 +261,10 @@ if(ENABLE_STATIC_LIB)
PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/bzlib_private.h PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/bzlib_private.h
INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}/bzlib.h) INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}/bzlib.h)
set_target_properties(bz2_static PROPERTIES set_target_properties(bz2_static PROPERTIES
COMPILE_FLAGS ${WARNCFLAGS} COMPILE_FLAGS "${WARNCFLAGS}"
VERSION ${LT_VERSION} VERSION ${LT_VERSION}
SOVERSION ${LT_SOVERSION} SOVERSION ${LT_SOVERSION}
ARCHIVE_OUTPUT_NAME bz2) ARCHIVE_OUTPUT_NAME bz2_static)
target_compile_definitions(bz2_static PUBLIC BZ2_STATICLIB) target_compile_definitions(bz2_static PUBLIC BZ2_STATICLIB)
install(TARGETS bz2_static DESTINATION ${CMAKE_INSTALL_LIBDIR}) install(TARGETS bz2_static DESTINATION ${CMAKE_INSTALL_LIBDIR})
install(FILES bzlib.h DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) install(FILES bzlib.h DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})