Skip to content

Forcing option GTK3 induces an error as findGTK3.cmake is not in path (OpenSUSE) #9

@dominig

Description

@dominig

@Rasbats
@jongough

When force the selection of GTK3 (as auto selection still complains of missing gtk2) by the option in make cmake command and fails to complete the configuration.

BUILD_GTK3="true";\
cmake -DCMAKE_SKIP_RPATH=ON \
      -DOCPN_FORCE_GTK3=ON  \
      -DCMAKE_INSTALL_PREFIX=%{_prefix} \
      -DCFLAGS="-O2 -march=native" \
      ../
make

I still get an configuration error (see details bellow).
The following patch corrects the GTK3 issue.

diff --git a/cmake/PluginConfigure.cmake b/cmake/PluginConfigure.cmake
index 069bfd7..03e1fe6 100644
--- a/cmake/PluginConfigure.cmake
+++ b/cmake/PluginConfigure.cmake
@@ -393,7 +393,8 @@ if(NOT WIN32
         set(GTK_LIBRARIES ${GTK2_LIBRARIES})
         message(STATUS "${CMLOC}Building against GTK2...")
     else(GTK2_FOUND)
-        find_package(GTK3)
+       find_package(PkgConfig)
+        pkg_check_modules(GTK3 gtk+-3.0)
         include_directories(${GTK3_INCLUDE_DIRS})
         set(GTK_LIBRARIES ${GTK3_LIBRARIES})
         set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D__WXGTK3__")

---------- configuration error log extract without the patch----------------

[    5s] CMake Warning at cmake/PluginConfigure.cmake:396 (find_package):
[    5s]   By not providing "FindGTK3.cmake" in CMAKE_MODULE_PATH this project has
[    5s]   asked CMake to find a package configuration file provided by "GTK3", but
[    5s]   CMake did not find one.
[    5s] 
[    5s]   Could not find a package configuration file provided by "GTK3" with any of
[    5s]   the following names:
[    5s] 
[    5s]     GTK3Config.cmake
[    5s]     gtk3-config.cmake
[    5s] 
[    5s]   Add the installation prefix of "GTK3" to CMAKE_PREFIX_PATH or set
[    5s]   "GTK3_DIR" to a directory containing one of the above files.  If "GTK3"
[    5s]   provides a separate development package or SDK, be sure it has been
[    5s]   installed.
[    5s] Call Stack (most recent call first):
[    5s]   CMakeLists.txt:123 (include)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions