Rename BUILD_TESTING to ENABLE_TESTS and WITH_BINDINGS to ENABLE_BINDINGS

This is for future consistency where ENABLE_ variables will denote optional
components of PolyVox and WITH_ variables denote optionally using features
provided by external libraries (e.g. OGRE compatibility).
This commit is contained in:
Matt Williams 2012-06-26 17:08:44 +01:00
parent ffa14c6f39
commit 11685a1874
3 changed files with 28 additions and 25 deletions

View File

@ -51,11 +51,12 @@ ENDIF(ENABLE_EXAMPLES)
INCLUDE(Packaging.cmake)
INCLUDE(CTest)
MARK_AS_ADVANCED(FORCE DART_TESTING_TIMEOUT) #This is only needed to hide the variable in the GUI (CMake bug)
IF(BUILD_TESTING)
OPTION(ENABLE_TESTS "Should the tests be built" ON)
IF(ENABLE_TESTS)
INCLUDE(CTest)
MARK_AS_ADVANCED(FORCE DART_TESTING_TIMEOUT) #This is only needed to hide the variable in the GUI (CMake bug)
ADD_SUBDIRECTORY(tests)
ENDIF(BUILD_TESTING)
ENDIF(ENABLE_TESTS)
#Check if we will building _and_ bundling the docs
IF(DOXYGEN_FOUND AND QT_QCOLLECTIONGENERATOR_EXECUTABLE)
@ -73,7 +74,7 @@ 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 "Build tests: " ${ENABLE_TESTS})
MESSAGE(STATUS "Build bindings: " ${BUILD_BINDINGS})
MESSAGE(STATUS "API Docs available: " ${DOXYGEN_FOUND})
MESSAGE(STATUS " - Qt Help bundling: " ${BUILD_AND_BUNDLE_DOCS})

View File

@ -45,10 +45,10 @@ The other available settings for PolyVox are:
``ENABLE_EXAMPLES`` (``ON`` or ``OFF``)
Build the example applications that come with PolyVox. Defaults to ``ON``.
``BUILD_TESTING`` (``ON`` or ``OFF``)
``ENABLE_TESTS`` (``ON`` or ``OFF``)
Build the test applications that come with PolyVox. Running the tests is detailed in the next section. Defaults to ``ON``.
``WITH_BINDINGS`` (``ON`` or ``OFF``)
``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``)

View File

@ -1,21 +1,23 @@
find_package(SWIG)
find_package(PythonLibs)
option(WITH_BINDINGS "Build Python bindings" ON)
if(SWIG_FOUND AND PYTHONLIBS_FOUND AND WITH_BINDINGS)
set(BUILD_BINDINGS YES CACHE BOOL "Will the bindings be built" FORCE)
include(${SWIG_USE_FILE})
include_directories(${PYTHON_INCLUDE_PATH})
include_directories(${PolyVoxCore_SOURCE_DIR}/include ${PolyVoxCore_SOURCE_DIR}/include/PolyVoxCore)
link_directories(${PolyVoxCore_BINARY_DIR})
option(ENABLE_BINDINGS "Build Python bindings" ON)
if(ENABLE_BINDINGS)
find_package(SWIG)
find_package(PythonLibs)
if(SWIG_FOUND AND PYTHONLIBS_FOUND)
set(BUILD_BINDINGS YES CACHE BOOL "Will the bindings be built" FORCE)
include(${SWIG_USE_FILE})
include_directories(${PYTHON_INCLUDE_PATH})
include_directories(${PolyVoxCore_SOURCE_DIR}/include ${PolyVoxCore_SOURCE_DIR}/include/PolyVoxCore)
link_directories(${PolyVoxCore_BINARY_DIR})
set(CMAKE_SWIG_FLAGS "")
set_source_files_properties(PolyVoxCore.i PROPERTIES CPLUSPLUS ON)
#set_source_files_properties(PolyVoxCore.i PROPERTIES SWIG_FLAGS "-builtin")
swig_add_module(PolyVoxCore python PolyVoxCore.i)
swig_link_libraries(PolyVoxCore ${PYTHON_LIBRARIES} PolyVoxCore)
#set_target_properties(${SWIG_MODULE_PolyVoxCore_REAL_NAME} PROPERTIES SUFFIX ".pyd")
set(CMAKE_SWIG_FLAGS "")
set_source_files_properties(PolyVoxCore.i PROPERTIES CPLUSPLUS ON)
#set_source_files_properties(PolyVoxCore.i PROPERTIES SWIG_FLAGS "-builtin")
swig_add_module(PolyVoxCore python PolyVoxCore.i)
swig_link_libraries(PolyVoxCore ${PYTHON_LIBRARIES} PolyVoxCore)
#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)
endif()
endif()