forked from VSRonin/QtXlsxWriter
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathCMakeLists.txt
88 lines (74 loc) · 2.14 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
87
cmake_minimum_required(VERSION 3.2)
project(QtXlsxWriter)
add_definitions(-DQT_BUILD_XLSX_LIB)
set(BUILD_SHARED_LIBS TRUE)
set(CMAKE_AUTOMOC ON)
if (NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE "Release")
endif()
file(
GLOB
QtXlsxWriter_SOURCE_FILES
${CMAKE_CURRENT_SOURCE_DIR}/src/xlsx/*.cpp
${CMAKE_CURRENT_BINARY_DIR}/QtXlsxWriterTest_automoc.cpp
)
find_package(Qt5 5.5 REQUIRED Core Gui Test)
include_directories(
${CMAKE_CURRENT_SOURCE_DIR}/src/xlsx/
${Qt5Core_INCLUDE_DIRS}
${Qt5Gui_INCLUDE_DIRS}
${Qt5Gui_PRIVATE_INCLUDE_DIRS} )
add_library(QtXlsxWriter SHARED "${QtXlsxWriter_SOURCE_FILES}")
# automatically add C++11 support with GCC
if(NOT MSVC)
target_compile_features(QtXlsxWriter PRIVATE cxx_range_for)
endif()
set_target_properties(QtXlsxWriter PROPERTIES DEBUG_POSTFIX "d")
target_link_libraries(QtXlsxWriter ${Qt5Core_LIBRARIES})
target_link_libraries(QtXlsxWriter ${Qt5Gui_LIBRARIES})
if(BUILD_TESTING)
add_subdirectory(tests)
endif()
if(BUILD_EXAMPLES)
add_custom_command(TARGET QtXlsxWriter POST_BUILD
COMMAND ${CMAKE_COMMAND}
-E copy_directory $<CONFIGURATION> ${CMAKE_CURRENT_BINARY_DIR}/examples/xlsx/$<CONFIGURATION>)
add_subdirectory(examples/xlsx)
endif()
##
#
# QtxlsxwriterVersion.cmake creation
#
##
set(QtXlsxWriter_CONFIG_PATH ${CMAKE_INSTALL_PREFIX})
configure_file(QtXlsxWriterConfig.cmake.in QtXlsxWriterConfig.cmake @ONLY)
#####
#
# Installation configuration
#
#####
INSTALL(TARGETS QtXlsxWriter
RUNTIME DESTINATION bin
LIBRARY DESTINATION lib
ARCHIVE DESTINATION lib
)
INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/QtXlsxWriterConfig.cmake DESTINATION lib/cmake/${PROJECT_NAME})
SET(INCLUDE_FILES
src/xlsx/xlsxabstractooxmlfile.h
src/xlsx/xlsxabstractsheet.h
src/xlsx/xlsxcell.h
src/xlsx/xlsxcellformula.h
src/xlsx/xlsxcellrange.h
src/xlsx/xlsxcellreference.h
src/xlsx/xlsxchart.h
src/xlsx/xlsxchartsheet.h
src/xlsx/xlsxconditionalformatting.h
src/xlsx/xlsxdatavalidation.h
src/xlsx/xlsxdocument.h
src/xlsx/xlsxformat.h
src/xlsx/xlsxglobal.h
src/xlsx/xlsxrichstring.h
src/xlsx/xlsxworkbook.h
src/xlsx/xlsxworksheet.h
)
INSTALL(FILES ${INCLUDE_FILES} DESTINATION include)