[CMake] Path qualifier dropped in VS71 generator

William A. Hoffman billlist at nycap.rr.com
Sun May 21 08:38:26 EDT 2006


At 08:27 AM 5/21/2006, Brandon J. Van Every wrote:
>E:\devel\vs71\chicken\debug\silex.exe is built as a target dependency just fine.  However, when it comes time to execute it, the ${Chicken_BINARY_DIR}/silex path qualifier is being dropped.  silex.exe is a generated tool that I need for successive stages of my build.
>
># Need to generate SILEX.EXE
># This is a key 1st step in the bootstrap.
>ADD_CUSTOM_COMMAND(
> OUTPUT ${Chicken_BINARY_DIR}/easyffi.l.silex
> MAIN_DEPENDENCY ${Chicken_SOURCE_DIR}/easyffi.l
> # silex.exe is a proper target name.  Do I need to path-qualify it?
> DEPENDS ${Chicken_BINARY_DIR}/silex
> COMMAND ${Chicken_BINARY_DIR}/silex ${Chicken_SOURCE_DIR}/easyffi.l ${Chicken_BINARY_DIR}/easyffi.l.silex
>)
>
>When generating for Visual Studio .NET 2003, I get:
>
>
>Creating command line ""e:\devel\vs71\chicken\chicken-static.dir\Debug\BAT000155.bat""
>Creating temporary file "e:\devel\vs71\chicken\chicken-static.dir\Debug\BAT000156.bat" with contents
>[
>@echo off
>silex E:/devel/src/chicken/easyffi.l E:/devel/vs71/chicken/easyffi.l.silex
>
>if errorlevel 1 goto VCReportError
>goto VCEnd
>:VCReportError
>echo Project : error PRJ0019: A tool returned an error code from "Generating easyffi.l.silex"
>exit 1
>:VCEnd
>]
>
>Generating easyffi.l.silex
>'silex' is not recognized as an internal or external command,
>operable program or batch file.
>Project : error PRJ0019: A tool returned an error code from "Generating easyffi.l.silex"


You need to use 
GET_TARGET_PROPERTY(MY_GENERATOR_EXE my_generator LOCATION)
With VS IDE the executables are in Debug/Release sub directories.

See this FAQ entry:

http://www.cmake.org/Wiki/CMake_FAQ#How_can_I_generate_a_source_file_during_the_build.3F

-Bill





More information about the CMake mailing list