diff --git a/CMakeLists.txt b/CMakeLists.txt index 39b8d381..42bc8912 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -13,6 +13,12 @@ FIND_PACKAGE(Doxygen) set_package_properties(Doxygen PROPERTIES URL http://www.doxygen.org DESCRIPTION "API documentation generator" TYPE OPTIONAL PURPOSE "Building the API documentation") OPTION(ENABLE_EXAMPLES "Should the examples be built" ON) +SET(LIBRARY_TYPE "DYNAMIC" CACHE STRING "Should the library be STATIC or DYNAMIC") +SET_PROPERTY(CACHE LIBRARY_TYPE PROPERTY STRINGS DYNAMIC STATIC) +IF(WIN32) + SET(LIBRARY_TYPE "STATIC") +ENDIF() + # Qt is required for building the tests, the example and optionally for bundling the documentation FIND_PACKAGE(Qt4 COMPONENTS QtCore QtGui QtOpenGL QtTest) INCLUDE(${QT_USE_FILE}) @@ -42,18 +48,6 @@ IF(ENABLE_EXAMPLES) ADD_SUBDIRECTORY(examples/Paging) ADD_SUBDIRECTORY(examples/OpenGL) ADD_SUBDIRECTORY(examples/SmoothLOD) - if(ENABLE_STATIC_LIBRARIES) - ADD_DEPENDENCIES(BasicExample PolyVoxCoreStatic PolyVoxUtilStatic) - ADD_DEPENDENCIES(PagingExample PolyVoxCoreStatic PolyVoxUtilStatic) - ADD_DEPENDENCIES(OpenGLExample PolyVoxCoreStatic PolyVoxUtilStatic) - ADD_DEPENDENCIES(SmoothLODExample PolyVoxCoreStatic PolyVoxUtilStatic) - endif() - if(ENABLE_DYNAMIC_LIBRARIES) - ADD_DEPENDENCIES(BasicExample PolyVoxCoreDynamic PolyVoxUtilDynamic) - ADD_DEPENDENCIES(PagingExample PolyVoxCoreDynamic PolyVoxUtilDynamic) - ADD_DEPENDENCIES(OpenGLExample PolyVoxCoreDynamic PolyVoxUtilDynamic) - ADD_DEPENDENCIES(SmoothLODExample PolyVoxCoreDynamic PolyVoxUtilDynamic) - endif() ENDIF(ENABLE_EXAMPLES) INCLUDE(Packaging.cmake) @@ -74,8 +68,6 @@ ENDIF() ADD_SUBDIRECTORY(documentation) -add_feature_info("Static libraries" ENABLE_STATIC_LIBRARIES "Will static libraries be built") -add_feature_info("Dynamic libraries" ENABLE_DYNAMIC_LIBRARIES "Will dynamic libraries be built") add_feature_info("Examples" ENABLE_EXAMPLES "Examples of PolyVox usage") add_feature_info("Tests" ENABLE_TESTS "Unit tests") add_feature_info("Bindings" BUILD_BINDINGS "SWIG bindings") @@ -89,8 +81,7 @@ feature_summary(WHAT ALL) MESSAGE(STATUS "") MESSAGE(STATUS "Summary") MESSAGE(STATUS "-------") -MESSAGE(STATUS "Static libraries: " ${ENABLE_STATIC_LIBRARIES}) -MESSAGE(STATUS "Dynamic libraries: " ${ENABLE_DYNAMIC_LIBRARIES}) +MESSAGE(STATUS "Library type: " ${LIBRARY_TYPE}) MESSAGE(STATUS "Build examples: " ${ENABLE_EXAMPLES}) MESSAGE(STATUS "Build tests: " ${ENABLE_TESTS}) MESSAGE(STATUS "Build bindings: " ${BUILD_BINDINGS}) diff --git a/INSTALL.txt b/INSTALL.txt index f10e6ce2..bcbf500c 100644 --- a/INSTALL.txt +++ b/INSTALL.txt @@ -51,8 +51,8 @@ The other available settings for PolyVox are: ``ENABLE_BINDINGS`` (``ON`` or ``OFF``) Should the Python bindings to PolyVox be built. This requires the Python development libraries and SWIG to be installed. Defaults to ``ON``. -``ENABLE_STATIC_LIBRARIES`` and ``ENABLE_DYNAMIC_LIBRARIES`` (``ON`` or ``OFF``) - Choose whether static (``.a``) or dynamic libraries (``.so``) should be built. On Linux both are built by default. +``LIBRARY_TYPE`` (``DYNAMIC`` or ``STATIC``) + Choose whether static (``.a``) or dynamic libraries (``.so``) should be built. On Linux ``DYNAMIC`` is the default and on Windows ``STATIC`` is the 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``. @@ -123,8 +123,6 @@ You need CMake installed so get the binary distribution from `CMake.org