bdf2sfd

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

CMakeLists.txt (1806B)


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