summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2016-12-24 22:13:00 +0100
committerStanislaw Halik <sthalik@misaki.pl>2016-12-24 22:13:00 +0100
commit28d028d26abaaa5c6192624262811e2989de36de (patch)
treeb0e23d1645318e942276f96a501011bd45f3bf37
parentd564786057c62dce58ecf9ebd9726310fc3ab598 (diff)
cmake: switch to using dynamically-linked CRT
It's been verified to work on Windows XP.
-rwxr-xr-xCMakeLists.txt1
-rw-r--r--cmake/msvc.cmake2
-rw-r--r--cmake/opentrack-win32-crt.cmake8
3 files changed, 10 insertions, 1 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index e3d12828..8d7adeba 100755
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -41,6 +41,7 @@ include(opentrack-boilerplate)
include(opentrack-version)
include(opentrack-install)
+include(opentrack-win32-crt)
if(WIN32)
enable_language(RC)
diff --git a/cmake/msvc.cmake b/cmake/msvc.cmake
index e7e0ced3..1c47d20d 100644
--- a/cmake/msvc.cmake
+++ b/cmake/msvc.cmake
@@ -43,7 +43,7 @@ if(CMAKE_PROJECT_NAME STREQUAL "opentrack")
set(cc "${cc} /GR-")
endif()
-set(silly "${warns_} /MT /Zi /Gm")
+set(silly "${warns_} /MD /Zi /Gm")
set(_CFLAGS "${silly}")
set(_CXXFLAGS "${silly}")
diff --git a/cmake/opentrack-win32-crt.cmake b/cmake/opentrack-win32-crt.cmake
new file mode 100644
index 00000000..85348e89
--- /dev/null
+++ b/cmake/opentrack-win32-crt.cmake
@@ -0,0 +1,8 @@
+if(MSVC)
+ set(SDK_WIN32_CRT "" CACHE PATH "Path to dynamically linked CRT libraries")
+ if(SDK_WIN32_CRT)
+ file(GLOB crt-libs "${SDK_WIN32_CRT}/*.dll")
+ install(FILES ${crt-libs} DESTINATION . ${opentrack-perms})
+ install(FILES "${SDK_WIN32_CRT}/LICENSE.TXT" RENAME "MSVCRT-LICENSE.txt" DESTINATION "./${opentrack-hier-doc}/3rdparty-notices")
+ endif()
+endif()