[CMake] multiple executables

PCJohn peciva at fit.vutbr.cz
Sun Jun 1 17:17:12 EDT 2008


 > [...] if you instead set the OUTPUT_NAME property of the target
 > using set_target_properties, I believe you will get the result
 > you want.

I guess, that would be the option if I would need just one
executable. But I need ten executables - each one of different name.
Simlinks, etc. are not an option because this is used on Windows only.

It would be nice to get ${CMAKE_CFG_INTDIR} working. Investigating...
Finally, found a bug!

Following cmake code

add_custom_command (TARGET autoconsole
      POST_BUILD
      COMMAND ${CMAKE_COMMAND} -E copy
      ${PROJECT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/autoconsole.exe
      ${ivview_BINARY_DIR}/${CMAKE_CFG_INTDIR}/ivview.exe
      COMMENT "Copying executables..." VERBATIM)

produces following command as post-build step in Visual Studio:

C:\usr\pkg\cmake-2.6.0-win32-x86\bin\cmake.exe -E copy 
C:/Users/John/Desktop/ivTools.cmake.Win/build/winAutoConsole/"$"(OutDir)/autoconsole.exe 
C:/Users/John/Desktop/ivTools.cmake.Win/build/ivview/"$"(OutDir)/ivview.exe

Notice "$". The "" avoids correct expansion of $(OutDir) by Visual 
Studio Express 2008. If I manually remove "", everything works like a 
charm. I am using cmake 2.6.0. Not sure about 2.4...

Note: The "" are not seen in "Output window" - you have to enter Project 
-> Properties -> Build Events -> Post-build Event and see Command line,
or you can open BuildLog.htm. I am able to give you support in testing, 
etc....

If you confirm it as bug, I am able to proceed with the project at next 
patch-level release. Thanks for your work at cmake - excelent project.
John



Alan W. Irwin wrote:
> On 2008-06-01 16:29+0200 Pe�iva Jan wrote:
> 
>> install (TARGETS autoconsole
>>         RUNTIME
>>         DESTINATION bin
>>         RENAME ivview.exe)
>>
>> It copies the file, but RENAME does not work (It probably works only 
>> for PROGRAMS and FILES signatures). I was planning to use this command 
>> about ten times to get all the required .exe.
> 
> RENAME does not appear in the documentation of the install(TARGETS ...)
> signature of the install command so I think you are correct what you
> attempted above should not work.  However, if you instead set the
> OUTPUT_NAME property of the target using set_target_properties, I believe
> you will get the result you want.
> 
> Alan
> __________________________
> Alan W. Irwin
> 
> Astronomical research affiliation with Department of Physics and Astronomy,
> University of Victoria (astrowww.phys.uvic.ca).
> 
> Programming affiliations with the FreeEOS equation-of-state implementation
> for stellar interiors (freeeos.sf.net); PLplot scientific plotting software
> package (plplot.org); the libLASi project (unifont.org/lasi); the Loads of
> Linux Links project (loll.sf.net); and the Linux Brochure Project
> (lbproject.sf.net).
> __________________________
> 
> Linux-powered Science
> __________________________


More information about the CMake mailing list