Different INSTALL target settings per project

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Different INSTALL target settings per project

Andrew White
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
Reply | Threaded
Open this post in threaded view
|

Re: Different INSTALL target settings per project

Marc CHEVRIER
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 <[hidden email]> 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

--

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