FindGTK2: Populate GTK2_DEFINITIONS before searching for libraries

This commit is contained in:
Daniele E. Domenichelli 2013-08-02 17:39:28 +02:00 committed by Brad King
parent 8d7b070410
commit fab6c2deb0
1 changed files with 14 additions and 14 deletions

View File

@ -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
#