forked from minhngoc25a/freetype2
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.
This commit is contained in:
parent
7702edf793
commit
f7b4fb3a21
|
@ -153,7 +153,7 @@ option(FT_WITH_HARFBUZZ "Improve auto-hinting of OpenType fonts." OFF)
|
||||||
|
|
||||||
|
|
||||||
# Disallow in-source builds
|
# Disallow in-source builds
|
||||||
if ("${PROJECT_BINARY_DIR}" STREQUAL "${PROJECT_SOURCE_DIR}")
|
if ("${CMAKE_BINARY_DIR}" STREQUAL "${CMAKE_SOURCE_DIR}")
|
||||||
message(FATAL_ERROR
|
message(FATAL_ERROR
|
||||||
"In-source builds are not permitted! Make a separate folder for"
|
"In-source builds are not permitted! Make a separate folder for"
|
||||||
" building, e.g.,\n"
|
" building, e.g.,\n"
|
||||||
|
@ -356,17 +356,17 @@ if (BUILD_SHARED_LIBS)
|
||||||
SOVERSION ${LIBRARY_SOVERSION})
|
SOVERSION ${LIBRARY_SOVERSION})
|
||||||
endif ()
|
endif ()
|
||||||
|
|
||||||
target_include_directories(
|
# Pick up ftconfig.h and ftoption.h generated above, first.
|
||||||
freetype BEFORE # Pick up ftconfig.h and ftoption.h generated above.
|
|
||||||
PRIVATE "${PROJECT_BINARY_DIR}/include")
|
|
||||||
|
|
||||||
target_include_directories(
|
target_include_directories(
|
||||||
freetype
|
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)
|
if (BUILD_FRAMEWORK)
|
||||||
set_property(SOURCE ${PUBLIC_CONFIG_HEADERS}
|
set_property(SOURCE ${PUBLIC_CONFIG_HEADERS}
|
||||||
|
|
|
@ -1,3 +1,11 @@
|
||||||
|
2018-05-07 Nikolaus Waxweiler <madigens@gmail.com>
|
||||||
|
|
||||||
|
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 <wl@gnu.org>
|
2018-05-07 Werner Lemberg <wl@gnu.org>
|
||||||
|
|
||||||
[build] Suppress configure's `nothing to be done' message.
|
[build] Suppress configure's `nothing to be done' message.
|
||||||
|
|
Loading…
Reference in New Issue