-
Notifications
You must be signed in to change notification settings - Fork 1
/
CMakeLists.txt
51 lines (39 loc) · 1.4 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
cmake_minimum_required(VERSION 3.20)
project(Reader LANGUAGES C CXX
VERSION 0.3.0
DESCRIPTION "a simple epub-file reader"
HOMEPAGE_URL "https://github.com/yyhran/epubreader"
)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall")
# set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ../res/icon.o")
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
set(CMAKE_CXX_EXTENSIONS ON)
set(CMAKE_BUILD_TYPE Release)
set(CMAKE_AUTOUIC ON)
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)
find_package(Qt5 COMPONENTS Widgets Core Gui Xml REQUIRED)
if(Qt5_FOUND)
message("Qt5_FOUND")
endif()
message("------------------------------------------------------------")
message("PROJECT_NAME: " ${PROJECT_NAME})
message("PROJECT_VERSION: " ${PROJECT_VERSION})
message("DESCRIPTION: " ${PROJECT_DESCRIPTION})
message("HOMEPAGE_URL: " ${PROJECT_HOMEPAGE_URL})
message("------------------------------------------------------------")
include_directories(
${PROJECT_SOURCE_DIR}/src
)
if(WIN32)
add_executable(${PROJECT_NAME} WIN32)
else()
add_executable(${PROJECT_NAME})
endif()
# file(GLOB_RECURSE sources CONFIGURE_DEPENDS *.cpp *.h)
file(GLOB sources CONFIGURE_DEPENDS res/res.qrc src/*.cpp src/*.h)
target_sources(${PROJECT_NAME} PUBLIC ${sources})
target_link_libraries(${PROJECT_NAME} PUBLIC Qt5::Widgets Qt5::Core Qt5::Gui Qt5::Xml z)