From 8abadd86029fea4a040c34eca03379eac993dcca Mon Sep 17 00:00:00 2001 From: Allen Winter Date: Mon, 12 Nov 2018 16:52:37 -0500 Subject: .travis.yml, setup-travis.sh - setting up xml2 for Mac builds --- .travis.yml | 3 ++- scripts/setup-travis.sh | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 13092c62..3ac6f746 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,7 +1,8 @@ env: global: - secure: "NlWO/NTPlOU6cowOMuPOvjAprXVwIjmpHHf9CoMR71E2c/eBFFKIHj10kXuyFwz2KihHAIExmo9OlGtGniNWobvIrVrabO3dsOSb6UGbPAQkzQiyQLKsDNQAZx3nMuWEKBtMsVRee6rd7/2uGTY4WB5Ot3VhrUYcN1FoRgQQ9gk=" - - PKG_CONFIG_PATH=/usr/local/opt/libffi/lib/pkgconfig # needed to find homebrew's libffi on osx + - PKG_CONFIG_PATH=/usr/local/opt/libffi/lib/pkgconfig:/usr/local/opt/libxml2/lib/pkgconfig # needed to find homebrew's libxml2 an libffi on osx + - XML_CATALOG_FILES=/usr/local/etc/xml/catalog # homebrew installed libxml2 catalog os: diff --git a/scripts/setup-travis.sh b/scripts/setup-travis.sh index 36705b78..e74e1937 100755 --- a/scripts/setup-travis.sh +++ b/scripts/setup-travis.sh @@ -4,6 +4,7 @@ if ( test "`uname -s`" = "Darwin" ) then + brew install libxml2 brew install icu4c brew install db brew install gobject-introspection -- cgit v1.2.1 From be44c3250d72d40a1e7c75a29ef1dc7fdc5f7a72 Mon Sep 17 00:00:00 2001 From: Allen Winter Date: Mon, 12 Nov 2018 16:53:38 -0500 Subject: scripts/buildtests.sh - add more settings for the Mac --- scripts/buildtests.sh | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/scripts/buildtests.sh b/scripts/buildtests.sh index b05b3922..668c6918 100755 --- a/scripts/buildtests.sh +++ b/scripts/buildtests.sh @@ -10,8 +10,13 @@ set -o pipefail #ensure parallel builds export MAKEFLAGS=-j8 -#needed to find homebrew's libffi on osx -export PKG_CONFIG_PATH=/usr/local/opt/libffi/lib/pkgconfig +if (test "`uname -s`" = "Darwin") +then + #needed to find homebrew's libxml2 and libffi on osx + export PKG_CONFIG_PATH=/usr/local/opt/libffi/lib/pkgconfig:/usr/local/opt/libxml2/lib/pkgconfig + #needed to find the homebrew installed xml2 catalog + export XML_CATALOG_FILES=/usr/local/etc/xml/catalog +fi ##### START FUNCTIONS ##### -- cgit v1.2.1 From 2c343926f73d8327ad159a70d15134aed60d54da Mon Sep 17 00:00:00 2001 From: Allen Winter Date: Mon, 12 Nov 2018 17:40:51 -0500 Subject: cmake/modules/GtkDoc.cmake, Install.txt - fixes --- Install.txt | 14 ++++++++++++++ cmake/modules/GtkDoc.cmake | 11 ++++++----- 2 files changed, 20 insertions(+), 5 deletions(-) diff --git a/Install.txt b/Install.txt index 9df6cf3e..62c1d5bb 100644 --- a/Install.txt +++ b/Install.txt @@ -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. diff --git a/cmake/modules/GtkDoc.cmake b/cmake/modules/GtkDoc.cmake index c480b86f..dbeedade 100644 --- a/cmake/modules/GtkDoc.cmake +++ b/cmake/modules/GtkDoc.cmake @@ -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) @@ -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}) @@ -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} -- cgit v1.2.1