diff --git a/CMakeLists.txt b/CMakeLists.txt index 9766cee16..ff04c6bab 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -53,12 +53,16 @@ endif() # Include some common macros to simpilfy the Poco CMake files include(PocoMacros) -option(BUILD_SHARED_LIBS "Build shared libraries" ON) +if(POCO_STATIC) + option(BUILD_SHARED_LIBS "Build shared libraries" OFF) +else() + option(BUILD_SHARED_LIBS "Build shared libraries" ON) +endif() if(MSVC) option(POCO_MT "Set to OFF|ON (default is OFF) to control build of POCO as /MT instead of /MD" OFF) option(ENABLE_MSVC_MP "Set to OFF|ON (default is OFF) to control parallel build of POCO with MSVC" ON) - + if(BUILD_SHARED_LIBS AND POCO_MT) message(FATAL_ERROR "Cannot have both BUILD_SHARED_LIBS and POCO_MT") endif()