How to use gtk with cmake under Windows platform?

This FindGTK.cmake

:

# don't even bother under WIN32
IF(UNIX)


...


ENDIF(UNIX)

      

Therefore it is not designed to work on windows at all, although I already installed it gtk+-bundle_2.20.0-20100406_win32

days ago.

How to use it correctly gtk

with cmake

now?

+2


a source to share


1 answer


Considering you are using GTK 2.20.0 (i.e. version> = 2), you should use GTK2 instead of GTK. But if FindGTK2 has the same problem, you can use find_path to find the header files and you can use find_library to find the associated library files. By combining them, you can create the GTK2_FOUND, GTK2_LIBRARIES and GTK2_INCLUDE_DIRS symbols that it should produce. You can find my FindUnitTestPlusPlus.cmakethe file is a little useful; it uses "FindPackageHandleStandardArgs" which takes care of the verbose details that you won't fail if the library isn't listed there and the REQUIRED flag is specified. Unfortunately, there really isn't a lot of documentation on creating custom FindXYZ.cmake modules; however, I think you should be able to hack something along with the existing modules.



Another option is to contact the developer of that particular module. A list of CMake module lookup helpers can be found here. Philip Lowman is a popular guy for the FindGTK2 module.

+1


a source







All Articles