Commit 11c304d9 authored by Manuel Grizonnet's avatar Manuel Grizonnet

Merge branch 'develop' into modulus_2bands

parents 9015e68c 5ec9d84f
......@@ -50,13 +50,16 @@ if ( OTB_WRAP_PYTHON )
endif()
macro(swap_cache_variable var1 var2)
set(_backup ${${var1}})
get_property(_var1_type CACHE ${var1} PROPERTY TYPE)
get_property(_var1_help CACHE ${var1} PROPERTY HELPSTRING)
get_property(_var2_type CACHE ${var2} PROPERTY TYPE)
get_property(_var2_help CACHE ${var2} PROPERTY HELPSTRING)
set(${var1} ${${var2}} CACHE ${_var1_type} "${_var1_help}" FORCE)
set(${var2} ${_backup} CACHE ${_var2_type} "${_var2_help}" FORCE)
# Only swap variable if var1 exists in the cmake cache
if (${var1})
set(_backup ${${var1}})
get_property(_var1_type CACHE ${var1} PROPERTY TYPE)
get_property(_var1_help CACHE ${var1} PROPERTY HELPSTRING)
get_property(_var2_type CACHE ${var2} PROPERTY TYPE)
get_property(_var2_help CACHE ${var2} PROPERTY HELPSTRING)
set(${var1} ${${var2}} CACHE ${_var1_type} "${_var1_help}" FORCE)
set(${var2} ${_backup} CACHE ${_var2_type} "${_var2_help}" FORCE)
endif()
endmacro()
macro(swap_variable var1 var2)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment