diff options
author | Brad King <brad.king@kitware.com> | 2017-11-13 19:09:57 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2017-11-14 12:26:36 (GMT) |
commit | 313a565729407fd13a7b0b702b4a7509ad7fa8d5 (patch) | |
tree | 085a5fcebd29bc77063ac3007c07fd7597095578 /Utilities | |
parent | a12830c2fd3acf5b6ba67c2356593e965fdf1982 (diff) | |
download | CMake-313a565729407fd13a7b0b702b4a7509ad7fa8d5.zip CMake-313a565729407fd13a7b0b702b4a7509ad7fa8d5.tar.gz CMake-313a565729407fd13a7b0b702b4a7509ad7fa8d5.tar.bz2 |
Utilities/Release: Build static executables on Windows
Switch to the MSVC static runtime library (and static UCRT).
Link Qt statically, including the Windows platform plugin.
Disable the Qt tests because they are incompatible with a
Qt using a static runtime library.
Diffstat (limited to 'Utilities')
-rw-r--r-- | Utilities/Release/win32_release.cmake | 26 | ||||
-rw-r--r-- | Utilities/Release/win64_release.cmake | 23 |
2 files changed, 36 insertions, 13 deletions
diff --git a/Utilities/Release/win32_release.cmake b/Utilities/Release/win32_release.cmake index f54a4ca..bdf002e 100644 --- a/Utilities/Release/win32_release.cmake +++ b/Utilities/Release/win32_release.cmake @@ -1,13 +1,20 @@ -set(CMAKE_RELEASE_DIRECTORY "c:/msys64/home/dashboard/CMakeReleaseDirectory") +set(CMAKE_RELEASE_DIRECTORY "c:/msys64/home/dashboard/CMakeReleaseDirectory32") set(CONFIGURE_WITH_CMAKE TRUE) set(CMAKE_CONFIGURE_PATH "c:/Program\\ Files/CMake/bin/cmake.exe") -set(PROCESSORS 8) -set(HOST dash3win7) +set(PROCESSORS 16) +set(HOST win32) set(RUN_LAUNCHER ~/rel/run) set(CPACK_BINARY_GENERATORS "WIX ZIP") set(CPACK_SOURCE_GENERATORS "ZIP") set(MAKE_PROGRAM "ninja") -set(MAKE "${MAKE_PROGRAM} -j8") +set(MAKE "${MAKE_PROGRAM} -j16") +set(qt_prefix "c:/Qt/5.6.3/msvc2017-32-xp-mt") +set(qt_win_libs + ${qt_prefix}/plugins/platforms/qwindows.lib + ${qt_prefix}/lib/Qt5PlatformSupport.lib + ${qt_prefix}/lib/qtfreetype.lib + imm32.lib + ) set(INITIAL_CACHE "CMAKE_BUILD_TYPE:STRING=Release CMAKE_DOC_DIR:STRING=doc/cmake CMAKE_USE_OPENSSL:BOOL=OFF @@ -16,17 +23,22 @@ CMAKE_Fortran_COMPILER:FILEPATH=FALSE CMAKE_GENERATOR:INTERNAL=Ninja BUILD_QtDialog:BOOL:=TRUE CMake_GUI_DISTRIBUTE_WITH_Qt_LGPL:STRING=3 -CMake_INSTALL_DEPENDENCIES:BOOL=ON +CMAKE_C_FLAGS_RELEASE:STRING=-MT -O2 -Ob2 -DNDEBUG +CMAKE_CXX_FLAGS_RELEASE:STRING=-MT -O2 -Ob2 -DNDEBUG CMAKE_EXE_LINKER_FLAGS:STRING=-machine:x86 -subsystem:console,5.01 +CMake_QT_STATIC_QWindowsIntegrationPlugin_LIBRARIES:STRING=${qt_win_libs} +CMAKE_PREFIX_PATH:STRING=${qt_prefix} +CMake_TEST_Qt4:BOOL=OFF +CMake_TEST_Qt5:BOOL=OFF ") set(ppflags "-D_WIN32_WINNT=0x501 -DNTDDI_VERSION=0x05010000 -D_USING_V110_SDK71_") set(CFLAGS "${ppflags}") set(CXXFLAGS "${ppflags}") -set(ENV ". ~/rel/env") +set(ENV ". ~/rel/env32") get_filename_component(path "${CMAKE_CURRENT_LIST_FILE}" PATH) set(GIT_EXTRA "git config core.autocrlf true") if(CMAKE_CREATE_VERSION STREQUAL "nightly") # Some tests fail spuriously too often. - set(EXTRA_CTEST_ARGS "-E 'Qt5Autogen|ConsoleBuf'") + set(EXTRA_CTEST_ARGS "-E 'ConsoleBuf'") endif() include(${path}/release_cmake.cmake) diff --git a/Utilities/Release/win64_release.cmake b/Utilities/Release/win64_release.cmake index bd2690f..1c81f82 100644 --- a/Utilities/Release/win64_release.cmake +++ b/Utilities/Release/win64_release.cmake @@ -1,14 +1,20 @@ set(CMAKE_RELEASE_DIRECTORY "c:/msys64/home/dashboard/CMakeReleaseDirectory64") set(CONFIGURE_WITH_CMAKE TRUE) set(CMAKE_CONFIGURE_PATH "c:/Program\\ Files/CMake/bin/cmake.exe") -set(PROCESSORS 8) -set(HOST dash3win7) -set(SCRIPT_NAME dash3win7x64) +set(PROCESSORS 16) +set(HOST win64) set(RUN_LAUNCHER ~/rel/run) set(CPACK_BINARY_GENERATORS "WIX ZIP") set(CPACK_SOURCE_GENERATORS "") set(MAKE_PROGRAM "ninja") -set(MAKE "${MAKE_PROGRAM} -j8") +set(MAKE "${MAKE_PROGRAM} -j16") +set(qt_prefix "c:/Qt/5.6.3/msvc2017-64-xp-mt") +set(qt_win_libs + ${qt_prefix}/plugins/platforms/qwindows.lib + ${qt_prefix}/lib/Qt5PlatformSupport.lib + ${qt_prefix}/lib/qtfreetype.lib + imm32.lib + ) set(INITIAL_CACHE "CMAKE_BUILD_TYPE:STRING=Release CMAKE_DOC_DIR:STRING=doc/cmake CMAKE_USE_OPENSSL:BOOL=OFF @@ -17,8 +23,13 @@ CMAKE_Fortran_COMPILER:FILEPATH=FALSE CMAKE_GENERATOR:INTERNAL=Ninja BUILD_QtDialog:BOOL:=TRUE CMake_GUI_DISTRIBUTE_WITH_Qt_LGPL:STRING=3 -CMake_INSTALL_DEPENDENCIES:BOOL=ON +CMAKE_C_FLAGS_RELEASE:STRING=-MT -O2 -Ob2 -DNDEBUG +CMAKE_CXX_FLAGS_RELEASE:STRING=-MT -O2 -Ob2 -DNDEBUG CMAKE_EXE_LINKER_FLAGS:STRING=-machine:x64 -subsystem:console,5.02 +CMake_QT_STATIC_QWindowsIntegrationPlugin_LIBRARIES:STRING=${qt_win_libs} +CMAKE_PREFIX_PATH:STRING=${qt_prefix} +CMake_TEST_Qt4:BOOL=OFF +CMake_TEST_Qt5:BOOL=OFF ") set(ppflags "-D_WIN32_WINNT=0x502 -DNTDDI_VERSION=0x05020000 -D_USING_V110_SDK71_") set(CFLAGS "${ppflags}") @@ -28,6 +39,6 @@ get_filename_component(path "${CMAKE_CURRENT_LIST_FILE}" PATH) set(GIT_EXTRA "git config core.autocrlf true") if(CMAKE_CREATE_VERSION STREQUAL "nightly") # Some tests fail spuriously too often. - set(EXTRA_CTEST_ARGS "-E 'Qt5Autogen|ConsoleBuf'") + set(EXTRA_CTEST_ARGS "-E 'ConsoleBuf'") endif() include(${path}/release_cmake.cmake) |