diff --git a/CMakeLists.txt b/CMakeLists.txt index 0ed79c99..f8bbb803 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -71,6 +71,10 @@ option(USE_LTO "Enable link-time optimization" OFF) # See https://github.com/DaemonEngine/crunch/issues/29 option(USE_FAST_MATH "Enable fast math (generated images are less likely to be reproducible)" OFF) +if (BUILD_STATIC_LIBCRN) + option(INSTALL_STATIC_LIBS "Install static libraries" OFF) +endif() + if (MSVC) # Enable MSVC parallel compilation. set_cxx_flag("/MP") diff --git a/crnlib/CMakeLists.txt b/crnlib/CMakeLists.txt index 7f6292f2..5f888360 100644 --- a/crnlib/CMakeLists.txt +++ b/crnlib/CMakeLists.txt @@ -210,7 +210,7 @@ endif() add_library(${CRUNCH_LIBRARY_NAME} ${CRUNCH_DEFAULT_LIBRARY_TYPE} $) set_property(TARGET ${CRUNCH_LIBRARY_NAME} PROPERTY POSITION_INDEPENDENT_CODE 1) -if (BUILD_SHARED_LIBS OR BUILD_STATIC_LIBCRN) +if (BUILD_SHARED_LIBS OR (BUILD_STATIC_LIBCRN AND INSTALL_STATIC_LIBS)) install(TARGETS ${CRUNCH_LIBRARY_NAME} DESTINATION lib) endif()