From 760b5548f8957cdf6a627f5f0bc6e1f134846f14 Mon Sep 17 00:00:00 2001 From: Thomas Debesse Date: Tue, 12 Nov 2019 08:31:04 +0100 Subject: [PATCH] enable crunch if available --- CMakeLists.txt | 8 +++++++- README.md | 4 ++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 76f733fe..fb00a218 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -2,9 +2,15 @@ cmake_minimum_required(VERSION 2.8.12 FATAL_ERROR) list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/cmake") project(NetRadiant C CXX) +if (EXISTS "${PROJECT_SOURCE_DIR}/libs/crunch/inc/crn_decomp.h") + set(DEFAULT_BUILD_CRUNCH ON CACHE INTERNAL "...") +else () + set(DEFAULT_BUILD_CRUNCH OFF CACHE INTERNAL "...") +endif () + option(BUILD_RADIANT "Build the GUI" ON) option(BUILD_TOOLS "Build the tools" ON) -option(BUILD_CRUNCH "Build Crunch image support" OFF) +option(BUILD_CRUNCH "Build Crunch image support" ${DEFAULT_BUILD_CRUNCH}) option(DOWNLOAD_GAMEPACKS "Download game packs" ON) option(USE_WERROR "Build with -Werror -pedantic-errors" OFF) option(FHS_INSTALL "Install according to Filesystem Hierarchy Standard" OFF) diff --git a/README.md b/README.md index dfcbcb04..192d2826 100644 --- a/README.md +++ b/README.md @@ -148,8 +148,8 @@ Options: Do not build NetRadiant (default: `ON`, build netradiant graphical editor); * `BUILD_TOOLS=OFF` Do not build q3map2 and other tools (default: `ON`, build command line tools); -* `BUILD_CRUNCH=ON` - Enable crunch support (default: `OFF`, disable crunch support); +* `BUILD_CRUNCH=OFF` + Disable crunch support (default: `ON` if submodule is there, enable crunch support); * `RADIANT_ABOUTMSG="Custom build by $(whoami)"` A message shown in the about dialog (default: `Custom build`). -- 2.39.2