freetype-commit
[Top][All Lists]
Advanced

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

[freetype2] master f7b4fb3: CMake: Allow using project as subfolder in o


From: Nikolaus Waxweiler
Subject: [freetype2] master f7b4fb3: CMake: Allow using project as subfolder in other project
Date: Tue, 8 May 2018 02:46:32 -0400 (EDT)

branch: master
commit f7b4fb3a214c15df0579979bd1bd4e7f613f0209
Author: Nikolaus Waxweiler <address@hidden>
Commit: Nikolaus Waxweiler <address@hidden>

    CMake: Allow using project as subfolder in other project
    
    * CMakeLists.txt: Test for CMake build directory being diffent from
    source directory. Provide other parts of the build system access the
    full include directory.
---
 CMakeLists.txt | 18 +++++++++---------
 ChangeLog      |  8 ++++++++
 2 files changed, 17 insertions(+), 9 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 6f3fef7..cfba113 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -153,7 +153,7 @@ option(FT_WITH_HARFBUZZ "Improve auto-hinting of OpenType 
fonts." OFF)
 
 
 # Disallow in-source builds
-if ("${PROJECT_BINARY_DIR}" STREQUAL "${PROJECT_SOURCE_DIR}")
+if ("${CMAKE_BINARY_DIR}" STREQUAL "${CMAKE_SOURCE_DIR}")
   message(FATAL_ERROR
     "In-source builds are not permitted!  Make a separate folder for"
     " building, e.g.,\n"
@@ -356,17 +356,17 @@ if (BUILD_SHARED_LIBS)
     SOVERSION ${LIBRARY_SOVERSION})
 endif ()
 
-target_include_directories(
-  freetype BEFORE  # Pick up ftconfig.h and ftoption.h generated above.
-    PRIVATE "${PROJECT_BINARY_DIR}/include")
-
+# Pick up ftconfig.h and ftoption.h generated above, first.
 target_include_directories(
   freetype
-    PRIVATE "${PROJECT_SOURCE_DIR}/include")
+    PUBLIC
+      $<INSTALL_INTERFACE:include/freetype2>
+      $<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}/include>
+      $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
+    PRIVATE 
+      ${CMAKE_CURRENT_BINARY_DIR}/include
+      ${CMAKE_CURRENT_SOURCE_DIR}/include)
 
-target_include_directories(
-  freetype
-    PUBLIC $<INSTALL_INTERFACE:include/freetype2>)
 
 if (BUILD_FRAMEWORK)
   set_property(SOURCE ${PUBLIC_CONFIG_HEADERS}
diff --git a/ChangeLog b/ChangeLog
index 2397f67..8947227 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2018-05-07  Nikolaus Waxweiler  <address@hidden>
+
+       CMake: Allow using project as subfolder in other project
+
+       * CMakeLists.txt: Test for CMake build directory being diffent from 
source
+       directory. Provide other parts of the build system access the full 
include
+       directory.
+
 2018-05-07  Werner Lemberg  <address@hidden>
 
        [build] Suppress configure's `nothing to be done' message.



reply via email to

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