/
CMakeLists.txt
59 lines (45 loc) · 1.61 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
cmake_minimum_required(VERSION 3.9)
project(pdf_sigil)
set(CMAKE_C_STANDARD 11)
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -pedantic")
# header files
include_directories(include)
file(GLOB LIB_SRC "lib/*.c")
set (TEST_SRC "test/test.c")
# build both static and shared library
add_library(pdfsigil_static STATIC ${LIB_SRC})
add_library(pdfsigil SHARED ${LIB_SRC})
target_link_libraries(pdfsigil_static crypto)
target_link_libraries(pdfsigil crypto)
# build selftest executable
add_executable(selftest ${TEST_SRC})
target_link_libraries(selftest pdfsigil)
#build pdf-sigil - PoC command-line application
add_executable(pdf-sigil src/pdf-sigil.c)
target_link_libraries(pdf-sigil pdfsigil)
# running selftest
add_custom_target(run_tests ALL
COMMAND selftest
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
add_custom_target(run_tests_verbose
COMMAND selftest --verbose
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
)
add_custom_target(run_tests_quiet
COMMAND selftest --quiet
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
)
# generating the documentation with a Doxygen
find_package(Doxygen)
if (DOXYGEN_FOUND)
set(doxyfile_in ${CMAKE_CURRENT_SOURCE_DIR}/Doxyfile.in)
set(doxyfile ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile)
configure_file(${doxyfile_in} ${doxyfile})
add_custom_target(doc ALL
COMMAND ${DOXYGEN_EXECUTABLE} ${doxyfile}
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
COMMENT "Generating API documentation with Doxygen"
VERBATIM)
else (DOXYGEN_FOUND)
message("Install Doxygen for generation of the documentation")
endif (DOXYGEN_FOUND)