summaryrefslogtreecommitdiffstats
path: root/Modules/Compiler
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2010-12-16 18:59:52 (GMT)
committerCMake Topic Stage <kwrobot@kitware.com>2010-12-16 18:59:52 (GMT)
commit72163de0a58d3b8bcdf95c8861fe83b2f699f709 (patch)
treec685d814db45c07240a68f489dec355594e6824e /Modules/Compiler
parent2e594e4adb7df47c1538ef4ba2ffa43b64e2e9f6 (diff)
parent09d1c1080def2b060397469240f184b3fa5358d9 (diff)
downloadCMake-72163de0a58d3b8bcdf95c8861fe83b2f699f709.zip
CMake-72163de0a58d3b8bcdf95c8861fe83b2f699f709.tar.gz
CMake-72163de0a58d3b8bcdf95c8861fe83b2f699f709.tar.bz2
Merge topic 'NAG-Fortran'
09d1c10 FortranCInterface: Recognize NAG Fortran module symbols af2ad90 Add NAG Fortran compiler information files 24cc3d4 Recognize the NAG Fortran compiler 83892c4 Allow Fortran platform files to set empty values fe3f878 Detect object files in implicit link information
Diffstat (limited to 'Modules/Compiler')
-rw-r--r--Modules/Compiler/NAG-Fortran.cmake32
1 files changed, 32 insertions, 0 deletions
diff --git a/Modules/Compiler/NAG-Fortran.cmake b/Modules/Compiler/NAG-Fortran.cmake
new file mode 100644
index 0000000..b68c479
--- /dev/null
+++ b/Modules/Compiler/NAG-Fortran.cmake
@@ -0,0 +1,32 @@
+# Help CMAKE_PARSE_IMPLICIT_LINK_INFO detect NAG Fortran object files.
+if(NOT CMAKE_Fortran_COMPILER_WORKS AND NOT CMAKE_Fortran_COMPILER_FORCED)
+ message(STATUS "Detecting NAG Fortran directory")
+ # Run with -dryrun to see sample "link" line.
+ execute_process(
+ COMMAND ${CMAKE_Fortran_COMPILER} dummy.o -dryrun
+ OUTPUT_VARIABLE _dryrun
+ ERROR_VARIABLE _dryrun
+ )
+ # Match an object file.
+ string(REGEX MATCH "/[^ ]*/[^ /][^ /]*\\.o" _nag_obj "${_dryrun}")
+ if(_nag_obj)
+ # Parse object directory and convert to a regex.
+ string(REGEX REPLACE "/[^/]*$" "" _nag_dir "${_nag_obj}")
+ string(REGEX REPLACE "([][+.*()^])" "\\\\\\1" _nag_regex "${_nag_dir}")
+ set(CMAKE_Fortran_IMPLICIT_OBJECT_REGEX "^${_nag_regex}/")
+ file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
+ "Detecting NAG Fortran directory with -dryrun found\n"
+ " object: ${_nag_obj}\n"
+ " directory: ${_nag_dir}\n"
+ " regex: ${CMAKE_Fortran_IMPLICIT_OBJECT_REGEX}\n"
+ "from output:\n${_dryrun}\n\n")
+ message(STATUS "Detecting NAG Fortran directory - ${_nag_dir}")
+ else()
+ file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
+ "Detecting NAG Fortran directory with -dryrun failed:\n${_dryrun}\n\n")
+ message(STATUS "Detecting NAG Fortran directory - failed")
+ endif()
+endif()
+
+set(CMAKE_Fortran_MODDIR_FLAG "-mdir ")
+set(CMAKE_SHARED_LIBRARY_Fortran_FLAGS "-PIC")