[cmake-developers] [CMake 0015688]: ADD_CUSTOM_TARGET with Fortran sources creates invalid Unix Makefiles

Mantis Bug Tracker mantis at public.kitware.com
Fri Aug 7 09:56:13 EDT 2015


The following issue has been SUBMITTED. 
====================================================================== 
http://public.kitware.com/Bug/view.php?id=15688 
====================================================================== 
Reported By:                bburgerm
Assigned To:                
====================================================================== 
Project:                    CMake
Issue ID:                   15688
Category:                   CMake
Reproducibility:            always
Severity:                   major
Priority:                   normal
Status:                     new
====================================================================== 
Date Submitted:             2015-08-07 09:56 EDT
Last Modified:              2015-08-07 09:56 EDT
====================================================================== 
Summary:                    ADD_CUSTOM_TARGET with Fortran sources creates
invalid Unix Makefiles
Description: 
The add_custom_target allows to specify "sources" for IDE display but if any
Fortran source is specified (and Fortran enabled) make fails with

make[2]: *** No rule to make target 'CMakeFiles/copy.dir/requires'.  Stop.

The Visual studio generator creates a *.vfproj project in this case where custom
commands only work partially (with Intel Fortran Compiler) - instead of a
*.vcxproj when no sources are specified.

-> I would expect the build of a custom target to behave identical with or
without sources specified.

Steps to Reproduce: 
Run cmake to create Unix Makefiles for attached CMakeLists.txt, run make ->
shows specified error


Additional Information: 
Stripped down from a huge project with many targets and a common pre-processing
script to combine the fortran inputs for automatic interface check (not just
copy like in the example). Works if the "sources" argument is removed from the
ADD_CUSTOM_TARGET but for better support by IDEs we like to add this argument.

Adding
  SET_SOURCE_FILES_PROPERTIES(s1.f PROPERTIES LANGUAGE "")
Enables to run the custom command, but the compile does nothing then.

Adding
  SET(CMAKE_Fortran_SOURCE_FILE_EXTENSIONS "FFF")
  SET(CMAKE_Fortran_IGNORE_EXTENSIONS "f")
has no effect at all (and would only help too if it can be reset for and
add_executable/add_library)

Identical behaviour of CMake-3.0.2 and CMake-3.3.

====================================================================== 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2015-08-07 09:56 bburgerm       New Issue                                    
2015-08-07 09:56 bburgerm       File Added: CMakeLists.txt                    
======================================================================



More information about the cmake-developers mailing list