-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathCMakeLists.txt
72 lines (59 loc) · 2.13 KB
/
CMakeLists.txt
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
68
69
70
71
# More information on building QT project with CMake at http://qt-project.org/quarterly/view/using_cmake_to_build_qt_projects
PROJECT(simulpret)
FIND_PACKAGE(Qt4 REQUIRED)
cmake_minimum_required(VERSION 2.8)
SET(SIMULPRET_SOURCES
src/calculecheancier.cpp
src/db.cpp
src/dbdumper.cpp
src/evenement.cpp
src/main.cpp
src/pret.cpp
src/projet.cpp
src/ui/currencydelegate.cpp
src/ui/evenementdialog.cpp
src/ui/evenementmodel.cpp
src/ui/mainwindow.cpp
src/ui/pretwidget.cpp)
SET(SIMULPRET_HEADERS
src/calculecheancier.h
src/db.h
src/evenement.h
src/pret.h
src/projet.h
src/visitor.h
src/ui/currencydelegate.h
src/ui/evenementdialog.h
src/ui/evenementmodel.h
src/ui/mainwindow.h
src/ui/pretwidget.h)
SET(SIMULPRET_FORMS
src/ui/evenementdialog.ui
src/ui/mainwindow.ui
src/ui/pretwidget.ui)
SET(SIMULPRET_RESOURCES
resources/simulpret-resources.qrc)
QT4_WRAP_CPP(SIMULPRET_HEADERS_MOC ${SIMULPRET_HEADERS})
QT4_WRAP_UI(SIMULPRET_FORMS_HEADERS ${SIMULPRET_FORMS})
QT4_ADD_RESOURCES(SIMULPRET_RESOURCES_RCC ${SIMULPRET_RESOURCES})
INCLUDE(${QT_USE_FILE})
ADD_DEFINITIONS(${QT_DEFINITIONS})
# Add build dir to include header file generated by uic
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR} ${QT_QTSQL_INCLUDE_DIR})
SET(QT_USE_QTSQL TRUE)
SET(QT_USE_QTTEST TRUE)
ADD_EXECUTABLE(simulpret ${SIMULPRET_SOURCES} ${SIMULPRET_HEADERS_MOC} ${SIMULPRET_FORMS_HEADERS} ${SIMULPRET_RESOURCES_RCC})
TARGET_LINK_LIBRARIES(simulpret ${QT_LIBRARIES} ${QT_QTSQL_LIBRARIES})
ENABLE_TESTING(true)
INCLUDE_DIRECTORIES( test )
SET(VERBOSE 1)
MACRO(add_qtest testname testsrc)
SET(test_${testname}_SRCS ${testsrc})
qt4_automoc(${test_${testname}_SRCS})
ADD_EXECUTABLE(test_${testname} ${test_${testname}_SRCS} src/db.cpp src/evenement.cpp src/pret.cpp src/dbdumper.cpp ${test_additional})
TARGET_LINK_LIBRARIES(test_${testname} ${QT_QTCORE_LIBRARY}
${QT_QTTEST_LIBRARY} ${QT_QTGUI_LIBRARY}
${GSOAP_LIBRARIES} ${QT_QTSQL_LIBRARIES})
ADD_TEST(test_${testname} test_${testname})
ENDMACRO(add_qtest)
add_qtest(dbloadertest test/dbloadertest.cpp)