Add BUILD_SHARED_LIBS as an option

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

Add BUILD_SHARED_LIBS as an option

Mateusz Loskot
Hi,

The docs [1] say:

"This variable [BUILD_SHARED_LIBS] is often added to projects as an option()"

[1] https://cmake.org/cmake/help/latest/variable/BUILD_SHARED_LIBS.html

Does that literally mean adding the option this way?

option(BUILD_SHARED_LIBS "Build shared library" OFF)

Or, adding an extra level of indirection via custom option:

option(XXX_BUILD_SHARED "Build shared library" OFF)

if (XXX_BUILD_SHARED)
  set(BUILD_SHARED_LIBS ON)
endif()

I do realise it's question about docs pedantism, but I'd like to get
that cleared once for good :)
I'm trying to cut number of custom options and I'm never certain
how I can actually re/ab-use the standard CMake settings.

Best regards,
--
Mateusz Loskot, http://mateusz.loskot.net
--

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
--
Mateusz Loskot
http://mateusz.loskot.net
Loading...