Re: [cmake-developers] Assembly/preprocessed targets for Fortran

2014-11-05 Thread Brad King
On 11/04/2014 06:37 PM, Tim Gallagher wrote:
 I have attached the patch to enable the targets for Fortran.

Thanks.  Please update it to avoid using hard TABs for indentation.
Also in the CompileCommandOutput test hunk:

 -project (CompileCommandOutput CXX)
 +project (CompileCommandOutput)
 +enable_language(CXX)
 +enable_language(Fortran)

there are a couple problems:

- By removing any explicit languages from the project() call
  it will enable C and CXX by default.  Use NONE to suppress
  that.

- We cannot assume that Fortran will be available.  The other
  Fortran tests are all guarded by availability of a Fortran
  compiler.

The test for CMAKE_EXPORT_COMPILE_COMMANDS was already missing
for C, so let's just skip Fortran for the test too.  They can
be fixed together as a separate change later.

Thanks,
-Brad

-- 

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake-developers


Re: [cmake-developers] Assembly/preprocessed targets for Fortran

2014-11-05 Thread Tim Gallagher
Sorry about the TABs, I guess emacs defaults to it and I never noticed.

I have attached an updated patch where the tabs are removed and the test for 
CMAKE_EXPORT_COMPILE_COMMANDS is also removed. 

Tim

- Original Message -
From: Brad King brad.k...@kitware.com
To: tim gallagher tim.gallag...@gatech.edu, cmake-developers@cmake.org
Sent: Wednesday, November 5, 2014 11:26:26 AM
Subject: Re: [cmake-developers] Assembly/preprocessed targets for Fortran

On 11/04/2014 06:37 PM, Tim Gallagher wrote:
 I have attached the patch to enable the targets for Fortran.

Thanks.  Please update it to avoid using hard TABs for indentation.
Also in the CompileCommandOutput test hunk:

 -project (CompileCommandOutput CXX)
 +project (CompileCommandOutput)
 +enable_language(CXX)
 +enable_language(Fortran)

there are a couple problems:

- By removing any explicit languages from the project() call
  it will enable C and CXX by default.  Use NONE to suppress
  that.

- We cannot assume that Fortran will be available.  The other
  Fortran tests are all guarded by availability of a Fortran
  compiler.

The test for CMAKE_EXPORT_COMPILE_COMMANDS was already missing
for C, so let's just skip Fortran for the test too.  They can
be fixed together as a separate change later.

Thanks,
-Brad

From ff4a9ffe8a03822e87bc7d26a144ab2ca1e1ced6 Mon Sep 17 00:00:00 2001
From: Tim Gallagher tim.gallag...@gatech.edu
Date: Wed, 5 Nov 2014 12:07:33 -0500
Subject: [PATCH] Enabled the generation of assembly and preprocessor targets 
 for Fortran.

The Makefile generator has been updated to create .i and .s targets for
Fortran files. The variable lang_is_c_or_cxx has been changed and split
into variables to indicate languages which can be preprocessed, generate
assembly, or have their compile commands output. This should allow for
more fine-grained control over these behaviors if languages can handle
some or all of those features.

The modules have been updated to set the CMAKE_Fortran_CREATE_* flags
required. This has been tested successfully on Intel and GNU suites but
remains untested for the others. The assumption is that other Fortran
compilers handle the options the same way their respective C/C++
compilers handle it.

Testing has been added to the FortranOnly test to verify the
preprocessor works. This test behaves the same as the test in the
Complex test for C++. There is no test for assembly in C/C++ however, so
there is not one in Fortran either.
---
 Modules/Compiler/GNU-Fortran.cmake   |5 
 Modules/Compiler/HP-Fortran.cmake|3 +++
 Modules/Compiler/Intel-Fortran.cmake |3 +++
 Modules/Compiler/PGI-Fortran.cmake   |5 
 Modules/Compiler/SunPro-Fortran.cmake|3 +++
 Modules/Compiler/XL-Fortran.cmake|4 ---
 Modules/Platform/HP-UX-HP-Fortran.cmake  |3 +++
 Modules/Platform/IRIX.cmake  |8 ++
 Modules/Platform/IRIX64.cmake|9 +++
 Source/cmLocalUnixMakefileGenerator3.cxx |   43 +-
 Source/cmMakefileTargetGenerator.cxx |   13 ++---
 Tests/FortranOnly/CMakeLists.txt |   22 +++
 Tests/FortranOnly/test_preprocess.cmake  |7 +
 13 files changed, 91 insertions(+), 37 deletions(-)
 create mode 100644 Tests/FortranOnly/test_preprocess.cmake

diff --git a/Modules/Compiler/GNU-Fortran.cmake b/Modules/Compiler/GNU-Fortran.cmake
index 313ccbd..dfd7927 100644
--- a/Modules/Compiler/GNU-Fortran.cmake
+++ b/Modules/Compiler/GNU-Fortran.cmake
@@ -8,10 +8,5 @@ set(CMAKE_Fortran_FORMAT_FREE_FLAG -ffree-form)
 set(CMAKE_Fortran_FLAGS_MINSIZEREL_INIT -Os)
 set(CMAKE_Fortran_FLAGS_RELEASE_INIT -O3)
 
-# We require updates to CMake C++ code to support preprocessing rules
-# for Fortran.
-set(CMAKE_Fortran_CREATE_PREPROCESSED_SOURCE)
-set(CMAKE_Fortran_CREATE_ASSEMBLY_SOURCE)
-
 # Fortran-specific feature flags.
 set(CMAKE_Fortran_MODDIR_FLAG -J)
diff --git a/Modules/Compiler/HP-Fortran.cmake b/Modules/Compiler/HP-Fortran.cmake
index cc56b46..ad821ab 100644
--- a/Modules/Compiler/HP-Fortran.cmake
+++ b/Modules/Compiler/HP-Fortran.cmake
@@ -1,3 +1,6 @@
 set(CMAKE_Fortran_VERBOSE_FLAG -v)
 set(CMAKE_Fortran_FORMAT_FIXED_FLAG +source=fixed)
 set(CMAKE_Fortran_FORMAT_FREE_FLAG +source=free)
+
+set(CMAKE_Fortran_CREATE_ASSEMBLY_SOURCE CMAKE_Fortran_COMPILER DEFINES FLAGS -S SOURCE -o ASSEMBLY_SOURCE)
+set(CMAKE_Fortran_CREATE_PREPROCESSED_SOURCE CMAKE_Fortran_COMPILER DEFINES FLAGS -E SOURCE  PREPROCESSED_SOURCE)
diff --git a/Modules/Compiler/Intel-Fortran.cmake b/Modules/Compiler/Intel-Fortran.cmake
index 84f6182..9ebac5a 100644
--- a/Modules/Compiler/Intel-Fortran.cmake
+++ b/Modules/Compiler/Intel-Fortran.cmake
@@ -7,3 +7,6 @@ set(CMAKE_Fortran_MODDIR_FLAG -module )
 set(CMAKE_Fortran_VERBOSE_FLAG -v)
 set(CMAKE_Fortran_FORMAT_FIXED_FLAG -fixed)
 set(CMAKE_Fortran_FORMAT_FREE_FLAG -free)
+
+set(CMAKE_Fortran_CREATE_PREPROCESSED_SOURCE CMAKE_Fortran_COMPILER DEFINES FLAGS -E SOURCE

Re: [cmake-developers] Assembly/preprocessed targets for Fortran

2014-11-05 Thread Brad King
On 11/05/2014 12:14 PM, Tim Gallagher wrote:
 I have attached an updated patch

Thanks!  Please split this into two patches.  The first one should
do the refactoring of the variable name and corresponding logic
with no functionality changes.  The second one can add the Fortran
feature.

Also please keep C++ source lines to 79 columns or below.

The FortranOnly test fails for me with:

 f95: error: gfortran does not support -E without -cpp

because it doesn't enable preprocessing for lower-case extensions.
You'll need to add another .F test source with an upper-case
extension to activate preprocessing without special flags.

Thanks,
-Brad

-- 

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake-developers


Re: [cmake-developers] Assembly/preprocessed targets for Fortran

2014-11-05 Thread Tim Gallagher
Here's to hoping 3rd time's the charm...

Also, what version of gfortran do you have that requires both -E and -cpp to do 
the preprocessing? I don't need that on my version, I'm using 4.7.1. There may 
need to be more sophisticated logic in the Compiler module to add -cpp to the 
command line for versions that require it.

Tim

- Original Message -
From: Brad King brad.k...@kitware.com
To: Tim Gallagher tim.gallag...@gatech.edu
Cc: cmake-developers@cmake.org
Sent: Wednesday, November 5, 2014 12:55:04 PM
Subject: Re: [cmake-developers] Assembly/preprocessed targets for Fortran

On 11/05/2014 12:14 PM, Tim Gallagher wrote:
 I have attached an updated patch

Thanks!  Please split this into two patches.  The first one should
do the refactoring of the variable name and corresponding logic
with no functionality changes.  The second one can add the Fortran
feature.

Also please keep C++ source lines to 79 columns or below.

The FortranOnly test fails for me with:

 f95: error: gfortran does not support -E without -cpp

because it doesn't enable preprocessing for lower-case extensions.
You'll need to add another .F test source with an upper-case
extension to activate preprocessing without special flags.

Thanks,
-Brad

From 4d7eafbcf923fda5f541bc9e5fbdb1004e29ecf1 Mon Sep 17 00:00:00 2001
From: Tim Gallagher tim.gallag...@gatech.edu
Date: Wed, 5 Nov 2014 13:37:25 -0500
Subject: [PATCH] Refactored the checks for language-specific targets and
 export compile cmds

The checks are now split into languages that are able to generate
assembly listings, languages that are able to generate
preprocessed listings and languages that are able to export the
compile commands.
---
 Source/cmLocalUnixMakefileGenerator3.cxx |   44 +-
 Source/cmMakefileTargetGenerator.cxx |   14 +++---
 2 files changed, 35 insertions(+), 23 deletions(-)

diff --git a/Source/cmLocalUnixMakefileGenerator3.cxx b/Source/cmLocalUnixMakefileGenerator3.cxx
index c18e027..e6b125b 100644
--- a/Source/cmLocalUnixMakefileGenerator3.cxx
+++ b/Source/cmLocalUnixMakefileGenerator3.cxx
@@ -314,37 +314,43 @@ void cmLocalUnixMakefileGenerator3::WriteLocalMakefile()
  lo-first.c_str(), lo-second);

 // Check whether preprocessing and assembly rules make sense.
-// They make sense only for C and C++ sources.
-bool lang_is_c_or_cxx = false;
+// They make sense only for C/C++ sources.
+bool lang_has_preprocessor = false;
+bool lang_has_assembly = false;
+
 for(std::vectorLocalObjectEntry::const_iterator ei =
   lo-second.begin(); ei != lo-second.end(); ++ei)
   {
-  if(ei-Language == C || ei-Language == CXX)
+  if(ei-Language == C ||
+ ei-Language == CXX)
 {
-lang_is_c_or_cxx = true;
+   // Right now, C/C++ have both a preprocessor and the
+   // ability to generate assembly code
+lang_has_preprocessor = true;
+lang_has_assembly = true;
 break;
 }
   }

 // Add convenience rules for preprocessed and assembly files.
-if(lang_is_c_or_cxx  (do_preprocess_rules || do_assembly_rules))
+if(lang_has_preprocessor  do_preprocess_rules)
   {
   std::string::size_type dot_pos = lo-first.rfind(.);
   std::string base = lo-first.substr(0, dot_pos);
-  if(do_preprocess_rules)
-{
-this-WriteObjectConvenienceRule(
-  ruleFileStream, target to preprocess a source file,
-  (base + .i).c_str(), lo-second);
-  lo-second.HasPreprocessRule = true;
-}
-  if(do_assembly_rules)
-{
-this-WriteObjectConvenienceRule(
-  ruleFileStream, target to generate assembly for a file,
-  (base + .s).c_str(), lo-second);
-  lo-second.HasAssembleRule = true;
-}
+  this-WriteObjectConvenienceRule(
+ruleFileStream, target to preprocess a source file,
+   (base + .i).c_str(), lo-second);
+  lo-second.HasPreprocessRule = true;
+  }
+
+if(lang_has_assembly  do_assembly_rules)
+  {
+  std::string::size_type dot_pos = lo-first.rfind(.);
+  std::string base = lo-first.substr(0, dot_pos);
+  this-WriteObjectConvenienceRule(
+   ruleFileStream, target to generate assembly for a file,
+   (base + .s).c_str(), lo-second);
+  lo-second.HasAssembleRule = true;
   }
 }

diff --git a/Source/cmMakefileTargetGenerator.cxx b/Source/cmMakefileTargetGenerator.cxx
index 1adcb8a..6b98b35 100644
--- a/Source/cmMakefileTargetGenerator.cxx
+++ b/Source/cmMakefileTargetGenerator.cxx
@@ -702,7 +702,13 @@ cmMakefileTargetGenerator

   vars.Defines = definesString.c_str();

-  bool lang_is_c_or_cxx = ((lang == C) || (lang == CXX));
+  // At the moment, it is assumed that C/C++ have both
+  // assembly and preprocessor capabilities. The same is true for the
+  // ability to export compile commands
+  bool lang_has_preprocessor = ((lang == C

Re: [cmake-developers] Assembly/preprocessed targets for Fortran

2014-11-05 Thread Brad King
On 11/05/2014 01:53 PM, Tim Gallagher wrote:
 Here's to hoping 3rd time's the charm...

Thanks.  Applied with minor tweaks:

 Makefile: Refactor checks for lang-specific targets and export compile cmds
 http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=06f8b429

 Makefile: Add assembly and preprocessed targets for Fortran
 http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=a811f014

and merged to 'next' for testing.

 Also, what version of gfortran do you have that requires both -E
 and -cpp to do the preprocessing?

It is gfortran 4.9.1.

Many other compilers have this too.  Uppercase source extensions
get preprocessed by default, lowercase extensions require -cpp.
That is why Modules/CMakeFortranCompilerId.F.in uses an uppercase
extension.

-Brad

-- 

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake-developers


Re: [cmake-developers] Assembly/preprocessed targets for Fortran

2014-11-04 Thread Brad King
On 11/04/2014 03:19 PM, Tim Gallagher wrote:
 I looked through the CMake source code and it didn't seem that
 hard to make it work correctly for Fortran also. I made the
 changes on my local branch and it works great for the Intel
 and GNU compiler suites on Linux (those are the only ones I
 have access to). I modified the other compiler modules on the
 assumption that the options were the same for C, C++ and Fortran
 source files (which is true for Intel and GNU).

Great, thanks for looking into this.

 adding Fortran to the check for C and C++ when assigning
 the `lang_is_c_or_cxx` variable. That variable name should change

Perhaps lang_has_preprocessor?  You could also add

 bool const lang_has_assembly = lang_has_preprocessor;

and update each use of the variable to use the proper name.
In the future the answer may not be the same.

Watch out for other uses of lang_is_c_or_cxx, like for
CMAKE_EXPORT_COMPILE_COMMANDS.  Check if each use case
makes sense for Fortran.

 2) How would/could I go about testing the changes to the other
 compilers/platforms that I do not have personal access to?

You could look at adding coverage of these make targets to
the test suite under the proper conditions.  That will likely
be a harder change than your main fix though.

Thanks,
-Brad

-- 

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake-developers


Re: [cmake-developers] Assembly/preprocessed targets for Fortran

2014-11-04 Thread Tim Gallagher
Hi Brad,

Thanks for the info. 

What does the CMAKE_EXPORT_COMPILE_COMMANDS do? Or maybe more precisely, what 
output should I expect when it is set to ON instead of OFF? I tried it with my 
changes and nothing breaks, but I also don't see any difference in outputs with 
it set to ON so maybe I am missing something. 

I'll also dig into the testing to see what it would take to add the coverage.

Thanks again,

Tim

- Original Message -
From: Brad King brad.k...@kitware.com
To: tim gallagher tim.gallag...@gatech.edu, cmake-developers@cmake.org
Sent: Tuesday, November 4, 2014 3:45:39 PM
Subject: Re: [cmake-developers] Assembly/preprocessed targets for Fortran

On 11/04/2014 03:19 PM, Tim Gallagher wrote:
 I looked through the CMake source code and it didn't seem that
 hard to make it work correctly for Fortran also. I made the
 changes on my local branch and it works great for the Intel
 and GNU compiler suites on Linux (those are the only ones I
 have access to). I modified the other compiler modules on the
 assumption that the options were the same for C, C++ and Fortran
 source files (which is true for Intel and GNU).

Great, thanks for looking into this.

 adding Fortran to the check for C and C++ when assigning
 the `lang_is_c_or_cxx` variable. That variable name should change

Perhaps lang_has_preprocessor?  You could also add

 bool const lang_has_assembly = lang_has_preprocessor;

and update each use of the variable to use the proper name.
In the future the answer may not be the same.

Watch out for other uses of lang_is_c_or_cxx, like for
CMAKE_EXPORT_COMPILE_COMMANDS.  Check if each use case
makes sense for Fortran.

 2) How would/could I go about testing the changes to the other
 compilers/platforms that I do not have personal access to?

You could look at adding coverage of these make targets to
the test suite under the proper conditions.  That will likely
be a harder change than your main fix though.

Thanks,
-Brad

-- 

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake-developers


Re: [cmake-developers] Assembly/preprocessed targets for Fortran

2014-11-04 Thread Tim Gallagher
Scratch that, I found it. Wasn't looking in the right places!

The export command works for Fortran, so that's not an issue.

I'll take a look at the testing and see if I can get that going. I'll send 
along a patch when I get it worked out.

Thanks,

Tim

- Original Message -
From: Tim Gallagher tim.gallag...@gatech.edu
To: Brad King brad.k...@kitware.com
Cc: cmake-developers@cmake.org
Sent: Tuesday, November 4, 2014 4:08:49 PM
Subject: Re: [cmake-developers] Assembly/preprocessed targets for Fortran

Hi Brad,

Thanks for the info. 

What does the CMAKE_EXPORT_COMPILE_COMMANDS do? Or maybe more precisely, what 
output should I expect when it is set to ON instead of OFF? I tried it with my 
changes and nothing breaks, but I also don't see any difference in outputs with 
it set to ON so maybe I am missing something. 

I'll also dig into the testing to see what it would take to add the coverage.

Thanks again,

Tim

- Original Message -
From: Brad King brad.k...@kitware.com
To: tim gallagher tim.gallag...@gatech.edu, cmake-developers@cmake.org
Sent: Tuesday, November 4, 2014 3:45:39 PM
Subject: Re: [cmake-developers] Assembly/preprocessed targets for Fortran

On 11/04/2014 03:19 PM, Tim Gallagher wrote:
 I looked through the CMake source code and it didn't seem that
 hard to make it work correctly for Fortran also. I made the
 changes on my local branch and it works great for the Intel
 and GNU compiler suites on Linux (those are the only ones I
 have access to). I modified the other compiler modules on the
 assumption that the options were the same for C, C++ and Fortran
 source files (which is true for Intel and GNU).

Great, thanks for looking into this.

 adding Fortran to the check for C and C++ when assigning
 the `lang_is_c_or_cxx` variable. That variable name should change

Perhaps lang_has_preprocessor?  You could also add

 bool const lang_has_assembly = lang_has_preprocessor;

and update each use of the variable to use the proper name.
In the future the answer may not be the same.

Watch out for other uses of lang_is_c_or_cxx, like for
CMAKE_EXPORT_COMPILE_COMMANDS.  Check if each use case
makes sense for Fortran.

 2) How would/could I go about testing the changes to the other
 compilers/platforms that I do not have personal access to?

You could look at adding coverage of these make targets to
the test suite under the proper conditions.  That will likely
be a harder change than your main fix though.

Thanks,
-Brad

-- 

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake-developers
-- 

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake-developers


Re: [cmake-developers] Assembly/preprocessed targets for Fortran

2014-11-04 Thread Tim Gallagher
Hi Brad,

I have attached the patch to enable the targets for Fortran. It includes 
updates to 2 tests to make sure that it works as expected. Both of the tests 
pass for me with Intel and GNU but that's all I have access to.

Let me know if I messed anything up or if you have any suggestions on things I 
should have done better/differently so I know to do it correctly next time I 
have a patch.

Thanks,

Tim

- Original Message -
From: Tim Gallagher tim.gallag...@gatech.edu
To: tim gallagher tim.gallag...@gatech.edu
Cc: cmake-developers@cmake.org, Brad King brad.k...@kitware.com
Sent: Tuesday, November 4, 2014 4:12:01 PM
Subject: Re: [cmake-developers] Assembly/preprocessed targets for Fortran

Scratch that, I found it. Wasn't looking in the right places!

The export command works for Fortran, so that's not an issue.

I'll take a look at the testing and see if I can get that going. I'll send 
along a patch when I get it worked out.

Thanks,

Tim

- Original Message -
From: Tim Gallagher tim.gallag...@gatech.edu
To: Brad King brad.k...@kitware.com
Cc: cmake-developers@cmake.org
Sent: Tuesday, November 4, 2014 4:08:49 PM
Subject: Re: [cmake-developers] Assembly/preprocessed targets for Fortran

Hi Brad,

Thanks for the info. 

What does the CMAKE_EXPORT_COMPILE_COMMANDS do? Or maybe more precisely, what 
output should I expect when it is set to ON instead of OFF? I tried it with my 
changes and nothing breaks, but I also don't see any difference in outputs with 
it set to ON so maybe I am missing something. 

I'll also dig into the testing to see what it would take to add the coverage.

Thanks again,

Tim

- Original Message -
From: Brad King brad.k...@kitware.com
To: tim gallagher tim.gallag...@gatech.edu, cmake-developers@cmake.org
Sent: Tuesday, November 4, 2014 3:45:39 PM
Subject: Re: [cmake-developers] Assembly/preprocessed targets for Fortran

On 11/04/2014 03:19 PM, Tim Gallagher wrote:
 I looked through the CMake source code and it didn't seem that
 hard to make it work correctly for Fortran also. I made the
 changes on my local branch and it works great for the Intel
 and GNU compiler suites on Linux (those are the only ones I
 have access to). I modified the other compiler modules on the
 assumption that the options were the same for C, C++ and Fortran
 source files (which is true for Intel and GNU).

Great, thanks for looking into this.

 adding Fortran to the check for C and C++ when assigning
 the `lang_is_c_or_cxx` variable. That variable name should change

Perhaps lang_has_preprocessor?  You could also add

 bool const lang_has_assembly = lang_has_preprocessor;

and update each use of the variable to use the proper name.
In the future the answer may not be the same.

Watch out for other uses of lang_is_c_or_cxx, like for
CMAKE_EXPORT_COMPILE_COMMANDS.  Check if each use case
makes sense for Fortran.

 2) How would/could I go about testing the changes to the other
 compilers/platforms that I do not have personal access to?

You could look at adding coverage of these make targets to
the test suite under the proper conditions.  That will likely
be a harder change than your main fix though.

Thanks,
-Brad

-- 

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake-developers
From 03f06808a086dd767e3414a5a1e5fc14ecc0a0e3 Mon Sep 17 00:00:00 2001
From: Tim Gallagher tim.gallag...@gatech.edu
Date: Tue, 4 Nov 2014 18:26:22 -0500
Subject: [PATCH] Enabled the generation of assembly and preprocessor targets
 for Fortran.

The Makefile generator has been updated to create .i and .s targets for
Fortran files. The variable lang_is_c_or_cxx has been changed and split
into variables to indicate languages which can be preprocessed, generate
assembly, or have their compile commands output. This should allow for
more fine-grained control over these behaviors if languages can handle
some or all of those features.

The modules have been updated to set the CMAKE_Fortran_CREATE_* flags
required. This has been tested successfully on Intel and GNU suites but
remains untested for the others. The assumption is that other Fortran
compilers handle the options the same way their respective C/C++
compilers handle it.

Testing has been added to the FortranOnly test to verify the
preprocessor works. This test behaves the same as the test in the
Complex test for C++. There is no test for assembly in C/C++ however, so
there is not one in Fortran