After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 776205 - gtk-doc doesn't work with cmake
gtk-doc doesn't work with cmake
Status: RESOLVED NOTGNOME
Product: gtk-doc
Classification: Platform
Component: general
1.25
Other Linux
: Normal normal
: ---
Assigned To: gtk-doc maintainers
gtk-doc maintainers
Depends on:
Blocks:
 
 
Reported: 2016-12-17 11:53 UTC by Fahad Al-Saidi
Modified: 2018-01-03 05:04 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Fahad Al-Saidi 2016-12-17 11:53:26 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
Comment 1 Stefan Sauer (gstreamer, gtkdoc dev) 2016-12-20 10:58:25 UTC
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.
Comment 2 Fahad Al-Saidi 2016-12-20 12:22:48 UTC
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.
Comment 3 Fahad Al-Saidi 2016-12-28 05:03:54 UTC
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
Comment 4 Stefan Sauer (gstreamer, gtkdoc dev) 2016-12-28 21:12:43 UTC
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).
Comment 5 Fahad Al-Saidi 2016-12-29 05:49:37 UTC
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
Comment 6 Stefan Sauer (gstreamer, gtkdoc dev) 2016-12-29 09:56:22 UTC
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.
Comment 7 Fahad Al-Saidi 2016-12-31 08:03:12 UTC
@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
Comment 8 Fahad Al-Saidi 2016-12-31 08:09:04 UTC
when I do message("exec_prefix:${exec_prefix}") I get empty space.
Comment 9 Stefan Sauer (gstreamer, gtkdoc dev) 2017-01-02 14:02:06 UTC
(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.
Comment 10 Fahad Al-Saidi 2017-01-03 03:36:15 UTC
(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
Comment 11 Bruce Mitchener 2018-01-03 05:04:12 UTC
I've submitted a fix for this issue in https://bugzilla.gnome.org/show_bug.cgi?id=792148