Skip to content
This repository has been archived by the owner on Feb 12, 2023. It is now read-only.

Commit

Permalink
fix: Using foreach to iterate through CFLAGS_OTHER
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
Diadlo committed Jun 11, 2017
1 parent d90a60b commit 9a0632b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion cmake/Dependencies.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand Down

0 comments on commit 9a0632b

Please sign in to comment.