forked from zxing-cpp/zxing-cpp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
75 lines (61 loc) · 1.75 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
72
73
74
if (${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_CURRENT_SOURCE_DIR})
# this is the top level project
cmake_minimum_required (VERSION 2.8.12)
project (ZXingGdiPlus)
set (ENABLE_ENCODERS OFF CACHE BOOL "Check to include encoders")
set (ENABLE_DECODERS ON CACHE BOOL "Check to include decoders")
set (LINK_CPP_STATICALLY OFF CACHE BOOL "MSVC only, check to link statically standard library (/MT and /MTd)")
add_definitions (-DUNICODE -D_UNICODE)
if (MSVC AND LINK_CPP_STATICALLY)
set (CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} /MT")
set (CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /MT")
set (CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} /MTd")
set (CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /MTd")
endif()
endif()
if (NOT DEFINED ENABLE_ENCODERS)
set (ENABLE_ENCODERS OFF)
endif()
if (NOT DEFINED ENABLE_DECODERS)
set (ENABLE_DECODERS ON)
endif()
add_subdirectory (${CMAKE_CURRENT_SOURCE_DIR}/../../core ${CMAKE_BINARY_DIR}/ZXingCore)
set (LOCAL_COMMON_FILES
GdiplusInit.h
GdiplusInit.cpp
)
if (ENABLE_DECODERS)
set (DECODERS_FILES
ImageReader.h
ImageReader.cpp
BarcodeReader.h
BarcodeReader.cpp
)
endif()
if (ENABLE_ENCODERS)
set (ENCODERS_FILES
ImageWriter.h
ImageWriter.cpp
BarcodeGenerator.h
BarcodeGenerator.cpp
)
endif()
source_group (Sources FILES
${LOCAL_COMMON_FILES}
${DECODERS_FILES}
${ENCODERS_FILES}
)
add_library (ZXingGdiPlus
${LOCAL_COMMON_FILES}
${DECODERS_FILES}
${ENCODERS_FILES}
)
target_include_directories (ZXingGdiPlus
PUBLIC .
)
target_link_libraries (ZXingGdiPlus
PRIVATE ZXingCore gdiplus.lib
)
target_compile_options (ZXingGdiPlus
PUBLIC -DGDIPVER=0x0110
)