The following issue has been SUBMITTED. ====================================================================== http://www.cmake.org/Bug/view.php?id=14979 ====================================================================== Reported By: Nico Assigned To: ====================================================================== Project: CMake Issue ID: 14979 Category: (No Category) Reproducibility: have not tried Severity: feature Priority: low Status: new ====================================================================== Date Submitted: 2014-06-17 20:00 EDT Last Modified: 2014-06-17 20:00 EDT ====================================================================== Summary: build both static and dynamic with cmake arguments Description: Right now, to build both the static and the dynamic version of a library, two `add_library` calls have to be present in the respective CMakeLists.txt file, e.g., ``` add_library(MyLib SHARED source1.c source2.c) add_library(MyLibStatic STATIC source1.c source2.c) ``` To control this from the command line, one has the switch `BUILD_SHARED_LIBS` which is set to either on or off.
In Debian -- and possibly other distributors too --, you would like to build *both* shared and dynamic versions of all libraries, and that without modifying the software sources. The first option (patch the software to contain both `add_library(... SHARED ...)` and `add_library(... STATIC ...)`) is hence not an option. It seems that configuring the software twice, with BUILD_SHARED_LIBS set to ON and OFF, respectively, is the only option. Is this what CMake developers would recommend, too, or would there be a smarter way of handling things? ====================================================================== Issue History Date Modified Username Field Change ====================================================================== 2014-06-17 20:00 Nico New Issue ====================================================================== -- 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
