CMake: Cairo is required for CLI, not just tests.

pull/135/head
whitequark 2016-12-04 19:05:51 +00:00
parent 3858cbe249
commit 6989a3d068
1 changed files with 15 additions and 22 deletions

View File

@ -140,21 +140,19 @@ if(WIN32)
find_package(OpenGL REQUIRED)
endif()
if(ENABLE_TESTS)
message(STATUS "Using in-tree pixman")
add_vendored_subdirectory(extlib/pixman)
set(PIXMAN_FOUND YES)
set(PIXMAN_LIBRARY pixman)
set(PIXMAN_INCLUDE_DIRS ${CMAKE_SOURCE_DIR}/extlib/pixman/pixman)
list(APPEND PIXMAN_INCLUDE_DIRS ${CMAKE_BINARY_DIR}/extlib/pixman/pixman)
message(STATUS "Using in-tree pixman")
add_vendored_subdirectory(extlib/pixman)
set(PIXMAN_FOUND YES)
set(PIXMAN_LIBRARY pixman)
set(PIXMAN_INCLUDE_DIRS ${CMAKE_SOURCE_DIR}/extlib/pixman/pixman)
list(APPEND PIXMAN_INCLUDE_DIRS ${CMAKE_BINARY_DIR}/extlib/pixman/pixman)
message(STATUS "Using in-tree cairo")
add_vendored_subdirectory(extlib/cairo)
set(CAIRO_FOUND YES)
set(CAIRO_LIBRARIES cairo)
set(CAIRO_INCLUDE_DIRS ${CMAKE_SOURCE_DIR}/extlib/cairo/src)
list(APPEND CAIRO_INCLUDE_DIRS ${CMAKE_BINARY_DIR}/extlib/cairo/src)
endif()
message(STATUS "Using in-tree cairo")
add_vendored_subdirectory(extlib/cairo)
set(CAIRO_FOUND YES)
set(CAIRO_LIBRARIES cairo)
set(CAIRO_INCLUDE_DIRS ${CMAKE_SOURCE_DIR}/extlib/cairo/src)
list(APPEND CAIRO_INCLUDE_DIRS ${CMAKE_BINARY_DIR}/extlib/cairo/src)
if(NOT MINGW)
message(STATUS "Using prebuilt SpaceWare")
@ -172,10 +170,8 @@ elseif(APPLE)
find_package(Freetype REQUIRED)
find_package(OpenGL REQUIRED)
if(ENABLE_TESTS)
find_library(CAIRO_LIBRARIES cairo REQUIRED)
find_path(CAIRO_INCLUDE_DIRS cairo.h PATH_SUFFIXES cairo)
endif()
find_library(CAIRO_LIBRARIES cairo REQUIRED)
find_path(CAIRO_INCLUDE_DIRS cairo.h PATH_SUFFIXES cairo)
find_library(APPKIT_LIBRARY AppKit REQUIRED)
else() # Linux and compatible systems
@ -189,13 +185,10 @@ else() # Linux and compatible systems
find_package(Freetype REQUIRED)
find_package(OpenGL REQUIRED)
if(ENABLE_TESTS)
pkg_check_modules(CAIRO REQUIRED cairo)
endif()
pkg_check_modules(CAIRO REQUIRED cairo)
pkg_check_modules(FONTCONFIG REQUIRED fontconfig)
pkg_check_modules(JSONC REQUIRED json-c)
pkg_check_modules(FREETYPE REQUIRED freetype2)
if(GUI STREQUAL "gtk3")
set(HAVE_GTK3 TRUE)