CMakeLists.txt 3.79 KB
Newer Older
Andi Fischer's avatar
Andi Fischer committed
1

2
3
set(EXECUTABLE_OUTPUT_PATH ${CMAKE_CURRENT_BINARY_DIR})
set(SRC_PATH ../umbrello)
Andi Fischer's avatar
Andi Fischer committed
4

5
include_directories(
Andi Fischer's avatar
Andi Fischer committed
6
7
8
9
10
11
      ${LIBXML2_INCLUDE_DIR}
      ${LIBXSLT_INCLUDE_DIR}
      ${CMAKE_SOURCE_DIR}
      ${SRC_PATH}
      ${SRC_PATH}/debug/
      ${SRC_PATH}/dialogs/
12
13
      ${SRC_PATH}/dialogs/pages
      ${SRC_PATH}/dialogs/widgets
Andi Fischer's avatar
Andi Fischer committed
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
      ${SRC_PATH}/clipboard
      ${SRC_PATH}/cmds
      ${SRC_PATH}/codegenerators
      ${SRC_PATH}/codegenerators/ada/
      ${SRC_PATH}/codegenerators/as/
      ${SRC_PATH}/codegenerators/cpp/
      ${SRC_PATH}/codegenerators/csharp/
      ${SRC_PATH}/codegenerators/d/
      ${SRC_PATH}/codegenerators/idl/
      ${SRC_PATH}/codegenerators/java/
      ${SRC_PATH}/codegenerators/js/
      ${SRC_PATH}/codegenerators/pascal/
      ${SRC_PATH}/codegenerators/perl/
      ${SRC_PATH}/codegenerators/php/
      ${SRC_PATH}/codegenerators/python/
      ${SRC_PATH}/codegenerators/ruby/
      ${SRC_PATH}/codegenerators/sql/
      ${SRC_PATH}/codegenerators/tcl/
      ${SRC_PATH}/codegenerators/vala/
      ${SRC_PATH}/codegenerators/xml/
      ${SRC_PATH}/codegenwizard
      ${SRC_PATH}/codeimport
      ${SRC_PATH}/debug
      ${SRC_PATH}/dialogs
      ${SRC_PATH}/docgenerators
      ${SRC_PATH}/refactoring
40
      ${SRC_PATH}/uml1model/
41
      ${SRC_PATH}/umlwidgets/
Andi Fischer's avatar
Andi Fischer committed
42
      ${CMAKE_CURRENT_BINARY_DIR}
43
)
Andi Fischer's avatar
Andi Fischer committed
44

45
46
if(NOT BUILD_KF5)
    set(LIBS
47
48
49
50
        Qt4::QtCore
        Qt4::QtGui
        Qt4::QtXml
        Qt4::QtTest
51
        Qt4::QtWebKit
52
53
54
        ${KDE4_KFILE_LIBS}
        ${LIBXML2_LIBRARIES}
        ${LIBXSLT_LIBRARIES}
55
        libumbrello
56
57
58
    )
else()
    set(LIBS
59
        Qt5::Xml
60
61
        Qt5::Test
        Qt5::Widgets
62
        Qt5::WebKitWidgets
63
        KF5::I18n
64
        KF5::KCrash
65
66
        ${LIBXML2_LIBRARIES}
        ${LIBXSLT_LIBRARIES}
67
        libumbrello
68
69
    )
endif()
Andi Fischer's avatar
Andi Fischer committed
70

71
ecm_add_test(
72
    testbasictypes.cpp
73
    LINK_LIBRARIES ${LIBS}
74
    TEST_NAME testbasictypes
75
)
Andi Fischer's avatar
Andi Fischer committed
76

Ralf Habacker's avatar
Ralf Habacker committed
77
ecm_add_test(
78
    testumlobject.cpp
Ralf Habacker's avatar
Ralf Habacker committed
79
    testbase.cpp
Ralf Habacker's avatar
Ralf Habacker committed
80
    LINK_LIBRARIES ${LIBS}
81
    TEST_NAME testumlobject
Ralf Habacker's avatar
Ralf Habacker committed
82
83
)

Ralf Habacker's avatar
Ralf Habacker committed
84
#ecm_add_test(
85
#    testclassifier.cpp
Ralf Habacker's avatar
Ralf Habacker committed
86
87
#    testbase.cpp
#    LINK_LIBRARIES ${LIBS}
88
#    TEST_NAME testclassifier
Ralf Habacker's avatar
Ralf Habacker committed
89
#)
Andi Fischer's avatar
Andi Fischer committed
90

91
ecm_add_test(
92
    testcppwriter.cpp
93
    testbase.cpp
94
    LINK_LIBRARIES ${LIBS}
95
    TEST_NAME testcppwriter
96
)
Andi Fischer's avatar
Andi Fischer committed
97

98
ecm_add_test(
99
    testpythonwriter.cpp
100
    testbase.cpp
101
    LINK_LIBRARIES ${LIBS}
102
    TEST_NAME testpythonwriter
103
)
104

105
ecm_add_test(
106
    testoptionstate.cpp
107
108
    testbase.cpp
    LINK_LIBRARIES ${LIBS}
109
    TEST_NAME testoptionstate
110
111
)

112
113
set(testumlroledialog_SRCS
    testumlroledialog.cpp
114
115
)

116
117
ecm_add_executable(testumlroledialog ${testumlroledialog_SRCS})
target_link_libraries(testumlroledialog ${LIBS})
Ralf Habacker's avatar
Ralf Habacker committed
118

119
120
121
ecm_add_executable(testcrashhandler testcrashhandler.cpp)
target_link_libraries(testcrashhandler ${LIBS})

Ralf Habacker's avatar
Ralf Habacker committed
122
find_package(LLVM CONFIG)
123
find_package(CLANG QUIET)
124
if(LLVM_FOUND AND CLANG_FOUND)
Ralf Habacker's avatar
Ralf Habacker committed
125
126
127
    message(STATUS "Found LLVM ${LLVM_PACKAGE_VERSION}")
    message(STATUS "Using LLVMConfig.cmake in: ${LLVM_DIR}")

128
129
    message(STATUS "Found CLANG ${CLANG_PACKAGE_VERSION}")

Ralf Habacker's avatar
Ralf Habacker committed
130
131
132
    include_directories(${LLVM_INCLUDE_DIRS})
    add_definitions(${LLVM_DEFINITIONS})

133
134
    include_directories(${CLANG_INCLUDE_DIRS})
    add_definitions(${CLANG_DEFINITIONS})
135

Ralf Habacker's avatar
Ralf Habacker committed
136
    # Now build our tools
137
    add_executable(testllvm testllvm.cpp)
Ralf Habacker's avatar
Ralf Habacker committed
138
139
140
141
142
143

    # Find the libraries that correspond to the LLVM components
    # that we wish to use
    llvm_map_components_to_libnames(llvm_libs support core irreader analysis)

    # Link against LLVM libraries
144
    target_link_libraries(testllvm ${llvm_libs} clangFrontend clangTooling)
Ralf Habacker's avatar
Ralf Habacker committed
145

146
    add_executable(testllvmparser testllvmparser.cpp)
Ralf Habacker's avatar
Ralf Habacker committed
147
    llvm_map_components_to_libnames(llvm_libs support)
148
149
    target_link_libraries(testllvmparser ${llvm_libs} clangFrontend clangTooling clangAST clangBasic ${LIBS})
    ecm_mark_nongui_executable(testllvm testllvmparser)
Ralf Habacker's avatar
Ralf Habacker committed
150
endif()
151
152

add_custom_target(check COMMAND ${CMAKE_BUILD_TOOL} test)