1
0
Fork 0
mirror of https://github.com/KingDuckZ/dindexer.git synced 2024-11-29 01:33:46 +00:00

Fix mixed indentation

This commit is contained in:
King_DuckZ 2016-10-14 21:07:43 +02:00
parent 5e4cfc161e
commit 44706da689

View file

@ -1,9 +1,9 @@
function(set_switchable)
set(options "")
set(options "")
set(one_value_args PREFIX INFIX OUT_INFIX NAME)
set(multi_value_args ONVALUE OFFVALUE)
set(multi_value_args ONVALUE OFFVALUE)
cmake_parse_arguments(SS "${options}" "${one_value_args}" "${multi_value_args}" ${ARGN})
cmake_parse_arguments(SS "${options}" "${one_value_args}" "${multi_value_args}" ${ARGN})
if (NOT SS_PREFIX)
message(FATAL_ERROR "No PREFIX given")
@ -18,19 +18,19 @@ function(set_switchable)
message(FATAL_ERROR "No NAME given")
endif()
list(FIND SS_ONVALUE CACHE on_is_cachevar)
list(FIND SS_ONVALUE PARENT_SCOPE on_is_parentscope)
list(FIND SS_OFFVALUE CACHE off_is_cachevar)
list(FIND SS_OFFVALUE PARENT_SCOPE off_is_parentscope)
list(FIND SS_ONVALUE CACHE on_is_cachevar)
list(FIND SS_ONVALUE PARENT_SCOPE on_is_parentscope)
list(FIND SS_OFFVALUE CACHE off_is_cachevar)
list(FIND SS_OFFVALUE PARENT_SCOPE off_is_parentscope)
set(on_parentscope)
if (${on_is_cachevar} LESS 0 AND ${on_is_parentscope} LESS 1)
list(APPEND on_parentscope "PARENT_SCOPE")
endif()
set(off_parentscope)
if (${off_is_cachevar} LESS 0 AND ${off_is_parentscope} LESS 1)
list(APPEND off_parentscope "PARENT_SCOPE")
endif()
set(on_parentscope)
if (${on_is_cachevar} LESS 0 AND ${on_is_parentscope} LESS 1)
list(APPEND on_parentscope "PARENT_SCOPE")
endif()
set(off_parentscope)
if (${off_is_cachevar} LESS 0 AND ${off_is_parentscope} LESS 1)
list(APPEND off_parentscope "PARENT_SCOPE")
endif()
#Set some alisases to make the following code less yelling-at-me
set(prefix "${SS_PREFIX}")
@ -38,11 +38,11 @@ function(set_switchable)
set(out_infix "${SS_OUT_INFIX}")
set(suffix "${SS_NAME}")
set(${prefix}_${infix}_${suffix} ${SS_ONVALUE} ${on_parentscope})
set(${prefix}_${suffix} ${SS_OFFVALUE} ${off_parentscope})
set(${prefix}_${infix}_${suffix} ${SS_ONVALUE} ${on_parentscope})
set(${prefix}_${suffix} ${SS_OFFVALUE} ${off_parentscope})
#message(STATUS "${prefix}_${suffix} set to \"${${prefix}_${suffix}}\"")
#message(STATUS "${prefix}_${infix}_${suffix} set to \"${${prefix}_${infix}_${suffix}}\"")
#message(STATUS "${prefix}_${infix}_${suffix} set to \"${${prefix}_${infix}_${suffix}}\"")
if (${prefix}_${infix}_MODE)
set(${prefix}_${out_infix}_${suffix} "${${prefix}_${infix}_${suffix}}" PARENT_SCOPE)