CMakeLists.txt 1.76 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)

Alexandre Lision's avatar
Alexandre Lision committed
7
PROJECT(Ring)
Alexandre Lision's avatar
Alexandre Lision committed
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 43 44

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)

MESSAGE("BINARY IS HERE:" ${LIB_RING_CLIENT_LIBRARY})

Alexandre Lision's avatar
Alexandre Lision committed
45 46 47
SET(MACOSX_BUNDLE_DISPLAY_NAME Ring)
SET(MACOSX_BUNDLE_BUNDLE_NAME Ring)
SET(MACOSX_BUNDLE_BUNDLE_VERSION 1.0)
Alexandre Lision's avatar
Alexandre Lision committed
48 49 50 51 52 53 54 55 56 57 58 59

# Icons

# NOTE: Don't include the path in MACOSX_BUNDLE_ICON_FILE -- this is
# the property added to Info.plist
SET(MACOSX_BUNDLE_ICON_FILE appicon.icns)

# 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
60
ADD_EXECUTABLE(Ring MACOSX_BUNDLE
Alexandre Lision's avatar
Alexandre Lision committed
61 62 63 64 65 66
   ${ringclient_SRCS}
   ${ringclient_HEADERS_MOC}
   ${ringclient_FORMS_HEADERS}
   ${myApp_ICON})


Alexandre Lision's avatar
Alexandre Lision committed
67
TARGET_LINK_LIBRARIES( Ring
Alexandre Lision's avatar
Alexandre Lision committed
68 69 70 71 72 73
   ${LIB_RING_CLIENT_LIBRARY}
   ${QT_QTCORE_LIBRARY}
   ${Qt5Widgets_LIBRARIES}
   ${QT_QTGUI_LIBRARY}
)