Merge branch 'master' of git@gitorious.org:polyvox/polyvox.git
This commit is contained in:
commit
ea7404cdf9
@ -1,4 +1,4 @@
|
||||
CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
|
||||
CMAKE_MINIMUM_REQUIRED(VERSION 2.8.3)
|
||||
|
||||
PROJECT(PolyVox)
|
||||
|
||||
@ -7,11 +7,18 @@ SET(POLYVOX_VERSION_MINOR "1")
|
||||
SET(POLYVOX_VERSION_PATCH "0")
|
||||
SET(POLYVOX_VERSION "${POLYVOX_VERSION_MAJOR}.${POLYVOX_VERSION_MINOR}.${POLYVOX_VERSION_PATCH}")
|
||||
|
||||
include(FeatureSummary)
|
||||
|
||||
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)
|
||||
|
||||
# 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})
|
||||
set_package_properties(Qt4 PROPERTIES DESCRIPTION "C++ framework" URL http://qt-project.org)
|
||||
set_package_properties(Qt4 PROPERTIES TYPE RECOMMENDED PURPOSE "Building the examples")
|
||||
set_package_properties(Qt4 PROPERTIES TYPE OPTIONAL PURPOSE "Building the tests")
|
||||
|
||||
if(MSVC AND (MSVC_VERSION LESS 1600))
|
||||
# Require boost for older (pre-vc2010) Visual Studio compilers
|
||||
@ -60,19 +67,30 @@ ENDIF(ENABLE_TESTS)
|
||||
|
||||
#Check if we will building _and_ bundling the docs
|
||||
IF(DOXYGEN_FOUND AND QT_QCOLLECTIONGENERATOR_EXECUTABLE)
|
||||
SET(BUILD_AND_BUNDLE_DOCS YES)
|
||||
SET(BUILD_AND_BUNDLE_DOCS ON)
|
||||
ELSE()
|
||||
SET(BUILD_AND_BUNDLE_DOCS NO)
|
||||
SET(BUILD_AND_BUNDLE_DOCS OFF)
|
||||
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")
|
||||
add_feature_info("API docs" DOXYGEN_FOUND "HTML documentation of the API")
|
||||
add_feature_info("Qt Help" BUILD_AND_BUNDLE_DOCS "API docs in Qt Help format")
|
||||
add_feature_info("Manual" BUILD_MANUAL "HTML user's manual")
|
||||
|
||||
feature_summary(WHAT ALL)
|
||||
|
||||
# Option summary
|
||||
MESSAGE(STATUS "")
|
||||
MESSAGE(STATUS "Summary")
|
||||
MESSAGE(STATUS "-------")
|
||||
MESSAGE(STATUS "Static libraries: " ${BUILD_STATIC_LIBRARIES})
|
||||
MESSAGE(STATUS "Dynamic libraries: " ${BUILD_DYNAMIC_LIBRARIES})
|
||||
MESSAGE(STATUS "Static libraries: " ${ENABLE_STATIC_LIBRARIES})
|
||||
MESSAGE(STATUS "Dynamic libraries: " ${ENABLE_DYNAMIC_LIBRARIES})
|
||||
MESSAGE(STATUS "Build examples: " ${ENABLE_EXAMPLES})
|
||||
MESSAGE(STATUS "Build tests: " ${ENABLE_TESTS})
|
||||
MESSAGE(STATUS "Build bindings: " ${BUILD_BINDINGS})
|
||||
|
@ -7,7 +7,7 @@ Requirements
|
||||
|
||||
To build PolyVox you need:
|
||||
|
||||
* `CMake <http://cmake.org>`_ 2.6 or greater
|
||||
* `CMake <http://cmake.org>`_ 2.8.3 or greater
|
||||
* A C++ compiler with support for some C++0x features (GCC 4.3 or VC 2010 seem to work)
|
||||
|
||||
With the following optional packages:
|
||||
@ -51,7 +51,7 @@ 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``.
|
||||
|
||||
``BUILD_STATIC_LIBRARIES`` and ``BUILD_DYNAMIC_LIBRARIES`` (``ON`` or ``OFF``)
|
||||
``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.
|
||||
|
||||
``CMAKE_BUILD_TYPE`` (``Debug``, ``Release``, ``RelWithDebInfo`` or ``MinSizeRel``)
|
||||
|
@ -1,8 +1,9 @@
|
||||
find_program(SPHINXBUILD_EXECUTABLE sphinx-build DOC "The location of the sphinx-build executable")
|
||||
|
||||
if(SPHINXBUILD_EXECUTABLE AND QT_QCOLLECTIONGENERATOR_EXECUTABLE)
|
||||
#if(SPHINXBUILD_EXECUTABLE AND QT_QCOLLECTIONGENERATOR_EXECUTABLE)
|
||||
if(SPHINXBUILD_EXECUTABLE)
|
||||
message(STATUS "Found `sphinx-build` at ${SPHINXBUILD_EXECUTABLE}")
|
||||
set(BUILD_MANUAL YES PARENT_SCOPE)
|
||||
set(BUILD_MANUAL ON PARENT_SCOPE)
|
||||
|
||||
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/conf.in.py ${CMAKE_CURRENT_BINARY_DIR}/conf.py @ONLY)
|
||||
#Generates the HTML docs and the Qt help file which can be opened with "assistant -collectionFile thermite.qhc"
|
||||
@ -21,5 +22,5 @@ else()
|
||||
if(NOT QT_QCOLLECTIONGENERATOR_EXECUTABLE)
|
||||
message(STATUS "`qhelpgenerator` was not found. Try setting QT_QCOLLECTIONGENERATOR_EXECUTABLE to its location.")
|
||||
endif()
|
||||
set(BUILD_MANUAL NO PARENT_SCOPE)
|
||||
set(BUILD_MANUAL OFF PARENT_SCOPE)
|
||||
endif()
|
||||
|
@ -4,30 +4,30 @@ PROJECT(PolyVox)
|
||||
|
||||
#By default only build static libraries on Windows but both on Linux
|
||||
#If we ever require CMake 2.8 then use http://www.kitware.com/blog/home/post/82
|
||||
option(BUILD_STATIC_LIBRARIES "Build static libraries" ON)
|
||||
option(ENABLE_STATIC_LIBRARIES "Build static libraries" ON)
|
||||
if(WIN32)
|
||||
option(BUILD_DYNAMIC_LIBRARIES "Build dynamic libraries" OFF)
|
||||
option(ENABLE_DYNAMIC_LIBRARIES "Build dynamic libraries" OFF)
|
||||
else()
|
||||
option(BUILD_DYNAMIC_LIBRARIES "Build dynamic libraries" ON)
|
||||
option(ENABLE_DYNAMIC_LIBRARIES "Build dynamic libraries" ON)
|
||||
endif()
|
||||
|
||||
if(WIN32)
|
||||
#If both are enabled then diable the dyanamic build
|
||||
if(BUILD_STATIC_LIBRARIES AND BUILD_DYNAMIC_LIBRARIES)
|
||||
if(ENABLE_STATIC_LIBRARIES AND ENABLE_DYNAMIC_LIBRARIES)
|
||||
message(STATUS "Building both static and dynamic libraries is not supported on Windows. Disabling dynamic libraries.")
|
||||
set(BUILD_DYNAMIC_LIBRARIES OFF CACHE BOOL "Build dynamic libraries" FORCE)
|
||||
set(ENABLE_DYNAMIC_LIBRARIES OFF CACHE BOOL "Build dynamic libraries" FORCE)
|
||||
endif()
|
||||
#If both are diabled then re-enable the static build
|
||||
if(NOT BUILD_STATIC_LIBRARIES AND NOT BUILD_DYNAMIC_LIBRARIES)
|
||||
if(NOT ENABLE_STATIC_LIBRARIES AND NOT ENABLE_DYNAMIC_LIBRARIES)
|
||||
message(STATUS "Both dynamic and static libraries were disabled - re-enabling static build.")
|
||||
set(BUILD_STATIC_LIBRARIES ON CACHE BOOL "Build static libraries" FORCE)
|
||||
set(ENABLE_STATIC_LIBRARIES ON CACHE BOOL "Build static libraries" FORCE)
|
||||
endif()
|
||||
else()
|
||||
#It's nonsense to disble both so on Linux, re-enable both.
|
||||
if(NOT BUILD_STATIC_LIBRARIES AND NOT BUILD_DYNAMIC_LIBRARIES)
|
||||
if(NOT ENABLE_STATIC_LIBRARIES AND NOT ENABLE_DYNAMIC_LIBRARIES)
|
||||
message(STATUS "Both dynamic and static libraries were disabled - re-enabling both.")
|
||||
set(BUILD_STATIC_LIBRARIES ON CACHE BOOL "Build static libraries" FORCE)
|
||||
set(BUILD_DYNAMIC_LIBRARIES ON CACHE BOOL "Build dynamic libraries" FORCE)
|
||||
set(ENABLE_STATIC_LIBRARIES ON CACHE BOOL "Build static libraries" FORCE)
|
||||
set(ENABLE_DYNAMIC_LIBRARIES ON CACHE BOOL "Build dynamic libraries" FORCE)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
|
@ -113,7 +113,7 @@ INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/include)
|
||||
|
||||
#Core
|
||||
#Build
|
||||
IF(BUILD_STATIC_LIBRARIES)
|
||||
IF(ENABLE_STATIC_LIBRARIES)
|
||||
ADD_LIBRARY(PolyVoxCoreStatic STATIC ${CORE_SRC_FILES} ${CORE_INC_FILES} ${IMPL_SRC_FILES} ${IMPL_INC_FILES})
|
||||
SET_TARGET_PROPERTIES(PolyVoxCoreStatic PROPERTIES OUTPUT_NAME "PolyVoxCore")
|
||||
SET_TARGET_PROPERTIES(PolyVoxCoreStatic PROPERTIES VERSION ${POLYVOX_VERSION} SOVERSION ${POLYVOX_VERSION_MAJOR})
|
||||
@ -122,7 +122,7 @@ IF(BUILD_STATIC_LIBRARIES)
|
||||
ENDIF(MSVC)
|
||||
SET(PolyVoxCore_LIBRARY "PolyVoxCoreStatic")
|
||||
ENDIF()
|
||||
IF(BUILD_DYNAMIC_LIBRARIES)
|
||||
IF(ENABLE_DYNAMIC_LIBRARIES)
|
||||
ADD_LIBRARY(PolyVoxCoreDynamic SHARED ${CORE_SRC_FILES} ${CORE_INC_FILES} ${IMPL_SRC_FILES} ${IMPL_INC_FILES})
|
||||
SET_TARGET_PROPERTIES(PolyVoxCoreDynamic PROPERTIES OUTPUT_NAME "PolyVoxCore")
|
||||
SET_TARGET_PROPERTIES(PolyVoxCoreDynamic PROPERTIES COMPILE_FLAGS "-DPOLYVOX_SHARED_EXPORTS")
|
||||
@ -135,14 +135,14 @@ ENDIF()
|
||||
|
||||
#Install
|
||||
IF(WIN32)
|
||||
IF(BUILD_STATIC_LIBRARIES)
|
||||
IF(ENABLE_STATIC_LIBRARIES)
|
||||
INSTALL(TARGETS PolyVoxCoreStatic
|
||||
RUNTIME DESTINATION PolyVoxCore/bin COMPONENT library
|
||||
LIBRARY DESTINATION PolyVoxCore/lib COMPONENT library
|
||||
ARCHIVE DESTINATION PolyVoxCore/lib COMPONENT library
|
||||
)
|
||||
ENDIF()
|
||||
IF(BUILD_DYNAMIC_LIBRARIES)
|
||||
IF(ENABLE_DYNAMIC_LIBRARIES)
|
||||
INSTALL(TARGETS PolyVoxCoreDynamic
|
||||
RUNTIME DESTINATION PolyVoxCore/bin COMPONENT library
|
||||
LIBRARY DESTINATION PolyVoxCore/lib COMPONENT library
|
||||
@ -159,14 +159,14 @@ IF(WIN32)
|
||||
INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/Debug/PolyVoxCore.pdb DESTINATION PolyVoxCore/lib CONFIGURATIONS Debug)
|
||||
INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/RelWithDebInfo/PolyVoxCore.pdb DESTINATION PolyVoxCore/lib CONFIGURATIONS RelWithDebInfo)
|
||||
ELSE(WIN32)
|
||||
IF(BUILD_STATIC_LIBRARIES)
|
||||
IF(ENABLE_STATIC_LIBRARIES)
|
||||
INSTALL(TARGETS PolyVoxCoreStatic
|
||||
RUNTIME DESTINATION bin COMPONENT library
|
||||
LIBRARY DESTINATION lib COMPONENT library
|
||||
ARCHIVE DESTINATION lib COMPONENT library
|
||||
)
|
||||
ENDIF()
|
||||
IF(BUILD_DYNAMIC_LIBRARIES)
|
||||
IF(ENABLE_DYNAMIC_LIBRARIES)
|
||||
INSTALL(TARGETS PolyVoxCoreDynamic
|
||||
RUNTIME DESTINATION bin COMPONENT library
|
||||
LIBRARY DESTINATION lib COMPONENT library
|
||||
|
@ -29,7 +29,7 @@ LINK_DIRECTORIES(${PolyVoxCore_BINARY_DIR}/debug ${PolyVoxCore_BINARY_DIR}/relea
|
||||
|
||||
#Util
|
||||
#Build
|
||||
IF(BUILD_STATIC_LIBRARIES)
|
||||
IF(ENABLE_STATIC_LIBRARIES)
|
||||
ADD_LIBRARY(PolyVoxUtilStatic STATIC ${UTIL_SRC_FILES} ${UTIL_INC_FILES})
|
||||
TARGET_LINK_LIBRARIES(PolyVoxUtilStatic PolyVoxCore)
|
||||
SET_TARGET_PROPERTIES(PolyVoxUtilStatic PROPERTIES OUTPUT_NAME "PolyVoxUtil")
|
||||
@ -39,7 +39,7 @@ IF(BUILD_STATIC_LIBRARIES)
|
||||
ENDIF(MSVC)
|
||||
ADD_DEPENDENCIES(PolyVoxUtilStatic PolyVoxCoreStatic)
|
||||
ENDIF()
|
||||
IF(BUILD_DYNAMIC_LIBRARIES)
|
||||
IF(ENABLE_DYNAMIC_LIBRARIES)
|
||||
ADD_LIBRARY(PolyVoxUtilDynamic SHARED ${UTIL_SRC_FILES} ${UTIL_INC_FILES})
|
||||
TARGET_LINK_LIBRARIES(PolyVoxUtilDynamic PolyVoxCore)
|
||||
SET_TARGET_PROPERTIES(PolyVoxUtilDynamic PROPERTIES OUTPUT_NAME "PolyVoxUtil")
|
||||
@ -53,14 +53,14 @@ ENDIF()
|
||||
|
||||
#Install
|
||||
IF(WIN32)
|
||||
IF(BUILD_STATIC_LIBRARIES)
|
||||
IF(ENABLE_STATIC_LIBRARIES)
|
||||
INSTALL(TARGETS PolyVoxUtilStatic
|
||||
RUNTIME DESTINATION PolyVoxUtil/bin COMPONENT library
|
||||
LIBRARY DESTINATION PolyVoxUtil/lib COMPONENT library
|
||||
ARCHIVE DESTINATION PolyVoxUtil/lib COMPONENT library
|
||||
)
|
||||
ENDIF()
|
||||
IF(BUILD_DYNAMIC_LIBRARIES)
|
||||
IF(ENABLE_DYNAMIC_LIBRARIES)
|
||||
INSTALL(TARGETS PolyVoxUtilDynamic
|
||||
RUNTIME DESTINATION PolyVoxUtil/bin COMPONENT library
|
||||
LIBRARY DESTINATION PolyVoxUtil/lib COMPONENT library
|
||||
@ -77,14 +77,14 @@ IF(WIN32)
|
||||
INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/Debug/PolyVoxUtil.pdb DESTINATION PolyVoxUtil/lib CONFIGURATIONS Debug)
|
||||
INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/RelWithDebInfo/PolyVoxUtil.pdb DESTINATION PolyVoxUtil/lib CONFIGURATIONS RelWithDebInfo)
|
||||
ELSE(WIN32)
|
||||
IF(BUILD_STATIC_LIBRARIES)
|
||||
IF(ENABLE_STATIC_LIBRARIES)
|
||||
INSTALL(TARGETS PolyVoxUtilStatic
|
||||
RUNTIME DESTINATION bin COMPONENT library
|
||||
LIBRARY DESTINATION lib COMPONENT library
|
||||
ARCHIVE DESTINATION lib COMPONENT library
|
||||
)
|
||||
ENDIF()
|
||||
IF(BUILD_DYNAMIC_LIBRARIES)
|
||||
IF(ENABLE_DYNAMIC_LIBRARIES)
|
||||
INSTALL(TARGETS PolyVoxUtilDynamic
|
||||
RUNTIME DESTINATION bin COMPONENT library
|
||||
LIBRARY DESTINATION lib COMPONENT library
|
||||
|
@ -1,9 +1,11 @@
|
||||
option(ENABLE_BINDINGS "Build Python bindings" ON)
|
||||
if(ENABLE_BINDINGS)
|
||||
find_package(SWIG)
|
||||
set_package_properties(SWIG PROPERTIES DESCRIPTION "Bindings generator" URL http://www.swig.org)
|
||||
find_package(PythonLibs)
|
||||
set_package_properties(PythonLibs PROPERTIES DESCRIPTION "Programming language" URL http://www.python.org)
|
||||
if(SWIG_FOUND AND PYTHONLIBS_FOUND)
|
||||
set(BUILD_BINDINGS YES CACHE BOOL "Will the bindings be built" FORCE)
|
||||
set(BUILD_BINDINGS ON CACHE BOOL "Will the bindings be built" FORCE)
|
||||
include(${SWIG_USE_FILE})
|
||||
|
||||
include_directories(${PYTHON_INCLUDE_PATH})
|
||||
@ -19,5 +21,5 @@ if(ENABLE_BINDINGS)
|
||||
#set_target_properties(${SWIG_MODULE_PolyVoxCore_REAL_NAME} PROPERTIES SUFFIX ".pyd")
|
||||
endif()
|
||||
else()
|
||||
set(BUILD_BINDINGS NO CACHE BOOL "Will the bindings be built" FORCE)
|
||||
set(BUILD_BINDINGS OFF CACHE BOOL "Will the bindings be built" FORCE)
|
||||
endif()
|
||||
|
Loading…
x
Reference in New Issue
Block a user