[CMake] FILE command in make_custom_target
Philippe Fremy
phil at freehackers.org
Tue Jun 19 07:11:18 EDT 2007
Brandon Van Every wrote:
> On 6/17/07, Philippe Fremy <phil at freehackers.org> wrote:
>>
>> Hi,
>>
>> I want a directory to be built when a custom target is executed.
>>
>> I tried something like this:
>>
>> add_custom_target(
>> doc_libyzis
>> COMMAND FILE( MAKE_DIRECTORY
>> ${CMAKE_CURRENT_SOURCE_DIR}/../apidoc )
>
> COMMANDs for a custom target are not CMake commands. They are
> commands you could run on a command line.
Yeah, I understood that now.
You can't use FILE, you
> have to use a system-specific "mkdir" or some such. You could write a
> CMake script with FILE in it, and then invoke the CMake script with
> "cmake -P", if you want something guaranteed to be portable.
It is ironic that a running cmake instance, that supports platform
agnostic directory creation, is not able to do that inside a rule and
has to fallback an calling a second cmake instance for that.
cheers,
Philippe
More information about the CMake
mailing list