Install shared libraries only if required

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Install shared libraries only if required

Dushara Jayasinghe
Hi all,

I've got a cmake project that builds multiple executables and shared
libraries. There are option() settings that determine which of these
executables are built. What I'd like to be able to do is prevent the
building and installation of shared libraries that are not required. So
what I did is as follows:

 1. set(CMAKE_SKIP_INSTALL_ALL_DEPENDENCY TRUE) on the top level
    CMakeLists file
 2. add_library(${SHARED_LIBRARY} SHARED EXCLUDE_FROM_ALL ...)
 3. install(TARGETS ${SHARED_LIBRARY} DESTINATION ${DESTINATION} OPTIONAL)

These three settings result in the desired behaviour. However, cmake
generates the following warning:

WARNING: Target "xxxx" has EXCLUDE_FROM_ALL set and will not be built by
default but an install rule has been provided for it. CMake does not
define behavior for this case.

  * Is this warning still valid in this specific scenario?
  * If so is there another/more correct way to achieve what I want?
  * If what I'm doing is acceptable, is there a way to suppress this
    warning?

Thank you

Dushara

--

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
Loading...