CMakeLists.txt 2.59 KB
Newer Older
1
project(akabei)
2

Luca Giambonini's avatar
Luca Giambonini committed
3
cmake_minimum_required(VERSION 3.0.0)
4
set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake/modules")
Luca Giambonini's avatar
Luca Giambonini committed
5

6 7 8 9 10 11 12 13 14 15
# KF5 global definitions, use them to be compatible with KF5 applications
add_definitions(#-DQT_NO_CAST_TO_ASCII
                #-DQT_NO_CAST_FROM_ASCII
                -DQT_NO_URL_CAST_FROM_STRING
                -DQT_NO_CAST_FROM_BYTEARRAY
                -DQT_NO_SIGNALS_SLOTS_KEYWORDS
                -DQT_USE_FAST_OPERATOR_PLUS
                -DQT_USE_QSTRINGBUILDER
               )

16 17
set(DATA_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/share/akabei" CACHE "Akabei data's install dir" STRING)
set(SCRIPTS_INSTALL_DIR "${DATA_INSTALL_DIR}/python" CACHE "Akabei scripts' install dir" STRING)
18
set(LOCALE_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/share/locale" CACHE "Akabei locales' install dir" STRING)
19

Luca Giambonini's avatar
Luca Giambonini committed
20
find_package(Qt5 5.2.0 REQUIRED CONFIG COMPONENTS Core Network)
21
find_package(AkabeiCore REQUIRED)
22
find_package(AkabeiClient REQUIRED)
Lukas Appelhans's avatar
Lukas Appelhans committed
23
find_package(MSGFMT REQUIRED)
Lisa's avatar
Lisa committed
24 25 26 27 28 29 30

# This header adds a macro to make the licenses accessible to akabei independently of the install prefix
configure_file(
    "${CMAKE_CURRENT_SOURCE_DIR}/akabeilicensepath.h.cmake"
    "${CMAKE_CURRENT_BINARY_DIR}/akabeilicensepath.h"
    IMMEDIATE @ONLY
)
31

Luca Giambonini's avatar
Luca Giambonini committed
32 33 34
add_definitions(${QT_DEFINITIONS} -W -Wall)
add_definitions(-Werror)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
35

36
include_directories(BEFORE SYSTEM
Luca Giambonini's avatar
Luca Giambonini committed
37 38
                    ${Qt5Core_LIBRARIES}
                    ${Qt5Network_LIBRARIES}
39
                    ${CMAKE_CURRENT_BINARY_DIR}
Lisa's avatar
Lisa committed
40
                    ${CMAKE_SOURCE_DIR}
41 42
                    ${AKABEICLIENT_INCLUDE_DIR}
                    ${AKABEICORE_INCLUDE_DIR})
43

44
set(apm_SRCS
45
progressbar.cpp
46
fieldnames.cpp
47
utils.cpp
48 49 50 51 52 53 54
queueoperation.cpp
upgradeoperation.cpp
removeoperation.cpp
syncoperation.cpp
queryoperation.cpp
performoperation.cpp
apm.cpp
55
akabeioptions.cpp
56 57 58
parser.cpp
akabeiparser.cpp
pakabeiparser.cpp
Lisa's avatar
Lisa committed
59
akabeiaboutdata.cpp
60 61
main.cpp)

62
add_subdirectory(tools)
63
add_subdirectory(scripts)
Lukas Appelhans's avatar
Lukas Appelhans committed
64
add_subdirectory(translations)
65
add_subdirectory(docs)
Lisa's avatar
Lisa committed
66 67 68
add_subdirectory(licenses)

add_executable(akabei ${apm_SRCS} ${MISSING_MOCS})
Luca Giambonini's avatar
Luca Giambonini committed
69 70 71
set_target_properties(akabei PROPERTIES AUTOMOC TRUE)

target_link_libraries(akabei ${Qt5Core_LIBRARIES} ${Qt5Network_LIBRARIES} ${AKABEICORE_LIBRARIES} ${AKABEICLIENT_LIBRARIES})
Lisa's avatar
Lisa committed
72 73
install(TARGETS akabei
        RUNTIME DESTINATION bin)
74

Lisa's avatar
Lisa committed
75
add_executable(pakabei ${apm_SRCS} ${MISSING_MOCS})
Luca Giambonini's avatar
Luca Giambonini committed
76 77 78
set_target_properties(pakabei PROPERTIES AUTOMOC TRUE)

target_link_libraries(pakabei ${Qt5Core_LIBRARIES} ${Qt5Network_LIBRARIES} ${AKABEICORE_LIBRARIES} ${AKABEICLIENT_LIBRARIES})
Lisa's avatar
Lisa committed
79 80
install(TARGETS pakabei
        RUNTIME DESTINATION bin)