From fab6c2deb0ced0d4a0623fe2dfd56c0b235a5ca1 Mon Sep 17 00:00:00 2001 From: "Daniele E. Domenichelli" Date: Fri, 2 Aug 2013 17:39:28 +0200 Subject: [PATCH] FindGTK2: Populate GTK2_DEFINITIONS before searching for libraries --- Modules/FindGTK2.cmake | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/Modules/FindGTK2.cmake b/Modules/FindGTK2.cmake index 669d5d284..22b470738 100644 --- a/Modules/FindGTK2.cmake +++ b/Modules/FindGTK2.cmake @@ -449,6 +449,20 @@ if(GTK2_FIND_VERSION) endif() endif() +# +# On MSVC, according to https://wiki.gnome.org/gtkmm/MSWindows, the /vd2 flag needs to be +# passed to the compiler in order to use gtkmm +# +if(MSVC) + foreach(_GTK2_component ${GTK2_FIND_COMPONENTS}) + if(_GTK2_component STREQUAL "gtkmm") + set(GTK2_DEFINITIONS "/vd2") + elseif(_GTK2_component STREQUAL "glademm") + set(GTK2_DEFINITIONS "/vd2") + endif() + endforeach() +endif() + # # Find all components # @@ -565,20 +579,6 @@ if(NOT GTK2_FIND_VERSION AND GTK2_GTK_INCLUDE_DIR) set(GTK2_VERSION ${GTK2_MAJOR_VERSION}.${GTK2_MINOR_VERSION}.${GTK2_PATCH_VERSION}) endif() -# -# On MSVC, according to https://wiki.gnome.org/gtkmm/MSWindows, the /vd2 flag needs to be -# passed to the compiler in order to use gtkmm -# -if(MSVC) - foreach(_GTK2_component ${GTK2_FIND_COMPONENTS}) - if(_GTK2_component STREQUAL "gtkmm") - set(GTK2_DEFINITIONS "/vd2") - elseif(_GTK2_component STREQUAL "glademm") - set(GTK2_DEFINITIONS "/vd2") - endif() - endforeach() -endif() - # # Try to enforce components #