diff options
Diffstat (limited to 'Modules/IntelVSImplicitPath')
-rw-r--r-- | Modules/IntelVSImplicitPath/CMakeLists.txt | 11 | ||||
-rw-r--r-- | Modules/IntelVSImplicitPath/extract.cmake | 12 | ||||
-rw-r--r-- | Modules/IntelVSImplicitPath/hello.f | 0 |
3 files changed, 23 insertions, 0 deletions
diff --git a/Modules/IntelVSImplicitPath/CMakeLists.txt b/Modules/IntelVSImplicitPath/CMakeLists.txt new file mode 100644 index 0000000..e2a4b3f --- /dev/null +++ b/Modules/IntelVSImplicitPath/CMakeLists.txt @@ -0,0 +1,11 @@ +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) diff --git a/Modules/IntelVSImplicitPath/extract.cmake b/Modules/IntelVSImplicitPath/extract.cmake new file mode 100644 index 0000000..055247c --- /dev/null +++ b/Modules/IntelVSImplicitPath/extract.cmake @@ -0,0 +1,12 @@ +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() diff --git a/Modules/IntelVSImplicitPath/hello.f b/Modules/IntelVSImplicitPath/hello.f new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/Modules/IntelVSImplicitPath/hello.f |