diff options
author | Campbell Barton <ideasman42@gmail.com> | 2015-06-17 02:16:17 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2015-06-17 02:38:24 +0300 |
commit | 81b37f5e92340cae8df118315b1ba6ac0cc02b0b (patch) | |
tree | b3b881dd8073426b027d022cdd8c08c999b43009 /CMakeLists.txt | |
parent | ecdbe3cc6351bd5f59b0052289419a0337047574 (diff) |
CMake: use functions instead of macros
Reduces issues with vars leaking into the parent scope.
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 32 |
1 files changed, 19 insertions, 13 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 1f0be6cd22e..38a9a5849be 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -53,7 +53,9 @@ if(NOT (${CMAKE_VERSION} VERSION_LESS 3.0)) endif() if(NOT EXECUTABLE_OUTPUT_PATH) - set(FIRST_RUN "TRUE") + set(FIRST_RUN TRUE) +else() + set(FIRST_RUN FALSE) endif() # this starts out unset @@ -129,7 +131,7 @@ macro(option_defaults_init) set(${_var} ON) list(APPEND _init_vars "${_var}") endforeach() - unset(_INC) + unset(_var) endmacro() # remove from namespace @@ -2760,25 +2762,29 @@ include(build_files/cmake/packaging.cmake) # Print Final Configuration if(FIRST_RUN) - set(_config_msg "\n* Blender Configuration *") - macro(info_cfg_option - _setting) - set(_msg " * ${_setting}") + + set(_config_msg "\nBlender Configuration\n=====================") + + function(info_cfg_option + _setting + ) + + set(_msg " - ${_setting}") string(LENGTH "${_msg}" _len) while("32" GREATER "${_len}") set(_msg "${_msg} ") math(EXPR _len "${_len} + 1") endwhile() - set(_config_msg "${_config_msg}\n${_msg}${${_setting}}") - endmacro() - - macro(info_cfg_text - _text) - set(_config_msg "${_config_msg}\n\n ${_text}") + set(_config_msg "${_config_msg}\n${_msg}${${_setting}}" PARENT_SCOPE) + endfunction() + function(info_cfg_text + _text + ) - endmacro() + set(_config_msg "${_config_msg}\n\n ${_text}" PARENT_SCOPE) + endfunction() message(STATUS "C Compiler: \"${CMAKE_C_COMPILER_ID}\"") message(STATUS "C++ Compiler: \"${CMAKE_CXX_COMPILER_ID}\"") |