More fidling and nicefying of the build system.
Add better C++0x support check to warn on old versions of GCC.
This commit is contained in:
parent
e9b963acc2
commit
c066c72c6d
@ -9,13 +9,22 @@ SET(POLYVOX_VERSION "${POLYVOX_VERSION_MAJOR}.${POLYVOX_VERSION_MINOR}.${POLYVOX
|
|||||||
|
|
||||||
OPTION(ENABLE_CPP0X "Does the compiler support C++0x" ON) #Disable with -DENABLE_CPP0X=OFF or in the GUI
|
OPTION(ENABLE_CPP0X "Does the compiler support C++0x" ON) #Disable with -DENABLE_CPP0X=OFF or in the GUI
|
||||||
IF(ENABLE_CPP0X)
|
IF(ENABLE_CPP0X)
|
||||||
|
INCLUDE(CheckCXXCompilerFlag)
|
||||||
IF(CMAKE_COMPILER_IS_GNUCXX) #Maybe "OR MINGW"
|
IF(CMAKE_COMPILER_IS_GNUCXX) #Maybe "OR MINGW"
|
||||||
ADD_DEFINITIONS(-DC_PLUS_PLUS_ZERO_X_SUPPORTED -std=c++0x) #Will only work on GCC
|
CHECK_CXX_COMPILER_FLAG(-std=c++0x COMPILER_CPP0X_SUPPORTED) #Check if flag is supported...
|
||||||
|
IF(COMPILER_CPP0X_SUPPORTED)
|
||||||
|
ADD_DEFINITIONS(-DC_PLUS_PLUS_ZERO_X_SUPPORTED -std=c++0x) #...if so, add it...
|
||||||
|
ELSE(COMPILER_CPP0X_SUPPORTED)
|
||||||
|
SET(ENABLE_CPP0X OFF) #...if not, disable C++0x mode.
|
||||||
|
MESSAGE(STATUS "Your version of GCC does not support the -std=c++0x flag. C++0x mode is disabled.")
|
||||||
|
ENDIF(COMPILER_CPP0X_SUPPORTED)
|
||||||
ELSEIF(MSYS)
|
ELSEIF(MSYS)
|
||||||
#ADD_DEFINITIONS(-DC_PLUS_PLUS_ZERO_X_SUPPORTED)
|
#ADD_DEFINITIONS(-DC_PLUS_PLUS_ZERO_X_SUPPORTED)
|
||||||
ENDIF()
|
ENDIF()
|
||||||
ENDIF()
|
ENDIF()
|
||||||
|
|
||||||
|
FIND_PACKAGE(Doxygen)
|
||||||
|
|
||||||
ADD_SUBDIRECTORY(library)
|
ADD_SUBDIRECTORY(library)
|
||||||
|
|
||||||
OPTION(ENABLE_EXAMPLES "Should the examples be built" ON)
|
OPTION(ENABLE_EXAMPLES "Should the examples be built" ON)
|
||||||
@ -27,10 +36,12 @@ ENDIF(ENABLE_EXAMPLES)
|
|||||||
INCLUDE(Packaging.cmake)
|
INCLUDE(Packaging.cmake)
|
||||||
|
|
||||||
INCLUDE(CTest)
|
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)
|
IF(BUILD_TESTING)
|
||||||
ADD_SUBDIRECTORY(tests)
|
ADD_SUBDIRECTORY(tests)
|
||||||
ENDIF(BUILD_TESTING)
|
ENDIF(BUILD_TESTING)
|
||||||
|
|
||||||
|
|
||||||
# Option summary
|
# Option summary
|
||||||
MESSAGE(STATUS "")
|
MESSAGE(STATUS "")
|
||||||
MESSAGE(STATUS "Summary")
|
MESSAGE(STATUS "Summary")
|
||||||
@ -38,4 +49,5 @@ MESSAGE(STATUS "-------")
|
|||||||
MESSAGE(STATUS "C++0x mode: " ${ENABLE_CPP0X})
|
MESSAGE(STATUS "C++0x mode: " ${ENABLE_CPP0X})
|
||||||
MESSAGE(STATUS "Build examples: " ${ENABLE_EXAMPLES})
|
MESSAGE(STATUS "Build examples: " ${ENABLE_EXAMPLES})
|
||||||
MESSAGE(STATUS "Build tests: " ${BUILD_TESTING})
|
MESSAGE(STATUS "Build tests: " ${BUILD_TESTING})
|
||||||
|
MESSAGE(STATUS "API Docs available: " ${DOXYGEN_FOUND})
|
||||||
MESSAGE(STATUS "")
|
MESSAGE(STATUS "")
|
||||||
|
@ -23,11 +23,11 @@ endif(WIN32)
|
|||||||
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/PolyVoxConfig.cmake.in ${CMAKE_CURRENT_BINARY_DIR}/PolyVoxConfig.cmake @ONLY)
|
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/PolyVoxConfig.cmake.in ${CMAKE_CURRENT_BINARY_DIR}/PolyVoxConfig.cmake @ONLY)
|
||||||
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/PolyVoxConfig.cmake DESTINATION ${CONFIG_FILE_DIR} COMPONENT development)
|
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/PolyVoxConfig.cmake DESTINATION ${CONFIG_FILE_DIR} COMPONENT development)
|
||||||
|
|
||||||
find_package(Doxygen)
|
|
||||||
if(DOXYGEN_FOUND)
|
if(DOXYGEN_FOUND)
|
||||||
#configure_file(${CMAKE_CURRENT_SOURCE_DIR}/polyvox.css ${CMAKE_CURRENT_BINARY_DIR}/polyvox.css)
|
#configure_file(${CMAKE_CURRENT_SOURCE_DIR}/polyvox.css ${CMAKE_CURRENT_BINARY_DIR}/polyvox.css)
|
||||||
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/Doxyfile.in ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile)
|
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/Doxyfile.in ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile)
|
||||||
add_custom_target(doc COMMAND ${DOXYGEN_EXECUTABLE} WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} COMMENT "Building documentation" VERBATIM)
|
add_custom_target(doc COMMAND ${DOXYGEN_EXECUTABLE} WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} COMMENT "Building documentation" VERBATIM)
|
||||||
|
set_target_properties(doc PROPERTIES PROJECT_LABEL "Documentation") #Set label seen in IDE
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
#add_subdirectory(bindings)
|
#add_subdirectory(bindings)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user