|
|
|
|
@ -17,6 +17,10 @@
|
|
|
|
|
# misrepresented as being the original software. |
|
|
|
|
# 3. This notice may not be removed or altered from any source distribution. |
|
|
|
|
|
|
|
|
|
# Note: In CMake before 3.0 set(var "" PARENT_SCOPE) *unsets* the variable in the |
|
|
|
|
# parent scope instead of setting it to the empty string. |
|
|
|
|
# This means if(var STREQUAL "") will be false since var is not defined and thus not expanded. |
|
|
|
|
|
|
|
|
|
function(check_compile RESULT FILE FLAG TYPE) |
|
|
|
|
|
|
|
|
|
string(REGEX REPLACE "[^a-zA-Z0-9_][^a-zA-Z0-9_]*" "-" cachevar "${TYPE}-${FLAG}") |
|
|
|
|
@ -142,7 +146,7 @@ function(add_cxxflag FLAG)
|
|
|
|
|
|
|
|
|
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${RESULT}" PARENT_SCOPE) |
|
|
|
|
|
|
|
|
|
if(RESULT STREQUAL "") |
|
|
|
|
if(NOT DEFINED RESULT OR RESULT STREQUAL "") |
|
|
|
|
set(FLAG_FOUND 0 PARENT_SCOPE) |
|
|
|
|
else() |
|
|
|
|
set(FLAG_FOUND 1 PARENT_SCOPE) |
|
|
|
|
@ -158,7 +162,7 @@ function(add_ldflag FLAG)
|
|
|
|
|
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} ${RESULT}" PARENT_SCOPE) |
|
|
|
|
set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} ${RESULT}" PARENT_SCOPE) |
|
|
|
|
|
|
|
|
|
if(RESULT STREQUAL "") |
|
|
|
|
if(NOT DEFINED RESULT OR RESULT STREQUAL "") |
|
|
|
|
set(FLAG_FOUND 0 PARENT_SCOPE) |
|
|
|
|
else() |
|
|
|
|
set(FLAG_FOUND 1 PARENT_SCOPE) |
|
|
|
|
|