summaryrefslogtreecommitdiffstats
path: root/Modules/Platform
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2009-12-04 14:20:24 (GMT)
committerBrad King <brad.king@kitware.com>2009-12-04 14:20:24 (GMT)
commite2083979767f08e0644030c890cd7de971bbd77a (patch)
treeec6bb895c5e9e112f114950ff1fecc004e7eeec4 /Modules/Platform
parent77ded39645ac09a190fe058bf796978bfe2327ba (diff)
downloadCMake-e2083979767f08e0644030c890cd7de971bbd77a.zip
CMake-e2083979767f08e0644030c890cd7de971bbd77a.tar.gz
CMake-e2083979767f08e0644030c890cd7de971bbd77a.tar.bz2
Consolidate Linux Intel compiler information
We consolidate duplicate code from Platform/Linux-Intel-<lang>.cmake files into a macro defined in Platform/Linux-Intel.cmake.
Diffstat (limited to 'Modules/Platform')
-rw-r--r--Modules/Platform/Linux-Intel-C.cmake8
-rw-r--r--Modules/Platform/Linux-Intel-CXX.cmake8
-rw-r--r--Modules/Platform/Linux-Intel-Fortran.cmake17
-rw-r--r--Modules/Platform/Linux-Intel.cmake33
4 files changed, 38 insertions, 28 deletions
diff --git a/Modules/Platform/Linux-Intel-C.cmake b/Modules/Platform/Linux-Intel-C.cmake
index 7be331e..c909e68 100644
--- a/Modules/Platform/Linux-Intel-C.cmake
+++ b/Modules/Platform/Linux-Intel-C.cmake
@@ -1,8 +1,2 @@
INCLUDE(Platform/Linux-Intel)
-IF(XIAR)
- # INTERPROCEDURAL_OPTIMIZATION
- SET(CMAKE_C_COMPILE_OPTIONS_IPO -ipo)
- SET(CMAKE_C_CREATE_STATIC_LIBRARY_IPO
- "${XIAR} cr <TARGET> <LINK_FLAGS> <OBJECTS> "
- "${XIAR} -s <TARGET> ")
-ENDIF(XIAR)
+__linux_compiler_intel(C)
diff --git a/Modules/Platform/Linux-Intel-CXX.cmake b/Modules/Platform/Linux-Intel-CXX.cmake
index cedb196..0b7daf4 100644
--- a/Modules/Platform/Linux-Intel-CXX.cmake
+++ b/Modules/Platform/Linux-Intel-CXX.cmake
@@ -1,8 +1,2 @@
INCLUDE(Platform/Linux-Intel)
-IF(XIAR)
- # INTERPROCEDURAL_OPTIMIZATION
- SET(CMAKE_CXX_COMPILE_OPTIONS_IPO -ipo)
- SET(CMAKE_CXX_CREATE_STATIC_LIBRARY_IPO
- "${XIAR} cr <TARGET> <LINK_FLAGS> <OBJECTS> "
- "${XIAR} -s <TARGET> ")
-ENDIF(XIAR)
+__linux_compiler_intel(CXX)
diff --git a/Modules/Platform/Linux-Intel-Fortran.cmake b/Modules/Platform/Linux-Intel-Fortran.cmake
index 60925c4..342b5c2 100644
--- a/Modules/Platform/Linux-Intel-Fortran.cmake
+++ b/Modules/Platform/Linux-Intel-Fortran.cmake
@@ -1,15 +1,4 @@
INCLUDE(Platform/Linux-Intel)
-IF(XIAR)
- # INTERPROCEDURAL_OPTIMIZATION
- SET(CMAKE_Fortran_COMPILE_OPTIONS_IPO -ipo)
- SET(CMAKE_Fortran_CREATE_STATIC_LIBRARY_IPO
- "${XIAR} cr <TARGET> <LINK_FLAGS> <OBJECTS> "
- "${XIAR} -s <TARGET> ")
-ENDIF(XIAR)
-
-SET(CMAKE_SHARED_LIBRARY_Fortran_FLAGS "-fPIC")
-SET(CMAKE_SHARED_LIBRARY_CREATE_Fortran_FLAGS "-shared -i_dynamic -nofor_main")
-SET(CMAKE_SHARED_LIBRARY_LINK_Fortran_FLAGS "-i_dynamic")
-SET(CMAKE_SHARED_LIBRARY_RUNTIME_Fortran_FLAG "-Wl,-rpath,")
-SET(CMAKE_SHARED_LIBRARY_RUNTIME_Fortran_FLAG_SEP ":")
-SET(CMAKE_DL_LIBS "dl")
+__linux_compiler_intel(Fortran)
+set(CMAKE_SHARED_LIBRARY_CREATE_Fortran_FLAGS "${CMAKE_SHARED_LIBRARY_CREATE_Fortran_FLAGS} -i_dynamic -nofor_main")
+set(CMAKE_SHARED_LIBRARY_LINK_Fortran_FLAGS "-i_dynamic")
diff --git a/Modules/Platform/Linux-Intel.cmake b/Modules/Platform/Linux-Intel.cmake
index e7a67b6..1474051 100644
--- a/Modules/Platform/Linux-Intel.cmake
+++ b/Modules/Platform/Linux-Intel.cmake
@@ -1,3 +1,23 @@
+
+#=============================================================================
+# Copyright 2002-2009 Kitware, Inc.
+#
+# Distributed under the OSI-approved BSD License (the "License");
+# see accompanying file Copyright.txt for details.
+#
+# This software is distributed WITHOUT ANY WARRANTY; without even the
+# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+# See the License for more information.
+#=============================================================================
+# (To distributed this file outside of CMake, substitute the full
+# License text for the above reference.)
+
+# This module is shared by multiple languages; use include blocker.
+if(__LINUX_COMPILER_INTEL)
+ return()
+endif()
+set(__LINUX_COMPILER_INTEL 1)
+
if(NOT XIAR)
set(_intel_xiar_hints)
foreach(lang C CXX Fortran)
@@ -9,3 +29,16 @@ if(NOT XIAR)
find_program(XIAR NAMES xiar HINTS ${_intel_xiar_hints})
mark_as_advanced(XIAR)
endif(NOT XIAR)
+
+macro(__linux_compiler_intel lang)
+ set(CMAKE_SHARED_LIBRARY_${lang}_FLAGS "-fPIC")
+ set(CMAKE_SHARED_LIBRARY_CREATE_${lang}_FLAGS "-shared")
+
+ if(XIAR)
+ # INTERPROCEDURAL_OPTIMIZATION
+ set(CMAKE_${lang}_COMPILE_OPTIONS_IPO -ipo)
+ set(CMAKE_${lang}_CREATE_STATIC_LIBRARY_IPO
+ "${XIAR} cr <TARGET> <LINK_FLAGS> <OBJECTS> "
+ "${XIAR} -s <TARGET> ")
+ endif()
+endmacro()