@@ -20,6 +20,8 @@ set(CMAKE_CXX_STANDARD_REQUIRED ON)
2020message (STATUS "CMake version: ${CMAKE_VERSION} " )
2121message (STATUS "Project version: ${PROJECT_VERSION} " )
2222
23+ option (SQLITECPP_USE_STATIC_RUNTIME "Use MSVC static runtime (default for internal googletest)." ON )
24+
2325# Define useful variables to handle OS differences:
2426if (WIN32 )
2527 set (DEV_NULL "NUL" )
@@ -33,14 +35,14 @@ if (MSVC)
3335 set (CPPCHECK_ARG_TEMPLATE "--template=vs" )
3436 # disable Visual Studio warnings for fopen() used in the example
3537 add_definitions (-D_CRT_SECURE_NO_WARNINGS)
36- # Flags for linking with multithread static C++ runtime, required by googletest
37- if (SQLITECPP_BUILD_TESTS )
38- message (STATUS "Linking against multithread static C++ runtime for unit tests with googletest " )
38+ # Flags for linking with multithread static C++ runtime, required by internal googletest
39+ if (SQLITECPP_USE_STATIC_RUNTIME )
40+ message (STATUS "Linking against multithread static C++ runtime" )
3941 set (CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} /MT" )
4042 set (CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} /MTd" )
4143 set (CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /MT" )
4244 set (CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /MTd" )
43- endif (SQLITECPP_BUILD_TESTS )
45+ endif (SQLITECPP_USE_STATIC_RUNTIME )
4446 # MSVC versions prior to 2015 are not supported anymore by SQLiteC++ 3.x
4547 if (MSVC_VERSION LESS 1900) # OR MSVC_TOOLSET_VERSION LESS 140)
4648 message (ERROR "Visual Studio prior to 2015 is not supported anymore." )
0 commit comments