@@ -12,6 +12,8 @@ option( CPP-NETLIB_BUILD_TESTS "Build the cpp-netlib project tests." ON)
1212# option( CPP-NETLIB_BUILD_EXPERIMENTS "Build the cpp-netlib project experiments." ON)
1313option ( CPP-NETLIB_BUILD_EXAMPLES"Build the cpp-netlib project examples." ON )
1414option ( CPP-NETLIB_ENABLE_HTTPS"Build cpp-netlib with support for https if OpenSSL is found." ON )
15+ option ( CPP-NETLIB_STATIC_OPENSSL"Build cpp-netlib using static OpenSSL" OFF )
16+ option ( CPP-NETLIB_STATIC_BOOST"Build cpp-netlib using static Boost" OFF )
1517
1618include (GNUInstallDirs)
1719
@@ -37,8 +39,10 @@ else()
3739 set (BUILD_SHARED_LIBS OFF )
3840endif ()
3941
40- # Always use Boost's shared libraries.
41- set (Boost_USE_STATIC_LIBSOFF )
42+ # Use Boost's static libraries
43+ if (CPP-NETLIB_STATIC_BOOST)
44+ set (Boost_USE_STATIC_LIBSON )
45+ endif ()
4246
4347# We need this for all tests to use the dynamic version.
4448add_definitions (-DBOOST_TEST_DYN_LINK)
@@ -65,6 +69,9 @@ if (CPP-NETLIB_ENABLE_HTTPS)
6569 endif ()
6670 endif ()
6771 endif ()
72+ if (CPP-NETLIB_STATIC_OPENSSL)
73+ set (CMAKE_FIND_LIBRARY_SUFFIXES .a)
74+ endif ()
6875 find_package (OpenSSL)
6976endif ()
7077