View Issue Details Jump to Notes ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0011713CMakeCMakepublic2011-01-17 10:262011-01-17 10:56
ReporterGaleazzi 
Assigned ToBrad King 
PrioritynormalSeveritymajorReproducibilityalways
StatusclosedResolutionno change required 
PlatformPCOSWindows XPOS Version
Product VersionCMake 2.8.3 
Target VersionFixed in Version 
Summary0011713: add_custom_command is not invoked
DescriptionI use the add_custom_command function in order to increment the build number. It seems that add_custom_command is never invoked in the build process.
Steps To ReproduceYou just unzip the attached file and generate a mingw makefiles or VS solution. You can also change the following line in order to fit them with your paths:
add_custom_command(OUTPUT ./BuildNumber.h COMMAND "java" ARGS "-jar"
                                        "c:\\Tools\\Updater\\BuildNumberUpdater.jar"
                                        "M:\\ProvaCMake\\HelloExec\\BuildNumber.h"
                                        DEPENDS ${SOURCES}
                                        COMMENT "Changing the build number")
TagsNo tags attached.
Attached Filesrar file icon CMakeBug.rar [^] (3,965 bytes) 2011-01-17 10:26
zip file icon add_custom_ok.zip [^] (5,301 bytes) 2011-01-17 10:44

 Relationships

  Notes
(0024752)
Galeazzi (reporter)
2011-01-17 10:31

You can also take a look at:
http://www.mail-archive.com/cmake@cmake.org/msg33903.html [^]
(0024754)
Eric NOULARD (developer)
2011-01-17 10:50

I think this is not a bug.
I did just upload "add_custom_ok.zip" which contains an updated project
which should work, the fix are the following:

0) Use absolute PATH for GENERATED files
   Use relative PATH (with no extra "./" in the beginning)
       for other files.
   
1) separate SOURCES from GENERATED_SOURCES in order to
   avoid the circular dependency

The updated project works for me on Linux.
The project still have the weird
add_subdirectory(../myLib "${Lib_OutPut_Dir}/BuildFiles")

this if off course OK but I would expect either myLib to be a
subdir of HelloExec or a sibling which is built by some
mother CMakeLists.txt.
(0024755)
Brad King (manager)
2011-01-17 10:56

As Eric stated in 0011713:0024754 this is not a bug. Please post the the cmake@cmake.org mailing list:

  http://www.cmake.org/mailman/listinfo/cmake [^]

for further help in writing your CMake code.

Thanks.

 Issue History
Date Modified Username Field Change
2011-01-17 10:26 Galeazzi New Issue
2011-01-17 10:26 Galeazzi File Added: CMakeBug.rar
2011-01-17 10:31 Galeazzi Note Added: 0024752
2011-01-17 10:44 Eric NOULARD File Added: add_custom_ok.zip
2011-01-17 10:50 Eric NOULARD Note Added: 0024754
2011-01-17 10:56 Brad King Note Added: 0024755
2011-01-17 10:56 Brad King Status new => closed
2011-01-17 10:56 Brad King Assigned To => Brad King
2011-01-17 10:56 Brad King Resolution open => no change required


Copyright © 2000 - 2018 MantisBT Team