-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathCMakeLists.txt
39 lines (27 loc) · 1.03 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
#--------------------------------------------------------------------------
# EDE project
#--------------------------------------------------------------------------
cmake_minimum_required(VERSION 2.8.11)
project(EDE)
# Instruct CMake to run moc automatically when needed.
set(CMAKE_AUTOMOC ON)
#Runs UIC if ui_XXX.h is included in headers and expects XXX.ui
SET(CMAKE_AUTOUIC ON)
#QT Resource files
SET(CMAKE_AUTORCC ON)
# Find includes in corresponding build directories
set(CMAKE_INCLUDE_CURRENT_DIR ON)
FIND_PACKAGE(Qt5Widgets REQUIRED)
INCLUDE_DIRECTORIES(${Qt5Widgets_INCLUDES})
FILE(GLOB HEAD "code/*.h")
FILE(GLOB SRC "code/*.cpp")
LIST(APPEND CODE ${HEAD} ${SRC})
SOURCE_GROUP("code" FILES ${CODE})
FILE(GLOB UI "code/*.ui")
SOURCE_GROUP("ui" FILES ${UI})
SET(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/bin")
ADD_EXECUTABLE(EDE WIN32 ${CODE} ${UI})
TARGET_LINK_LIBRARIES(EDE Qt5::Widgets)
ADD_CUSTOM_COMMAND(TARGET EDE PRE_BUILD
COMMAND ${CMAKE_COMMAND} -E make_directory
${CMAKE_CURRENT_SOURCE_DIR}/bin)