diff --git a/CMakeLists.txt b/CMakeLists.txt index ea30d0da..812dd9f7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -72,22 +72,28 @@ endif() ADD_SUBDIRECTORY(library) OPTION(ENABLE_EXAMPLES "Should the examples be built" ON) -IF(ENABLE_EXAMPLES) +IF(ENABLE_EXAMPLES AND QT_QTOPENGL_FOUND) ADD_SUBDIRECTORY(examples/Basic) ADD_SUBDIRECTORY(examples/Paging) ADD_SUBDIRECTORY(examples/OpenGL) ADD_SUBDIRECTORY(examples/SmoothLOD) -ENDIF(ENABLE_EXAMPLES) + SET(BUILD_EXAMPLES ON) +ELSE() + SET(BUILD_EXAMPLES OFF) +ENDIF() INCLUDE(Packaging.cmake) OPTION(ENABLE_TESTS "Should the tests be built" ON) -IF(ENABLE_TESTS) +IF(ENABLE_TESTS AND QT_QTTEST_FOUND) INCLUDE(CTest) MARK_AS_ADVANCED(FORCE DART_TESTING_TIMEOUT) #This is only needed to hide the variable in the GUI (CMake bug) until 2.8.5 MARK_AS_ADVANCED(FORCE BUILD_TESTING) ADD_SUBDIRECTORY(tests) -ENDIF(ENABLE_TESTS) + SET(BUILD_TESTS ON) +ELSE() + SET(BUILD_TESTS OFF) +ENDIF() #Check if we will building _and_ bundling the docs IF(DOXYGEN_FOUND AND QT_QCOLLECTIONGENERATOR_EXECUTABLE) @@ -98,8 +104,8 @@ ENDIF() ADD_SUBDIRECTORY(documentation) -add_feature_info("Examples" ENABLE_EXAMPLES "Examples of PolyVox usage") -add_feature_info("Tests" ENABLE_TESTS "Unit tests") +add_feature_info("Examples" BUILD_EXAMPLES "Examples of PolyVox usage") +add_feature_info("Tests" BUILD_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") @@ -112,8 +118,8 @@ MESSAGE(STATUS "") MESSAGE(STATUS "Summary") MESSAGE(STATUS "-------") MESSAGE(STATUS "Library type: " ${LIBRARY_TYPE}) -MESSAGE(STATUS "Build examples: " ${ENABLE_EXAMPLES}) -MESSAGE(STATUS "Build tests: " ${ENABLE_TESTS}) +MESSAGE(STATUS "Build examples: " ${BUILD_EXAMPLES}) +MESSAGE(STATUS "Build tests: " ${BUILD_TESTS}) MESSAGE(STATUS "Build bindings: " ${BUILD_BINDINGS}) MESSAGE(STATUS "API Docs available: " ${DOXYGEN_FOUND}) MESSAGE(STATUS " - Qt Help bundling: " ${BUILD_AND_BUNDLE_DOCS}) diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index c10e9f9c..6c6fe163 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -39,10 +39,6 @@ MACRO(CREATE_TEST headerfile sourcefile executablename) SET_PROPERTY(TARGET ${executablename} PROPERTY FOLDER "Tests") ENDMACRO(CREATE_TEST) -IF(NOT QT_QTTEST_FOUND) - MESSAGE(STATUS "QtTest not found. Either install it or disable tests by setting ENABLE_TESTS to OFF") -ENDIF() - INCLUDE_DIRECTORIES(${PolyVox_SOURCE_DIR}/PolyVoxCore/include ${CMAKE_CURRENT_BINARY_DIR}) REMOVE_DEFINITIONS(-DQT_GUI_LIB) #Make sure the tests don't link to the QtGui