[CMake] using gtk2 and gtk3 for different modules

Markus Lausser sgopxx at gmail.com
Thu May 29 07:40:47 EDT 2014


Hello,

I am trying to use both gtk2 and gtk3 in one project.
The structure of the project (with gtk2 only) is like this:

core
   core gtk2 UI

Now I tried to add a new user interface based on gtk3.

core
   core gtk2 UI
   core gtk3 UI

The file "CMakeLists.txt" of "core gtk3 UI" looks basically like this:

    find_package(PkgConfig REQUIRED)
    pkg_check_modules(GTK3 REQUIRED gtk+-3.0)

    file(GLOB gtk3_ui_source_files *.c)
    add_library(gtk3_core SHARED ${gtk3_ui_source_files})
    target_link_libraries(gtk3_core ${GTK3_LIBRARIES})

My Problem is, that cmake tries to include gtk3 headers in my gtk2 
modules. And gtk2 does not compile anymore.
Why?



Markus

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20140529/c9ffb2a8/attachment.html>


More information about the CMake mailing list