View Issue Details Jump to Notes ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0015688CMakeCMakepublic2015-08-07 09:562016-06-10 14:31
Reporterbburgerm 
Assigned ToKitware Robot 
PrioritynormalSeveritymajorReproducibilityalways
StatusclosedResolutionmoved 
PlatformOSOS Version
Product VersionCMake 3.3 
Target VersionFixed in Version 
Summary0015688: ADD_CUSTOM_TARGET with Fortran sources creates invalid Unix Makefiles
DescriptionThe 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 ReproduceRun cmake to create Unix Makefiles for attached CMakeLists.txt, run make -> shows specified error
Additional InformationStripped 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.
TagsNo tags attached.
Attached Filestxt file icon CMakeLists.txt [^] (385 bytes) 2015-08-07 09:56 [Show Content]

 Relationships

  Notes
(0039261)
Brad King (manager)
2015-08-10 11:01

Several generators have various special cases when Fortran sources appear in a target. It looks like those need to be made conditional to not apply on custom targets.
(0042819)
Kitware Robot (administrator)
2016-06-10 14:29

Resolving issue as `moved`.

This issue tracker is no longer used. Further discussion of this issue may take place in the current CMake Issues page linked in the banner at the top of this page.

 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
2015-08-10 11:01 Brad King Note Added: 0039261
2016-06-10 14:29 Kitware Robot Note Added: 0042819
2016-06-10 14:29 Kitware Robot Status new => resolved
2016-06-10 14:29 Kitware Robot Resolution open => moved
2016-06-10 14:29 Kitware Robot Assigned To => Kitware Robot
2016-06-10 14:31 Kitware Robot Status resolved => closed


Copyright © 2000 - 2018 MantisBT Team