forked from H-uru/PlasmaShop
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
60 lines (49 loc) · 1.73 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
project(PlasmaShop)
cmake_minimum_required(VERSION 2.8.11.2)
set(CMAKE_AUTOMOC TRUE)
if(POLICY CMP0071)
# Don't run generated source files (bytes/python_*.cpp) through automoc
cmake_policy(SET CMP0071 OLD)
endif()
find_package(HSPlasma REQUIRED)
find_package(string_theory REQUIRED)
find_package(Qt5Core REQUIRED)
find_package(Qt5Gui REQUIRED)
find_package(Qt5Widgets REQUIRED)
add_definitions(-DST_NO_2_0_DEPRECATION)
if(MSVC)
add_definitions("/D_CRT_SECURE_NO_WARNINGS")
# Fix <windows.h> doing stupid stuff to QDateTime's header
add_definitions("/DNOMINMAX")
endif()
add_subdirectory(QScintilla/Qt4Qt5)
if(WIN32)
add_definitions(-DPLAT_FONT="Courier New")
else()
add_definitions(-DPLAT_FONT="Monospace")
endif()
# do this after QScintilla - it generates tons of warnings
if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX OR
CMAKE_CXX_COMPILER_ID MATCHES ".*Clang")
set(WARNING_FLAGS "-Wall -Wextra")
set(CMAKE_CXX_FLAGS "-std=c++0x ${WARNING_FLAGS} ${CMAKE_CXX_FLAGS}")
set(CMAKE_C_FLAGS "${WARNING_FLAGS} ${CMAKE_C_FLAGS}")
endif()
# Get the version number from git
set(PlasmaShop_VERSION "3.0-untracked")
if(EXISTS "${CMAKE_SOURCE_DIR}/.git")
find_program(GIT_EXECUTABLE NAMES git git.cmd)
mark_as_advanced(GIT_EXECUTABLE)
if(GIT_EXECUTABLE)
execute_process(COMMAND ${GIT_EXECUTABLE} describe --dirty
OUTPUT_VARIABLE PlasmaShop_VERSION
OUTPUT_STRIP_TRAILING_WHITESPACE
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR})
endif()
endif()
add_definitions(-DPLASMASHOP_VERSION="${PlasmaShop_VERSION}")
include_directories(${STRING_THEORY_INCLUDE_DIRS})
add_subdirectory(src)
if(WIN32)
add_subdirectory(icons/win32)
endif()