From 6bb595f84295291fb6e2574dff64ea7c4c446130 Mon Sep 17 00:00:00 2001 From: Nicolas Hake Date: Sun, 20 Jan 2013 21:53:56 +0100 Subject: [PATCH] CMake: Use GTK+ cflags as reported by pkg-config Ignoring CFLAGS/LDFLAGS makes GTK+ not work correctly if the libraries are compiled with -mms-bitfields (as is the case with the prebuilt binaries from gnome.org). --- CMakeLists.txt | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 94fc20faa..02ec14e61 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -40,6 +40,13 @@ separate_arguments(OC_EXE_LINKER_FLAGS) set(OC_EXE_LINKER_FLAGS_DEBUG ${CMAKE_EXE_LINKER_FLAGS_DEBUG}) separate_arguments(OC_EXE_LINKER_FLAGS_DEBUG) +function(unseparate_arguments _var _list) + foreach(_arg ${_list}) + set(_string "${_string} ${_arg}") + endforeach() + set(${_var} "${_string}" PARENT_SCOPE) +endfunction() + ############################################################################ # User selectable options ############################################################################ @@ -1082,6 +1089,10 @@ add_executable(clonk WIN32 MACOSX_BUNDLE if(MAPE_GTK_FOUND) add_executable(mape ${MAPE_BASE_SOURCES} ${MAPE_SOURCES}) + unseparate_arguments(MAPE_GTK_CFLAGS "${MAPE_GTK_CFLAGS}") + set_property(TARGET mape APPEND_STRING PROPERTY COMPILE_FLAGS ${MAPE_GTK_CFLAGS}) + unseparate_arguments(MAPE_GTK_LDFLAGS "${MAPE_GTK_LDFLAGS}") + set_property(TARGET mape APPEND_STRING PROPERTY LINK_FLAGS ${MAPE_GTK_LDFLAGS}) endif() add_executable(c4group