[aseprite] 108/196: Use find_package(FOO REQUIRED)
Tobias Hansen
thansen at moszumanska.debian.org
Wed Apr 20 18:50:08 UTC 2016
This is an automated email from the git hooks/post-receive script.
thansen pushed a commit to branch master
in repository aseprite.
commit 75f908b45e128b9c121467a17e96f7bc85c4ce2d
Author: Azamat H. Hackimov <azamat.hackimov at gmail.com>
Date: Sat Mar 26 14:26:22 2016 +0500
Use find_package(FOO REQUIRED)
Using more cmake-way finding packages for shared system libraries
where it is possible.
---
CMakeLists.txt | 34 +++++++---------------------------
1 file changed, 7 insertions(+), 27 deletions(-)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index c516f29..2280f9c 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -157,10 +157,7 @@ endif()
# zlib
if(USE_SHARED_ZLIB)
- find_package(ZLIB)
- if(NOT ZLIB_FOUND)
- message(FATAL_ERROR "zlib not found")
- endif()
+ find_package(ZLIB REQUIRED)
else()
set(ZLIB_LIBRARIES zlib)
set(ZLIB_INCLUDE_DIR ${ZLIB_DIR})
@@ -171,10 +168,7 @@ include_directories(${ZLIB_INCLUDE_DIR})
# libpng
if(USE_SHARED_LIBPNG)
- find_package(PNG)
- if(NOT PNG_FOUND)
- message(FATAL_ERROR "libpng not found")
- endif()
+ find_package(PNG REQUIRED)
add_definitions(${PNG_DEFINITIONS})
else()
set(PNG_LIBRARIES libpng)
@@ -222,8 +216,7 @@ include_directories(${PIXMAN_INCLUDE_DIR})
# freetype
if(USE_SHARED_FREETYPE)
- find_library(FREETYPE_LIBRARY NAMES freetype)
- find_path(FREETYPE_INCLUDE_DIR NAMES freetype.h)
+ find_package(Freetype REQUIRED)
else()
set(FREETYPE_LIBRARY freetype)
set(FREETYPE_INCLUDE_DIR ${FREETYPE_DIR}/include)
@@ -232,9 +225,6 @@ include_directories(${FREETYPE_INCLUDE_DIR})
if(USE_SHARED_GIFLIB)
find_package(GIF REQUIRED)
- if(NOT GIF_FOUND)
- message(FATAL_ERROR "giflib not found")
- endif()
else()
set(GIF_LIBRARIES giflib)
set(GIF_INCLUDE_DIR ${GIFLIB_DIR}/lib)
@@ -242,10 +232,7 @@ endif()
include_directories(${GIF_INCLUDE_DIR})
if(USE_SHARED_JPEGLIB)
- find_package(JPEG)
- if(NOT JPEG_FOUND)
- message(FATAL_ERROR "jpeg not found")
- endif()
+ find_package(JPEG REQUIRED)
else()
set(JPEG_LIBRARIES jpeg)
set(JPEG_INCLUDE_DIR ${LIBJPEG_DIR})
@@ -264,8 +251,7 @@ if(USE_ALLEG4_BACKEND)
endif()
if(USE_SHARED_CURL)
- find_library(LIBCURL_LIBRARY NAMES curl)
- find_path(LIBCURL_INCLUDE_DIR NAMES curl/curl.h)
+ find_package(CURL REQUIRED)
else()
set(LIBCURL_LIBRARY libcurl)
set(LIBCURL_INCLUDE_DIR ${CURL_DIR}/include)
@@ -323,17 +309,11 @@ endif()
if(UNIX AND NOT APPLE AND NOT BEOS)
# Pthreads
- find_package(Threads)
- if(NOT CMAKE_USE_PTHREADS_INIT)
- message(FATAL_ERROR "Unix port requires pthreads support.")
- endif()
+ find_package(Threads REQUIRED)
list(APPEND PLATFORM_LIBS m ${CMAKE_THREAD_LIBS_INIT})
# X11
- find_package(X11)
- if(NOT X11_FOUND)
- message(FATAL_ERROR "Unix port requires X11 (e.g. libx11-dev).")
- endif()
+ find_package(X11 REQUIRED)
include_directories(SYSTEM ${X11_INCLUDE_DIR})
list(APPEND PLATFORM_LIBS ${X11_LIBRARIES})
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-games/aseprite.git
More information about the Pkg-games-commits
mailing list