libansilove

Library for converting ANSI, ASCII, and other formats to PNG
Log | Files | Refs | README | LICENSE

CMakeLists.txt (2390B)


      1 cmake_minimum_required (VERSION 2.6)
      2 
      3 set(LIB_VERSION_MAJOR 1)
      4 set(LIB_VERSION_MINOR 2)
      5 set(LIB_VERSION_PATCH 4)
      6 set(LIB_VERSION_STRING ${LIB_VERSION_MAJOR}.${LIB_VERSION_MINOR}.${LIB_VERSION_PATCH})
      7 
      8 project (ansilove C)
      9 
     10 include(CheckFunctionExists)
     11 include(GNUInstallDirs)
     12 
     13 # Check if system has strtonum
     14 check_function_exists(strtonum HAVE_STRTONUM)
     15 
     16 # Additional include directories for compat functions and headers
     17 include_directories("compat" "include" "src")
     18 
     19 # GD
     20 find_path(GD_INCLUDE_DIRS gd.h)
     21 find_library(GD_LIBRARIES NAMES gd REQUIRED)
     22 include_directories(${GD_INCLUDE_DIRS})
     23 
     24 set(SRC src/clean.c src/drawchar.c src/fonts.c src/error.c src/loadfile.c src/init.c src/output.c src/savefile.c)
     25 set(LOADERS src/loaders/ansi.c src/loaders/artworx.c src/loaders/binary.c src/loaders/icedraw.c src/loaders/pcboard.c src/loaders/tundra.c src/loaders/xbin.c)
     26 
     27 if(NOT HAVE_STRTONUM)
     28   set (SRC ${SRC} compat/strtonum.c)
     29 endif()
     30 
     31 add_definitions(-D_GNU_SOURCE -Wall -Wextra -std=c99 -pedantic)
     32 add_library(ansilove SHARED ${SRC} ${LOADERS})
     33 
     34 target_link_libraries(ansilove ${GD_LIBRARIES} m)
     35 
     36 set_target_properties(ansilove PROPERTIES
     37   VERSION ${LIB_VERSION_STRING} SOVERSION ${LIB_VERSION_MAJOR}
     38   C_VISIBILITY_PRESET hidden)
     39 
     40 install(TARGETS ansilove DESTINATION ${CMAKE_INSTALL_LIBDIR})
     41 install(FILES include/ansilove.h DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
     42 install(FILES man/libansilove.3 DESTINATION ${CMAKE_INSTALL_MANDIR}/man3/)
     43 install(FILES man/ansilove_clean.3 DESTINATION ${CMAKE_INSTALL_MANDIR}/man3/)
     44 install(FILES man/ansilove_error.3 DESTINATION ${CMAKE_INSTALL_MANDIR}/man3/)
     45 install(FILES man/ansilove_init.3 DESTINATION ${CMAKE_INSTALL_MANDIR}/man3/)
     46 install(FILES man/ansilove_loadfile.3 DESTINATION ${CMAKE_INSTALL_MANDIR}/man3/)
     47 install(FILES man/ansilove_savefile.3 DESTINATION ${CMAKE_INSTALL_MANDIR}/man3/)
     48 install(FILES man/ansilove_ansi.3 DESTINATION ${CMAKE_INSTALL_MANDIR}/man3/)
     49 install(FILES man/ansilove_artworx.3 DESTINATION ${CMAKE_INSTALL_MANDIR}/man3/)
     50 install(FILES man/ansilove_binary.3 DESTINATION ${CMAKE_INSTALL_MANDIR}/man3/)
     51 install(FILES man/ansilove_icedraw.3 DESTINATION ${CMAKE_INSTALL_MANDIR}/man3/)
     52 install(FILES man/ansilove_pcboard.3 DESTINATION ${CMAKE_INSTALL_MANDIR}/man3/)
     53 install(FILES man/ansilove_tundra.3 DESTINATION ${CMAKE_INSTALL_MANDIR}/man3/)
     54 install(FILES man/ansilove_xbin.3 DESTINATION ${CMAKE_INSTALL_MANDIR}/man3/)