summaryrefslogtreecommitdiffstats
path: root/Source/MFCDialog/CMakeLists.txt
diff options
context:
space:
mode:
authorDavid Cole <david.cole@kitware.com>2007-09-11 19:21:37 (GMT)
committerDavid Cole <david.cole@kitware.com>2007-09-11 19:21:37 (GMT)
commita54169789d2eaffd83fa121d092e1af755c2a968 (patch)
tree2cc7bfabfad00c26abc2333a97de3b311b2ea742 /Source/MFCDialog/CMakeLists.txt
parent1f99030cfa5d7782859d903e09eda3f518aa31a2 (diff)
downloadCMake-a54169789d2eaffd83fa121d092e1af755c2a968.zip
CMake-a54169789d2eaffd83fa121d092e1af755c2a968.tar.gz
CMake-a54169789d2eaffd83fa121d092e1af755c2a968.tar.bz2
ENH: Avoid prompting for admin privileges when running CMakeSetup.exe on Vista by adding a requestedExecutionLevel element to its manifest.
Diffstat (limited to 'Source/MFCDialog/CMakeLists.txt')
-rw-r--r--Source/MFCDialog/CMakeLists.txt19
1 files changed, 19 insertions, 0 deletions
diff --git a/Source/MFCDialog/CMakeLists.txt b/Source/MFCDialog/CMakeLists.txt
index 060509f..ae9fc37 100644
--- a/Source/MFCDialog/CMakeLists.txt
+++ b/Source/MFCDialog/CMakeLists.txt
@@ -30,4 +30,23 @@ SET(CMAKE_MFC_FLAG 2)
ADD_EXECUTABLE(CMakeSetup WIN32 ${SRCS})
TARGET_LINK_LIBRARIES(CMakeSetup CMakeLib)
ADD_DEPENDENCIES(CMakeSetup cmake)
+
+IF(MSVC AND NOT MSVC60 AND NOT MSVC70 AND NOT MSVC71)
+ SET(exe "${CMAKE_CFG_INTDIR}/CMakeSetup.exe")
+ IF(EXECUTABLE_OUTPUT_PATH)
+ SET(exe "${EXECUTABLE_OUTPUT_PATH}/${CMAKE_CFG_INTDIR}/CMakeSetup.exe")
+ ENDIF(EXECUTABLE_OUTPUT_PATH)
+
+ # Solve the "things named like *Setup prompt for admin privileges
+ # on Vista" problem by merging a manifest fragment that contains a
+ # requestedExecutionLevel element:
+ #
+ ADD_CUSTOM_COMMAND(TARGET CMakeSetup
+ POST_BUILD COMMAND mt
+ "-inputresource:${exe};#1"
+ -manifest "${CMAKE_CURRENT_SOURCE_DIR}/CMakeSetupManifest.xml"
+ "-outputresource:${exe};#1"
+ )
+ENDIF(MSVC AND NOT MSVC60 AND NOT MSVC70 AND NOT MSVC71)
+
INSTALL_TARGETS(/bin CMakeSetup)