ansilove

ANSI and ASCII art to PNG converter in C
Log | Files | Refs | README | LICENSE

commit d6a5720f988e809083d67a025b48842c0dab9829
parent 2f5d156a2e61de4971e7094e506027ee4882cb43
Author: Frederic Cambus <fred@statdns.com>
Date:   Tue, 12 Jan 2016 07:55:04 +0100

Removing hardcoded paths for GD library detection

Diffstat:
MCMakeLists.txt | 12++++++++----
1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt @@ -3,14 +3,18 @@ cmake_minimum_required (VERSION 2.6) project (ansilove C) include(CheckFunctionExists) -include_directories(/usr/local/include /usr/pkg/include) include(GNUInstallDirs) +# Check if system has strtonum +list(APPEND CMAKE_REQUIRED_DEFINITIONS -D_OPENBSD_SOURCE) check_function_exists(strtonum HAVE_STRTONUM) -find_library(LIB_GD NAMES gd REQUIRED) +# GD +find_path(GD_INCLUDE_DIRS gd.h) +find_library(GD_LIBRARIES NAMES gd REQUIRED) +include_directories(${GD_INCLUDE_DIRS}) -set (SRC src/main.c src/albinfonts.c src/ansilove.c src/explode.c src/filesize.c src/strtolower.c src/substr.c) +set(SRC src/main.c src/albinfonts.c src/ansilove.c src/explode.c src/filesize.c src/strtolower.c src/substr.c) if(NOT HAVE_STRTONUM) set (SRC ${SRC} compat/strtonum.c) @@ -19,7 +23,7 @@ endif() add_definitions(-Wall -Wextra -Werror -std=gnu99 -pedantic) add_executable(ansilove ${SRC}) -target_link_libraries(ansilove ${LIB_GD} m) +target_link_libraries(ansilove ${GD_LIBRARIES} m) install(TARGETS ansilove DESTINATION bin) install(FILES ansilove.1 DESTINATION ${CMAKE_INSTALL_MANDIR}/man1/)