From 1ef879e9c17c9a620d6936c394d2d73ef659c3d2 Mon Sep 17 00:00:00 2001 From: King_DuckZ Date: Wed, 27 Apr 2016 01:29:40 +0200 Subject: [PATCH] Define all case combinations of cmake_on/off. This saves having to remember to do STRING(TOUPPER) in every cmake file. At times that's really not convenient if possible at all. For example when a top-level project is guessing what option some subproject is going to use and tries to use it for the builtin options view. The acutal OPTION statement is not there, and it's not nice to put a string(toupper) on a variable that seems to come from nowhere (and in fact it might not be there at all). --- include/dindexer-common/cmake_on_off.h | 10 ++++++++++ src/machinery/CMakeLists.txt | 1 - 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/include/dindexer-common/cmake_on_off.h b/include/dindexer-common/cmake_on_off.h index dba9e75..165ab95 100644 --- a/include/dindexer-common/cmake_on_off.h +++ b/include/dindexer-common/cmake_on_off.h @@ -20,9 +20,19 @@ #if !defined(CMAKE_ON) # define CMAKE_ON 1 +# define CMAKE_on 1 +# define CMAKE_On 1 +# define CMAKE_oN 1 #endif #if !defined(CMAKE_OFF) # define CMAKE_OFF 0 +# define CMAKE_OFf 0 +# define CMAKE_OfF 0 +# define CMAKE_Off 0 +# define CMAKE_oFF 0 +# define CMAKE_oFf 0 +# define CMAKE_ofF 0 +# define CMAKE_off 0 #endif #endif diff --git a/src/machinery/CMakeLists.txt b/src/machinery/CMakeLists.txt index cda93f0..64c87c6 100644 --- a/src/machinery/CMakeLists.txt +++ b/src/machinery/CMakeLists.txt @@ -4,7 +4,6 @@ include(WithMediaAutodetect) find_package(Magic REQUIRED) option(DINDEXER_WITH_NICE_MEDIA_TYPES "Enable this if C++14 is available in order to get some nicer media type names, like CD-Rom instead of CDRom" OFF) -string(TOUPPER ${DINDEXER_WITH_NICE_MEDIA_TYPES} DINDEXER_WITH_NICE_MEDIA_TYPES) add_library(${PROJECT_NAME} SHARED pathname.cpp