Skip to content

Commit

Permalink
cmake/modules/GtkDoc.cmake, Install.txt - fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
winterz committed Nov 12, 2018
1 parent be44c32 commit 2c34392
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 5 deletions.
14 changes: 14 additions & 0 deletions Install.txt
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,20 @@ For example, say you want to use Clang to build on Linux.
Then you can set the C and C++ compilers at CMake time, like so:
% CC=clang CXX=clang++ cmake ..

== Building for OSX (Mac) ==
Homebrew:
A couple of necessary dependencies do not have their headers
and development libraries linked into /usr/local/{include,lib} due
to possible contamination with the operating system versions of the
same name. This is known to be the case with libffi and libxml2
Fix is to export PKG_CONFIG_PATH so CMake can find them, as in:
export PKG_CONFIG_PATH=/usr/local/opt/libffi/lib/pkgconfig:\
/usr/local/opt/libxml2/lib/pkgconfig

Also, if building the gtkdocs you'll need to say where the xml
catalog files can be found so the gtk entities are located, like so:
export XML_CATALOG_FILES=/usr/local/etc/xml/catalog

== Optional Dependencies ==
* libicu "International Components for Unicode" development libraries.
Highly recommended for RSCALE support.
Expand Down
11 changes: 6 additions & 5 deletions cmake/modules/GtkDoc.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,10 @@ macro(add_gtkdoc _module _namespace _deprecated_guards _srcdirsvar _depsvar _ign
list(APPEND _filedeps ${_files})
endforeach()

set(_mkhtml_prefix "")
if(APPLE)
set(_mkhtml_prefix "${CMAKE_COMMAND} -E env XML_CATALOG_FILES=\"/usr/local/etc/xml/catalog\"")
if(NOT DEFINED ENV{XML_CATALOG_FILES})
message(FATAL_ERROR "On OSX, please run \'export XML_CATALOG_FILES=/usr/local/etc/xml/catalog\' first; else the gtk entities cannot be located.")
endif()
endif()

set(_scangobj_deps)
Expand All @@ -70,8 +71,8 @@ macro(add_gtkdoc _module _namespace _deprecated_guards _srcdirsvar _depsvar _ign
set(_scangobj_ldflags "")
set(_scangobj_ld_lib_dirs "")

list(APPEND _scangobj_cflags_list -I${INCLUDE_INSTALL_DIR})
list(APPEND _scangobj_ldflags -L${LIB_INSTALL_DIR})
list(APPEND _scangobj_cflags_list -I${CMAKE_INSTALL_PREFIX}/${INCLUDE_INSTALL_DIR})
list(APPEND _scangobj_ldflags -L${CMAKE_INSTALL_PREFIX}/${LIB_INSTALL_DIR})

foreach(opt IN LISTS ${_depsvar})
if(TARGET ${opt})
Expand Down Expand Up @@ -164,7 +165,7 @@ macro(add_gtkdoc _module _namespace _deprecated_guards _srcdirsvar _depsvar _ign

COMMAND ${CMAKE_COMMAND} -E make_directory "${CMAKE_CURRENT_BINARY_DIR}/html"

COMMAND ${CMAKE_COMMAND} -E chdir "${CMAKE_CURRENT_BINARY_DIR}/html" ${_mkhtml_prefix} ${GTKDOC_MKHTML} --path=.. ${_module} ../${_module}-docs.sgml
COMMAND ${CMAKE_COMMAND} -E chdir "${CMAKE_CURRENT_BINARY_DIR}/html" ${GTKDOC_MKHTML} --path=.. ${_module} ../${_module}-docs.sgml

COMMAND ${GTKDOC_FIXXREF}
--module=${_module}
Expand Down

0 comments on commit 2c34392

Please sign in to comment.