diff --git a/Source/CMakeLists.txt b/Source/CMakeLists.txt index 16b9ea10b..e2a7ff247 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 diff --git a/Source/QtDialog/CMakeLists.txt b/Source/QtDialog/CMakeLists.txt index 570b5375f..66fd18b82 100644 --- a/Source/QtDialog/CMakeLists.txt +++ b/Source/QtDialog/CMakeLists.txt @@ -152,7 +152,7 @@ endif() set(CMAKE_INCLUDE_CURRENT_DIR ON) -add_executable(cmake-gui WIN32 MACOSX_BUNDLE ${SRCS}) +add_executable(cmake-gui WIN32 MACOSX_BUNDLE ${SRCS} ${MANIFEST_FILE}) target_link_libraries(cmake-gui CMakeLib ${QT_QTMAIN_LIBRARY} ${CMake_QT_LIBRARIES}) if(APPLE) diff --git a/Source/cmake.version.manifest b/Source/cmake.version.manifest new file mode 100644 index 000000000..e7010c972 --- /dev/null +++ b/Source/cmake.version.manifest @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + +