2.0.4
This commit is contained in:
34
MyxCMake/lib/macro/CheckEnableCxxCompilerFlag.cmake
Normal file
34
MyxCMake/lib/macro/CheckEnableCxxCompilerFlag.cmake
Normal file
@@ -0,0 +1,34 @@
|
||||
include_guard(GLOBAL)
|
||||
|
||||
# based on https://github.com/bluescarni/yacma
|
||||
|
||||
include(CheckCXXCompilerFlag)
|
||||
|
||||
macro(check_enable_cxx_compiler_flag flag)
|
||||
set(options)
|
||||
set(oneValueArgs TARGET)
|
||||
set(multiValueArgs)
|
||||
cmake_parse_arguments(ARG "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})
|
||||
|
||||
set(cmake_required_quiet TRUE)
|
||||
check_cxx_compiler_flag("${flag}" check_cxx_flag)
|
||||
unset(cmake_required_quiet)
|
||||
|
||||
if(check_cxx_flag)
|
||||
if(ARG_TARGET)
|
||||
target_compile_options(${ARG_TARGET} PUBLIC ${flag})
|
||||
else()
|
||||
add_compile_options(${flag})
|
||||
endif()
|
||||
endif()
|
||||
|
||||
unset(check_cxx_flag CACHE)
|
||||
foreach(iter IN LISTS oneValueArgs multiValueArgs)
|
||||
unset(ARG_${iter})
|
||||
endforeach()
|
||||
unset(ARG_UNPARSED_ARGUMENTS)
|
||||
unset(multiValueArgs)
|
||||
unset(oneValueArgs)
|
||||
unset(options)
|
||||
endmacro()
|
||||
|
@@ -4,7 +4,6 @@ macro(myx_find_packages)
|
||||
set(options)
|
||||
set(oneValueArgs)
|
||||
set(multiValueArgs PACKAGES Boost Qt5 Qt5Private)
|
||||
|
||||
cmake_parse_arguments(ARG "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})
|
||||
|
||||
foreach(iter ${ARG_PACKAGES})
|
||||
|
Reference in New Issue
Block a user