My CMake knowledge is somewhat dated, and I try to distance myself from Windows because I find it unpleasant, but this is what FindGTK.cmake
should be for.
According to this post on the CMake mailing list you should:
FIND_PACKAGE(GTK)
IF(GTK_FOUND)
INCLUDE_DIRECTORIES(${GTK_INCLUDE_DIR})
ADD_EXECUTABLE(my_gtk_exe my_gtk_exe.cxx)
TARGET_LINK_LIBRARIES(my_gtk_exe ${GTK_LIBRARIES})
ENDIF(GTK_FOUND)
Update: It might be that the FindGTK.cmake
is indeed too old and refers to GTK1, you might want to try FindGTK2.cmake
instead. If it isn't part of your CMake version you can try and get it from here.
Update2: Indeed the the FindGTK2 link above is no good for you. All it's logic is enclosed with:
if(UNIX)
...
endif(UNIX)
Update3: Again a quote from the mailing list:
...
One prime example of such spread to windows is libGTK+ and friends (as one
other has mentioned in this thread). Some of the PLplot drivers depend on
parts of the GTK+ stack of libraries. I quote from one of our developers
(Werner Smekal) who recently reported to the PLplot devel list about how
simple it is to get those drivers to work on windows:
Cairo driver in Windows or using gtk+ for plplot on Windows
1) Download the all-in-one bundle of the GTK+ stack including 3rd-party dependencies for windows:
http://ftp.gnome.org/pub/gnome/binaries/win32/gtk+/2.12/gtk+-bundle-2.12.9.zip
available from http://www.gtk.org/download-windows.html.
2) Expand the package to a directory, e.g. C:\Development\gtk
3) Set environment variables so that CMake can find pkf-config
set PKG_CONFIG_PATH=C:\Development\gtk\lib\pkgconfig
set PATH=C:\Development\gtk\bin;%PATH%
4) CMake will find pkg-config and all the libraries necessary to build the
pdfcairo, pscairo, pngcairo and svgcairo devices. xcairo will not be built
since the X-Headers are not present.
So it seem you are missing the:
set PKG_CONFIG_PATH=C:\path\to\gtk\lib\pkgconfig
set PATH=C:\path\to\gtk\bin;%PATH%