[cmake] Add better control of library dependencies.
* CMakeLists.txt: Add `WITH_*' variables to force/auto/omit ZLIB/BZip2/PNG/HarfBuzz.
This commit is contained in:
parent
4854df62f7
commit
da97b4c43e
|
@ -61,6 +61,13 @@
|
||||||
#
|
#
|
||||||
# . If you want to disable the automatic generation of the distribution
|
# . If you want to disable the automatic generation of the distribution
|
||||||
# targets, add the `-D FREETYPE_NO_DIST=true' command line argument.
|
# targets, add the `-D FREETYPE_NO_DIST=true' command line argument.
|
||||||
|
#
|
||||||
|
# . Set the `WITH_ZLIB', `WITH_BZip2', `WITH_PNG', and `WITH_HarfBuzz'
|
||||||
|
# CMake variables to `ON' or `OFF' to force or skip using a dependency.
|
||||||
|
# Leave a variable undefined (which is the default) to use the dependency
|
||||||
|
# only if it is available. Example:
|
||||||
|
#
|
||||||
|
# cmake ... -DWITH_ZLIB=ON -DWITH_HarfBuzz=OFF ...
|
||||||
|
|
||||||
|
|
||||||
cmake_minimum_required(VERSION 2.6)
|
cmake_minimum_required(VERSION 2.6)
|
||||||
|
@ -153,10 +160,21 @@ add_definitions(-DFT2_BUILD_LIBRARY)
|
||||||
|
|
||||||
|
|
||||||
# Find dependencies
|
# Find dependencies
|
||||||
find_package(ZLIB)
|
foreach (d ZLIB BZip2 PNG HarfBuzz)
|
||||||
find_package(BZip2)
|
string(TOUPPER "${d}" D)
|
||||||
find_package(PNG)
|
|
||||||
find_package(HarfBuzz)
|
if (DEFINED WITH_${d} OR DEFINED WITH_${D})
|
||||||
|
if (WITH_${d} OR WITH_${D})
|
||||||
|
find_package(${d} QUIET REQUIRED)
|
||||||
|
endif ()
|
||||||
|
else ()
|
||||||
|
find_package(${d} QUIET)
|
||||||
|
endif ()
|
||||||
|
|
||||||
|
if (${d}_FOUND OR ${D}_FOUND)
|
||||||
|
message(STATUS "Building with ${d}")
|
||||||
|
endif()
|
||||||
|
endforeach ()
|
||||||
|
|
||||||
|
|
||||||
message(STATUS
|
message(STATUS
|
||||||
|
|
|
@ -1,3 +1,10 @@
|
||||||
|
2015-11-27 Tamas Kenez <tamas.kenez@adasworks.com>
|
||||||
|
|
||||||
|
[cmake] Add better control of library dependencies.
|
||||||
|
|
||||||
|
* CMakeLists.txt: Add `WITH_*' variables to force/auto/omit
|
||||||
|
ZLIB/BZip2/PNG/HarfBuzz.
|
||||||
|
|
||||||
2015-11-27 Tamas Kenez <tamas.kenez@adasworks.com>
|
2015-11-27 Tamas Kenez <tamas.kenez@adasworks.com>
|
||||||
|
|
||||||
[cmake] Make `FindHarfbuzz' observe the REQUIRED option.
|
[cmake] Make `FindHarfbuzz' observe the REQUIRED option.
|
||||||
|
|
Loading…
Reference in New Issue