bdf2sfd

BDF to SFD converter, allowing to vectorize bitmap fonts
Log | Files | Refs | README | LICENSE

CMakeLists.txt (1860B)


      1 #
      2 # bdf2sfd 1.1.5
      3 # Copyright (c) 2019-2020, Frederic Cambus
      4 # https://github.com/fcambus/bdf2sfd
      5 #
      6 # Created:      2019-11-21
      7 # Last Updated: 2020-10-10
      8 #
      9 # bdf2sfd is released under the BSD 2-Clause license
     10 # See LICENSE file for details
     11 #
     12 
     13 cmake_minimum_required (VERSION 2.6)
     14 
     15 project(bdf2sfd C)
     16 
     17 include(CheckFunctionExists)
     18 include(GNUInstallDirs)
     19 
     20 # Conditional build options
     21 set(ENABLE_SECCOMP 0
     22     CACHE BOOL "Enable building with seccomp")
     23 
     24 # Check if system has pledge and strtonum
     25 list(APPEND CMAKE_REQUIRED_DEFINITIONS -D_OPENBSD_SOURCE)
     26 check_function_exists(pledge HAVE_PLEDGE)
     27 check_function_exists(strtonum HAVE_STRTONUM)
     28 
     29 if(ENABLE_SECCOMP)
     30   # Check if system has seccomp
     31   message(STATUS "Looking for seccomp")
     32   find_path(SECCOMP NAMES "linux/seccomp.h")
     33   if(SECCOMP)
     34     message(STATUS "Looking for seccomp - found")
     35     add_definitions(-DHAVE_SECCOMP)
     36   else()
     37     message(STATUS "Looking for seccomp - not found")
     38   endif()
     39 endif(ENABLE_SECCOMP)
     40 
     41 # Additional include directories for compat functions + dependencies
     42 include_directories("compat")
     43 
     44 set(CMAKE_BUILD_TYPE Release)
     45 set(SRC src/bdf2sfd.c src/header.c src/parse.c src/polygon.c)
     46 
     47 if(NOT HAVE_PLEDGE)
     48   set (SRC ${SRC} compat/pledge.c)
     49 endif()
     50 
     51 if(NOT HAVE_STRTONUM)
     52   set (SRC ${SRC} compat/strtonum.c)
     53 endif()
     54 
     55 add_definitions(-D_GNU_SOURCE -D_FORTIFY_SOURCE=2 -Wall -Wextra -std=c99 -pedantic)
     56 add_executable(bdf2sfd ${SRC})
     57 
     58 install(TARGETS bdf2sfd DESTINATION ${CMAKE_INSTALL_BINDIR})
     59 install(FILES bdf2sfd.1 DESTINATION ${CMAKE_INSTALL_MANDIR}/man1/)
     60 
     61 enable_testing()
     62 add_test(bdf2sfd bdf2sfd)
     63 add_test(8x16 bdf2sfd ${PROJECT_SOURCE_DIR}/tests/spleen-8x16.bdf)
     64 add_test(12x24 bdf2sfd ${PROJECT_SOURCE_DIR}/tests/spleen-12x24.bdf)
     65 add_test(16x32 bdf2sfd ${PROJECT_SOURCE_DIR}/tests/spleen-16x32.bdf)
     66 add_test(32x64 bdf2sfd ${PROJECT_SOURCE_DIR}/tests/spleen-32x64.bdf)