From 8710cc6422fcb8887bf3b5642ab4c4934c570740 Mon Sep 17 00:00:00 2001
From: Bill Hoffman <bill.hoffman@kitware.com>
Date: Tue, 1 Sep 2009 16:33:51 -0400
Subject: Add support for embeded manifests for Intel C/C++/Fortran compilers

---
 Modules/Platform/Windows-icl.cmake   | 19 ++++++++++++++++++-
 Modules/Platform/Windows-ifort.cmake | 13 ++++++++++++-
 2 files changed, 30 insertions(+), 2 deletions(-)

diff --git a/Modules/Platform/Windows-icl.cmake b/Modules/Platform/Windows-icl.cmake
index dc40c87..6ba372b 100644
--- a/Modules/Platform/Windows-icl.cmake
+++ b/Modules/Platform/Windows-icl.cmake
@@ -40,7 +40,7 @@ SET(CMAKE_C_LINK_EXECUTABLE
 SET(CMAKE_COMPILE_RESOURCE "rc <FLAGS> /fo<OBJECT> <SOURCE>")
 
 SET(CMAKE_CXX_LINK_EXECUTABLE
-    "<CMAKE_CXX_COMPILER> ${CMAKE_CL_NOLOGO} ${CMAKE_START_TEMP_FILE} <FLAGS> <OBJECTS> /Fe<TARGET> -link <CMAKE_CXX_LINK_FLAGS> <LINK_FLAGS> <LINK_LIBRARIES>${CMAKE_END_TEMP_FILE}")
+  "<CMAKE_CXX_COMPILER> ${CMAKE_CL_NOLOGO} ${CMAKE_START_TEMP_FILE} <FLAGS> <OBJECTS> /Fe<TARGET> -link <CMAKE_CXX_LINK_FLAGS> <LINK_FLAGS> <LINK_LIBRARIES>${CMAKE_END_TEMP_FILE}")
 
 SET(CMAKE_CREATE_WIN32_EXE /subsystem:windows)
 SET(CMAKE_CREATE_CONSOLE_EXE /subsystem:console)
@@ -75,3 +75,20 @@ SET (CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO_INIT ${CMAKE_EXE_LINKER_FLAGS_DEBU
 SET (CMAKE_MODULE_LINKER_FLAGS_INIT ${CMAKE_SHARED_LINKER_FLAGS_INIT})
 SET (CMAKE_MODULE_LINKER_FLAGS_DEBUG_INIT ${CMAKE_SHARED_LINKER_FLAGS_DEBUG_INIT})
 SET (CMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO_INIT ${CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO_INIT})
+
+INCLUDE(Platform/Windows-Intel)
+
+IF(_INTEL_COMPILER_SUPPORTS_MANIFEST)
+  SET(CMAKE_C_LINK_EXECUTABLE
+    "<CMAKE_COMMAND> -E vs_link_exe ${CMAKE_C_LINK_EXECUTABLE}")
+  SET(CMAKE_C_CREATE_SHARED_LIBRARY
+    "<CMAKE_COMMAND> -E vs_link_dll ${CMAKE_C_CREATE_SHARED_LIBRARY}")
+  SET(CMAKE_C_CREATE_SHARED_MODULE
+    "<CMAKE_COMMAND> -E vs_link_dll ${CMAKE_C_CREATE_SHARED_MODULE}")
+  SET(CMAKE_CXX_LINK_EXECUTABLE
+    "<CMAKE_COMMAND> -E vs_link_exe ${CMAKE_CXX_LINK_EXECUTABLE}")
+  SET(CMAKE_CXX_CREATE_SHARED_LIBRARY
+    "<CMAKE_COMMAND> -E vs_link_dll ${CMAKE_CXX_CREATE_SHARED_LIBRARY}")
+  SET(CMAKE_CXX_CREATE_SHARED_MODULE
+    "<CMAKE_COMMAND> -E vs_link_dll ${CMAKE_CXX_CREATE_SHARED_MODULE}")
+ENDIF(_INTEL_COMPILER_SUPPORTS_MANIFEST)
diff --git a/Modules/Platform/Windows-ifort.cmake b/Modules/Platform/Windows-ifort.cmake
index 2bf4753..01848a6 100644
--- a/Modules/Platform/Windows-ifort.cmake
+++ b/Modules/Platform/Windows-ifort.cmake
@@ -26,7 +26,18 @@ SET(CMAKE_Fortran_COMPILE_OBJECT
 SET(CMAKE_COMPILE_RESOURCE "rc <FLAGS> /fo<OBJECT> <SOURCE>")
 
 SET(CMAKE_Fortran_LINK_EXECUTABLE
-    "<CMAKE_Fortran_COMPILER> ${CMAKE_CL_NOLOGO} <OBJECTS> ${CMAKE_START_TEMP_FILE} <FLAGS> /Fe<TARGET> -link <CMAKE_Fortran_LINK_FLAGS> <LINK_FLAGS> <LINK_LIBRARIES>${CMAKE_END_TEMP_FILE}")
+  "<CMAKE_Fortran_COMPILER> ${CMAKE_CL_NOLOGO} <OBJECTS> ${CMAKE_START_TEMP_FILE} <FLAGS> /Fe<TARGET> -link <CMAKE_Fortran_LINK_FLAGS> <LINK_FLAGS> <LINK_LIBRARIES>${CMAKE_END_TEMP_FILE}")
+
+INCLUDE(Platform/Windows-Intel)
+
+IF(_INTEL_COMPILER_SUPPORTS_MANIFEST)
+    SET(CMAKE_Fortran_LINK_EXECUTABLE
+      "<CMAKE_COMMAND> -E vs_link_exe ${CMAKE_Fortran_LINK_EXECUTABLE}")
+  SET(CMAKE_Fortran_CREATE_SHARED_LIBRARY
+    "<CMAKE_COMMAND> -E vs_link_dll ${CMAKE_Fortran_CREATE_SHARED_LIBRARY}")
+  SET(CMAKE_Fortran_CREATE_SHARED_MODULE
+    "<CMAKE_COMMAND> -E vs_link_dll ${CMAKE_Fortran_CREATE_SHARED_MODULE}")
+ENDIF(_INTEL_COMPILER_SUPPORTS_MANIFEST)
 
 SET(CMAKE_CREATE_WIN32_EXE /subsystem:windows)
 SET(CMAKE_CREATE_CONSOLE_EXE /subsystem:console)
-- 
cgit v0.12