diff options
author | Bill Hoffman <bill.hoffman@kitware.com> | 2004-08-06 18:51:41 (GMT) |
---|---|---|
committer | Bill Hoffman <bill.hoffman@kitware.com> | 2004-08-06 18:51:41 (GMT) |
commit | 9655299f08b5aa04ea63193ebecfa08efae7ca3d (patch) | |
tree | 69f0415d9b8414cee074b25d80c4520a6feb6086 /Source/cmTryCompileCommand.cxx | |
parent | 0220a85e3337f87c3b34c2d49d85b6ace127ea50 (diff) | |
download | CMake-9655299f08b5aa04ea63193ebecfa08efae7ca3d.zip CMake-9655299f08b5aa04ea63193ebecfa08efae7ca3d.tar.gz CMake-9655299f08b5aa04ea63193ebecfa08efae7ca3d.tar.bz2 |
ENH: initial fortran support
Diffstat (limited to 'Source/cmTryCompileCommand.cxx')
-rw-r--r-- | Source/cmTryCompileCommand.cxx | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/Source/cmTryCompileCommand.cxx b/Source/cmTryCompileCommand.cxx index 422b02b..b72f14d 100644 --- a/Source/cmTryCompileCommand.cxx +++ b/Source/cmTryCompileCommand.cxx @@ -156,10 +156,14 @@ int cmTryCompileCommand::CoreTryCompileCode( { fprintf(fout, "PROJECT(CMAKE_TRY_COMPILE CXX)\n"); } + else if ( format == cmSystemTools::FORTRAN_FILE_FORMAT ) + { + fprintf(fout, "PROJECT(CMAKE_TRY_COMPILE FORTRAN)\n"); + } else { cmSystemTools::Error("Unknown file format for file: ", source.c_str(), - "; TRY_COMPILE only works for C and CXX files"); + "; TRY_COMPILE only works for C, CXX, and FORTRAN files"); return -1; } const char* cflags = mf->GetDefinition("CMAKE_C_FLAGS"); @@ -181,6 +185,16 @@ int cmTryCompileCommand::CoreTryCompileCode( } fprintf(fout, " ${COMPILE_DEFINITIONS}\")\n"); } + if(format == cmSystemTools::FORTRAN_FILE_FORMAT ) + { + const char* fflags = mf->GetDefinition("CMAKE_FORTRAN_FLAGS"); + fprintf(fout, "SET(CMAKE_FORTRAN_FLAGS \"${CMAKE_FORTRAN_FLAGS} "); + if(fflags) + { + fprintf(fout, " %s ", fflags); + } + fprintf(fout, " ${COMPILE_DEFINITIONS}\")\n"); + } fprintf(fout, "INCLUDE_DIRECTORIES(${INCLUDE_DIRECTORIES})\n"); fprintf(fout, "LINK_DIRECTORIES(${LINK_DIRECTORIES})\n"); // handle any compile flags we need to pass on |