[cmake-developers] [CMake 0012471]: CMake add_custom_command problem when triggering a FATAL_ERROR in MSVC

2011-09-21 Thread Mantis Bug Tracker

The following issue has been SUBMITTED. 
== 
http://public.kitware.com/Bug/view.php?id=12471 
== 
Reported By:Hauke Heibel
Assigned To:
== 
Project:CMake
Issue ID:   12471
Category:   CMake
Reproducibility:always
Severity:   minor
Priority:   normal
Status: new
== 
Date Submitted: 2011-09-21 09:09 EDT
Last Modified:  2011-09-21 09:09 EDT
== 
Summary:CMake add_custom_command problem when triggering a
FATAL_ERROR in MSVC
Description: 
If have multiple custom commands which call

  message(FATAL_ERROR Some message)

in case of errors. If you do this and encounter such a case MSVC generates many
MSB3073 errors. I think this issue is somewhat related to
http://public.kitware.com/Bug/view.php?id=11938.

The problem is that the MSVC's error message hides the one generated by CMake.
It were nice, if CMake could terminate the script without issuing multiple
MSB3073 errors.

Steps to Reproduce: 
Create any custom command via

add_custom_command(TARGET FooCommand 
  COMMAND ${CMAKE_COMMAND}
  -P BarScript.cmake
)

and call

message(FATAL_ERROR Some message)

from within the BarScript.cmake
== 

Issue History 
Date ModifiedUsername   FieldChange   
== 
2011-09-21 09:09 Hauke Heibel   New Issue
2011-09-21 09:09 Hauke Heibel   File Added: msvc_error_output.txt   

==

___
cmake-developers mailing list
cmake-developers@cmake.org
http://public.kitware.com/cgi-bin/mailman/listinfo/cmake-developers


Re: [CMake] add_custom_command problem

2011-01-17 Thread Eric Noulard
2011/1/17 Andrea Galeazzi galea...@korg.it:
 I'm trying to invoke a program which increment the build number on a header
 file. I'm currently using the following statement:
 add_custom_command(OUTPUT ./BuildNumber.h COMMAND java ARGS -jar
                                        ${TOOLS}\\BuildNumberUpdater.jar

  ${PROJECT_PATH}\\Frameworks\\Win32\\BuildNumber.h
                                        DEPENDS ${SOURCES}
                                        COMMENT Changing the build numeber)
 But the command is never invoked. Surely there's something wrong or
 something that I don't understand, but what?

Does any targets depends on the output BuildNumber.h ?
Did you try to specify OUTPUT with absolute path ?
-- 
Erk
Membre de l'April - « promouvoir et défendre le logiciel libre » -
http://www.april.org
___
Powered by www.kitware.com

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

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

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake


Re: [CMake] add_custom_command problem

2011-01-17 Thread Rolf Eike Beer
 I'm trying to invoke a program which increment the build number on a 
 header file. I'm currently using the following statement:
 add_custom_command(OUTPUT ./BuildNumber.h COMMAND java ARGS -jar

Specify an absolute output  path here, usually using CMAKE_CURRENT_BINARY_DIR 
or something similar.
                                     
 ${TOOLS}\\BuildNumberUpdater.jar                       
 ${PROJECT_PATH}\\Frameworks\\Win32\\BuildNumber.h
                                                                               
    DEPENDS ${SOURCES}
                                                                               
    COMMENT Changing the build 
 numeber)

Typo here, number.

 But the command is never invoked. Surely there's something wrong or 
 something that I don't understand, but what?

You probably need something to depend on that header.

Eike
___
Powered by www.kitware.com

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

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

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake

Re: [CMake] add_custom_command problem

2011-01-17 Thread Andrea Galeazzi

Il 17/01/2011 11.09, Eric Noulard ha scritto:

2011/1/17 Andrea Galeazzigalea...@korg.it:

I'm trying to invoke a program which increment the build number on a header
file. I'm currently using the following statement:
add_custom_command(OUTPUT ./BuildNumber.h COMMAND java ARGS -jar
${TOOLS}\\BuildNumberUpdater.jar

  ${PROJECT_PATH}\\Frameworks\\Win32\\BuildNumber.h
DEPENDS ${SOURCES}
COMMENT Changing the build numeber)
But the command is never invoked. Surely there's something wrong or
something that I don't understand, but what?

Does any targets depends on the output BuildNumber.h ?
Did you try to specify OUTPUT with absolute path ?


Yes I also tried with absolute path but it doesn't change anything. 
That's the only target I have:


add_executable(Z102A ${SOURCES} )
where:
set (SOURCES
   ${SOURCES_SourceXXYYFiles}
   ${SOURCES_HeaderXXYYFiles}
   ...
  ${SOURCES_Cfg}
 
)


 set (SOURCES_HeaderXXYYFiles
   ./ASIC.H
   ./BaseTypes.h
   ./HAL.h
   ./IOPort.h
   ./usb2spi.h
   ./BuildNumber.h
)
set (SOURCES_Cfg
   ../../Cfg/AisTestData.cpp
   ../../Cfg/AisWin32Data.cpp
   ../../Cfg/AlphaKeybConfig.cpp
   ../../Cfg/AlphaKeybConfig.h
   ../../Cfg/BuildConfig.h
   ../../Cfg/Config.cpp
   ..
  )
and Config.cpp includes BuildNumber.h. Maybe should I add an explicit 
dependency in some ways?

___
Powered by www.kitware.com

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

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

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake


Re: [CMake] add_custom_command problem

2011-01-17 Thread Eric Noulard
2011/1/17 Andrea Galeazzi galea...@korg.it:
 Il 17/01/2011 11.09, Eric Noulard ha scritto:

 2011/1/17 Andrea Galeazzigalea...@korg.it:

 I'm trying to invoke a program which increment the build number on a
 header

I just realized something.
Do you want
   A) to increase the build number EACH time you build
   B) to increase the build number WHEN of of the SOURCES change?

 Does any targets depends on the output BuildNumber.h ?
 Did you try to specify OUTPUT with absolute path ?

 Yes I also tried with absolute path but it doesn't change anything. That's
 the only target I have:

 add_executable(Z102A ${SOURCES} )
[...]


  set (SOURCES_HeaderXXYYFiles
       ./ASIC.H
       ./BaseTypes.h
       ./HAL.h
       ./IOPort.h
       ./usb2spi.h
       ./BuildNumber.h

You need absolute path in both places
 1) in set (SOURCES_HeaderXXYYFiles
 2) in the add_custom_command output

 set (SOURCES_Cfg
       ../../Cfg/AisTestData.cpp
       ../../Cfg/AisWin32Data.cpp
       ../../Cfg/AlphaKeybConfig.cpp
       ../../Cfg/AlphaKeybConfig.h
       ../../Cfg/BuildConfig.h
       ../../Cfg/Config.cpp
       ..
  )
 and Config.cpp includes BuildNumber.h. Maybe should I add an explicit
 dependency in some ways?

I don't think this is necessary. But could you tell us in which case you want
your BuildNumber.h to be regenerated?



-- 
Erk
Membre de l'April - « promouvoir et défendre le logiciel libre » -
http://www.april.org
___
Powered by www.kitware.com

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

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

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake


Re: [CMake] add_custom_command problem

2011-01-17 Thread Andrea Galeazzi

Il 17/01/2011 12.34, Eric Noulard ha scritto:

2011/1/17 Andrea Galeazzigalea...@korg.it:

Il 17/01/2011 11.09, Eric Noulard ha scritto:

2011/1/17 Andrea Galeazzigalea...@korg.it:

I'm trying to invoke a program which increment the build number on a
header

I just realized something.
Do you want
A) to increase the build number EACH time you build
B) to increase the build number WHEN of of the SOURCES change?


Does any targets depends on the output BuildNumber.h ?
Did you try to specify OUTPUT with absolute path ?

Yes I also tried with absolute path but it doesn't change anything. That's
the only target I have:

add_executable(Z102A ${SOURCES} )

[...]


  set (SOURCES_HeaderXXYYFiles
   ./ASIC.H
   ./BaseTypes.h
   ./HAL.h
   ./IOPort.h
   ./usb2spi.h
   ./BuildNumber.h

You need absolute path in both places
  1) in set (SOURCES_HeaderXXYYFiles
  2) in the add_custom_command output


set (SOURCES_Cfg
   ../../Cfg/AisTestData.cpp
   ../../Cfg/AisWin32Data.cpp
   ../../Cfg/AlphaKeybConfig.cpp
   ../../Cfg/AlphaKeybConfig.h
   ../../Cfg/BuildConfig.h
   ../../Cfg/Config.cpp
   ..
  )
and Config.cpp includes BuildNumber.h. Maybe should I add an explicit
dependency in some ways?

I don't think this is necessary. But could you tell us in which case you want
your BuildNumber.h to be regenerated?





The B is definitely my choice.
___
Powered by www.kitware.com

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

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

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake


Re: [CMake] add_custom_command problem

2011-01-17 Thread Eric Noulard
2011/1/17 Andrea Galeazzi galea...@korg.it:
 Il 17/01/2011 12.34, Eric Noulard ha scritto:
 I just realized something.
 Do you want
    A) to increase the build number EACH time you build
    B) to increase the build number WHEN of of the SOURCES change?

 The B is definitely my choice.

So then what is the precise symptom.

1) The BuildNumber.h is never generated (and you have a compile error)
2) The BuildNumber.h is never regenerated when Config.cpp change?

-- 
Erk
Membre de l'April - « promouvoir et défendre le logiciel libre » -
http://www.april.org
___
Powered by www.kitware.com

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

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

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake


Re: [CMake] add_custom_command problem

2011-01-17 Thread Andrea Galeazzi




Eric Noulard ha scritto:

  2011/1/17 Andrea Galeazzi galea...@korg.it:
  
  
Il 17/01/2011 12.34, Eric Noulard ha scritto:


  I just realized something.
Do you want
 A) to increase the build number EACH time you build
 B) to increase the build number WHEN of of the SOURCES change?
  

The B is definitely my choice.

  
  
So then what is the precise symptom.

1) The BuildNumber.h is never generated (and you have a compile error)
2) The BuildNumber.h is never regenerated when Config.cpp change?





The symptoms are both:
1 - The first time I build the project I have a compile error because
BuildNumber.h doesn't exist.
2 - If I manually create BuildNumber.h in
order to "pass" the compilation, any next build doesn't update
BuildNumber.h.

I also point out that I wanna update such file
every time ANY sources are changed.
I made a simple project that has this problem, where can I upload it?




___
Powered by www.kitware.com

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

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

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake

Re: [CMake] add_custom_command problem

2011-01-17 Thread Eric Noulard
2011/1/17 Andrea Galeazzi galea...@korg.it:
 Eric Noulard ha scritto:

 2011/1/17 Andrea Galeazzi galea...@korg.it:


 Il 17/01/2011 12.34, Eric Noulard ha scritto:


 I just realized something.
 Do you want
    A) to increase the build number EACH time you build
    B) to increase the build number WHEN of of the SOURCES change?


 The B is definitely my choice.


 So then what is the precise symptom.

 1) The BuildNumber.h is never generated (and you have a compile error)
 2) The BuildNumber.h is never regenerated when Config.cpp change?

 The symptoms are both:
  1 - The first time I build the project I have a compile error because
 BuildNumber.h doesn't exist.

So there is an initial dependency issue.

 2 - If I manually create BuildNumber.h in order to pass the compilation,
 any next build doesn't update BuildNumber.h.

 I also point out that I wanna update such file every time ANY sources are
 changed.
 I made a simple project that has this problem, where can I upload it?

1) Open bug report:
http://public.kitware.com/Bug/main_page.php

2) and attach your example project to the bug.

3) Send an e-mail into this thread which gives the
 url of the bug this way the bug will be linked to the discussion.


-- 
Erk
Membre de l'April - « promouvoir et défendre le logiciel libre » -
http://www.april.org
___
Powered by www.kitware.com

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

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

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake


Re: [CMake] add_custom_command problem

2011-01-17 Thread Andrea Galeazzi
Title: korg Firma




Eric Noulard ha scritto:

  2011/1/17 Andrea Galeazzi galea...@korg.it:
  
  
Eric Noulard ha scritto:

2011/1/17 Andrea Galeazzi galea...@korg.it:


Il 17/01/2011 12.34, Eric Noulard ha scritto:


I just realized something.
Do you want
 A) to increase the build number EACH time you build
 B) to increase the build number WHEN of of the SOURCES change?


The B is definitely my choice.


So then what is the precise symptom.

1) The BuildNumber.h is never generated (and you have a compile error)
2) The BuildNumber.h is never regenerated when Config.cpp change?

The symptoms are both:
1 - The first time I build the project I have a compile error because
BuildNumber.h doesn't exist.

  
  
So there is an initial dependency issue.

  
  
2 - If I manually create BuildNumber.h in order to "pass" the compilation,
any next build doesn't update BuildNumber.h.

I also point out that I wanna update such file every time ANY sources are
changed.
I made a simple project that has this problem, where can I upload it?

  
  
1) Open bug report:
http://public.kitware.com/Bug/main_page.php

2) and attach your example project to the bug.

3) Send an e-mail into this thread which gives the
 url of the bug this way the bug will be linked to the discussion.


  

I opened a new bug:
http://public.kitware.com/Bug/view.php?id=11713

-- 









KORG
ITALY SPA
Via
Cagiata, 85  60027 Osimo (AN) - ITALY
Ph.
+39 071 727161 - Fax +39 071 7231228
P.IVA
e
Cod. fiscale IT01460580424
Soggetta
al controllo della Societ KORG Inc. - Giappone
Reg.
Imprese di n. 212056/1996 del 23/12/96
REA
di Ancona
al n. 133105 del 06/12/96
Capitale
sociale Euro 814.253,16 i.v.



Ai sensi del D.Lgs. 30
giugno 2003,
n. 196, Codice in materia di protezione dei dati personali si precisa
che le
informazioni contenute nel messaggio sono riservate e destinate
esclusivamente
alla persona od organizzazione sopra indicata. A chi legge il presente
avviso -
se non  l'effettivo destinatario, o un dipendente, o la persona
responsabile
della consegna del messaggio - si notifica che sono proibite copie,
distribuzione o divulgazione di quanto in esso contenuto (C.P. 616). Se
questo
messaggio Vi  pervenuto per errore, Vi preghiamo di informarci
immediatamente,
di non leggerlo e di distruggerlo. Grazie.

According
to Legislative Decree n. 196 of 30 June 2003 about Personal Data
Protection
Code we point out that the information contained in this message may
be
privileged and confidential and is intended only for the use of the
individual
entity named above. If the reader of this message is not the intended
recipient, or an employee or agent responsible for delivering this
message to
the intended recipient, you are hereby notified that any dissemination,
distribution, or copying of this message is strictly prohibited. If you
have
received this message in error, please notify us immediately and
destroy the
original message. Thank
you.






___
Powered by www.kitware.com

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

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

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake

[CMake] ADD_CUSTOM_COMMAND problem with cmake 2.4.3

2006-10-05 Thread Gregor Berginc

Dear all,

yesterday I faced wierd behaviour of the newest cmake. Before, I was
using cmake version 2.4-patch 2 and the following command executed
successfully:
=
ADD_CUSTOM_COMMAND(
OUTPUT ${CMAKE_CURRENT_SOURCE_DIR}/${cpp_class}.h
COMMAND ${JAVAH_RUNTIME}
ARGS -verbose -classpath ${OUTPUT}/classes -d
${CMAKE_CURRENT_SOURCE_DIR} ${jni_class}
)

The command should use javah executable to compile the ${jni_class}
into ${cpp_class}.h. The output should be placed in
project_root/src/c++/balt/jni directory. Now, when I use cmake
version 2.4-patch 3, I get the following error during make:

make[2]: *** No rule to make target
`../src/c++/balt/jni/balt_jni_NativeProcessLauncher.h', needed by
`src/c++/balt/jni/CMakeFiles/FrameworkJNI.dir/JNIProcessInterface.o'.
Stop.
make[1]: *** [src/c++/balt/jni/CMakeFiles/FrameworkJNI.dir/all] Error 2
make: *** [all] Error 2

Note, that I am using out-of-source build which is started from
project_root/.debug. Now, I am not sure why the command is not
executed. The path
../src/c++/balt/jni/balt_jni_NativeProcessLauncher.h is correct if it
is relative to the project_root/.debug. The file needs to be created
under the src directory!

What has changed since patch 2 version? Is this a bug or just my bad
interpretation of ADD_CUSTOM_COMMAND and cmake variables?

Also, if you need more information about the behaviour, please let me know.

Best,
Gregor

--
Gregor Berginc, Ph.D. Student
University of Ljubljana, Faculty of CIS
Trzaska 25, SI-1001 Ljubljana, Slovenia
tel: +386 1 4776630, fax: +386 1 4264647
www: http://vicos.fri.uni-lj.si/gregor
___
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake


Re: [CMake] ADD_CUSTOM_COMMAND problem with cmake 2.4.3

2006-10-05 Thread Brad King
Gregor Berginc wrote:
 Dear all,
 
 yesterday I faced wierd behaviour of the newest cmake. Before, I was
 using cmake version 2.4-patch 2 and the following command executed
 successfully:
 =
 ADD_CUSTOM_COMMAND(
 OUTPUT ${CMAKE_CURRENT_SOURCE_DIR}/${cpp_class}.h
 COMMAND ${JAVAH_RUNTIME}
 ARGS -verbose -classpath ${OUTPUT}/classes -d
 ${CMAKE_CURRENT_SOURCE_DIR} ${jni_class}
 )
 
 The command should use javah executable to compile the ${jni_class}
 into ${cpp_class}.h. The output should be placed in
 project_root/src/c++/balt/jni directory. Now, when I use cmake
 version 2.4-patch 3, I get the following error during make:
 
 make[2]: *** No rule to make target
 `../src/c++/balt/jni/balt_jni_NativeProcessLauncher.h', needed by
 `src/c++/balt/jni/CMakeFiles/FrameworkJNI.dir/JNIProcessInterface.o'.
 Stop.
 make[1]: *** [src/c++/balt/jni/CMakeFiles/FrameworkJNI.dir/all] Error 2
 make: *** [all] Error 2
 
 Note, that I am using out-of-source build which is started from
 project_root/.debug. Now, I am not sure why the command is not
 executed. The path
 ../src/c++/balt/jni/balt_jni_NativeProcessLauncher.h is correct if it
 is relative to the project_root/.debug. The file needs to be created
 under the src directory!
 
 What has changed since patch 2 version? Is this a bug or just my bad
 interpretation of ADD_CUSTOM_COMMAND and cmake variables?

IIRC there was a change that had to do with the relative path
computation during dependency scanning to make sure .o file dependencies
and custom command outputs appeared with the same form in the makefiles.
 Perhaps there were cached scan results that tricked this code into not
working.  Does it still occur with a fresh build tree and source tree?

-Brad
___
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake


Re: [CMake] ADD_CUSTOM_COMMAND problem with cmake 2.4.3

2006-10-05 Thread Brad King
Alexander Neundorf wrote:
  Original-Nachricht 
 Datum: Thu, 5 Oct 2006 09:53:37 +0200
 Von: Gregor Berginc [EMAIL PROTECTED]
 What has changed since patch 2 version? Is this a bug or just my bad
 interpretation of ADD_CUSTOM_COMMAND and cmake variables?
 
 You need to add the generated file to the list of sources for the target 
 where it's needed. Then it will work.

Alex is right, please ignore my previous response.

-Brad
___
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake