[CMake] Different INSTALL target settings per project

Marc CHEVRIER marc.chevrier at gmail.com
Tue Jul 3 02:44:52 EDT 2018


FYI, next release (3.13) will relaxing this contraint so you will be able
to apply this strategy.


Le mar. 3 juil. 2018 à 08:05, Andrew White <andrew.white at audinate.com> a
écrit :

> We have a number of projects that include other projects.  Some of the
> parent projects are cross-compile projects with various odd settings.
>
> Example project:
>
>         add_subdirectory(a)
>         add_subdirectory(b)
>
> I want to go:
>         Install(TARGETS target_a program_b
>                 RUNTIME DESTINATION other-bin
>         )
>
> If I put it in the root CMakeLists.txt, CMake complains that the targets
> are not defined in this context.  But if I put an install() command in
> subdirs A and B, then the 'other-bin' output path will apply to all
> projects, not just this one.
>
> Is there an easy way to specify custom install paths for targets in
> subdirectories without directly hacking the environment variables?
>
> Thanks
>
> --
> Andrew
>
> --
>
> 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:
> https://cmake.org/mailman/listinfo/cmake
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://cmake.org/pipermail/cmake/attachments/20180703/7597529d/attachment.html>


More information about the CMake mailing list