added options to cmake to disable building docs and tests, default behavior unchanged (#357)

This commit is contained in:
Random 2023-05-11 09:42:16 -07:00 committed by GitHub
parent 356e5ab963
commit a12e9fe152
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 19 additions and 11 deletions

View File

@ -97,11 +97,6 @@ find_package(TBB REQUIRED)
set(TEST_QUAKE_MAP_EXPORT_DIR "" CACHE PATH "When running unit tests, export Quake maps to this directory (useful for testing in game)") set(TEST_QUAKE_MAP_EXPORT_DIR "" CACHE PATH "When running unit tests, export Quake maps to this directory (useful for testing in game)")
set(TEST_QUAKE2_MAP_EXPORT_DIR "" CACHE PATH "When running unit tests, export Quake 2 maps to this directory (useful for testing in game)") set(TEST_QUAKE2_MAP_EXPORT_DIR "" CACHE PATH "When running unit tests, export Quake 2 maps to this directory (useful for testing in game)")
# just creates testmaps.hh with absolute path to the testmaps source directory.
# include it as #include <testmaps.hh>
configure_file(testmaps.hh.in testmaps.hh @ONLY)
include_directories(${CMAKE_CURRENT_BINARY_DIR})
add_subdirectory(3rdparty) add_subdirectory(3rdparty)
add_subdirectory(common) add_subdirectory(common)
add_subdirectory(bspinfo) add_subdirectory(bspinfo)
@ -114,14 +109,27 @@ endif ()
add_subdirectory(qbsp) add_subdirectory(qbsp)
add_subdirectory(vis) add_subdirectory(vis)
add_subdirectory(docs)
add_subdirectory(tests) option(DISABLE_TESTS "Disables Tests" OFF)
option(DISABLE_DOCS "Disables Docs" OFF)
if(NOT DISABLE_TESTS)
# just creates testmaps.hh with absolute path to the testmaps source directory.
# include it as #include <testmaps.hh>
configure_file(testmaps.hh.in testmaps.hh @ONLY)
include_directories(${CMAKE_CURRENT_BINARY_DIR})
add_subdirectory(tests)
#CTest
enable_testing()
endif ()
if(NOT DISABLE_DOCS)
add_subdirectory(docs)
endif ()
install(FILES README.md DESTINATION bin) install(FILES README.md DESTINATION bin)
#CTest
enable_testing()
#CPack configuration #CPack configuration
set(CPACK_GENERATOR ZIP) set(CPACK_GENERATOR ZIP)