-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathCMakeLists.txt
81 lines (68 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
#---------------------------------------------------------------------------
set(CMAKE_BUILD_TYPE Release
CACHE STRING
"Choose the type of build, options are: None Debug Release RelWithDebInfo MinSizeRel.")
set(CMAKE_INSTALL_PREFIX ${CMAKE_CURRENT_SOURCE_DIR} CACHE STRING "Normally the source dir")
#---------------------------------------------------------------------------
project(project)
cmake_minimum_required(VERSION 3.0)
set(CMAKE_DEBUG_POSTFIX "d")
set(CMAKE_ALLOW_LOOSE_LOOP_CONSTRUCTS TRUE)
#---------------------------------------------------------------------------
set(exec windowWithImage)
#---------------------------------------------------------------------------
option(QT_STATIC "Use the Static Qt lib" OFF)
#---------------------------------------------------------------------------
set (CMAKE_AUTOMOC ON)
set (CMAKE_AUTORCC ON)
find_package(Qt5 REQUIRED COMPONENTS Core Gui Widgets)
if (WIN32)
set(WinMain Qt5::WinMain)
endif()
set(QT_LIBRARIES
Qt5::Core
Qt5::Gui
Qt5::Widgets
${WinMain}
)
if (QT_STATIC)
include (qtstatic.cmake)
endif()
#---------------------------------------------------------------------------
# windows needs even more stuff
if(WIN32)
set(QT_LIBRARIES
${QT_LIBRARIES}
imm32
winmm
ws2_32
)
endif(WIN32)
#---------------------------------------------------------------------------
include_directories(
${CMAKE_SOURCE_DIR}
${CMAKE_SOURCE_DIR}/include
)
#---------------------------------------------------------------------------
set(sources
src/main.cpp
src/mainWindow.cpp
resources.qrc
)
set (headers
include/borderLess.h
include/windowWithImage.h
include/titleBarWindow.h
include/image.h
include/mainWindow.h
)
#---------------------------------------------------------------------------
add_executable(${exec} ${sources} ${headers})
#---------------------------------------------------------------------------
target_link_libraries(${exec}
${QT_LIBRARIES}
)
#---------------------------------------------------------------------------
install(TARGETS ${exec}
RUNTIME DESTINATION bin
)