summaryrefslogtreecommitdiffstats
path: root/src/fbgui/CMakeLists.txt
blob: 8b19777eea64a3b84638a980ef1299582906fd35 (plain) (blame)
1
2
3
4
5
6
7
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
pkg_check_modules(LOG4CXX REQUIRED liblog4cxx)
pkg_check_modules(LIBSYSFS REQUIRED libsysfs)
pkg_check_modules(LIBNL REQUIRED libnl-1)
pkg_check_modules(LIBUSB REQUIRED libusb-1.0)

set(QT_MIN_VERSION "4.7.0")
find_package(Qt4 REQUIRED)
if (QT4_FOUND)
  message(STATUS "QT4 found.")
else(QT4_FOUND)
  message(FATAL_ERROR "QT4 not found!")
endif(QT4_FOUND)

set(QT_USE_QTNETWORK TRUE)
set(QT_USE_QTWEBKIT TRUE)

file(GLOB FBGUI_SOURCES *.cpp)
file(GLOB FBGUI_HEADERS *.h ../common/*.h)
file(GLOB FBGUI_MOC_HEADERS  
downloadmanager.h
interfaceconfiguration.h
javascriptinterface.h
ndgui.h
networkdiscovery.h
networkmanager.h
fbgui.h)
file(GLOB FBGUI_UIS *.ui)
file(GLOB FBGUI_RCS *.qrc)
 
include_directories(${CMAKE_CURRENT_BINARY_DIR} 
  /usr/include/
  ../customdhcpcd/
  ${QT_INCLUDE_DIRS}
  ${LOG4CXX_INCLUDE_DIRS}
  ${LIBSYSFS_INCLUDE_DIRS}
  ${LIBNL_INCLUDE_DIRS}
  ${LIBUSB_INCLUDE_DIRS}
)
  
include(${QT_USE_FILE})
add_definitions(${QT_DEFINITIONS})

QT4_ADD_RESOURCES(FBGUI_RC_SOURCES ${FBGUI_RCS})
QT4_WRAP_UI(FBGUI_UI_HEADERS ${FBGUI_UIS})
QT4_WRAP_CPP(FBGUI_MOC_SOURCES ${FBGUI_MOC_HEADERS})

add_executable(fbgui
  ${QT_INCLUDES}
  ${LIBSYSFS_INCLUDES}
  ${LIBNL_INCLUDES}
  ${LIBUSB_INCLUDES}
  ${FBGUI_SOURCES}
  ${FBGUI_MOC_SOURCES}
  ${FBGUI_UI_HEADERS}
  ${FBGUI_RC_SOURCES})

set_target_properties(fbgui PROPERTIES LINKER_LANGUAGE C)
target_link_libraries(fbgui 
  ${QT_LIBRARIES}
  ${LOG4CXX_LIBRARIES}
  ${LIBSYSFS_LIBRARIES}
  ${LIBNL_LIBRARIES}
  ${LIBUSB_LIBRARIES}
  customdhcpcd
)

install(TARGETS fbgui RUNTIME DESTINATION bin)