1
0
mirror of https://github.com/qTox/qTox.git synced 2024-03-22 14:00:36 +08:00

fix: Using foreach to iterate through CFLAGS_OTHER

PkgConfig use 'separate_arguments' for pkgconfig result, so output
converted to the list (in cmake it's semicolumnt separated values).
If we try to append CFLAGS_OTHER as is, it will provide error for
more then one cflag in '.pc' file

Fix #4175, fix #4457.
This commit is contained in:
Diadlo 2017-06-11 12:52:35 +03:00
parent d90a60bdf7
commit 9a0632b0cf
No known key found for this signature in database
GPG Key ID: 5AF9F2E29107C727

View File

@ -74,7 +74,9 @@ function(search_dependency pkg)
else()
link_directories(${${pkg}_LIBRARY_DIRS})
include_directories(${${pkg}_INCLUDE_DIRS})
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${${pkg}_CFLAGS_OTHER}" PARENT_SCOPE)
foreach(flag ${${pkg}_CFLAGS_OTHER})
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${flag}" PARENT_SCOPE)
endforeach()
set(ALL_LIBRARIES ${ALL_LIBRARIES} ${${pkg}_LIBRARIES} PARENT_SCOPE)
endif()