On 04/12/2016 02:54 PM, Robert Dailey wrote:
> set_target_properties( ALL_BUILD PROPERTIES FOLDER ${predefined_folder} )
>
> if( BUILD_TESTING )
> set_target_properties( RUN_TESTS PROPERTIES FOLDER "Testing" )
> endif()
>
> However this fails stating those targets do not exist.
They don't exist because they are not created until generate-time.
FYI recent changes in 'master' move ALL_BUILD into the predefined
targets folder.
> Does CMake only allow you to set properties on targets created
> directly by the scripts themselves (i.e. no built-in targets can be
> affected)?
Correct. See above. This is not trivial to change because the
ALL_BUILD, INSTALL, etc. targets are not normal targets.
Internally they have type GLOBAL_TARGET. There can be *multiple*
such targets of the same name created by the generators. Each
directory whose CMakeLists.txt file calls project(SomeName) gets
a SomeName.sln in VS, for example. Each such .sln has a different
ALL_BUILD target with its own dependencies. The generators can
get away with this because nothing ever looks up these targets
by name. Therefore trying to present such targets to CMake
project code is not well-defined.
-Brad
--
Powered by www.kitware.com
Please keep messages on-topic and check the CMake FAQ at:
http://www.cmake.org/Wiki/CMake_FAQ
Kitware offers various services to support the CMake community. For more
information on each offering, please visit:
CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html
Visit other Kitware open-source projects at
http://www.kitware.com/opensource/opensource.html
Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake-developers