[CMake] add_custom_command on test input files

2017-04-21 Thread Olaf Peter
Hello, for my project I have a sub dir with test case which feeds the tests '*.input' and allows to check to output '*.expected'. For documentation purpose, I have a python script which generates a TestMatrix.rst file. Using CMake I have: dir structure: $root/{src,include,utils,test} test/

[CMake] add_custom_command dependencies from file?

2016-09-06 Thread Evgeniy Dushistov
Hi, I need to solve problem described here: https://cmake.org/pipermail/cmake/2005-August/007091.html Basically I have test.i (swig input): %module native %include "lib.hpp" %{ #include "lib.hpp" %} swig with -M option can tell that generated by it code depend on "lib.hpp", but how I can reus

Re: [CMake] add_custom_command and re-running command when target in DEPENDS was updated

2016-08-29 Thread Maciej Mrozowski
On poniedziałek, 29 sierpnia 2016 23:31:59 CEST you wrote: > add_custom_command documentation says: > > > The DEPENDS option specifies files on which the command depends. If any > dependency is an OUTPUT of another custom command in the same directory > (CMakeLists.txt file) CMake automatically

[CMake] add_custom_command and re-running command when target in DEPENDS was updated

2016-08-29 Thread Maciej Mrozowski
Hello, I have a project that goes something along the lines of: (...) add_jar(generator src/javafile.java) (...) get_target_property(GENERATOR_PATH generator JAR_FILE) (...) add_custom_command ${CMAKE_CURRENT_BINARY_DIR}/generated.cpp COMMAND ${Java_JAVA_EXECUTABLE -jar ${GENERATOR_PATH} --ou

Re: [CMake] add_custom_command, POST_BUILD

2016-06-02 Thread iosif neitzke
On Thu, Jun 2, 2016 at 2:43 PM, Chuck Atkins wrote: > Could you just make the tests run in the post-build of the test? > > add_library(Foo Foo.cxx) > > add_executable(FooTest FooTest.cxx) > target_link_libraries(FooTest Foo) > > add_custom_command(TARGET FooTest POST_BUILD > COMMAND $ $ > ) > >

Re: [CMake] add_custom_command, POST_BUILD

2016-06-02 Thread Chuck Atkins
Could you just make the tests run in the post-build of the test? add_library(Foo Foo.cxx) add_executable(FooTest FooTest.cxx) target_link_libraries(FooTest Foo) add_custom_command(TARGET FooTest POST_BUILD COMMAND $ $ ) That way the the test is run as part of it's build. - Chuck On Wed, Ju

Re: [CMake] add_custom_command, POST_BUILD

2016-06-02 Thread Vladimir Chebotarev
Hi. The reason is to make build to fail as soon as possible if core library doesn't work properly. In C++ world that could be critical as hell because building process can last hours even on 32 cores. And it will make CMake more ecological tool as it will reduce the energy wasted. :) On Jun 1

Re: [CMake] add_custom_command, POST_BUILD

2016-06-01 Thread Magnus Therning
Vladimir Chebotarev writes: > Hi there. > > At the moment one can add a command executing after a build of a target > using: > add_custom_command(... POST_BUILD...) > > However if the command have a dependencies which build after the target, > there is practically no way to specify it. > > Simpl

[CMake] add_custom_command, POST_BUILD

2016-06-01 Thread Vladimir Chebotarev
Hi there. At the moment one can add a command executing after a build of a target using: add_custom_command(... POST_BUILD...) However if the command have a dependencies which build after the target, there is practically no way to specify it. Simple case: we have a library and tests for it. E.g.

Re: [CMake] add_custom_command() OUTPUT does not accept generator expressions, why?

2016-03-31 Thread Yves Frederix
Hi Brad, > > If anyone is interested in trying to implement generator expressions > for custom command outputs, I can provide more details to get started. I am interested in having a go at this. I recently ran into this issue at work as well and actually tried some things already. However, I real

Re: [CMake] add_custom_command() OUTPUT does not accept generator expressions, why?

2016-03-31 Thread Dan Liew
Hi, On 28 March 2016 at 15:05, Brad King wrote: > On 03/27/2016 06:11 AM, Dan Liew wrote: >> OUTPUT does not accept generator expressions, why? > > It hasn't been implemented. At least at one time it would have been > very hard to implement. I'm not sure now because there has been a lot > of re

Re: [CMake] add_custom_command() OUTPUT does not accept generator expressions, why?

2016-03-28 Thread Brad King
On 03/27/2016 06:11 AM, Dan Liew wrote: > OUTPUT does not accept generator expressions, why? It hasn't been implemented. At least at one time it would have been very hard to implement. I'm not sure now because there has been a lot of refactoring since I last looked at it. There is some discussi

[CMake] add_custom_command() OUTPUT does not accept generator expressions, why?

2016-03-27 Thread Dan Liew
Hi, I tried writing a add_custom_command statement that will output the generated file into the same directory as another target ``` set(OUTPUT_NAME "$/MyThing.dll") add_custom_command(OUTPUT "${OUTPUT_NAME}" COMMAND "csc.exe" "/output:$" "MySource.cs" ) ``` This doesn't work. CMake emits thi

Re: [CMake] add_custom_command scope

2016-01-19 Thread Hendrik Sattler
Am 19. Januar 2016 12:30:39 MEZ, schrieb Lars : > Hello, > >Using CMake 3.3 and VS2012. > >The below cmake scripts generate "Policy CMP0040 is not set: The target >in the TARGET signature of add_custom_command must exists". Why cannot >the custom/CMakeLists.txt file see the target created in >a

[CMake] add_custom_command scope

2016-01-19 Thread Lars
Hello, Using CMake 3.3 and VS2012. The below cmake scripts generate "Policy CMP0040 is not set: The target in the TARGET signature of add_custom_command must exists". Why cannot the custom/CMakeLists.txt file see the target created in app/CMakeLists.txt ? Moving the ADD_CUSTOM_COMMAND to th

Re: [CMake] add_custom_command not triggered

2015-10-31 Thread David Cole via CMake
Oh wait, I read it wrong... Try ${} to get the value of the variable. (It contains a file name, right?) D On Saturday, October 31, 2015, David Cole wrote: > Because you're giving DEPENDS as a target name, this is only an ordering > dependency, stating that the command should run after the t

Re: [CMake] add_custom_command not triggered

2015-10-31 Thread David Cole via CMake
Because you're giving DEPENDS as a target name, this is only an ordering dependency, stating that the command should run after the target is built. But not necessarily re-build whenever the target is re-built... If you want to re-run the command based on a file changing instead, then use the full

Re: [CMake] add_custom_command not triggered

2015-10-31 Thread Nils Gladitz
On 31.10.2015 15:49, Nico Schlömer wrote: add_custom_command( OUTPUT ${CMAKE_BINARY_DIR}/test/data/pacman.e.2.0 COMMAND decomp -p 2 ${CMAKE_BINARY_DIR}/test/data/pacman.e DEPENDS noshTestFetchData ) I don't know anything about the ExternalData module but assuming this is unrelated ...

[CMake] add_custom_command not triggered

2015-10-31 Thread Nico Schlömer
After downloading a file with ExternalData_Expand_Arguments [1], I would like to execute a command on the data to produce another file. So far, I have ``` ExternalData_Expand_Arguments( noshTestFetchData OUT_DATA DATA{${CMAKE_SOURCE_DIR}/test/data/${file}} ) ExternalData_Add_Target(noshTestFetc

Re: [CMake] add_custom_command and variable arguments

2015-06-09 Thread Nils Gladitz
On 06/09/2015 01:40 PM, Roman Savchenko wrote: I whant to add custom command in such way: add_custom_target(my_target) add_custom_command(TARGET my_target POST_BUILD COMMAND script ${LIST}) set(LIST "") function(add_to_target source) add_executable(source ${source}) add_dependency(my

[CMake] add_custom_command and variable arguments

2015-06-09 Thread Roman Savchenko
HI All, I whant to add custom command in such way: add_custom_target(my_target) add_custom_command(TARGET my_target POST_BUILD COMMAND script ${LIST}) set(LIST "") function(add_to_target source) add_executable(source ${source}) add_dependency(my_target ${source}) list(APPEND LIST ${

[CMake] add_custom_command and visual c++ only running first command?

2015-06-05 Thread Dan Kegel
I was using add_custom_command to execute three commands, triggering that rule with add_custom_target, and it worked great with make and ninja on linux and mac. Over on Windows, though, with visual c++ 2013 and cmake 3.0.1, only the first of the three commands was executed. After much head-scratch

[CMake] add_custom_command taints main dependency file?

2015-06-03 Thread Anders Lindgren
Hi! I just noticed that add_custom_command() "taints" the main dependency file, a behavior that in counter-intuitive and does not correspond to the description in the CMake manual. The following files demonstrates the problem: CMakeLists.txt cmake_minimum_required(VERSION 3.1) add_custom_c

[CMake] add_custom_command: update dependencies over rebuilds

2015-04-21 Thread kvolkov
Hello, Is there a way to to update add_custom_command dependencies over project rebuilds ? Current status - code generator that builds set of sources taking one input file as parameter - codegen input file may include other input files - already solved task of getting list of output files, parsin

Re: [CMake] ADD_CUSTOM_COMMAND Application dependency

2014-11-19 Thread Lars
Hello again, There can only be one working directory and the two lib's are located in different dirs. regards, Lars Date: Wed, 19 Nov 2014 19:21:54 +0100 Subject: Re: [CMake] ADD_CUSTOM_COMMAND Application dependency From: angeliki.chrysoc...@gmail.com To: laasu...@hotmail.com CC:

Re: [CMake] ADD_CUSTOM_COMMAND Application dependency

2014-11-19 Thread Lars
19 Nov 2014 14:10:07 +0100 Subject: Re: [CMake] ADD_CUSTOM_COMMAND Application dependency From: angeliki.chrysoc...@gmail.com To: laasu...@hotmail.com CC: cmake@cmake.org Hi Lars, What if you provide the working directory to ADD_CUSTOM_COMMAND like this: add_custom_command(

Re: [CMake] ADD_CUSTOM_COMMAND Application dependency

2014-11-19 Thread Angeliki Chrysochou
------ > Date: Wed, 19 Nov 2014 14:10:07 +0100 > Subject: Re: [CMake] ADD_CUSTOM_COMMAND Application dependency > From: angeliki.chrysoc...@gmail.com > To: laasu...@hotmail.com > CC: cmake@cmake.org > > > Hi Lars, > > What if you provide the

Re: [CMake] ADD_CUSTOM_COMMAND Application dependency

2014-11-19 Thread Angeliki Chrysochou
Hi Lars, What if you provide the working directory to ADD_CUSTOM_COMMAND like this: add_custom_command( OUTPUT COMMAND command_to_be_executed DEPENDS ${lib1} ${lib2} WORKING_DIRECTORY ${EXECUTABLE_OUTPUT_PATH} VERBATIM) Would it work? Otherwise a trick (more like a ha

[CMake] ADD_CUSTOM_COMMAND Application dependency

2014-11-19 Thread Lars
The below example build "App" and copies it to EXECUTABLE_OUTPUT_PATH. ADD_EXECUTABLE(App ${source}) TARGET_LINK_LIBRARIES(App ${lib1} ${lib2}) INSTALL(TARGETS App ..) The top level CMakeLists.txt has install directives for lib1 and lib2 INSTALL(FILES ${lib1}/bin/lib1.dll DESTINATION ...) INSTA

Re: [CMake] File concatenation in cmake add_custom_command()

2014-08-25 Thread Ravi Raman
.com| http://www.xoriant.com -Original Message- From: David Cole [mailto:dlrd...@aol.com] Sent: Monday, August 25, 2014 4:59 PM To: Ravi Raman Cc: cmake@cmake.org Subject: Re: File concatenation in cmake add_custom_command() First: thanks for your questions to the CMake list. However, when

Re: [CMake] File concatenation in cmake add_custom_command()

2014-08-25 Thread David Cole via CMake
First: thanks for your questions to the CMake list. However, when you send an email to the list, please just ask the question -- that is, please do *not* ask me by name. I know I've answered a few questions for you in the last few weeks, but I am not the only one here, and asking me by name may

Re: [CMake] add_custom_command and CONFIG-dependent output

2014-08-25 Thread Petr Kmoch
On Mon, Aug 25, 2014 at 1:07 PM, David Cole via CMake wrote: > > Ah, thanks... Though, I think there may be a general disconnect here: > > that is, it seems likely that one would want to construct output with > > a pattern composed from generator expressions. > > ... > > While I gather from your

Re: [CMake] add_custom_command and CONFIG-dependent output

2014-08-25 Thread David Cole via CMake
> Ah, thanks... Though, I think there may be a general disconnect here: > that is, it seems likely that one would want to construct output with > a pattern composed from generator expressions. > ... > While I gather from your comment that something like this might be > possible in the future, is th

Re: [CMake] add_custom_command and CONFIG-dependent output

2014-08-24 Thread Braden McDaniel
On Fri, 2014-08-22 at 16:58 -0400, David Cole via CMake wrote: > Use "${CMAKE_CFG_INTDIR}" in the context of add_custom_command OUTPUT, > not $. > > You may also use that in the COMMAND arguments. > > See documentation here: > http://www.cmake.org/cmake/help/v3.0/variable/CMAKE_CFG_INTDIR.html >

Re: [CMake] add_custom_command and CONFIG-dependent output

2014-08-22 Thread David Cole via CMake
Use "${CMAKE_CFG_INTDIR}" in the context of add_custom_command OUTPUT, not $. You may also use that in the COMMAND arguments. See documentation here: http://www.cmake.org/cmake/help/v3.0/variable/CMAKE_CFG_INTDIR.html The $<> generator expressions are relatively new, and do not work in all conte

[CMake] add_custom_command and CONFIG-dependent output

2014-08-22 Thread Braden McDaniel
I'm trying to do this: set(LIB_STAGEDIR "${STAGEDIR}/lib/$") add_custom_command( OUTPUT ${LIB_STAGEDIR} COMMAND ${CMAKE_COMMAND} -E make_directory ${LIB_STAGEDIR} ) …and CMake complains thusly: add_custom_command called with OUTPUT containing a "<". This characte

Re: [CMake] add_custom_command doesn't know about target; but get_target_property does

2014-08-22 Thread Nils Gladitz
On 22.08.2014 18:18, Braden McDaniel wrote: Actually, upon closer inspection, it looks like this doesn't work because $ won't be aware of the current configuration at CMake configure-time. I'm trying to get the configuration-dependent path of the emitted library. (And I need to support Wind

Re: [CMake] add_custom_command doesn't know about target; but get_target_property does

2014-08-22 Thread Braden McDaniel
Nils Gladitz writes: > Perhaps something like: > > file(GENERATE > OUTPUT "${CMAKE_BINARY_DIR}/${LIB_PATHS}/${EXPORT_TARGET}_$" > CONTENT "$" > ) Actually, upon closer inspection, it looks like this doesn't work because $ won't be aware of the current configuration at CMake configu

Re: [CMake] add_custom_command doesn't know about target; but get_target_property does

2014-08-22 Thread Braden McDaniel
On Fri, 2014-08-22 at 12:37 +0200, Nils Gladitz wrote: > On 22.08.2014 02:15, Braden McDaniel wrote: > > Ah. Bummer. > > > > Well, as you might have guessed, I'm trying to address an issue where > > the LOCATION property of a target (EXPORT_TARGET, in the example above) > > was being used. Is the

Re: [CMake] add_custom_command doesn't know about target; but get_target_property does

2014-08-22 Thread Nils Gladitz
On 22.08.2014 02:15, Braden McDaniel wrote: Ah. Bummer. Well, as you might have guessed, I'm trying to address an issue where the LOCATION property of a target (EXPORT_TARGET, in the example above) was being used. Is there some way I can get this information about the target that doesn't invol

Re: [CMake] add_custom_command doesn't know about target; but get_target_property does

2014-08-21 Thread Braden McDaniel
On Thu, 2014-08-21 at 23:05 +0200, Nils Gladitz wrote: > On 21.08.2014 22:27, Braden McDaniel wrote: > > I have the following code that executes in a top-level CMakeLists.txt > > *after* having recursed into subdirectories: > > > > get_target_property(TARGET_NAME ${EXPORT_TARGET} NAME) > >

Re: [CMake] add_custom_command doesn't know about target; but get_target_property does

2014-08-21 Thread Nils Gladitz
On 21.08.2014 22:27, Braden McDaniel wrote: I have the following code that executes in a top-level CMakeLists.txt *after* having recursed into subdirectories: get_target_property(TARGET_NAME ${EXPORT_TARGET} NAME) message(STATUS "${EXPORT_TARGET} NAME = ${TARGET_NAME}") add_custom_c

[CMake] add_custom_command doesn't know about target; but get_target_property does

2014-08-21 Thread Braden McDaniel
I have the following code that executes in a top-level CMakeLists.txt *after* having recursed into subdirectories: get_target_property(TARGET_NAME ${EXPORT_TARGET} NAME) message(STATUS "${EXPORT_TARGET} NAME = ${TARGET_NAME}") add_custom_command( TARGET ${

[CMake] add_custom_command not creating rules when output file is not a c++ header/source file

2014-06-21 Thread Wojciech Mamrak
Hello List, According to the docs: A target created in the same directory that specifies any output of the custom command as a source file is given a rule to generate the file using the command at build time. Above statement is clear and works fine if output file is .h/.cpp file. And how about e.

Re: [CMake] add_custom_command( NOT REQUIRED ) ?

2014-03-10 Thread J Decker
unning it at > all? Wouldn't it be faster to run nothing, and pretend that "it ran, but > failed..." ?? > > ;-) > > > > > -Original Message- > From: J Decker > To: cmake > Sent: Mon, Mar 10, 2014 11:52 pm > Subject: [CMake] add_custom

Re: [CMake] add_custom_command( NOT REQUIRED ) ?

2014-03-10 Thread David Cole
ls, then why are you running it at all? Wouldn't it be faster to run nothing, and pretend that "it ran, but failed..." ?? ;-) -Original Message- From: J Decker To: cmake Sent: Mon, Mar 10, 2014 11:52 pm Subject: [CMake] add_custom_command( NOT REQUIRED ) ? Is there

[CMake] add_custom_command( NOT REQUIRED ) ?

2014-03-10 Thread J Decker
Is there no way to specify 'I don't care if this command fails?' since I don't have an OUTPUT anyway? the thing is, I had a copy(all in directory, including subdirectories) and I had an RM (things that don't belong) which included anything that was a directory, but it didn't have a -f option and I

[CMake] add_custom_command, TARGET_LINKER_FILE and CMAKE_BUILD_TYPE

2013-09-30 Thread Romain LEGUAY
Hello everyonne, I try to build my lybrary in debug and release mode in only one command. The purpose is to create a package with the minimum files (library in debug and release mode and headers) inside it. Actually, I do something like this: add_custom_command(OUTPUT build_release_debug

[CMake] ADD_CUSTOM_COMMAND ?

2013-09-24 Thread g4
Trying to work-around NASM issues by using ADD_CUSTOM_COMMAND. The VS2012 project includes all specified source files but 3.asm wrongly configured: 'does not participate in build'. None of the expected Custom Build Tool properties set. What am I missing? TIA. # CMAKE_MINIMUM_REQUIRED (VER

[CMake] add_custom_command dependencies

2013-04-09 Thread Johann MacDonagh
I'm having a problem with something pretty basic, so I'm wondering what I'm doing wrong. In my build process, I want to use PyInstaller to generate an EXE. Due to the way the source code is laid out, the scripts for this PyInstaller setup are split among several directories. In addition, I need so

Re: [CMake] add_custom_command which generates new sources which I want to specify before

2013-02-28 Thread Eric Noulard
2013/3/1 Baradé : > Hi, > assuming I have the following statements: > > add_library(targetName src1 src2 ... generatedSrc) > add_custom_command(TARGET targetName PRE_BUILD COMMAND bash -c "bla bla > bla") > > and the custom command generates sources which are specified before in > "add_library" CMa

[CMake] add_custom_command which generates new sources which I want to specify before

2013-02-28 Thread Baradé
Hi, assuming I have the following statements: add_library(targetName src1 src2 ... generatedSrc) add_custom_command(TARGET targetName PRE_BUILD COMMAND bash -c "bla bla bla") and the custom command generates sources which are specified before in "add_library" CMake/build process will abort sinc

[CMake] add_custom_command MAIN_DEPENDENCY

2012-11-06 Thread Robert Dailey
Could someone explain the details of the MAIN_DEPENDENCY option to add_custom_command()? The docs state it's a hint to the Visual Studio generator, but doesn't really say much more than that. Why would I use this? What can it do for me? Any examples of where it would be useful? Thanks in advance.

Re: [CMake] add_custom_command

2012-10-18 Thread Michael Wild
On 10/17/2012 08:05 PM, Totte Karlsson wrote: > > On 10/16/2012 12:49 AM, Michael Wild wrote: >> This will always work: >> >> add_executable(frobnicate frobnicate.c) >> >> add_custom_command(OUTPUT ${resultFile} >>COMMAND frobnicate ${resultFileFolder} >>WORKING_DIRECTORY ${PROJECT_SOURCE_

Re: [CMake] add_custom_command

2012-10-17 Thread Totte Karlsson
On 10/16/2012 12:49 AM, Michael Wild wrote: This will always work: add_executable(frobnicate frobnicate.c) add_custom_command(OUTPUT ${resultFile} COMMAND frobnicate ${resultFileFolder} WORKING_DIRECTORY ${PROJECT_SOURCE_DIR} COMMENT "Generating Wiki reports" VERBATIM) add_custom_

Re: [CMake] add_custom_command

2012-10-17 Thread Amine Chadly
On Mon, Oct 15, 2012 at 12:54 AM, Totte Karlsson wrote: > Hi, > Hello ! > I have an executable target, that I want to be executed as part of its own > build. > > The target takes one argument, which is output folder of a text file. This > text file is part of my source dir. > > In my CMake file

Re: [CMake] add_custom_command

2012-10-16 Thread Michael Wild
On 10/15/2012 08:20 PM, Totte Karlsson wrote: > > set( resultFileFolder "${PROJECT_SOURCE_DIR}/wiki/reports") set( > resultFile "${resFileFolder}/tests_auto.xml") > >> First things first: You should *never* pollute your source tree, always >> output to the build tree. > This is part of a google c

Re: [CMake] add_custom_command

2012-10-15 Thread Totte Karlsson
set( resultFileFolder "${PROJECT_SOURCE_DIR}/wiki/reports") set( resultFile "${resFileFolder}/tests_auto.xml") First things first: You should *never* pollute your source tree, always output to the build tree. This is part of a google code project and the output file is a report in the wiki. It

Re: [CMake] add_custom_command

2012-10-14 Thread Michael Wild
Hi On 10/15/2012 12:54 AM, Totte Karlsson wrote: > Hi, I have an executable target, that I want to be executed as part > of its own build. > > The target takes one argument, which is output folder of a text > file. This text file is part of my source dir. > > In my CMake file I have, at the end

[CMake] add_custom_command

2012-10-14 Thread Totte Karlsson
Hi, I have an executable target, that I want to be executed as part of its own build. The target takes one argument, which is output folder of a text file. This text file is part of my source dir. In my CMake file I have, at the end set( resultFileFolder "${PROJECT_SOURCE_DIR}/wiki/reports"

[CMake] add_custom_command with per configuration options

2012-06-26 Thread LaViolette, Alan
I need to add a custom command that varies based on configuration (with VS2010 generator). As far as I can see no direct way exists to do this. I have tried to use the $<..> syntax but it keeps quoting the expression add_library (foo SHARED IMPORTED GLOBAL) set_target_properties(foo PROPERTIES

Re: [CMake] add_custom_command, source_group, and non-existant files with the VS 2010 generator

2011-11-08 Thread Michael Hertling
On 11/08/2011 10:56 PM, Matthew LeRoy wrote: > I've got a question related to the way CMake handles files that are > non-existant > at CMake-time, but which are listed as OUTPUTs of an add_custom_command, and > are > included in a source_group. I'm using CMake 2.8.5 and the Visual Studio 2010 > g

[CMake] add_custom_command, source_group, and non-existant files with the VS 2010 generator

2011-11-08 Thread Matthew LeRoy
I've got a question related to the way CMake handles files that are non-existant at CMake-time, but which are listed as OUTPUTs of an add_custom_command, and are included in a source_group. I'm using CMake 2.8.5 and the Visual Studio 2010 generator. I have a Python script which reads a .resx file

Re: [CMake] add_custom_command location

2011-11-07 Thread Michael Hertling
On 11/07/2011 05:51 PM, Tomasz Grobelny wrote: > I have a project which is configured in several CMakeLists.txt files. The > problem is that add_custom_command works or doesn't work depending on where > the command is located. If I put add_custom_command just after add_library > then it works fine.

[CMake] add_custom_command location

2011-11-07 Thread Tomasz Grobelny
I have a project which is configured in several CMakeLists.txt files. The problem is that add_custom_command works or doesn't work depending on where the command is located. If I put add_custom_command just after add_library then it works fine. Like this: add_library(mylib SHARED ${SOURCES} ${PRI

Re: [CMake] add_custom_command question

2011-10-21 Thread Łukasz Tasz
Hi all, with cmake 2.8.6 all my problems are solved, I'm can easily recreate/replicate custom_target. Thanks a lot! Best regards Lukasz -- 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

Re: [CMake] add_custom_command question

2011-10-20 Thread Michael Hertling
On 10/20/2011 08:23 PM, Łukasz Tasz wrote: >> add_custom_target(TARGET generator >>COMMAND touch aaa.cxx >>COMMENT generate file >> ) >> >> add_custom_command(OUTPUT aaa.cxx >>COMMAND echo "command" >>DEPENDS generator bar >> This does

Re: [CMake] add_custom_command question

2011-10-20 Thread Łukasz Tasz
> add_custom_target(TARGET generator >COMMAND touch aaa.cxx >COMMENT generate file > ) > > add_custom_command(OUTPUT aaa.cxx >COMMAND echo "command" >DEPENDS generator bar > This does not work^^^ >

Re: [CMake] add_custom_command question

2011-10-20 Thread Łukasz Tasz
Hi Michael, Hi All Thanks a lot for answer, I tried something else, let's assume that we have some output, then we are registering target which is dependend on ouptut - registered target is responsible to provide output in a global scope. I have other cmake lists, in which I have some targets tha

Re: [CMake] add_custom_command question

2011-10-20 Thread Michael Hertling
On 10/20/2011 12:37 PM, Łukasz Tasz wrote: > Hi all, > > In my cmake project I have few commands that are creating outputs. > > But Unfortunately those outputs are used across many directories. > > So my question is what's the real scope of output_command? only > Current_CmakeLists.txt? Yes, a

[CMake] add_custom_command question

2011-10-20 Thread Łukasz Tasz
Hi all, In my cmake project I have few commands that are creating outputs. But Unfortunately those outputs are used across many directories. So my question is what's the real scope of output_command? only Current_CmakeLists.txt? Can I somehow make make_target that is creating output registered i

Re: [CMake] add_custom_command and $<...>

2011-10-05 Thread Jaime Frey
On Oct 5, 2011, at 9:18 AM, David Cole wrote: > On Wed, Oct 5, 2011 at 10:09 AM, Jaime Frey wrote: >> Thanks. >> I see the entry in the Changelog now. I guess I didn't pick the right search >> term when I looked at it before. Might I suggest adding a note to bug 9465 >> that the custom command

Re: [CMake] add_custom_command and $<...>

2011-10-05 Thread David Cole
On Wed, Oct 5, 2011 at 10:09 AM, Jaime Frey wrote: > On Oct 4, 2011, at 6:56 PM, Michael Hertling wrote: > >> On 10/04/2011 09:20 PM, Jaime Frey wrote: >>> Hi. >>> I'm having some trouble with the add_custom_command() function in cmake >>> 2.8.3. I'm using it to run a POST_BUILD command on a targ

Re: [CMake] add_custom_command and $<...>

2011-10-05 Thread Jaime Frey
On Oct 4, 2011, at 6:56 PM, Michael Hertling wrote: > On 10/04/2011 09:20 PM, Jaime Frey wrote: >> Hi. >> I'm having some trouble with the add_custom_command() function in cmake >> 2.8.3. I'm using it to run a POST_BUILD command on a target. The docs say I >> can use $ in the arguments to COMMAN

Re: [CMake] add_custom_command and $<...>

2011-10-04 Thread Michael Hertling
On 10/04/2011 09:20 PM, Jaime Frey wrote: > Hi. > I'm having some trouble with the add_custom_command() function in cmake > 2.8.3. I'm using it to run a POST_BUILD command on a target. The docs say I > can use $ in the arguments to COMMAND to get the filename of > the generated target file. But

[CMake] add_custom_command and $<...>

2011-10-04 Thread Jaime Frey
Hi. I'm having some trouble with the add_custom_command() function in cmake 2.8.3. I'm using it to run a POST_BUILD command on a target. The docs say I can use $ in the arguments to COMMAND to get the filename of the generated target file. But no substitution occurs and "$" gets plopped into th

Re: [CMake] add_custom_command and DEPENDS

2011-09-20 Thread Michael Hertling
On 09/20/2011 07:00 PM, Talin wrote: > After several years of working with CMake, I have to say that I still do not > understand the behavior of the DEPENDS clause in add_custom_command. > > The main problem is a fairly simple one: I have an add_custom_command in one > subdirectory, the output of

[CMake] add_custom_command and DEPENDS

2011-09-20 Thread Talin
After several years of working with CMake, I have to say that I still do not understand the behavior of the DEPENDS clause in add_custom_command. The main problem is a fairly simple one: I have an add_custom_command in one subdirectory, the output of which is needed by an add_custom_command in ano

Re: [CMake] add_custom_command(TARGET ..) does nothing if target don't exist?

2011-08-31 Thread David Cole
That seems like add_custom_command should fail with an error when the named target does not exist. (I have never noticed this, because I never use that signature of add_custom_command...) On Tue, Aug 30, 2011 at 12:45 PM, Johan Björk wrote: > Hi guys, > I just ran into the following issue, and I

[CMake] add_custom_command(TARGET ..) does nothing if target don't exist?

2011-08-30 Thread Johan Björk
Hi guys, I just ran into the following issue, and I'm quite baffled? Is this really expected behaviour? cherimoya:cmake-postbuildearly phb$ cat CMakeLists ADD_CUSTOM_COMMAND(TARGET foo POST_BUILD COMMAND ${CMAKE_COMMAND} -E echo 'hello') TARGET_LINK_LIBRARIES(foo "-lbar") cherimoya:cmake-postbuil

Re: [CMake] ADD_CUSTOM_COMMAND and Dependencies

2011-08-01 Thread Michael Wild
On 08/01/2011 09:32 AM, Micha Renner wrote: > Am Montag, den 25.07.2011, 15:49 +0200 schrieb Michael Wild: >> On 07/25/2011 03:24 PM, Micha Renner wrote: >>> There is following sequence: >>> >>> ADD_EXECUTEABLE(generator gen.c) >>> >>> ADD_CUSTOM_COMMAND(OUTPUT tlib.h >>> COMMAND generator > tl

Re: [CMake] ADD_CUSTOM_COMMAND and Dependencies

2011-08-01 Thread Micha Renner
Am Montag, den 25.07.2011, 15:49 +0200 schrieb Michael Wild: > On 07/25/2011 03:24 PM, Micha Renner wrote: > > There is following sequence: > > > > ADD_EXECUTEABLE(generator gen.c) > > > > ADD_CUSTOM_COMMAND(OUTPUT tlib.h > > COMMAND generator > tlib.h) > > > > ADD_LIBRARY(tlib tlib.c tlib.h

Re: [CMake] ADD_CUSTOM_COMMAND and Dependencies

2011-07-25 Thread Michael Wild
On 07/25/2011 03:24 PM, Micha Renner wrote: > There is following sequence: > > ADD_EXECUTEABLE(generator gen.c) > > ADD_CUSTOM_COMMAND(OUTPUT tlib.h > COMMAND generator > tlib.h) > > ADD_LIBRARY(tlib tlib.c tlib.h) > > The question: Is it sure that ADD_EXECUTEABLE is invoked before the >

[CMake] ADD_CUSTOM_COMMAND and Dependencies

2011-07-25 Thread Micha Renner
There is following sequence: ADD_EXECUTEABLE(generator gen.c) ADD_CUSTOM_COMMAND(OUTPUT tlib.h COMMAND generator > tlib.h) ADD_LIBRARY(tlib tlib.c tlib.h) The question: Is it sure that ADD_EXECUTEABLE is invoked before the library is build or is here an ADD_DEPENDENCIES(tlib generator)

Re: [CMake] ADD_CUSTOM_COMMAND() cannot depend on ADD_CUSTOM_TARGET()

2011-02-14 Thread Michael Hertling
On 02/15/2011 12:58 AM, John McGehee wrote: > I have a custom command that depends on a custom target. In the example > below, it is as if >ADD_CUSTOM_COMMAND(... DEPENDS t ...) > has no effect: > > # CMakeLists.txt: > CMAKE_MINIMUM_REQUIRED(VERSION 2.8 FATAL_ERROR) > PROJECT(CUSTOMDEPENDS N

[CMake] ADD_CUSTOM_COMMAND() cannot depend on ADD_CUSTOM_TARGET()

2011-02-14 Thread John McGehee
I have a custom command that depends on a custom target. In the example below, it is as if ADD_CUSTOM_COMMAND(... DEPENDS t ...) has no effect: # CMakeLists.txt: CMAKE_MINIMUM_REQUIRED(VERSION 2.8 FATAL_ERROR) PROJECT(CUSTOMDEPENDS NONE) ADD_CUSTOM_TARGET(t ${CMAKE_COMMAND} -E echo "Build

[CMake] ADD_CUSTOM_COMMAND does not recognize source file property OBJECT_DEPENDS

2011-01-29 Thread John McGehee
This is a question about ADD_CUSTOM_COMMAND, not SWIG, which just appears in the introduction. I give the command, swig_add_module(basic csharp ${CMAKE_SOURCE_DIR}/basic.i) And the UseSWIG.cmake makes a custom command, add_custom_command( DEPENDS ${CMAKE_SOURCE_DIR}/ba

Re: [CMake] add_custom_command and generated true

2011-01-25 Thread Micha Renner
Am Dienstag, den 25.01.2011, 15:34 +0100 schrieb Michael Hertling: > On 01/25/2011 10:17 AM, Micha Renner wrote: > > Recently, I learned that ADD_CUSTOM_COMMAND generated the property > > GENERATED TRUE for the generated file. > > > > Somehow I have trouble in this situation: > > > > In a top lev

Re: [CMake] add_custom_command and generated true

2011-01-25 Thread Michael Hertling
On 01/25/2011 10:17 AM, Micha Renner wrote: > Recently, I learned that ADD_CUSTOM_COMMAND generated the property > GENERATED TRUE for the generated file. > > Somehow I have trouble in this situation: > > In a top level CMakeLists file a source file, blue.c, is generated. This > file should be use

[CMake] add_custom_command and generated true

2011-01-25 Thread Micha Renner
Recently, I learned that ADD_CUSTOM_COMMAND generated the property GENERATED TRUE for the generated file. Somehow I have trouble in this situation: In a top level CMakeLists file a source file, blue.c, is generated. This file should be used in a subdirectory with its own CMakeLists file. Running

Re: [CMake] add_custom_command problem

2011-01-17 Thread Andrea Galeazzi
Title: korg Firma Eric Noulard ha scritto: 2011/1/17 Andrea Galeazzi : Eric Noulard ha scritto: 2011/1/17 Andrea Galeazzi : 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 incr

Re: [CMake] add_custom_command problem

2011-01-17 Thread Eric Noulard
2011/1/17 Andrea Galeazzi : > Eric Noulard ha scritto: > > 2011/1/17 Andrea Galeazzi : > > > 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 SOUR

Re: [CMake] add_custom_command problem

2011-01-17 Thread Andrea Galeazzi
Eric Noulard ha scritto: 2011/1/17 Andrea Galeazzi : 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?

Re: [CMake] add_custom_command problem

2011-01-17 Thread Eric Noulard
2011/1/17 Andrea Galeazzi : > 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

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 Galeazzi: Il 17/01/2011 11.09, Eric Noulard ha scritto: 2011/1/17 Andrea Galeazzi: 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 num

Re: [CMake] add_custom_command problem

2011-01-17 Thread Eric Noulard
2011/1/17 Andrea Galeazzi : > Il 17/01/2011 11.09, Eric Noulard ha scritto: >> >> 2011/1/17 Andrea Galeazzi: >>> >>> 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) t

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 Galeazzi: 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"

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 s

Re: [CMake] add_custom_command problem

2011-01-17 Thread Eric Noulard
2011/1/17 Andrea Galeazzi : > 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}\\BuildNumberUpda

[CMake] add_custom_command problem

2011-01-17 Thread Andrea Galeazzi
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"

  1   2   3   >