Changeset 50 in pacpusframework for trunk/cmake/PacpusUtilities.cmake
- Timestamp:
- Jan 9, 2013, 9:06:15 AM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/cmake/PacpusUtilities.cmake
r40 r50 79 79 # ======================================== 80 80 macro(pacpus_purge_backslash var) 81 string(REGEX REPLACE "\\\\" "/" ${var} "${${var}}")81 string(REGEX REPLACE "\\\\" "/" ${var} "${${var}}") 82 82 endmacro() 83 83 … … 86 86 # ======================================== 87 87 macro(pacpus_get_msvc output) 88 # By default, unknown89 set(${output} "unknown")90 if(MSVC9)91 set(${output} "msvc2008")92 elseif(MSVC10)93 set(${output} "msvc2010")94 else(MSVC11)95 set(${output} "msvc2012")96 endif()88 # By default, unknown 89 set(${output} "unknown") 90 if(MSVC9) 91 set(${output} "msvc2008") 92 elseif(MSVC10) 93 set(${output} "msvc2010") 94 else(MSVC11) 95 set(${output} "msvc2012") 96 endif() 97 97 endmacro() 98 98 … … 101 101 # ======================================== 102 102 function(pacpus_output_status msg) 103 message(STATUS "${msg}")104 string(REPLACE "\\" "\\\\" msg "${msg}")105 string(REPLACE "\"" "\\\"" msg "${msg}")103 message(STATUS "${msg}") 104 string(REPLACE "\\" "\\\\" msg "${msg}") 105 string(REPLACE "\"" "\\\"" msg "${msg}") 106 106 endfunction() 107 107 … … 110 110 # ======================================== 111 111 function(pacpus_info text) 112 set(status_cond) 113 set(status_then) 114 set(status_else) 115 116 set(status_current_name "cond") 117 foreach(arg ${ARGN}) 118 if(arg STREQUAL "THEN") 119 set(status_current_name "then") 120 elseif(arg STREQUAL "ELSE") 121 set(status_current_name "else") 112 set(status_cond) 113 set(status_then) 114 set(status_else) 115 116 set(status_current_name "cond") 117 foreach(arg ${ARGN}) 118 if(arg STREQUAL "THEN") 119 set(status_current_name "then") 120 elseif(arg STREQUAL "ELSE") 121 set(status_current_name "else") 122 else() 123 list(APPEND status_${status_current_name} ${arg}) 124 endif() 125 endforeach() 126 127 if(DEFINED status_cond) 128 set(status_placeholder_length 32) 129 string(RANDOM LENGTH ${status_placeholder_length} ALPHABET " " status_placeholder) 130 string(LENGTH "${text}" status_text_length) 131 if(status_text_length LESS status_placeholder_length) 132 string(SUBSTRING "${text}${status_placeholder}" 0 ${status_placeholder_length} status_text) 133 elseif(DEFINED status_then OR DEFINED status_else) 134 pacpus_output_status("${text}") 135 set(status_text "${status_placeholder}") 136 else() 137 set(status_text "${text}") 138 endif() 139 140 if(DEFINED status_then OR DEFINED status_else) 141 if(${status_cond}) 142 string(REPLACE ";" " " status_then "${status_then}") 143 string(REGEX REPLACE "^[ \t]+" "" status_then "${status_then}") 144 pacpus_output_status("${status_text} ${status_then}") 145 else() 146 string(REPLACE ";" " " status_else "${status_else}") 147 string(REGEX REPLACE "^[ \t]+" "" status_else "${status_else}") 148 pacpus_output_status("${status_text} ${status_else}") 149 endif() 150 else() 151 string(REPLACE ";" " " status_cond "${status_cond}") 152 string(REGEX REPLACE "^[ \t]+" "" status_cond "${status_cond}") 153 pacpus_output_status("${status_text} ${status_cond}") 154 endif() 122 155 else() 123 list(APPEND status_${status_current_name} ${arg})156 pacpus_output_status("${text}") 124 157 endif() 125 endforeach()126 127 if(DEFINED status_cond)128 set(status_placeholder_length 32)129 string(RANDOM LENGTH ${status_placeholder_length} ALPHABET " " status_placeholder)130 string(LENGTH "${text}" status_text_length)131 if(status_text_length LESS status_placeholder_length)132 string(SUBSTRING "${text}${status_placeholder}" 0 ${status_placeholder_length} status_text)133 elseif(DEFINED status_then OR DEFINED status_else)134 pacpus_output_status("${text}")135 set(status_text "${status_placeholder}")136 else()137 set(status_text "${text}")138 endif()139 140 if(DEFINED status_then OR DEFINED status_else)141 if(${status_cond})142 string(REPLACE ";" " " status_then "${status_then}")143 string(REGEX REPLACE "^[ \t]+" "" status_then "${status_then}")144 pacpus_output_status("${status_text} ${status_then}")145 else()146 string(REPLACE ";" " " status_else "${status_else}")147 string(REGEX REPLACE "^[ \t]+" "" status_else "${status_else}")148 pacpus_output_status("${status_text} ${status_else}")149 endif()150 else()151 string(REPLACE ";" " " status_cond "${status_cond}")152 string(REGEX REPLACE "^[ \t]+" "" status_cond "${status_cond}")153 pacpus_output_status("${status_text} ${status_cond}")154 endif()155 else()156 pacpus_output_status("${text}")157 endif()158 158 endfunction() 159 159
Note:
See TracChangeset
for help on using the changeset viewer.