[HarfBuzz] harfbuzz: Branch 'master' - 3 commits

Behdad Esfahbod behdad at kemper.freedesktop.org
Tue Jan 2 15:22:53 UTC 2018


 .circleci/config.yml             |    2 
 CMakeLists.txt                   |  223 ++++++++++++++++++++-------------------
 appveyor.yml                     |    8 -
 test/CMakeLists.txt              |    2 
 test/api/CMakeLists.txt          |   48 +++-----
 test/fuzzing/CMakeLists.txt      |    9 +
 test/fuzzing/Makefile.am         |   23 +++-
 test/fuzzing/run-fuzzer-tests.py |   34 +++++
 test/shaping/CMakeLists.txt      |   10 +
 test/shaping/Makefile.am         |    3 
 test/shaping/run-tests.py        |   13 +-
 11 files changed, 228 insertions(+), 147 deletions(-)

New commits:
commit 4e3cf91af29ff654eca91e43c0af1c1a7171b9fa
Author: Ebrahim Byagowi <ebrahim at gnu.org>
Date:   Mon Jan 1 11:17:51 2018 +0330

    [cmake] Run rest of the tests on Windows (#668)

diff --git a/appveyor.yml b/appveyor.yml
index faa04d0c..7350b135 100644
--- a/appveyor.yml
+++ b/appveyor.yml
@@ -32,16 +32,16 @@ install:
   - C:\msys64\usr\bin\bash -lc "pacman --noconfirm -S mingw-w64-x86_64-ragel"
 
 build_script:
-  - 'if "%compiler%"=="msvc" if not "%platform%"=="ARM" vcpkg install glib:%triplet% freetype:%triplet%'
+  - 'if "%compiler%"=="msvc" if not "%platform%"=="ARM" vcpkg install glib:%triplet% freetype:%triplet% cairo:%triplet%'
   - 'if "%compiler%"=="msvc" md build'
   - 'if "%compiler%"=="msvc" cd build'
   - 'if "%compiler%"=="msvc" set PATH=%PATH%;C:\Program Files (x86)\MSBuild\14.0\Bin;c:\msys64\mingw64\bin' # msys2 is added just for having "ragel" on PATH
 
   - 'if "%compiler%"=="msvc" if "%platform%"=="ARM" cmake -DHB_HAVE_UNISCRIBE=ON -DHB_HAVE_DIRECTWRITE=ON -G "%generator%" ../'
-  - 'if "%compiler%"=="msvc" if not "%platform%"=="ARM" cmake -DHB_HAVE_UNISCRIBE=ON -DHB_HAVE_DIRECTWRITE=ON -DHB_HAVE_GLIB=ON -DHB_HAVE_FREETYPE=ON -G "%generator%" -DCMAKE_TOOLCHAIN_FILE=c:/tools/vcpkg/scripts/buildsystems/vcpkg.cmake ../'
+  - 'if "%compiler%"=="msvc" if not "%platform%"=="ARM" cmake -DHB_HAVE_UNISCRIBE=ON -DHB_HAVE_DIRECTWRITE=ON -DHB_HAVE_GLIB=ON -DHB_HAVE_FREETYPE=ON -DHB_BUILD_UTILS=ON -G "%generator%" -DCMAKE_TOOLCHAIN_FILE=c:/tools/vcpkg/scripts/buildsystems/vcpkg.cmake ../'
 
   - 'if "%compiler%"=="msvc" msbuild harfbuzz.sln /p:Configuration=%configuration% /p:Platform=%platform%'
-  - 'if "%compiler%"=="msvc" if not "%platform%"=="ARM" ctest --output-on-failure'
+  - 'if "%compiler%"=="msvc" if not "%platform%"=="ARM" ctest --output-on-failure -C %configuration%'
 
   - 'if "%compiler%"=="msys2" C:\msys64\usr\bin\bash -lc "pacman --noconfirm -S mingw-w64-$MSYS2_ARCH-{freetype,cairo,icu,gettext,gobject-introspection,gcc,gcc-libs,glib2,graphite2,pkg-config,python2}"'
   - 'if "%compiler%"=="msys2" C:\msys64\usr\bin\bash -lc "cd $APPVEYOR_BUILD_FOLDER; PATH=$PATH:/mingw64/bin:/mingw32/bin; ./autogen.sh --with-uniscribe --with-freetype --with-glib --with-gobject --with-cairo --with-icu --with-graphite2 --build=%MINGW_CHOST% --host=%MINGW_CHOST% --prefix=%MINGW_PREFIX%; make; make check || (cat */test-suite.log test/*/test-suite.log && false)"'
diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt
index 2bebd07f..2c97f4f8 100644
--- a/test/CMakeLists.txt
+++ b/test/CMakeLists.txt
@@ -1,6 +1,3 @@
 add_subdirectory(api)
 add_subdirectory(shaping)
-# Not ready yet
-if (NOT MSVC)
-  add_subdirectory(fuzzing)
-endif ()
+add_subdirectory(fuzzing)
diff --git a/test/fuzzing/CMakeLists.txt b/test/fuzzing/CMakeLists.txt
index 48432296..06355991 100644
--- a/test/fuzzing/CMakeLists.txt
+++ b/test/fuzzing/CMakeLists.txt
@@ -1,9 +1,9 @@
 if (HB_HAVE_GLIB)
-  add_executable (hb-fuzzer hb-fuzzer.cc hb-fuzzer.hh main.cc)
+  file (READ "${CMAKE_CURRENT_SOURCE_DIR}/Makefile.am" MAKEFILEAM)
+  extract_make_variable (hb_fuzzer_SOURCES ${MAKEFILEAM})
+  add_executable (hb-fuzzer ${hb_fuzzer_SOURCES})
   target_link_libraries (hb-fuzzer harfbuzz)
-  add_test (hb-fuzzer python run-fuzzer-tests.py)
-  set_tests_properties (hb-fuzzer PROPERTIES
-    WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
-    ENVIRONMENT "top_builddir=${PROJECT_BINARY_DIR};testdir=test;fuzzingdir=fuzzing"
-  )
+  add_test (NAME hb-fuzzer
+    COMMAND python run-fuzzer-tests.py $<TARGET_FILE:hb-fuzzer>
+    WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
 endif ()
diff --git a/test/fuzzing/Makefile.am b/test/fuzzing/Makefile.am
index 2c0eb908..6120afce 100644
--- a/test/fuzzing/Makefile.am
+++ b/test/fuzzing/Makefile.am
@@ -63,9 +63,6 @@ TESTS_ENVIRONMENT = \
 endif
 
 check:
-	cat $(srcdir)/../shaping/tests/fuzzed.tests | \
-	cut -d: -f1 | while read x; do \
-		./hb-fuzzer $(srcdir)/../shaping/$$x; \
-	done
+	$(srcdir)/run-fuzzer-tests.py
 
 -include $(top_srcdir)/git.mk
diff --git a/test/fuzzing/run-fuzzer-tests.py b/test/fuzzing/run-fuzzer-tests.py
index 3fc78837..aa615af7 100755
--- a/test/fuzzing/run-fuzzer-tests.py
+++ b/test/fuzzing/run-fuzzer-tests.py
@@ -6,9 +6,15 @@ import sys, os, subprocess
 srcdir = os.environ.get ("srcdir", ".")
 EXEEXT = os.environ.get ("EXEEXT", "")
 top_builddir = os.environ.get ("top_builddir", ".")
-testdir = os.environ.get ("testdir", ".")
-fuzzingdir = os.environ.get ("fuzzingdir", ".")
-hb_fuzzer = os.path.join (top_builddir, testdir, fuzzingdir, "hb-fuzzer" + EXEEXT)
+hb_fuzzer = os.path.join (top_builddir, "hb-fuzzer" + EXEEXT)
+
+if hb_fuzzer == ".\\hb-fuzzer":
+	hb_fuzzer = "./hb-fuzzer.exe"
+
+if not os.path.exists (hb_fuzzer):
+	hb_fuzzer = sys.argv[1]
+
+print ('hb_fuzzer:', hb_fuzzer)
 fails = 0
 
 for line in open (os.path.join (srcdir, "..", "shaping", "tests", "fuzzed.tests")):
diff --git a/test/shaping/CMakeLists.txt b/test/shaping/CMakeLists.txt
index 5310a2c2..e186858b 100644
--- a/test/shaping/CMakeLists.txt
+++ b/test/shaping/CMakeLists.txt
@@ -1,11 +1,10 @@
 if (HB_BUILD_UTILS)
   file (READ "${CMAKE_CURRENT_SOURCE_DIR}/Makefile.am" MAKEFILEAM)
   extract_make_variable (TESTS ${MAKEFILEAM})
+
   foreach (test IN ITEMS ${TESTS})
-    add_test (${test} python run-tests.py "${test}")
-    set_tests_properties (${test} PROPERTIES
-      WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
-      ENVIRONMENT "top_builddir=${PROJECT_BINARY_DIR};utildir=."
-    )
+    add_test (NAME ${test}
+      COMMAND python run-tests.py $<TARGET_FILE:hb-shape> "${test}"
+      WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
   endforeach ()
 endif ()
diff --git a/test/shaping/run-tests.py b/test/shaping/run-tests.py
index 09c2f685..342c006e 100755
--- a/test/shaping/run-tests.py
+++ b/test/shaping/run-tests.py
@@ -28,14 +28,22 @@ EXEEXT = os.environ.get ("EXEEXT", "")
 extra_options = "--verify"
 hb_shape = os.path.join (top_builddir, utildir, "hb-shape" + EXEEXT)
 
-fails = 0
 args = sys.argv[1:]
 
+if not os.path.exists (hb_shape):
+	hb_shape = args[0]
+	args = args[1:]
+
+fails = 0
+
 reference = False
 if len (args) and args[0] == "--reference":
 	reference = True
 	args = args[1:]
 
+if not reference:
+	print ('hb_shape:', hb_shape)
+
 if not len (args):
 	args = [sys.stdin]
 
commit 2dbdeb14214487acd0ff011386c49263ce800813
Author: Ebrahim Byagowi <ebrahim at gnu.org>
Date:   Fri Dec 29 23:13:29 2017 +0330

    [cmake] Run fuzzing and shaping tests (#666)

diff --git a/.circleci/config.yml b/.circleci/config.yml
index 4162488f..8f164384 100644
--- a/.circleci/config.yml
+++ b/.circleci/config.yml
@@ -7,7 +7,7 @@ jobs:
       - image: fedora
     steps:
       - checkout
-      - run: dnf install -y gcc ragel cmake make which glib2-devel freetype-devel cairo-devel libicu-devel graphite2-devel wget tar bzip2 || true
+      - run: dnf install -y gcc ragel cmake make which glib2-devel freetype-devel cairo-devel libicu-devel graphite2-devel wget tar bzip2 python || true
       - run: wget http://$ODSUSER:$ODSPASS@behdad.org/harfbuzz-private/OracleDeveloperStudio12.6-linux-x86-bin.tar.bz2 && tar xf OracleDeveloperStudio12.6-linux-x86-bin.tar.bz2 --owner root --group root --no-same-owner
       - run: CC=/root/project/OracleDeveloperStudio12.6-linux-x86-bin/developerstudio12.6/bin/suncc CXX=/root/project/OracleDeveloperStudio12.6-linux-x86-bin/developerstudio12.6/bin/sunCC cmake -DHB_HAVE_GRAPHITE2=ON -DHB_BUILTIN_UCDN=ON -DHB_HAVE_GLIB=ON -DHB_HAVE_ICU=ON -DHB_HAVE_FREETYPE=ON -Bbuild -H.
       - run: make -Cbuild
diff --git a/CMakeLists.txt b/CMakeLists.txt
index d0149b70..a24b136b 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -92,45 +92,56 @@ endif ()
 
 
 ## Extract variables from Makefile files
-# http://stackoverflow.com/a/27630120/1414809
-function (prepend var prefix)
+function (extract_make_variable variable makefile_source)
+  string(REGEX MATCH "${variable} = ([^$]+)\\$" temp ${makefile_source})
+  string(REGEX MATCHALL "[^ \n\t\\]+" listVar ${CMAKE_MATCH_1})
+  set (${variable} ${listVar} PARENT_SCOPE)
+endfunction ()
+
+# http://stackoverflow.com/a/27630120
+function (add_prefix_to_list var prefix)
   set (listVar "")
-  foreach (f ${ARGN})
+  foreach (f ${${var}})
     list(APPEND listVar "${prefix}${f}")
   endforeach ()
   set (${var} "${listVar}" PARENT_SCOPE)
 endfunction ()
 
-function (extract_make_variable variable file prefix)
-  string(REGEX MATCH "${variable} = ([^$]+)\\$" temp ${file})
-  string(REGEX MATCHALL "[^ \n\t\\]+" list ${CMAKE_MATCH_1})
-  prepend(list ${prefix} ${list})
-  set (${variable} ${list} PARENT_SCOPE)
-endfunction ()
-
 file(READ ${PROJECT_SOURCE_DIR}/src/Makefile.sources SRCSOURCES)
 file(READ ${PROJECT_SOURCE_DIR}/util/Makefile.sources UTILSOURCES)
 file(READ ${PROJECT_SOURCE_DIR}/src/hb-ucdn/Makefile.sources UCDNSOURCES)
 
-extract_make_variable(HB_BASE_sources ${SRCSOURCES} "${PROJECT_SOURCE_DIR}/src/")
-extract_make_variable(HB_BASE_headers ${SRCSOURCES} "${PROJECT_SOURCE_DIR}/src/")
-extract_make_variable(HB_FALLBACK_sources ${SRCSOURCES} "${PROJECT_SOURCE_DIR}/src/")
-extract_make_variable(HB_OT_sources ${SRCSOURCES} "${PROJECT_SOURCE_DIR}/src/")
-extract_make_variable(HB_OT_headers ${SRCSOURCES} "${PROJECT_SOURCE_DIR}/src/")
-
+extract_make_variable(HB_BASE_sources ${SRCSOURCES})
+add_prefix_to_list(HB_BASE_sources "${PROJECT_SOURCE_DIR}/src/")
+extract_make_variable(HB_BASE_headers ${SRCSOURCES})
+add_prefix_to_list(HB_BASE_headers "${PROJECT_SOURCE_DIR}/src/")
+extract_make_variable(HB_FALLBACK_sources ${SRCSOURCES})
+add_prefix_to_list(HB_FALLBACK_sources "${PROJECT_SOURCE_DIR}/src/")
+extract_make_variable(HB_OT_sources ${SRCSOURCES})
+add_prefix_to_list(HB_OT_sources "${PROJECT_SOURCE_DIR}/src/")
+extract_make_variable(HB_OT_headers ${SRCSOURCES})
+add_prefix_to_list(HB_OT_headers "${PROJECT_SOURCE_DIR}/src/")
+
+extract_make_variable(HB_BASE_RAGEL_GENERATED_sources ${SRCSOURCES})
+extract_make_variable(HB_OT_RAGEL_GENERATED_sources ${SRCSOURCES})
 if (IN_HB_DIST)
-  set (RAGEL_GENERATED_DIR "${PROJECT_SOURCE_DIR}/src/")
+  add_prefix_to_list(HB_BASE_RAGEL_GENERATED_sources "${PROJECT_SOURCE_DIR}/src/")
+  add_prefix_to_list(HB_OT_RAGEL_GENERATED_sources "${PROJECT_SOURCE_DIR}/src/")
 else ()
-  set (RAGEL_GENERATED_DIR "${PROJECT_BINARY_DIR}/src/")
+  add_prefix_to_list(HB_BASE_RAGEL_GENERATED_sources "${PROJECT_BINARY_DIR}/src/")
+  add_prefix_to_list(HB_OT_RAGEL_GENERATED_sources "${PROJECT_BINARY_DIR}/src/")
 endif ()
-extract_make_variable(HB_BASE_RAGEL_GENERATED_sources ${SRCSOURCES} ${RAGEL_GENERATED_DIR})
-extract_make_variable(HB_OT_RAGEL_GENERATED_sources ${SRCSOURCES} ${RAGEL_GENERATED_DIR})
 
-extract_make_variable(HB_VIEW_sources ${UTILSOURCES} "${PROJECT_SOURCE_DIR}/util/")
-extract_make_variable(HB_SHAPE_sources ${UTILSOURCES} "${PROJECT_SOURCE_DIR}/util/")
-extract_make_variable(HB_OT_SHAPE_CLOSURE_sources ${UTILSOURCES} "${PROJECT_SOURCE_DIR}/util/")
+extract_make_variable(HB_VIEW_sources ${UTILSOURCES})
+add_prefix_to_list(HB_VIEW_sources "${PROJECT_SOURCE_DIR}/util/")
+extract_make_variable(HB_SHAPE_sources ${UTILSOURCES})
+add_prefix_to_list(HB_SHAPE_sources "${PROJECT_SOURCE_DIR}/util/")
+extract_make_variable(HB_OT_SHAPE_CLOSURE_sources ${UTILSOURCES})
+add_prefix_to_list(HB_OT_SHAPE_CLOSURE_sources "${PROJECT_SOURCE_DIR}/util/")
+
+extract_make_variable(LIBHB_UCDN_sources ${UCDNSOURCES})
+add_prefix_to_list(LIBHB_UCDN_sources "${PROJECT_SOURCE_DIR}/src/hb-ucdn/")
 
-extract_make_variable(LIBHB_UCDN_sources ${UCDNSOURCES} "${PROJECT_SOURCE_DIR}/src/hb-ucdn/")
 
 file(READ configure.ac CONFIGUREAC)
 string(REGEX MATCH "\\[(([0-9]+)\\.([0-9]+)\\.([0-9]+))\\]" HB_VERSION_MATCH ${CONFIGUREAC})
diff --git a/appveyor.yml b/appveyor.yml
index 9a34052b..faa04d0c 100644
--- a/appveyor.yml
+++ b/appveyor.yml
@@ -41,9 +41,9 @@ build_script:
   - 'if "%compiler%"=="msvc" if not "%platform%"=="ARM" cmake -DHB_HAVE_UNISCRIBE=ON -DHB_HAVE_DIRECTWRITE=ON -DHB_HAVE_GLIB=ON -DHB_HAVE_FREETYPE=ON -G "%generator%" -DCMAKE_TOOLCHAIN_FILE=c:/tools/vcpkg/scripts/buildsystems/vcpkg.cmake ../'
 
   - 'if "%compiler%"=="msvc" msbuild harfbuzz.sln /p:Configuration=%configuration% /p:Platform=%platform%'
-  - 'if "%compiler%"=="msvc" if not "%platform%"=="ARM" ctest'
+  - 'if "%compiler%"=="msvc" if not "%platform%"=="ARM" ctest --output-on-failure'
 
-  - 'if "%compiler%"=="msys2" C:\msys64\usr\bin\bash -lc "pacman --noconfirm -S mingw-w64-$MSYS2_ARCH-{freetype,cairo,icu,gettext,gobject-introspection,gcc,gcc-libs,glib2,graphite2,pkg-config}"'
+  - 'if "%compiler%"=="msys2" C:\msys64\usr\bin\bash -lc "pacman --noconfirm -S mingw-w64-$MSYS2_ARCH-{freetype,cairo,icu,gettext,gobject-introspection,gcc,gcc-libs,glib2,graphite2,pkg-config,python2}"'
   - 'if "%compiler%"=="msys2" C:\msys64\usr\bin\bash -lc "cd $APPVEYOR_BUILD_FOLDER; PATH=$PATH:/mingw64/bin:/mingw32/bin; ./autogen.sh --with-uniscribe --with-freetype --with-glib --with-gobject --with-cairo --with-icu --with-graphite2 --build=%MINGW_CHOST% --host=%MINGW_CHOST% --prefix=%MINGW_PREFIX%; make; make check || (cat */test-suite.log test/*/test-suite.log && false)"'
 
 cache:
diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt
index 53d257b0..2bebd07f 100644
--- a/test/CMakeLists.txt
+++ b/test/CMakeLists.txt
@@ -1 +1,6 @@
 add_subdirectory(api)
+add_subdirectory(shaping)
+# Not ready yet
+if (NOT MSVC)
+  add_subdirectory(fuzzing)
+endif ()
diff --git a/test/api/CMakeLists.txt b/test/api/CMakeLists.txt
index 4e786ba6..c3914e48 100644
--- a/test/api/CMakeLists.txt
+++ b/test/api/CMakeLists.txt
@@ -1,39 +1,29 @@
-macro (_add_tests)
-  foreach(test_name ${ARGV})
+if (HB_HAVE_GLIB)
+  file (READ "${CMAKE_CURRENT_SOURCE_DIR}/Makefile.am" MAKEFILEAM)
+  extract_make_variable (TEST_PROGS ${MAKEFILEAM})
+
+  list (APPEND TEST_PROGS
+    test-ot-tag
+    test-c
+    test-cplusplus
+  )
+
+  if (HB_HAVE_FREETYPE)
+    list (APPEND TEST_PROGS test-ot-math)
+  endif ()
+
+  foreach (test_name IN ITEMS ${TEST_PROGS})
     if (EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${test_name}.c)
       add_executable (${test_name} ${test_name}.c)
     elseif (EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${test_name}.cc)
       add_executable (${test_name} ${test_name}.cc)
     else ()
-      message(FATAL_ERROR "No source file found for test ${test_name}")
+      message (FATAL_ERROR "No source file found for test ${test_name}")
     endif ()
     target_link_libraries (${test_name} harfbuzz)
     add_test (${test_name} ${test_name})
   endforeach ()
-  set_tests_properties (${ARGV} PROPERTIES ENVIRONMENT
+  set_tests_properties (${TEST_PROGS} PROPERTIES ENVIRONMENT
     "G_TEST_SRCDIR=${CMAKE_CURRENT_SOURCE_DIR};G_TEST_BUILDDIR=${CMAKE_CURRENT_BINARY_DIR}"
-    )
-endmacro ()
-
-if (HB_HAVE_GLIB)
-  _add_tests (
-    test-blob
-    test-buffer
-    test-common
-    test-font
-    test-object
-    test-set
-    test-shape
-    test-unicode
-    test-version
-    test-ot-tag
-    test-c
-    test-cplusplus
-    )
-
-  if (HB_HAVE_FREETYPE)
-    _add_tests (
-      test-ot-math
-      )
-  endif (HB_HAVE_FREETYPE)
-endif (HB_HAVE_GLIB)
+  )
+endif ()
diff --git a/test/fuzzing/CMakeLists.txt b/test/fuzzing/CMakeLists.txt
new file mode 100644
index 00000000..48432296
--- /dev/null
+++ b/test/fuzzing/CMakeLists.txt
@@ -0,0 +1,9 @@
+if (HB_HAVE_GLIB)
+  add_executable (hb-fuzzer hb-fuzzer.cc hb-fuzzer.hh main.cc)
+  target_link_libraries (hb-fuzzer harfbuzz)
+  add_test (hb-fuzzer python run-fuzzer-tests.py)
+  set_tests_properties (hb-fuzzer PROPERTIES
+    WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
+    ENVIRONMENT "top_builddir=${PROJECT_BINARY_DIR};testdir=test;fuzzingdir=fuzzing"
+  )
+endif ()
diff --git a/test/fuzzing/Makefile.am b/test/fuzzing/Makefile.am
index 3ea8605b..2c0eb908 100644
--- a/test/fuzzing/Makefile.am
+++ b/test/fuzzing/Makefile.am
@@ -14,6 +14,8 @@ $(top_builddir)/src/libharfbuzz-fuzzing.la: lib
 
 EXTRA_DIST += \
 	README \
+	run-fuzzer-tests.py \
+	CMakeLists.txt \
 	$(NULL)
 
 check_PROGRAMS = \
@@ -44,6 +46,22 @@ hb_fuzzer_DEPENDENCIES = \
 	lib \
 	$(NULL)
 
+AM_TESTS_ENVIRONMENT = \
+	EXEEXT="$(EXEEXT)"; \
+	export EXEEXT; \
+	srcdir="$(srcdir)"; \
+	export srcdir; \
+	builddir="$(builddir)"; \
+	export builddir; \
+	$(NULL)
+
+if AUTOMAKE_OLDER_THAN_1_13
+TESTS_ENVIRONMENT = \
+	$(AM_TESTS_ENVIRONMENT) \
+	$(TESTS_LOG_COMPILER) \
+	$(NULL)
+endif
+
 check:
 	cat $(srcdir)/../shaping/tests/fuzzed.tests | \
 	cut -d: -f1 | while read x; do \
diff --git a/test/fuzzing/run-fuzzer-tests.py b/test/fuzzing/run-fuzzer-tests.py
new file mode 100755
index 00000000..3fc78837
--- /dev/null
+++ b/test/fuzzing/run-fuzzer-tests.py
@@ -0,0 +1,28 @@
+#!/usr/bin/env python
+
+from __future__ import print_function
+import sys, os, subprocess
+
+srcdir = os.environ.get ("srcdir", ".")
+EXEEXT = os.environ.get ("EXEEXT", "")
+top_builddir = os.environ.get ("top_builddir", ".")
+testdir = os.environ.get ("testdir", ".")
+fuzzingdir = os.environ.get ("fuzzingdir", ".")
+hb_fuzzer = os.path.join (top_builddir, testdir, fuzzingdir, "hb-fuzzer" + EXEEXT)
+fails = 0
+
+for line in open (os.path.join (srcdir, "..", "shaping", "tests", "fuzzed.tests")):
+	font = line.split (":")[0]
+
+	p = subprocess.Popen (
+		[hb_fuzzer, os.path.join (srcdir, "..", "shaping", font)],
+		stdout=subprocess.PIPE, stderr=subprocess.PIPE)
+
+	if p.wait () != 0:
+		fails = fails + 1
+
+	print ((p.stdout.read () + p.stderr.read ()).decode ("utf-8").strip ())
+
+if fails:
+	print ("%i fuzzer related tests failed." % fails)
+	sys.exit (1)
diff --git a/test/shaping/CMakeLists.txt b/test/shaping/CMakeLists.txt
new file mode 100644
index 00000000..5310a2c2
--- /dev/null
+++ b/test/shaping/CMakeLists.txt
@@ -0,0 +1,11 @@
+if (HB_BUILD_UTILS)
+  file (READ "${CMAKE_CURRENT_SOURCE_DIR}/Makefile.am" MAKEFILEAM)
+  extract_make_variable (TESTS ${MAKEFILEAM})
+  foreach (test IN ITEMS ${TESTS})
+    add_test (${test} python run-tests.py "${test}")
+    set_tests_properties (${test} PROPERTIES
+      WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
+      ENVIRONMENT "top_builddir=${PROJECT_BINARY_DIR};utildir=."
+    )
+  endforeach ()
+endif ()
diff --git a/test/shaping/Makefile.am b/test/shaping/Makefile.am
index 4cf55749..4379363f 100644
--- a/test/shaping/Makefile.am
+++ b/test/shaping/Makefile.am
@@ -29,6 +29,7 @@ EXTRA_DIST += \
 	run-tests.py \
 	texts/in-tree \
 	fonts/sha1sum \
+	CMakeLists.txt \
 	$(TESTS) \
 	$(NULL)
 
@@ -104,7 +105,7 @@ TESTS_ENVIRONMENT = \
 	$(NULL)
 endif
 
-TESTS_LOG_COMPILER = python $(srcdir)/run-tests.py
+TESTS_LOG_COMPILER = $(srcdir)/run-tests.py
 
 .PHONY: manifests
 
diff --git a/test/shaping/run-tests.py b/test/shaping/run-tests.py
index ebba75aa..09c2f685 100755
--- a/test/shaping/run-tests.py
+++ b/test/shaping/run-tests.py
@@ -22,10 +22,11 @@ srcdir = os.environ.get ("srcdir", ".")
 builddir = os.environ.get ("builddir", ".")
 top_builddir = os.environ.get ("top_builddir",
 	os.path.normpath (os.path.join (os.getcwd (), "..", "..")))
+utildir = os.environ.get ("utildir", "util")
 EXEEXT = os.environ.get ("EXEEXT", "")
 
 extra_options = "--verify"
-hb_shape = os.path.join (top_builddir, "util", "hb-shape" + EXEEXT)
+hb_shape = os.path.join (top_builddir, utildir, "hb-shape" + EXEEXT)
 
 fails = 0
 args = sys.argv[1:]
commit 24b30faa2a285c6e4e46a18c346def2183fc2793
Author: Ebrahim Byagowi <ebrahim at gnu.org>
Date:   Mon Dec 25 22:01:28 2017 +0330

    [cmake] Use GNUInstallDirs values (#665)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 24ccb6fc..d0149b70 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -10,9 +10,9 @@ if (BUILD_FRAMEWORK)
     message(FATAL_ERROR
       "You should use Xcode generator with BUILD_FRAMEWORK enabled")
   endif ()
-  set(CMAKE_OSX_ARCHITECTURES "$(ARCHS_STANDARD_32_64_BIT)")
-  set(CMAKE_MACOSX_RPATH ON)
-  set(BUILD_SHARED_LIBS ON)
+  set (CMAKE_OSX_ARCHITECTURES "$(ARCHS_STANDARD_32_64_BIT)")
+  set (CMAKE_MACOSX_RPATH ON)
+  set (BUILD_SHARED_LIBS ON)
 endif ()
 
 
@@ -46,19 +46,19 @@ if (WIN32)
 endif ()
 option(HB_BUILD_UTILS "Build harfbuzz utils, needs cairo, freetype, and glib properly be installed" OFF)
 if (HB_BUILD_UTILS)
-  set(HB_HAVE_GLIB ON)
-  set(HB_HAVE_FREETYPE ON)
+  set (HB_HAVE_GLIB ON)
+  set (HB_HAVE_FREETYPE ON)
 endif ()
 
 option(HB_HAVE_GOBJECT "Enable GObject Bindings" OFF)
 if (HB_HAVE_GOBJECT)
-  set(HB_HAVE_GLIB ON)
+  set (HB_HAVE_GLIB ON)
 endif ()
 
 option(HB_HAVE_INTROSPECTION "Enable building introspection (.gir/.typelib) files" OFF)
 if (HB_HAVE_INTROSPECTION)
-  set(HB_HAVE_GOBJECT ON)
-  set(HB_HAVE_GLIB ON)
+  set (HB_HAVE_GOBJECT ON)
+  set (HB_HAVE_GLIB ON)
 endif ()
 
 include_directories(AFTER
@@ -83,29 +83,29 @@ endif ()
 
 
 ## Detect if we are running inside a distribution or regular repository folder
-set(IN_HB_DIST FALSE)
+set (IN_HB_DIST FALSE)
 if (EXISTS "${PROJECT_SOURCE_DIR}/ChangeLog")
   # perhaps we are on dist directory
-  set(IN_HB_DIST TRUE)
-  set(HB_VERSION_H "${PROJECT_SOURCE_DIR}/src/hb-version.h")
+  set (IN_HB_DIST TRUE)
+  set (HB_VERSION_H "${PROJECT_SOURCE_DIR}/src/hb-version.h")
 endif ()
 
 
 ## Extract variables from Makefile files
 # http://stackoverflow.com/a/27630120/1414809
 function (prepend var prefix)
-  set(listVar "")
+  set (listVar "")
   foreach (f ${ARGN})
     list(APPEND listVar "${prefix}${f}")
   endforeach ()
-  set(${var} "${listVar}" PARENT_SCOPE)
+  set (${var} "${listVar}" PARENT_SCOPE)
 endfunction ()
 
 function (extract_make_variable variable file prefix)
   string(REGEX MATCH "${variable} = ([^$]+)\\$" temp ${file})
   string(REGEX MATCHALL "[^ \n\t\\]+" list ${CMAKE_MATCH_1})
   prepend(list ${prefix} ${list})
-  set(${variable} ${list} PARENT_SCOPE)
+  set (${variable} ${list} PARENT_SCOPE)
 endfunction ()
 
 file(READ ${PROJECT_SOURCE_DIR}/src/Makefile.sources SRCSOURCES)
@@ -119,9 +119,9 @@ extract_make_variable(HB_OT_sources ${SRCSOURCES} "${PROJECT_SOURCE_DIR}/src/")
 extract_make_variable(HB_OT_headers ${SRCSOURCES} "${PROJECT_SOURCE_DIR}/src/")
 
 if (IN_HB_DIST)
-  set(RAGEL_GENERATED_DIR "${PROJECT_SOURCE_DIR}/src/")
+  set (RAGEL_GENERATED_DIR "${PROJECT_SOURCE_DIR}/src/")
 else ()
-  set(RAGEL_GENERATED_DIR "${PROJECT_BINARY_DIR}/src/")
+  set (RAGEL_GENERATED_DIR "${PROJECT_BINARY_DIR}/src/")
 endif ()
 extract_make_variable(HB_BASE_RAGEL_GENERATED_sources ${SRCSOURCES} ${RAGEL_GENERATED_DIR})
 extract_make_variable(HB_OT_RAGEL_GENERATED_sources ${SRCSOURCES} ${RAGEL_GENERATED_DIR})
@@ -134,10 +134,10 @@ extract_make_variable(LIBHB_UCDN_sources ${UCDNSOURCES} "${PROJECT_SOURCE_DIR}/s
 
 file(READ configure.ac CONFIGUREAC)
 string(REGEX MATCH "\\[(([0-9]+)\\.([0-9]+)\\.([0-9]+))\\]" HB_VERSION_MATCH ${CONFIGUREAC})
-set(HB_VERSION ${CMAKE_MATCH_1})
-set(HB_VERSION_MAJOR ${CMAKE_MATCH_2})
-set(HB_VERSION_MINOR ${CMAKE_MATCH_3})
-set(HB_VERSION_MICRO ${CMAKE_MATCH_4})
+set (HB_VERSION ${CMAKE_MATCH_1})
+set (HB_VERSION_MAJOR ${CMAKE_MATCH_2})
+set (HB_VERSION_MINOR ${CMAKE_MATCH_3})
+set (HB_VERSION_MICRO ${CMAKE_MATCH_4})
 
 
 ## Define ragel tasks
@@ -152,11 +152,11 @@ if (NOT IN_HB_DIST)
 
   foreach (ragel_output IN ITEMS ${HB_BASE_RAGEL_GENERATED_sources} ${HB_OT_RAGEL_GENERATED_sources})
     string(REGEX MATCH "([^/]+)\\.hh" temp ${ragel_output})
-    set(target_name ${CMAKE_MATCH_1})
+    set (target_name ${CMAKE_MATCH_1})
     add_custom_command(OUTPUT ${ragel_output}
       COMMAND ${RAGEL} -G2 -o ${ragel_output} ${PROJECT_SOURCE_DIR}/src/${target_name}.rl -I ${PROJECT_SOURCE_DIR} ${ARGN}
       DEPENDS ${PROJECT_SOURCE_DIR}/src/${target_name}.rl
-      )
+    )
     add_custom_target(harfbuzz_${target_name} DEPENDS ${PROJECT_BINARY_DIR}/src/${target_name})
   endforeach ()
 
@@ -166,45 +166,44 @@ endif ()
 
 ## Generate hb-version.h
 if (NOT IN_HB_DIST)
-  set(HB_VERSION_H_IN "${PROJECT_SOURCE_DIR}/src/hb-version.h.in")
-  set(HB_VERSION_H "${PROJECT_BINARY_DIR}/src/hb-version.h")
+  set (HB_VERSION_H_IN "${PROJECT_SOURCE_DIR}/src/hb-version.h.in")
+  set (HB_VERSION_H "${PROJECT_BINARY_DIR}/src/hb-version.h")
   set_source_files_properties("${HB_VERSION_H}" PROPERTIES GENERATED true)
   configure_file("${HB_VERSION_H_IN}" "${HB_VERSION_H}.tmp" @ONLY)
   execute_process(COMMAND "${CMAKE_COMMAND}" -E copy_if_different
     "${HB_VERSION_H}.tmp"
     "${HB_VERSION_H}"
-    )
+  )
   file(REMOVE "${HB_VERSION_H}.tmp")
 endif ()
 
 
 ## Define sources and headers of the project
-set(project_sources
+set (project_sources
   ${HB_BASE_sources}
   ${HB_BASE_RAGEL_GENERATED_sources}
 
   ${HB_FALLBACK_sources}
   ${HB_OT_sources}
   ${HB_OT_RAGEL_GENERATED_sources}
-  )
+)
 
-set(project_extra_sources)
+set (project_extra_sources)
 
-set(project_headers
+set (project_headers
   ${HB_VERSION_H}
 
   ${HB_BASE_headers}
   ${HB_OT_headers}
-  )
+)
 
 
 ## Find and include needed header folders and libraries
 if (HB_HAVE_FREETYPE)
-
   include(FindFreetype)
   if (NOT FREETYPE_FOUND)
     message(FATAL_ERROR "HB_HAVE_FREETYPE was set, but we failed to find it. Maybe add a CMAKE_PREFIX_PATH= to your Freetype2 install prefix")
-  endif()
+  endif ()
 
   list(APPEND THIRD_PARTY_LIBS ${FREETYPE_LIBRARIES})
   include_directories(AFTER ${FREETYPE_INCLUDE_DIRS})
@@ -212,7 +211,6 @@ if (HB_HAVE_FREETYPE)
 
   list(APPEND project_sources ${PROJECT_SOURCE_DIR}/src/hb-ft.cc)
   list(APPEND project_headers ${PROJECT_SOURCE_DIR}/src/hb-ft.h)
-
 endif ()
 
 if (HB_HAVE_GRAPHITE2)
@@ -322,8 +320,8 @@ if (HB_HAVE_GOBJECT)
   pkg_check_modules(PC_GLIB QUIET glib-2.0)
   find_program(GLIB_MKENUMS glib-mkenums
     HINTS ${PC_glib_mkenums}
-    )
-  set(GLIB_MKENUMS_CMD)
+  )
+  set (GLIB_MKENUMS_CMD)
 
   if (WIN32 AND NOT MINGW)
     # In Visual Studio builds, shebang lines are not supported
@@ -333,29 +331,29 @@ if (HB_HAVE_GOBJECT)
     execute_process(COMMAND "${PYTHON_EXECUTABLE}" "${GLIB_MKENUMS}" --version
       RESULT_VARIABLE GLIB_MKENUMS_PYTHON
       OUTPUT_QUIET ERROR_QUIET
-      )
+    )
     if (GLIB_MKENUMS_PYTHON EQUAL 0)
       message("${GLIB_MKENUMS} is a Python script.")
-      set(GLIB_MKENUMS_CMD "${PYTHON_EXECUTABLE}" "${GLIB_MKENUMS}")
+      set (GLIB_MKENUMS_CMD "${PYTHON_EXECUTABLE}" "${GLIB_MKENUMS}")
     else ()
       execute_process(COMMAND "${PERL_EXECUTABLE}" "${GLIB_MKENUMS}" --version
         RESULT_VARIABLE GLIB_MKENUMS_PERL
         OUTPUT_QUIET ERROR_QUIET
-        )
+      )
       if (GLIB_MKENUMS_PERL EQUAL 0)
         message("${GLIB_MKENUMS} is a PERL script.")
-        set(GLIB_MKENUMS_CMD "${PERL_EXECUTABLE}" "${GLIB_MKENUMS}")
+        set (GLIB_MKENUMS_CMD "${PERL_EXECUTABLE}" "${GLIB_MKENUMS}")
       endif ()
       if (NOT GLIB_MKENUMS_PERL EQUAL 0 AND NOT GLIB_MKENUMS_PYTHON EQUAL 0)
         message(FATAL_ERROR "Unable to determine type of glib-mkenums script")
       endif ()
-	endif ()
+    endif ()
   else ()
-    set(GLIB_MKENUMS_CMD "${GLIB_MKENUMS}")
+    set (GLIB_MKENUMS_CMD "${GLIB_MKENUMS}")
   endif ()
   if (NOT GLIB_MKENUMS_CMD)
     message(FATAL_ERROR "HB_HAVE_GOBJECT was set, but we failed to find glib-mkenums, which is required")
-  endif()
+  endif ()
 
   pkg_check_modules(PC_GOBJECT QUIET gobject-2.0)
 
@@ -368,19 +366,19 @@ if (HB_HAVE_GOBJECT)
   list(APPEND hb_gobject_sources ${PROJECT_SOURCE_DIR}/src/hb-gobject-structs.cc)
   list(APPEND hb_gobject_gen_sources
     ${CMAKE_CURRENT_BINARY_DIR}/src/hb-gobject-enums.cc
-    )
+  )
   list(APPEND hb_gobject_structs_headers
     ${PROJECT_SOURCE_DIR}/src/hb-gobject-structs.h
-    )
+  )
   list(APPEND hb_gobject_headers
     ${PROJECT_SOURCE_DIR}/src/hb-gobject.h
     ${hb_gobject_structs_headers}
-    )
+  )
   list(APPEND hb_gobject_gen_headers
     ${CMAKE_CURRENT_BINARY_DIR}/src/hb-gobject-enums.h
-    )
+  )
 
-  add_custom_command (
+  add_custom_command(
     OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/src/hb-gobject-enums.h
     COMMAND ${GLIB_MKENUMS_CMD}
       --template=${PROJECT_SOURCE_DIR}/src/hb-gobject-enums.h.tmpl
@@ -396,9 +394,9 @@ if (HB_HAVE_GOBJECT)
     DEPENDS ${PROJECT_SOURCE_DIR}/src/hb-gobject-enums.h.tmpl
       ${hb_gobject_header}
       ${project_headers}
-    )
+  )
 
-  add_custom_command (
+  add_custom_command(
     OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/src/hb-gobject-enums.cc
     COMMAND ${GLIB_MKENUMS_CMD}
       --template=${PROJECT_SOURCE_DIR}/src/hb-gobject-enums.cc.tmpl
@@ -415,7 +413,7 @@ if (HB_HAVE_GOBJECT)
       ${CMAKE_CURRENT_BINARY_DIR}/src/hb-gobject-enums.h
       ${hb_gobject_header}
       ${project_headers}
-    )
+  )
 endif ()
 
 ## Atomic ops availability detection
@@ -461,7 +459,7 @@ if (HB_HAVE_GOBJECT)
     ${hb_gobject_gen_sources}
     ${hb_gobject_headers}
     ${hb_gobject_gen_headers}
-    )
+  )
   include_directories(BEFORE ${CMAKE_CURRENT_BINARY_DIR}/src)
   add_dependencies(harfbuzz-gobject harfbuzz)
   target_link_libraries(harfbuzz-gobject harfbuzz ${GOBJECT_LIBRARIES} ${THIRD_PARTY_LIBS})
@@ -471,7 +469,7 @@ endif ()
 if (WIN32)
   if (NOT BUILD_SHARED_LIBS)
     message("Building introspection files on Windows requires BUILD_SHARED_LIBS to be enabled.")
-    set(HB_HAVE_INTROSPECTION OFF)
+    set (HB_HAVE_INTROSPECTION OFF)
   endif ()
 endif ()
 
@@ -482,23 +480,23 @@ if (HB_HAVE_INTROSPECTION)
 
   find_program(G_IR_SCANNER g-ir-scanner
     HINTS ${PC_g_ir_scanner}
-    )
+  )
 
   find_program(G_IR_COMPILER g-ir-compiler
     HINTS ${PC_g_ir_compiler}
-    )
+  )
 
   if (WIN32 AND NOT MINGW)
     # Note that since we already enable HB_HAVE_GOBJECT
     # we would already have PYTHON_EXECUTABLE handy
-    set(G_IR_SCANNER_CMD "${PYTHON_EXECUTABLE}" "${G_IR_SCANNER}")
+    set (G_IR_SCANNER_CMD "${PYTHON_EXECUTABLE}" "${G_IR_SCANNER}")
   else ()
-    set(G_IR_SCANNER_CMD "${G_IR_SCANNER}")
+    set (G_IR_SCANNER_CMD "${G_IR_SCANNER}")
   endif ()
 
   # We need to account for the varying output directories
   # when we build using Visual Studio projects
-  if("${CMAKE_GENERATOR}" MATCHES "Visual Studio*")
+  if ("${CMAKE_GENERATOR}" MATCHES "Visual Studio*")
     set (hb_libpath "${CMAKE_CURRENT_BINARY_DIR}/$<CONFIGURATION>")
   else ()
     set (hb_libpath "$<TARGET_FILE_DIR:harfbuzz-gobject>")
@@ -506,9 +504,9 @@ if (HB_HAVE_INTROSPECTION)
 
   # Get the CFlags that we used to build HarfBuzz/HarfBuzz-GObject
   set (hb_defines_cflags "")
-  foreach(hb_cflag ${hb_cflags})
+  foreach (hb_cflag ${hb_cflags})
     list(APPEND hb_defines_cflags "-D${hb_cflag}")
-  endforeach(hb_cflag)
+  endforeach (hb_cflag)
 
   # Get the other dependent libraries we used to build HarfBuzz/HarfBuzz-GObject
   set (extra_libs "")
@@ -518,7 +516,7 @@ if (HB_HAVE_INTROSPECTION)
     list(APPEND extra_libs "--extra-library=${extra_lib_stripped}")
   endforeach ()
 
-  set(introspected_sources)
+  set (introspected_sources)
   foreach (f
     ${project_headers}
     ${project_sources}
@@ -545,7 +543,7 @@ if (HB_HAVE_INTROSPECTION)
   endforeach ()
 
   # Finally, build the introspection files...
-  add_custom_command (
+  add_custom_command(
     TARGET harfbuzz-gobject
     POST_BUILD
     COMMAND ${G_IR_SCANNER_CMD}
@@ -576,9 +574,9 @@ if (HB_HAVE_INTROSPECTION)
       ${introspected_sources}
       -o ${hb_libpath}/HarfBuzz-0.0.gir
     DEPENDS harfbuzz-gobject harfbuzz
-    )
+  )
 
-  add_custom_command (
+  add_custom_command(
     TARGET harfbuzz-gobject
     POST_BUILD
     COMMAND "${G_IR_COMPILER}"
@@ -587,20 +585,20 @@ if (HB_HAVE_INTROSPECTION)
       ${hb_libpath}/HarfBuzz-0.0.gir
       -o ${hb_libpath}/HarfBuzz-0.0.typelib
     DEPENDS ${hb_libpath}/HarfBuzz-0.0.gir harfbuzz-gobject
-    )
+  )
 endif ()
 
 ## Additional framework build configs
 if (BUILD_FRAMEWORK)
-  set(CMAKE_MACOSX_RPATH ON)
+  set (CMAKE_MACOSX_RPATH ON)
   set_target_properties(harfbuzz PROPERTIES
     FRAMEWORK TRUE
     PUBLIC_HEADER "${project_headers}"
     XCODE_ATTRIBUTE_INSTALL_PATH "@rpath"
   )
-  set(MACOSX_FRAMEWORK_IDENTIFIER "harfbuzz")
-  set(MACOSX_FRAMEWORK_SHORT_VERSION_STRING "${HB_VERSION}")
-  set(MACOSX_FRAMEWORK_BUNDLE_VERSION "${HB_VERSION}")
+  set (MACOSX_FRAMEWORK_IDENTIFIER "harfbuzz")
+  set (MACOSX_FRAMEWORK_SHORT_VERSION_STRING "${HB_VERSION}")
+  set (MACOSX_FRAMEWORK_BUNDLE_VERSION "${HB_VERSION}")
 endif ()
 
 
@@ -631,56 +629,58 @@ endif ()
 
 
 ## Install
+include(GNUInstallDirs)
+
 if (NOT SKIP_INSTALL_HEADERS AND NOT SKIP_INSTALL_ALL)
-  install(FILES ${project_headers} DESTINATION include/harfbuzz)
+  install(FILES ${project_headers} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/harfbuzz)
   if (HB_HAVE_GOBJECT)
-    install(FILES ${hb_gobject_headers} ${hb_gobject_gen_headers} DESTINATION include/harfbuzz)
+    install(FILES ${hb_gobject_headers} ${hb_gobject_gen_headers} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/harfbuzz)
   endif ()
 endif ()
 
 if (NOT SKIP_INSTALL_LIBRARIES AND NOT SKIP_INSTALL_ALL)
   install(TARGETS harfbuzz
-    ARCHIVE DESTINATION lib
-    LIBRARY DESTINATION lib
-    RUNTIME DESTINATION bin
+    ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
+    LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
+    RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
     FRAMEWORK DESTINATION Library/Frameworks
-    )
+  )
   if (HB_BUILD_UTILS)
     install(TARGETS hb-view
-      RUNTIME DESTINATION bin
+      RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
     )
     install(TARGETS hb-view
-      RUNTIME DESTINATION bin
+      RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
     )
 
     install(TARGETS hb-shape
-      RUNTIME DESTINATION bin
+      RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
     )
 
     install(TARGETS hb-ot-shape-closure
-      RUNTIME DESTINATION bin
+      RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
     )
   endif ()
   if (HB_HAVE_GOBJECT)
     install(TARGETS harfbuzz-gobject
-      ARCHIVE DESTINATION lib
-      LIBRARY DESTINATION lib
-      RUNTIME DESTINATION bin
+      ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
+      LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
+      RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
     )
     if (HB_HAVE_INTROSPECTION)
-      if("${CMAKE_GENERATOR}" MATCHES "Visual Studio*")
+      if ("${CMAKE_GENERATOR}" MATCHES "Visual Studio*")
         set (hb_libpath "${CMAKE_CURRENT_BINARY_DIR}/$<CONFIGURATION>")
       else ()
         set (hb_libpath "$<TARGET_FILE_DIR:harfbuzz-gobject>")
       endif ()
 
       install(FILES "${hb_libpath}/HarfBuzz-0.0.gir"
-        DESTINATION share/gir-1.0
+        DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/gir-1.0
         )
 
       install(FILES "${hb_libpath}/HarfBuzz-0.0.typelib"
-        DESTINATION lib/girepository-1.0
-        )
+        DESTINATION ${CMAKE_INSTALL_LIBDIR}/girepository-1.0
+      )
     endif ()
   endif ()
 endif ()


More information about the HarfBuzz mailing list