CMakeLists.txt 2.03 KB
Newer Older
Linus Jahn's avatar
Linus Jahn committed
1
cmake_minimum_required(VERSION 2.8.11)
2 3
set(CMAKE_CXX_STANDARD 14)
set(QT_MIN_VERSION "5.7.0")
Linus Jahn's avatar
Linus Jahn committed
4 5 6

project(kaidan)

7 8 9 10
# application name
set(APPLICATION_ID "harbour.kaidan")
set(APPLICATION_NAME "kaidan")
set(APPLICATION_DISPLAY_NAME "Kaidan")
11
set(APPLICATION_DESCRIPTION "Cross platform XMPP client")
12

13 14 15
set(ORGANIZAITON_NAME "KaidanIM")
set(ORGANIZATION_DOMAIN "kaidanim.github.io")

Linus Jahn's avatar
Linus Jahn committed
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
# Version
set(VERSION_MAJOR 0)
set(VERSION_MINOR 0)
set(VERSION_PATCH 1)
set(VERSION_EXTRA "" CACHE STRING "Stuff to append to version string")

set(VERSION_STRING "${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}")
if(VERSION_EXTRA)
	set(VERSION_STRING ${VERSION_STRING}-${VERSION_EXTRA})
endif()


# Find includes in corresponding build directories
set(CMAKE_INCLUDE_CURRENT_DIR ON)

# Instruct CMake to run moc, uic and rcc automatically when needed.
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTOUIC ON)
set(CMAKE_AUTORCC ON)


# Set output path for executables
set(EXECUTABLE_OUTPUT_PATH "bin")


41 42 43 44
#
# Dependecies
#

Linus Jahn's avatar
Linus Jahn committed
45 46 47 48
# CMake module path
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake")

# Find packages
49
find_package(Qt5 ${QT_MIN_VERSION} REQUIRED NO_MODULE COMPONENTS Core Qml Quick LinguistTools)
Linus Jahn's avatar
Linus Jahn committed
50 51 52 53
find_package(KF5Kirigami REQUIRED)
find_package(Swiften REQUIRED)
find_package(Boost REQUIRED)

54 55 56 57 58 59 60 61 62
#
# Translation
#

include("${CMAKE_SOURCE_DIR}/i18n/CMakeLists.txt")

#
# Sources / Resources
#
Linus Jahn's avatar
Linus Jahn committed
63 64 65 66 67 68 69 70 71

add_executable(${PROJECT_NAME}
	kaidan.qrc
	src/main.cpp
	src/Kaidan.cpp
	src/RosterController.cpp
	src/RosterItem.cpp
)

72 73 74 75
#
# Linker Flags
#

Linus Jahn's avatar
Linus Jahn committed
76 77 78 79 80 81 82
target_link_libraries(${PROJECT_NAME}
	Qt5::Core
	Qt5::Qml
	Qt5::Quick
	${SWIFTEN_LIBRARY}
	${Boost_LIBRARY}
)
83

84 85 86 87
#
# Global C++ variables
#

88 89 90 91
target_compile_definitions(${PROJECT_NAME} PRIVATE
	APPLICATION_ID="${APPLICATION_ID}"
	APPLICATION_NAME="${APPLICATION_NAME}"
	APPLICATION_DISPLAY_NAME="${APPLICATION_DISPLAY_NAME}"
92
	APPLICATION_DESCRIPTION="${APPLICATION_DESCRIPTION}"
93 94
	ORGANIZAITON_NAME="${ORGANIZAITON_NAME}"
	ORGANIZATION_DOMAIN="${ORGANIZATION_DOMAIN}"
95 96

	VERSION_STRING="${VERSION_STRING}"
97 98

	BOOST_SIGNALS_NO_DEPRECATION_WARNING=True
99
)