freetype-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[freetype2] master 9224f05: [cmake] Honor SKIP_INSTALL_* settings (as us


From: Werner LEMBERG
Subject: [freetype2] master 9224f05: [cmake] Honor SKIP_INSTALL_* settings (as used in zlib).
Date: Sat, 16 Apr 2016 08:25:23 +0000

branch: master
commit 9224f05393485b44ca533015d37072d1ef2b3540
Author: David Capello <address@hidden>
Commit: Werner Lemberg <address@hidden>

    [cmake] Honor SKIP_INSTALL_* settings (as used in zlib).
    
    As FreeType depends on zlib, if we don't install zlib (e.g., because
    we defined SKIP_INSTALL_ALL), FreeType cannot be installed, too
    (cmake triggers an error saying that FreeType cannot be installed
    because zlib target isn't in the export set).
    
    * CMakeLists.txt: Honor `SKIP_INSTALL_HEADERS',
    `SKIP_INSTALL_LIBRARIES', and `SKIP_INSTALL_ALL' settings.
---
 CMakeLists.txt |   56 +++++++++++++++++++++++++++++++++-----------------------
 ChangeLog      |   12 ++++++++++++
 2 files changed, 45 insertions(+), 23 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 6535678..87a68c0 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -68,6 +68,11 @@
 #   only if it is available.  Example:
 #
 #     cmake ... -DWITH_ZLIB=ON -DWITH_HarfBuzz=OFF ...
+#
+# . Installation of FreeType can be controlled with the CMake variables
+#   `SKIP_INSTALL_HEADERS', `SKIP_INSTALL_LIBRARIES', and `SKIP_INSTALL_ALL'
+#   (this is compatible with the same CMake variables in zlib's CMake
+#   support).
 
 
 cmake_minimum_required(VERSION 2.6)
@@ -173,7 +178,7 @@ foreach (d ZLIB BZip2 PNG HarfBuzz)
 
   if (${d}_FOUND OR ${D}_FOUND)
     message(STATUS "Building with ${d}")
-  endif()
+  endif ()
 endforeach ()
 
 
@@ -383,28 +388,33 @@ endif ()
 
 # Installations
 # Note the trailing slash in the argument to the `DIRECTORY' directive
-install(DIRECTORY ${PROJECT_SOURCE_DIR}/include/
-  DESTINATION include/freetype2
-  PATTERN "internal" EXCLUDE
-  PATTERN "ftconfig.h" EXCLUDE
-  PATTERN "ftoption.h" EXCLUDE
-)
-install(FILES
-  ${PROJECT_BINARY_DIR}/include/freetype/config/ftconfig.h
-  ${PROJECT_BINARY_DIR}/include/freetype/config/ftoption.h
-  DESTINATION include/freetype2/freetype/config
-)
-install(TARGETS freetype
-  EXPORT freetype-targets
-  RUNTIME DESTINATION bin
-  LIBRARY DESTINATION lib
-  ARCHIVE DESTINATION lib
-  FRAMEWORK DESTINATION Library/Frameworks
-)
-install(EXPORT freetype-targets
-  DESTINATION lib/cmake/freetype
-  FILE freetype-config.cmake
-)
+if (NOT SKIP_INSTALL_HEADERS AND NOT SKIP_INSTALL_ALL)
+  install(DIRECTORY ${PROJECT_SOURCE_DIR}/include/
+    DESTINATION include/freetype2
+    PATTERN "internal" EXCLUDE
+    PATTERN "ftconfig.h" EXCLUDE
+    PATTERN "ftoption.h" EXCLUDE
+    )
+  install(FILES
+    ${PROJECT_BINARY_DIR}/include/freetype/config/ftconfig.h
+    ${PROJECT_BINARY_DIR}/include/freetype/config/ftoption.h
+    DESTINATION include/freetype2/freetype/config
+    )
+endif ()
+
+if (NOT SKIP_INSTALL_LIBRARIES AND NOT SKIP_INSTALL_ALL)
+  install(TARGETS freetype
+    EXPORT freetype-targets
+    RUNTIME DESTINATION bin
+    LIBRARY DESTINATION lib
+    ARCHIVE DESTINATION lib
+    FRAMEWORK DESTINATION Library/Frameworks
+    )
+  install(EXPORT freetype-targets
+    DESTINATION lib/cmake/freetype
+    FILE freetype-config.cmake
+    )
+endif ()
 
 
 # Packaging
diff --git a/ChangeLog b/ChangeLog
index 35456fa..ffc0a9c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,15 @@
+2016-04-16  David Capello  <address@hidden>
+
+       [cmake] Honor SKIP_INSTALL_* settings (as used in zlib).
+
+       As FreeType depends on zlib, if we don't install zlib (e.g., because
+       we defined SKIP_INSTALL_ALL), FreeType cannot be installed, too
+       (cmake triggers an error saying that FreeType cannot be installed
+       because zlib target isn't in the export set).
+
+       * CMakeLists.txt: Honor `SKIP_INSTALL_HEADERS',
+       `SKIP_INSTALL_LIBRARIES', and `SKIP_INSTALL_ALL' settings.
+
 2016-04-16  Behdad Esfahbod  <address@hidden>
 
        [truetype] Another fix for non-intermediate GX tuples.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]