diff --git a/CMakeLists.txt b/CMakeLists.txt index baf93dc9..3d120f03 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -20,6 +20,7 @@ set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake/modules" ) set(ZINT_DEBUG FALSE CACHE BOOL "Set debug compile flag") set(ZINT_SANITIZE FALSE CACHE BOOL "Set sanitize compile/link flags") set(ZINT_TEST FALSE CACHE BOOL "Set test compile flag") +set(ZINT_STATIC FALSE CACHE BOOL "Build static library") include (SetPaths.cmake) diff --git a/backend/CMakeLists.txt b/backend/CMakeLists.txt index 98e6faa8..0649dcc2 100644 --- a/backend/CMakeLists.txt +++ b/backend/CMakeLists.txt @@ -18,7 +18,9 @@ else(PNG_FOUND) endif(PNG_FOUND) add_library(zint SHARED ${zint_SRCS}) -add_library(zint-static STATIC ${zint_SRCS}) +if(ZINT_STATIC) + add_library(zint-static STATIC ${zint_SRCS}) +endif(ZINT_STATIC) set_target_properties(zint PROPERTIES SOVERSION "${ZINT_VERSION_MAJOR}.${ZINT_VERSION_MINOR}" VERSION ${ZINT_VERSION})