-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
57 lines (39 loc) · 1.29 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
cmake_minimum_required(VERSION 3.12)
project(qrcode)
set(CMAKE_CXX_STANDARD 20)
find_package( OpenCV REQUIRED )
include_directories( ${OpenCV_INCLUDE_DIRS} )
include_directories(${CMAKE_SOURCE_DIR}/src)
aux_source_directory(test TEST_SRC_LIST)
add_executable(unittest
${TEST_SRC_LIST}
src/ExtFiniteField256.cpp
)
target_link_libraries(unittest gtest pthread ${OpenCV_LIBS})
target_compile_options(unittest PUBLIC -O0 -g --coverage)
#target_compile_options(unittest PUBLIC -O2)
#target_compile_options(qrcode PUBLIC -O2)
target_link_options(unittest PUBLIC --coverage)
add_custom_target(lcov
COMMAND lcov --no-external --directory ${CMAKE_BINARY_DIR} --directory ${CMAKE_SOURCE_DIR} --capture --output-file capture.info
COMMAND genhtml capture.info -o cov_html
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
)
add_custom_target(applyCodeStyle
COMMAND find -iname '*.h' -o -iname '*.cpp' -o -iname '*.c' | xargs clang-format -i
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
)
add_custom_target(doxygen
COMMAND doxygen
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
)
add_executable(reedsolomon
src/main_reedsolomon.cpp
src/ExtFiniteField256.cpp
)
add_executable(qrcode
src/main_qrcode.cpp
src/ExtFiniteField256.cpp
)
target_compile_options(qrcode PUBLIC -O0 -g)
target_link_libraries( qrcode ${OpenCV_LIBS} )