summaryrefslogtreecommitdiff
path: root/Modules/IntelVSImplicitPath
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2011-09-14 13:59:23 -0400
committerBrad King <brad.king@kitware.com>2011-09-14 14:06:02 -0400
commit67fcc838d9e857de2697c2fbe34e40ac095973dc (patch)
tree5ac12c3aa4e4315aafd40a198a47cc4aaa477158 /Modules/IntelVSImplicitPath
parenta7ce26d837b1c6465c995519ee91e3e0d9190826 (diff)
downloadcmake-67fcc838d9e857de2697c2fbe34e40ac095973dc.tar.gz
Simplify IntelVSImplicitPath detection project
Use the ENV{LIB} variable directly instead of parsing the output of the whole environment from "set". Store the output in a .cmake script and include it from CMakeDetermineCompilerABI instead of using file(READ).
Diffstat (limited to 'Modules/IntelVSImplicitPath')
-rw-r--r--Modules/IntelVSImplicitPath/CMakeLists.txt14
-rw-r--r--Modules/IntelVSImplicitPath/detect.cmake9
-rw-r--r--Modules/IntelVSImplicitPath/extract.cmake12
3 files changed, 14 insertions, 21 deletions
diff --git a/Modules/IntelVSImplicitPath/CMakeLists.txt b/Modules/IntelVSImplicitPath/CMakeLists.txt
index e2a4b3fbd4..96dc4e6125 100644
--- a/Modules/IntelVSImplicitPath/CMakeLists.txt
+++ b/Modules/IntelVSImplicitPath/CMakeLists.txt
@@ -1,11 +1,7 @@
cmake_minimum_required (VERSION 2.8)
project(IntelFortranImplicit Fortran)
-add_custom_command(OUTPUT ${IntelFortranImplicit_BINARY_DIR}/env.txt
- COMMAND set > ${IntelFortranImplicit_BINARY_DIR}/env.txt)
-add_library(FortranLib hello.f
- ${IntelFortranImplicit_BINARY_DIR}/env.txt)
-add_custom_target(ExtractLibPath ALL
- COMMAND ${CMAKE_COMMAND} -P ${IntelFortranImplicit_SOURCE_DIR}/extract.cmake
- WORKING_DIRECTORY ${IntelFortranImplicit_BINARY_DIR}
-)
-add_dependencies(ExtractLibPath FortranLib)
+add_custom_command(
+ OUTPUT output.cmake
+ COMMAND ${CMAKE_COMMAND} -P ${IntelFortranImplicit_SOURCE_DIR}/detect.cmake
+ )
+add_library(FortranLib hello.f output.cmake)
diff --git a/Modules/IntelVSImplicitPath/detect.cmake b/Modules/IntelVSImplicitPath/detect.cmake
new file mode 100644
index 0000000000..20753bef49
--- /dev/null
+++ b/Modules/IntelVSImplicitPath/detect.cmake
@@ -0,0 +1,9 @@
+# look at each path and try to find ifconsol.lib
+set(LIB "$ENV{LIB}")
+foreach(dir ${LIB})
+ file(TO_CMAKE_PATH "${dir}" dir)
+ if(EXISTS "${dir}/ifconsol.lib")
+ file(WRITE output.cmake "list(APPEND implicit_dirs \"${dir}\")\n")
+ break()
+ endif()
+endforeach()
diff --git a/Modules/IntelVSImplicitPath/extract.cmake b/Modules/IntelVSImplicitPath/extract.cmake
deleted file mode 100644
index 055247cfb6..0000000000
--- a/Modules/IntelVSImplicitPath/extract.cmake
+++ /dev/null
@@ -1,12 +0,0 @@
-file(STRINGS env.txt LIB REGEX "^LIB=.*$")
-string(REPLACE "LIB=" "" LIB "${LIB}" )
-# change LIB from a string to a ; separated list of paths
-set(LIB ${LIB})
-# look at each path and try to find ifconsol.lib
-foreach( dir ${LIB})
- file(TO_CMAKE_PATH "${dir}" dir)
- if(EXISTS "${dir}/ifconsol.lib")
- file(WRITE implict_link.txt ${dir})
- return()
- endif()
-endforeach()