#
IF("${CMAKE_THREAD_LIBS_INIT}" MATCHES "-lpthread")
CHECK_CXX_COMPILER_FLAG("-pthread"
- DEAL_II_HAVE_FLAG_-pthread
+ DEAL_II_HAVE_FLAG_pthread
)
- IF(DEAL_II_HAVE_FLAG_-pthread)
+ IF(DEAL_II_HAVE_FLAG_pthread)
STRING(REPLACE "-lpthread" "-pthread" CMAKE_THREAD_LIBS_INIT
"${CMAKE_THREAD_LIBS_INIT}"
)
#
MACRO(ENABLE_IF_LINKS _variable _flag)
+ STRING(REGEX REPLACE "^-" "" _flag_name "${_flag}")
+
ADD_FLAGS(CMAKE_REQUIRED_FLAGS "${_flag}")
CHECK_CXX_SOURCE_COMPILES(
"
int main() { return 0; }
"
- DEAL_II_HAVE_FLAG_${_flag}
+ DEAL_II_HAVE_FLAG_${_flag_name}
)
STRIP_FLAG(CMAKE_REQUIRED_FLAGS "${_flag}")
- IF(DEAL_II_HAVE_FLAG_${_flag})
+ IF(DEAL_II_HAVE_FLAG_${_flag_name})
SET(${_variable} "${${_variable}} ${_flag}")
ENDIF()
ENDMACRO()
#
# If -ggdb is not available, fall back to -g:
#
- IF(NOT DEAL_II_HAVE_FLAG_-ggdb)
+ IF(NOT DEAL_II_HAVE_FLAG_ggdb)
ENABLE_IF_SUPPORTED(DEAL_II_CXX_FLAGS_DEBUG "-g")
ENABLE_IF_SUPPORTED(DEAL_II_SHARED_LINKER_FLAGS_DEBUG "-g")
ENDIF()
In the beginning the Universe was created. This has made a lot of
people very angry and has been widely regarded as a bad move.
Douglas Adams