summaryrefslogtreecommitdiffstats
path: root/src/svnqt/CMakeLists.txt.orig
blob: d8fd1a0dd9f8376d419bb0ccea2b082e4f3a4fa6 (plain)
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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
SET(SOURCES
    apr.cpp
    client_annotate.cpp
    client_cat.cpp
    client.cpp
    client_diff.cpp
    client_ls.cpp
    client_modify.cpp
    client_property.cpp
    client_status.cpp
    context.cpp
    datetime.cpp
    dirent.cpp
    entry.cpp
    exception.cpp
    log_entry.cpp
    path.cpp
    pool.cpp
    revision.cpp
    status.cpp
    targets.cpp
    url.cpp
    version_check.cpp
    wc.cpp
    lock_entry.cpp
    client_lock.cpp
    info_entry.cpp
    client_impl.cpp
    contextdata.cpp
    commititem.cpp
    repository.cpp
    repositorydata.cpp
    repositorylistener.cpp
    svnstream.cpp
    diff_data.cpp
    svnfilestream.cpp
    stringarray.cpp
    diffoptions.cpp
    conflictdescription.cpp
    conflictresult.cpp
    client_merge.cpp
    cache/LogCache.cpp
    cache/ReposLog.cpp
    cache/DatabaseException.hpp
    cache/DatabaseException.cpp
    )

    IF (SQLITE_FOUND)
        MESSAGE(STATUS "Build own sqlite3 database modul")
        SET(SOURCES
            ${SOURCES}
            cache/sqlite3/qsqlcachedresult.cpp
            cache/sqlite3/qsql_sqlite3.cpp
            cache/sqlite3/qsqlcachedresult.h
            cache/sqlite3/qsql_sqlite3.h
        )
    ELSE (SQLITE_FOUND)
        MESSAGE(SEND_ERROR "The QT3 version requires sqlite3 but could not found")
    ENDIF (SQLITE_FOUND)

SET(CACHEINST_HEADERS
    cache/LogCache.hpp
    cache/ReposLog.hpp
    cache/DatabaseException.hpp
)

SET(INST_HEADERS
    annotate_line.hpp
    apr.hpp
    check.hpp
    client.hpp
    commititem.hpp
    context.hpp
    context_listener.hpp
    datetime.hpp
    dirent.hpp
    entry.hpp
    exception.hpp
    info_entry.hpp
    lock_entry.hpp
    log_entry.hpp
    path.hpp
    pool.hpp
    repository.hpp
    repositorylistener.hpp
    revision.hpp
    smart_pointer.hpp
    shared_pointer.hpp
    status.hpp
    svnfilestream.hpp
    svnstream.hpp
    svnqttypes.hpp
    targets.hpp
    url.hpp
    version_check.hpp
    wc.hpp
    stringarray.hpp
    diffoptions.hpp
    conflictdescription.hpp
    conflictresult.hpp
    )

FILE(GLOB svnhdr RELATIVE  ${CMAKE_CURRENT_SOURCE_DIR} "*.hpp")
SET(svnhdr ${svnhdr} ${CACHE_INST_HEADERS})


        SET(TOUTF8 "utf8")
        SET(FROMUTF8 "fromUtf8")
        SET(QLIST "TQValueList")
        SET(TOASCII "latin1")
        SET(HOMEDIR "homeDirPath")
        SET(QDATABASE "TQSqlDatabase*")
        SET(QLONG "Q_LLONG")
    SET(svnqt-name svnqt)

IF (HAVE_GCC_VISIBILITY)
    SET(_SVNQT_EXPORT "__attribute__ ((visibility(\"default\")))")
    SET(_SVNQT_NOEXPORT "__attribute__ ((visibility(\"hidden\")))")
ENDIF (HAVE_GCC_VISIBILITY)

CONFIGURE_FILE(
    "${CMAKE_CURRENT_SOURCE_DIR}/svnqt_defines.hpp.in"
    "${CMAKE_CURRENT_BINARY_DIR}/svnqt_defines.hpp"
    IMMEDIATE
    @ONLY)

SET(INST_HEADERS ${INST_HEADERS} ${CMAKE_CURRENT_BINARY_DIR}/svnqt_defines.hpp)
INCLUDE_DIRECTORIES(BEFORE ${CMAKE_CURRENT_BINARY_DIR})

ADD_LIBRARY(${svnqt-name} SHARED ${SOURCES} ${svnhdr})
    SET(LIBRARY_OUTPUT_PATH ${PROJECT_BINARY_DIR}/lib${LIB_SUFFIX})
    SET_TARGET_PROPERTIES(${svnqt-name}
        PROPERTIES
        COMPILE_FLAGS ${CMAKE_SHARED_LIBRARY_CXX_FLAGS})

SET(LIB_MAJOR 4)
SET(LIB_MINOR 2)
SET(LIB_RELEASE 2)

SET(_soversion ${LIB_MAJOR}.${LIB_MINOR}.${LIB_RELEASE})

SET_TARGET_PROPERTIES(${svnqt-name} PROPERTIES
    SOVERSION ${LIB_MAJOR}
    VERSION ${_soversion})

SET(ALL_LINKFLAGS ${APR_EXTRA_LIBFLAGS})
SET(ALL_LINKFLAGS "${ALL_LINKFLAGS} ${APU_EXTRA_LIBFLAGS}")
SET_TARGET_PROPERTIES(${svnqt-name} PROPERTIES LINK_FLAGS "${ALL_LINKFLAGS} ${LINK_NO_UNDEFINED}")
TARGET_LINK_LIBRARIES(${svnqt-name} ${QT_LIBRARIES} ${SUBVERSION_ALL_LIBS})

IF (SQLITE_FOUND)
    TARGET_LINK_LIBRARIES(${svnqt-name} ${SQLITE_LIBRARIES})
    INCLUDE_DIRECTORIES(SQLITE_INCLUDE_DIR)
ELSE (SQLITE_FOUND)
    TARGET_LINK_LIBRARIES(${svnqt-name} ${QT_QTSQL_LIBRARY})
ENDIF (SQLITE_FOUND)

# Just a small linking test
IF (BUILD_TESTS)
    ADD_EXECUTABLE(testlink testmain.cpp)
    TARGET_LINK_LIBRARIES(testlink ${svnqt-name})
ENDIF (BUILD_TESTS)

    INSTALL(TARGETS ${svnqt-name} DESTINATION ${LIB_INSTALL_DIR})
    INSTALL(FILES ${INST_HEADERS} DESTINATION include/${svnqt-name})
    INSTALL(FILES ${CACHEINST_HEADERS} DESTINATION include/${svnqt-name}/cache)

IF (BUILD_TESTS)
  ADD_SUBDIRECTORY(tests)
  ADD_SUBDIRECTORY(cache/test)
ENDIF (BUILD_TESTS)