GNOME Bugzilla – Bug 776205
gtk-doc doesn't work with cmake
Last modified: 2018-01-03 05:04:12 UTC
I am trying to use gtk-doc with cmake but things doesn't work together. Details: I am trying to use gtk-docs with cmake for a project contains only one source file & one header. My CMakeLists here: https://github.com/Fahad-Alsaidi/libraqm/blob/cmake/CMakeLists.txt my implementiation for gtk-doc here: gtk_doc_add_module(raqm SOURCE ${CMAKE_SOURCE_DIR}/src ${CMAKE_BINARY_DIR}/src XML ${CMAKE_SOURCE_DIR}/docs/raqm-docs.xml LIBRARIES raqm ) I got this error [ 14%] Built target raqm Scanning dependencies of target doc-raqm [ 28%] Generating raqm/html_dir.stamp, raqm/html [ 42%] Generating raqm/dir.stamp, raqm [ 57%] Generating raqm/raqm-decl-list.txt, raqm/raqm-decl.txt, raqm/raqm-overrides.txt, raqm/raqm-sections.txt, raqm/raqm.types /bin/sh: 1: ................................/bin/gtkdoc-scan: not found make[3]: *** [raqm/raqm-decl-list.txt] Error 127 make[2]: *** [CMakeFiles/doc-raqm.dir/all] Error 2 make[1]: *** [CMakeFiles/doc-raqm.dir/rule] Error 2 make: *** [doc-raqm] Error 2
I am sorry, but I can't debug foreign build systems. There seems to be some clear error: /bin/gtkdoc-scan: not found So I would check where gtk-doc is installed: which gtkdoc-scan and then fix your build rules.
actually I am using ubuntu 14.04 and I install gtk-doc from source code.when I type gtkdoc-scan form shell it works fine.
well, Now I am using docker & ubuntu 16.04 and I got the same error, here is: Scanning dependencies of target doc-raqm [ 30%] Generating raqm/html_dir.stamp, raqm/html [ 40%] Generating raqm/dir.stamp, raqm [ 50%] Generating raqm/raqm-decl-list.txt, raqm/raqm-decl.txt, raqm/raqm-overrides.txt, raqm/raqm-sections.txt, raqm/raqm.types /bin/sh: 1: /bin/gtkdoc-scan: not found make[2]: *** [raqm/raqm-decl-list.txt] Error 127 CMakeFiles/doc-raqm.dir/build.make:92: recipe for target 'raqm/raqm-decl-list.txt' failed CMakeFiles/Makefile2:104: recipe for target 'CMakeFiles/doc-raqm.dir/all' failed make[1]: *** [CMakeFiles/doc-raqm.dir/all] Error 2 BTW, I test it with Fedora 25 and works fine but I need to get work under ubuntu for travis-ci.com
I really can't help much with cmake. When looking at https://github.com/Fahad-Alsaidi/libraqm/blob/cmake/CMakeLists.txt#L250 I have a hunch that find_package(GtkDoc 1.25 REQUIRED) does not do what it should. You'll need to debug this. What I'd do is to 1.) run e.g.: 'which gtkdoc-scan' - this will print the full path of where it is installed. 2.) add more message() lines to you CMakeLists.txt to print the content of e.g. GTKDOC_SCAN_EXE (see https://github.com/GNOME/gtk-doc/blob/master/cmake/GtkDocConfig.cmake.in for all vars).
In Ubuntu I find a workaround which just link all gtkdoc-* to /bin ln -s /usr/bin/gtkdoc-scan /bin/ ln -s /usr/bin/gtkdoc-fixxref /bin/ ln -s /usr/bin/gtkdoc-scangobj /bin/ ln -s /usr/bin/gtkdoc-mkhtml /bin/ ln -s /usr/bin/gtkdoc-mkdb /bin/ Unfortunately,this workaround doesn't work with travis-ci.com and OSX & homebrew. When I run 'which gtkdoc-scan' on OSX I get: /usr/local/bin/gtkdoc-scan
He, I am trying to help, even though bugzilla is not meant as a help forum (the irc channel #gtkdoc on gimpnet would be more appropriate). But then please provide the info I asked for. The symlinking is *obviously* not the right solution. gtkdoc binaries don't belong to /bin and if cmake's gtkdoc detection is broken, you need to debug why cmake believes that gtkdoc binaries are in /bin even if they aren't.
@Stefan I tried to be on gimpnet & #gtkdoc many times but no body there answer my questions. However, Here is the info: GTKDOC_SCAN_EXE:/bin/gtkdoc-scan GTKDOC_SCANGOBJ_EXE:/bin/gtkdoc-scangobj GTKDOC_MKDB_EXE:/bin/gtkdoc-mkdb GTKDOC_MKHTML_EXE:/bin/gtkdoc-mkhtml GTKDOC_FIXXREF_EXE:/bin/gtkdoc-fixxref >>which gtkdoc-scan >>/usr/local/bin/gtkdoc-scan >> cat gtk-doc.pc prefix=/usr/local exec_prefix=${prefix} data_dir=${prefix}/share/gtk-doc/data Name: gtk-doc Description: API documentation generator Version: 1.25
when I do message("exec_prefix:${exec_prefix}") I get empty space.
(In reply to Fahad Al-Saidi from comment #7) > @Stefan > > I tried to be on gimpnet & #gtkdoc many times but no body there answer my > questions. However, Here is the info: > GTKDOC_SCAN_EXE:/bin/gtkdoc-scan > GTKDOC_SCANGOBJ_EXE:/bin/gtkdoc-scangobj > GTKDOC_MKDB_EXE:/bin/gtkdoc-mkdb > GTKDOC_MKHTML_EXE:/bin/gtkdoc-mkhtml > GTKDOC_FIXXREF_EXE:/bin/gtkdoc-fixxref This is definitely wrong. So you need to figure out how the cmake comes up with those. Please try to find a cmake forum for this. > > >>which gtkdoc-scan > >>/usr/local/bin/gtkdoc-scan > > >> cat gtk-doc.pc > prefix=/usr/local > exec_prefix=${prefix} > data_dir=${prefix}/share/gtk-doc/data > > Name: gtk-doc > Description: API documentation generator > Version: 1.25 This means you installed gtk-doc manually (prefix=/usr/local). Is there no package provided by your distribution? A distro-package would normally place it in prefix=/usr. You can achieve the same using --prefix=/usr. In any case double check that cmake is looking for dependencies in /usr/local.
(In reply to Stefan Sauer (gstreamer, gtkdoc dev) from comment #9) > This means you installed gtk-doc manually (prefix=/usr/local). Is there no > package provided by your distribution? A distro-package would normally place > it in prefix=/usr. You can achieve the same using --prefix=/usr. In any case > double check that cmake is looking for dependencies in /usr/local. Well, I am using Ubuntu 14.04 as travic.org does, AFAIK, no package for gtkdoc 1.25. However, Ubuntu 16.04 does have a package for gtkdoc1.25 but the problem there, please see https://bugs.launchpad.net/ubuntu/+source/gtk-doc/+bug/1652880
I've submitted a fix for this issue in https://bugzilla.gnome.org/show_bug.cgi?id=792148