summaryrefslogtreecommitdiffstats
path: root/Source/CMakeLists.txt
diff options
context:
space:
mode:
authorGilles Khouzam <gillesk@microsoft.com>2015-09-18 14:23:21 (GMT)
committerBrad King <brad.king@kitware.com>2015-09-21 13:02:41 (GMT)
commit17009189f8bbf264b386bb610deafdd0d8ce53c2 (patch)
treecea48d39a3db1e2cd4a5741233dc7140e611839d /Source/CMakeLists.txt
parente3ace61212db5c960132ef0868f49cf05fe1c021 (diff)
downloadCMake-17009189f8bbf264b386bb610deafdd0d8ce53c2.zip
CMake-17009189f8bbf264b386bb610deafdd0d8ce53c2.tar.gz
CMake-17009189f8bbf264b386bb610deafdd0d8ce53c2.tar.bz2
Windows: Fix CMAKE_HOST_SYSTEM_VERSION on Windows >= 8 (#15674)
According to GetVersionEx documentation: https://msdn.microsoft.com/en-us/library/windows/desktop/ms724451.aspx https://msdn.microsoft.com/en-us/library/windows/desktop/dn481241.aspx we must manifest each application to explicitly declare support for each version of Windows.
Diffstat (limited to 'Source/CMakeLists.txt')
-rw-r--r--Source/CMakeLists.txt12
1 files changed, 8 insertions, 4 deletions
diff --git a/Source/CMakeLists.txt b/Source/CMakeLists.txt
index 16b9ea1..e2a7ff2 100644
--- a/Source/CMakeLists.txt
+++ b/Source/CMakeLists.txt
@@ -502,6 +502,10 @@ if (WIN32)
cmGhsMultiGpj.cxx
cmGhsMultiGpj.h
)
+
+ # Add a manifest file to executables on Windows to allow for
+ # GetVersion to work properly on Windows 8 and above.
+ set(MANIFEST_FILE ${CMAKE_CURRENT_SOURCE_DIR}/cmake.version.manifest)
endif()
endif ()
@@ -531,7 +535,7 @@ set(SRCS ${SRCS}
if(WIN32 AND NOT CYGWIN)
set_source_files_properties(cmcldeps.cxx PROPERTIES COMPILE_DEFINITIONS _WIN32_WINNT=0x0501)
- add_executable(cmcldeps cmcldeps.cxx)
+ add_executable(cmcldeps cmcldeps.cxx ${MANIFEST_FILE})
target_link_libraries(cmcldeps CMakeLib)
install(TARGETS cmcldeps DESTINATION bin)
endif()
@@ -720,15 +724,15 @@ if(APPLE)
endif()
# Build CMake executable
-add_executable(cmake cmakemain.cxx cmcmd.cxx cmcmd.h)
+add_executable(cmake cmakemain.cxx cmcmd.cxx cmcmd.h ${MANIFEST_FILE})
target_link_libraries(cmake CMakeLib)
# Build CTest executable
-add_executable(ctest ctest.cxx)
+add_executable(ctest ctest.cxx ${MANIFEST_FILE})
target_link_libraries(ctest CTestLib)
# Build CPack executable
-add_executable(cpack CPack/cpack.cxx)
+add_executable(cpack CPack/cpack.cxx ${MANIFEST_FILE})
target_link_libraries(cpack CPackLib)
# Curses GUI