Gtk on windows cmake file

已回答

I don't know what to put on the cmake file, i've been installing gtk with vcpkg for the past 5h (left it run overnight but i closed my laptop's screen so i doubt it did anything) but in the meanwhile, i would like to know what i will have to put in my config file. Thanks in advance (if anyone do answer)!

0

Hello!

If you installed gtk using vcpkg, you need to go to File | Settings | Build, Execution, Deployment | CMake and add -DCMAKE_TOOLCHAIN_FILE=<path_to_vcpkg>/scripts/buildsystems/vcpkg.cmake to CMake options.

After that you need to add to your CMakeLists.txt something similar to:

find_package(GTK3) 
include_directories(${GTK3_INCLUDE_DIRS})
target_link_libraries (<name_of_your_target> ${GTK3_LIBRARIES})

where <name_of_your_target> is the name of your target. Please use the gtk version you installed (GTK2, or GTK3, or etc.).

0

请先登录再写评论。