View Issue Details Jump to Notes ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0015384CMakeCMakepublic2015-01-31 11:342016-06-10 14:31
ReporterEgor P. 
Assigned ToKitware Robot 
PriorityhighSeveritymajorReproducibilityalways
StatusclosedResolutionmoved 
PlatformWindowsOSWindowsOS Version8.1
Product VersionCMake 3.1.1 
Target VersionFixed in Version 
Summary0015384: Rules are disappeared from solution (VS12) after touching any CMakeLists.txt file
DescriptionI have several custom commands and custom target which depends on them.
After initial cmake run custom command rules correctly appear in VS projects.
After any changes in CMakeLists.txt file and cmake run, those rules disappear from project (and solution).
The change can be trivial: just add an empty line or a comment.

I noticed it depends on existence of file.
1) run cmake; rules are in solution
2) first build (files are generated by custom rules - commands); rules are in solution
3) add new line to root (any) CMakeLists.txt file, save
4) run cmake or build; RULES ARE DISAPPEARED!!! <------------

Now any changes to CMakeLists.txt does not make rules appear.
How to do this?

5) Delete files generated during build
6) Repeat p.3
7) run cmake or build; RULES ARE APPEARED!!! <------------

I'm not sure, maybe this behavior is expected, BUT...
When I clean solution via VS (generated files are deleted now) and then I press rebuild, it does not rebuild custom files (commands)! Because there is no rules at solution and cmake is not run to check this issue and add this rules again.
This causes build errors etc.
The only way now to regenerate rules is to (!) touch cmake file and run cmake command.
Steps To Reproduce1) svn co svn://svn.code.sf.net/p/firebird/code/firebird/trunk [^] firebird
2) Put 'sed' in your PATH (can be taken from 'git' package).
3) cmake -H. -Bwin
4) Run win/firebird.sln
5) Look at 'databases' project in 'Boot/Custom build steps' solution dir. It contains several rules in '/databases/CMake Rules/*': help.fdb.rule, metadata.fdb.rule, msg.fdb.rule, security.fdb.rule.
6) Build solution (takes 5-10 minutes).
7) Touch firebird/src/CMakeLists.txt (add an empty line)
8) Re-run 'cmake' command or build 'ZERO_BUILD' project in solution.
9) Look at 'Boot/Custom build steps/databases/CMake Rules/*' again! There are no files listed above. !!!

These rules are declared in 'src/CMakeLists.txt', lines 90-185.

10) Delete 'win/src/*.fdb'
11) Repeat p.7
12) Re-run 'cmake' command or build 'CMake Targets/ZERO_BUILD' project in solution. Rule files are appeared. !!!
Additional InformationI cannot reproduce this on simple small cmake configuration, so providing real case.
On simple example the rules do not disappear.
TagsVisual Studio 2013
Attached Files

 Relationships

  Notes
(0037873)
Egor P. (reporter)
2015-02-01 08:50

I found simple repro.

-------------------------------------------
add_custom_command(OUTPUT c
    COMMAND ${CMAKE_COMMAND} -E remove c
    COMMAND ${CMAKE_COMMAND} -E echo "" > C
)
add_custom_target(t ALL DEPENDS c)
-------------------------------------------

1) On initial cmake run you will find 'c.rule' in project 't'.
2) Add new line at the end of file and build.
'c.rule' disappears. <---------------
3) Remove 'C' file.
4) Repeat p.2.
'c.rule' appears. <---------------

As Windows is not case sensitive, MSVS builds, re-builds and does other steps correctly.
But it looks like CMake is confused of this behavior.

---
FYI in my case I didn't know that generated files are in other case.
I'll fix it locally, but for CMake such behavior probably should be fixed or documented.
(0042707)
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-01-31 11:34 Egor P. New Issue
2015-01-31 14:59 Egor P. Tag Attached: Visual Studio 2013
2015-02-01 08:50 Egor P. Note Added: 0037873
2016-06-10 14:29 Kitware Robot Note Added: 0042707
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