[CMake] Custom targets that traverse subdirectories
EXT-York, Gantry
gantry.york at boeing.com
Wed Nov 9 18:25:21 EST 2011
And the command "specialtest" is executed out of the build tree?
This is what I'm doing now....
CMakeLists.txt
add_custom_target(aggr_target)
add_subdirectory(a)
add_subdirectory(b)
a/CMakeLists.txt
add_executable( specialtest1 IMPORTED )
add_custom_target(a_special_test COMMAND specialtest1)
add_dependencies(aggr_target a_special_test)
b/CMakeLists.txt
add_executable( specialtest2 IMPORTED )
add_custom_target(b_special_test COMMAND specialtest2)
add_dependencies(aggr_target b_special_test)
It can't seem to find specialtest1 or specialtest2 to execute.
Gantry York
Chandler, Arizona
-----Original Message-----
From: Łukasz Tasz [mailto:lukasz at tasz.eu]
Sent: Wednesday, November 09, 2011 3:52 PM
To: EXT-York, Gantry
Cc: cmake at cmake.org
Subject: Re: [CMake] Custom targets that traverse subdirectories
Hi
As far as I understood your problem correctly:
in main cmakelists create target that will agregate subtargets:
main_cmake:
add_custom_target(aggr_target)
add_subdirectory(a)
add_subdirectory(b)
a/CMakeLists.txt
add_custom_target(a_special_test COMMAND specialtest)
add_dependencies(aggr_target a_special_test)
b/CMakeLists.txt
add_custom_target(b_special_test COMMAND specialtest)
add_dependencies(aggr_target b_special_test)
after generation when you will call:
make aggr_target
both special tests for a and b dir will be executed.
br
L.
2011/11/9 EXT-York, Gantry <gantry.york at boeing.com>:
> How do I define a custom target and have it traverse the source tree?
>
>
>
> I'm using
>
>
>
> add_custom_target(
>
> specialtest
>
> COMMAND rel/path/to/test_script
>
> )
>
>
>
> However, I need to add other commands to this target that come from scripts
> in subdirectories.
>
>
>
>
>
>
>
> Gantry York
>
> Chandler, Arizona
>
>
>
> --
>
> 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 check the CMake FAQ at:
> http://www.cmake.org/Wiki/CMake_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.cmake.org/mailman/listinfo/cmake
>
--
Lukasz Tasz
More information about the CMake
mailing list