[CMake] ADD_CUSTOM_COMMAND and working directory

Eric Noulard eric.noulard at gmail.com
Wed Oct 3 16:52:23 EDT 2007


2007/10/3, Juan Sanchez <Juan.Sanchez at amd.com>:
> If I have multiple commands in ADD_CUSTOM_COMMAND, the WORKING_DIRECTORY
> specifier seems to be ignored?

I think WORKING_DIRECTORY may only be specified once
and it is shared by all COMMANDs

>
> What is the proper syntax for having different working directories?

I think you should use several
ADD_CUSTOM_COMMAND
script your different commands using
a cmake script with several EXECUTE_PROCESS.

>
> ADD_CUSTOM_COMMAND(
>   OUTPUT bar
>   COMMAND echo `pwd`
>   WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
>   COMMAND echo `pwd`
>   WORKING_DIRECTORY ${PROJECT_BINARY_DIR}
>   COMMAND echo `pwd`
>   WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
> )
>
>
> ADD_CUSTOM_TARGET( zed ALL DEPENDS bar)
>
> Will always print the source directory.
>
> Thanks,
>
> Juan
>
>
> --
> Juan Sanchez
> Juan.Sanchez at amd.com
> 800-538-8450 Ext. 54395
> 512-602-4395
>
>
> _______________________________________________
> CMake mailing list
> CMake at cmake.org
> http://www.cmake.org/mailman/listinfo/cmake
>


-- 
Erk


More information about the CMake mailing list