forked from dbzhang800/QtXlsxWriter
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathCMakeLists.txt
86 lines (76 loc) · 2.28 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
75
76
77
78
79
80
81
82
83
84
85
86
cmake_minimum_required(VERSION 3.30)
project(xlsx CXX)
###############
# ASI default settings
list(APPEND CMAKE_MODULE_PATH "$ENV{ASV_CMAKE}")
include(asv_cmake_defaults)
asv_cmake_defaults( )
###############
set(libname xlsx)
message(STATUS ${CMAKE_CURRENT_LIST_FILE})
list(APPEND CMAKE_PREFIX_PATH ${AQTDIR})
set(QT_LIBINFIX "ASV")
find_package(Qt5 CONFIG REQUIRED COMPONENTS Gui)
# get header files that are not *_p.h
file(GLOB tmp_hdr ${CMAKE_CURRENT_SOURCE_DIR}/src/xlsx/*.h)
foreach(hdr_file ${tmp_hdr})
string(REGEX MATCH ".*_p.h" hdr_match ${hdr_file})
if ("${hdr_match}" STREQUAL "")
list(APPEND hdrs ${hdr_file})
endif()
endforeach()
add_library(${libname} SHARED)
target_link_libraries(${libname} Qt5::GuiPrivate)
set_target_properties(${libname} PROPERTIES AUTOMOC ON)
set_target_properties(${libname} PROPERTIES WINDOWS_EXPORT_ALL_SYMBOLS ON)
if (UNIX)
# force linker to resolve all deps
set_target_properties(${libname} PROPERTIES LINK_FLAGS "-Wl,--no-undefined")
endif (UNIX)
target_sources(${libname} PRIVATE
src/xlsx/xlsxabstractooxmlfile.cpp
src/xlsx/xlsxabstractsheet.cpp
src/xlsx/xlsxanchor.cpp
src/xlsx/xlsxcell.cpp
src/xlsx/xlsxcellformula.cpp
src/xlsx/xlsxcellrange.cpp
src/xlsx/xlsxcellreference.cpp
src/xlsx/xlsxchart.cpp
src/xlsx/xlsxchartsheet.cpp
src/xlsx/xlsxcolor.cpp
src/xlsx/xlsxconditionalformatting.cpp
src/xlsx/xlsxcontenttypes.cpp
src/xlsx/xlsxdatavalidation.cpp
src/xlsx/xlsxdocpropsapp.cpp
src/xlsx/xlsxdocpropscore.cpp
src/xlsx/xlsxdocument.cpp
src/xlsx/xlsxdrawing.cpp
src/xlsx/xlsxdrawinganchor.cpp
src/xlsx/xlsxformat.cpp
src/xlsx/xlsxmediafile.cpp
src/xlsx/xlsxnumformatparser.cpp
src/xlsx/xlsxoleobject.cpp
src/xlsx/xlsxrelationships.cpp
src/xlsx/xlsxrichstring.cpp
src/xlsx/xlsxsharedstrings.cpp
src/xlsx/xlsxsimpleooxmlfile.cpp
src/xlsx/xlsxstyles.cpp
src/xlsx/xlsxtheme.cpp
src/xlsx/xlsxutility.cpp
src/xlsx/xlsxworkbook.cpp
src/xlsx/xlsxworksheet.cpp
src/xlsx/xlsxzipreader.cpp
src/xlsx/xlsxzipwriter.cpp
${hdrs}
)
# libraries
install(
TARGETS ${libname}
LIBRARY DESTINATION lib
RUNTIME DESTINATION bin
ARCHIVE DESTINATION lib
)
install(
FILES ${hdrs}
DESTINATION include/${libname}
)