From ac0fb2b310e18c992df645cac01d1e20aa424ca1 Mon Sep 17 00:00:00 2001 From: Matt Williams Date: Thu, 21 Apr 2011 21:40:51 +0200 Subject: [PATCH] Make dynamic or static libraries optional The user can choose static or dynamic libraries using BUILD_STATIC_LIBRARIES and BUILD_DYNAMIC_LIBRARIES. By default Windows will only build static libraries and Linux will build both. --- CMakeLists.txt | 2 + INSTALL.txt | 5 +++ examples/Basic/CMakeLists.txt | 2 +- examples/OpenGL/CMakeLists.txt | 2 +- examples/Paging/CMakeLists.txt | 2 +- library/CMakeLists.txt | 29 +++++++++++++ library/PolyVoxCore/CMakeLists.txt | 65 +++++++++++++++++++++-------- library/PolyVoxUtil/CMakeLists.txt | 67 +++++++++++++++++++++--------- tests/CMakeLists.txt | 1 + 9 files changed, 135 insertions(+), 40 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 9982a923..f4507f2b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -68,6 +68,8 @@ ADD_SUBDIRECTORY(documentation) MESSAGE(STATUS "") MESSAGE(STATUS "Summary") MESSAGE(STATUS "-------") +MESSAGE(STATUS "Static libraries: " ${BUILD_STATIC_LIBRARIES}) +MESSAGE(STATUS "Dynamic libraries: " ${BUILD_DYNAMIC_LIBRARIES}) MESSAGE(STATUS "Build examples: " ${ENABLE_EXAMPLES}) MESSAGE(STATUS "Build tests: " ${BUILD_TESTING}) MESSAGE(STATUS "API Docs available: " ${DOXYGEN_FOUND}) diff --git a/INSTALL.txt b/INSTALL.txt index d68ddcfc..302bab8b 100644 --- a/INSTALL.txt +++ b/INSTALL.txt @@ -47,6 +47,9 @@ The other available settings for PolyVox are: ``BUILD_TESTING`` (``ON`` or ``OFF``) Build the test applications that come with PolyVox. Running the tests is detailed in the next section. Defaults to ``ON``. +``BUILD_STATIC_LIBRARIES`` and ``BUILD_DYNAMIC_LIBRARIES`` (``ON`` or ``OFF``) + Choose whether static (``.a``) or dynamic libraries (``.so``) should be built. On Linux both are built by default. + ``CMAKE_BUILD_TYPE`` (``Debug``, ``Release``, ``RelWithDebInfo`` or ``MinSizeRel``) String option to set the type of build. This will automatically set some compilation flags such as the optimisation level or define ``NDEBUG``. @@ -116,6 +119,8 @@ You need CMake installed so get the binary distribution from `CMake.org