-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathCMakeLists.txt
59 lines (50 loc) · 1.67 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 -G "MinGW Makefiles"
cmake_minimum_required(VERSION 3.15)
Project(Ods2)
# https://cmake.org/cmake/help/latest/prop_tgt/CXX_STANDARD.html
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
# using Clang
elseif (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
# using GCC
elseif (CMAKE_CXX_COMPILER_ID STREQUAL "Intel")
# using Intel C++
elseif (CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
# using Visual Studio C++
endif()
find_package(QT NAMES Qt6 COMPONENTS Core Gui REQUIRED)
find_package(Qt6 COMPONENTS Core Gui REQUIRED) #5.15
# if (QT_VERSION_MAJOR EQUAL 6)
# find_package(Qt6 COMPONENTS Core5Compat REQUIRED)
# endif()
#only build zlib on windows because unix has it by default
#IF(WIN32)
# include_directories(${Ods2_SOURCE_DIR}/zlib)
# link_directories(${Ods2_BINARY_DIR}/lib)
# set_property(GLOBAL PROPERTY zlib_libs_property "zlib")
#ELSE (WIN32)
# find_package(ZLIB REQUIRED)
# if (ZLIB_FOUND)
# include_directories(${ZLIB_INCLUDE_DIRS})
# set_property(GLOBAL PROPERTY zlib_libs_property "${ZLIB_LIBRARIES}")
# endif(ZLIB_FOUND)
#ENDIF (WIN32)
if(WIN32)
set (CMAKE_PREFIX_PATH "C:\\Qt\\Qt5.12.9\\5.12.9\\mingw73_64\\")
# set (CMAKE_PREFIX_PATH "C:\\Qt\\Qt5.7.1\\5.7\\msvc2015_64\\")
endif (WIN32)
set(LIBRARY_OUTPUT_PATH "${Ods2_BINARY_DIR}/lib")
#set (BUILD_STATIC_LIBRARIES "1")
if (BUILD_STATIC_LIBRARIES)
set(ODS_STATIC "1")
#set(QUAZIP_STATIC "1")
set(ZLIB_STATIC "1")
endif (BUILD_STATIC_LIBRARIES)
#if (WIN32)
# add_subdirectory(zlib)
#endif(WIN32)
#add_subdirectory(quazip)
add_subdirectory(ods)
add_subdirectory(examples)