-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathCMakeLists.txt
71 lines (63 loc) · 3.04 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
cmake_minimum_required(VERSION 2.4.4...3.5.0)
project(libfudge)
option(LIBFUDGE_IMPORT_LIBXML "Include libxml2 from subrepo" ON)
option(LIBFUDGE_IMPORT_LUA "Include Lua 5.3 from lua.cmake" ON)
option(LIBFUDGE_IMPORT_FP "Include libfp from subrepo" ON)
set(FUDGE_CORE
fuji.c
tester.c
data.c
net.c
discovery.c
exif.c
fuji_usb.c
object.c
fuji_lua.c
lua_runtime.c
)
add_library(libfudge STATIC ${FUDGE_CORE})
target_compile_options(libfudge
PRIVATE -Wall -Wshadow -Wcast-qual -Wpedantic -Werror=incompatible-pointer-types -Werror=deprecated-declarations
)
if(LIBFUDGE_IMPORT_LUA)
include(../third_party/lua.cmake)
endif()
if(LIBFUDGE_IMPORT_LIBXML)
option(BUILD_SHARED_LIBS "Build shared libraries" OFF)
option(LIBXML2_WITH_CATALOG "Add the Catalog support" OFF)
option(LIBXML2_WITH_DEBUG "Add the debugging module" OFF)
option(LIBXML2_WITH_HTML "Add the HTML support" OFF)
option(LIBXML2_WITH_HTTP "Add the HTTP support" OFF)
option(LIBXML2_WITH_ICONV "Add ICONV support" OFF)
option(LIBXML2_WITH_ICU "Add ICU support" OFF)
option(LIBXML2_WITH_ISO8859X "Add ISO8859X support if no iconv" OFF)
option(LIBXML2_WITH_LEGACY "Add deprecated APIs for compatibility" OFF)
option(LIBXML2_WITH_LZMA "Use liblzma" OFF)
option(LIBXML2_WITH_MODULES "Add the dynamic modules support" OFF)
option(LIBXML2_WITH_OUTPUT "Add the serialization support" ON)
option(LIBXML2_WITH_PATTERN "Add the xmlPattern selection interface" OFF)
option(LIBXML2_WITH_PROGRAMS "Build programs" OFF)
option(LIBXML2_WITH_PUSH "Add the PUSH parser interfaces" OFF)
option(LIBXML2_WITH_PYTHON "Build Python bindings" OFF)
option(LIBXML2_WITH_READLINE "readline support for xmllint shell" OFF)
option(LIBXML2_WITH_REGEXPS "Add Regular Expressions support" OFF)
option(LIBXML2_WITH_SAX1 "Add the older SAX1 interface" OFF)
option(LIBXML2_WITH_TESTS "Build tests" OFF)
option(LIBXML2_WITH_THREADS "Add multithread support" OFF)
option(LIBXML2_WITH_TLS "Enable thread-local storage" OFF)
option(LIBXML2_WITH_VALID "Add the DTD validation support" OFF)
option(LIBXML2_WITH_XINCLUDE "Add the XInclude support" OFF)
option(LIBXML2_WITH_XPATH "Add the XPATH support" OFF)
option(LIBXML2_WITH_ZLIB "Use libz" OFF)
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../third_party/libxml2 ${CMAKE_CURRENT_BINARY_DIR}/libxml2 EXCLUDE_FROM_ALL)
set(LIBXML2_INCLUDE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/../third_party/libxml2/include ${CMAKE_CURRENT_BINARY_DIR}/libxml2)
set(LIBXML2_LIBRARIES LibXml2::LibXml2)
endif()
if(LIBFUDGE_IMPORT_FP)
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/fp ${CMAKE_CURRENT_BINARY_DIR}/fp)
endif()
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/libpict ${CMAKE_CURRENT_BINARY_DIR}/libpict)
target_include_directories(libfudge PUBLIC ${PROJECT_SOURCE_DIR} ${LUA_INCLUDE_DIRS})
target_link_libraries(libfudge PUBLIC libpict fp lua ${LUA_LIBRARIES})
target_compile_definitions(libfudge PUBLIC ${LUA_CFLAGS_OTHER})
set_target_properties(libfudge PROPERTIES OUTPUT_NAME libfudge)