CMakeLists.txt 2.95 KB
Newer Older
Alexandre Lision's avatar
Alexandre Lision committed
1 2 3 4 5 6
CMAKE_MINIMUM_REQUIRED(VERSION 2.8)

IF(POLICY CMP0022)
  CMAKE_POLICY(SET CMP0022 NEW)
ENDIF(POLICY CMP0022)

7 8 9 10
SET(PROJ_NAME Ring)
SET(RING_VERSION 1.0)

PROJECT(${PROJ_NAME})
Alexandre Lision's avatar
Alexandre Lision committed
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34

ADD_DEFINITIONS("-std=c++0x")

FIND_PACKAGE(Qt5Core REQUIRED)
FIND_PACKAGE(Qt5Gui REQUIRED)
FIND_PACKAGE(Qt5Widgets REQUIRED)
FIND_PACKAGE(LibRingClient REQUIRED)

# Instruct CMake to run moc automatically when needed.
SET(CMAKE_AUTOMOC ON)

INCLUDE_DIRECTORIES(SYSTEM ${Qt5Core_INCLUDE_DIRS})
INCLUDE_DIRECTORIES(SYSTEM ${Qt5Gui_INCLUDE_DIRS})
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR})
INCLUDE_DIRECTORIES( ${CMAKE_CURRENT_SOURCE_DIR})
INCLUDE_DIRECTORIES(${LIB_RING_CLIENT_INCLUDE_DIR})

MESSAGE("LibRingClient is here:" ${LIB_RING_CLIENT_INCLUDE_DIR})
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -w")

#Files to compile
SET(ringclient_SRCS
   main.cpp
   mainwindow.cpp
Alexandre Lision's avatar
Alexandre Lision committed
35
   minimalhistorybackend.cpp
Alexandre Lision's avatar
Alexandre Lision committed
36 37 38 39 40 41 42 43 44
   mysearchbar.cpp)

SET(ringclient_FORMS
   mainwindow.ui)

QT5_WRAP_UI(ringclient_FORMS_HEADERS ${ringclient_FORMS})

SET(ringclient_HDRS
   mainwindox.h
Alexandre Lision's avatar
Alexandre Lision committed
45
   minimalhistorybackend.h
Alexandre Lision's avatar
Alexandre Lision committed
46 47 48 49 50 51
   mysearchbar.h)

# Icons

# NOTE: Don't include the path in MACOSX_BUNDLE_ICON_FILE -- this is
# the property added to Info.plist
52
#SET(MACOSX_BUNDLE_ICON_FILE appicon.icns)
Alexandre Lision's avatar
Alexandre Lision committed
53 54 55 56 57 58

# And this part tells CMake where to find and install the file itself
SET(myApp_ICON ${CMAKE_CURRENT_SOURCE_DIR}/data/appicon.icns)
SET_SOURCE_FILES_PROPERTIES(${myApp_ICON} PROPERTIES
       MACOSX_PACKAGE_LOCATION "Resources")

Alexandre Lision's avatar
Alexandre Lision committed
59 60 61 62 63 64 65 66 67 68 69 70
SET(ring_ICONS ${CMAKE_CURRENT_SOURCE_DIR}/data/dark/ic_action_accept.png
${CMAKE_CURRENT_SOURCE_DIR}/data/dark/ic_action_call.png
${CMAKE_CURRENT_SOURCE_DIR}/data/dark/ic_action_cancel.png
${CMAKE_CURRENT_SOURCE_DIR}/data/dark/ic_action_email.png
${CMAKE_CURRENT_SOURCE_DIR}/data/dark/ic_action_new_email.png
${CMAKE_CURRENT_SOURCE_DIR}/data/dark/ic_action_search.png
${CMAKE_CURRENT_SOURCE_DIR}/data/dark/ic_action_video.png)
SET_SOURCE_FILES_PROPERTIES(${ring_ICONS} PROPERTIES
       MACOSX_PACKAGE_LOCATION "Resources")

qt5_add_resources(rcc_files ${CMAKE_CURRENT_SOURCE_DIR}/data.qrc)

71
ADD_EXECUTABLE(${PROJ_NAME} MACOSX_BUNDLE
Alexandre Lision's avatar
Alexandre Lision committed
72 73 74
   ${ringclient_SRCS}
   ${ringclient_HEADERS_MOC}
   ${ringclient_FORMS_HEADERS}
Alexandre Lision's avatar
Alexandre Lision committed
75 76 77
   ${myApp_ICON}
   ${ring_ICONS}
   ${rcc_files})
Alexandre Lision's avatar
Alexandre Lision committed
78

79
TARGET_LINK_LIBRARIES( ${PROJ_NAME}
Alexandre Lision's avatar
Alexandre Lision committed
80 81 82 83 84 85
   ${LIB_RING_CLIENT_LIBRARY}
   ${QT_QTCORE_LIBRARY}
   ${Qt5Widgets_LIBRARIES}
   ${QT_QTGUI_LIBRARY}
)

Alexandre Lision's avatar
Alexandre Lision committed
86

87 88 89 90 91 92 93 94 95 96 97
SET_TARGET_PROPERTIES(${PROJ_NAME} PROPERTIES
        MACOSX_BUNDLE_INFO_PLIST ${CMAKE_CURRENT_SOURCE_DIR}/cmake/MacOSXBundleInfo.plist.in
        MACOSX_BUNDLE_GUI_IDENTIFIER "cx.ring"
        MACOSX_BUNDLE_SHORT_VERSION_STRING ${RING_VERSION}
        MACOSX_BUNDLE_LONG_VERSION_STRING "${PROJ_NAME} ${RING_VERSION} Nightly"
        MACOSX_BUNDLE_BUNDLE_VERSION ${RING_VERSION}
        MACOSX_BUNDLE_COPYRIGHT "${PROJ_NAME}"
        MACOSX_BUNDLE_INFO_STRING "Nightly build of ${PROJ_NAME} ${RING_VERSION} for testing and development"
        MACOSX_BUNDLE_BUNDLE_NAME ${PROJ_NAME}
        MACOSX_BUNDLE_ICON_FILE "appicon.icns"
    )