forked from hluk/CopyQ
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
43 lines (34 loc) · 1.28 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
project(copyq)
OPTION(WITH_QT5 "Qt5 support" OFF)
OPTION(WITH_TESTS "Run test cases from command line" OFF)
OPTION(WITH_PLUGINS "Compile plugins" ON)
if (WITH_QT5)
cmake_minimum_required(VERSION 2.8.8)
find_package(Qt5Widgets REQUIRED)
else()
cmake_minimum_required(VERSION 2.8)
find_package(Qt4 REQUIRED)
endif()
set(copyq_ICON src/images/logo.svg)
set(copyq_DESKTOP shared/copyq.desktop)
# Be more strict while compiling debugging version
if(CMAKE_COMPILER_IS_GNUCXX OR "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-long-long")
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -Wextra -Wall -pedantic")
endif()
# Tests always on with debug version
if(CMAKE_BUILD_TYPE MATCHES Debug)
set(WITH_TESTS ON)
add_definitions( -DCOPYQ_LOG_DEBUG )
endif()
if (${CMAKE_SYSTEM_NAME} MATCHES "Linux")
install(FILES ${copyq_ICON} DESTINATION "${CMAKE_INSTALL_PREFIX}/share/icons" RENAME copyq.svg)
install(FILES ${copyq_DESKTOP} DESTINATION "${CMAKE_INSTALL_PREFIX}/share/applications")
set(copyq_plugin_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/lib/copyq/plugins")
else()
set(copyq_plugin_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/plugins")
endif()
add_subdirectory(src)
if (WITH_PLUGINS)
add_subdirectory(plugins)
endif()