CMakeLists.txt 2.28 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 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49

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
   mysearchbar.cpp)

SET(ringclient_FORMS
   mainwindow.ui)

QT5_WRAP_UI(ringclient_FORMS_HEADERS ${ringclient_FORMS})

SET(ringclient_HDRS
   mainwindox.h
   mysearchbar.h)

# Icons

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

# 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")

57
ADD_EXECUTABLE(${PROJ_NAME} MACOSX_BUNDLE
Alexandre Lision's avatar
Alexandre Lision committed
58 59 60 61 62
   ${ringclient_SRCS}
   ${ringclient_HEADERS_MOC}
   ${ringclient_FORMS_HEADERS}
   ${myApp_ICON})

63
TARGET_LINK_LIBRARIES( ${PROJ_NAME}
Alexandre Lision's avatar
Alexandre Lision committed
64 65 66 67 68 69
   ${LIB_RING_CLIENT_LIBRARY}
   ${QT_QTCORE_LIBRARY}
   ${Qt5Widgets_LIBRARIES}
   ${QT_QTGUI_LIBRARY}
)

70 71 72 73 74 75 76 77 78 79 80
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"
    )