Skip to content
This repository was archived by the owner on Sep 23, 2019. It is now read-only.

Commit 2129f91

Browse files
committed
Add cmake build system.
1 parent 4cdb062 commit 2129f91

File tree

3 files changed

+266
-0
lines changed

3 files changed

+266
-0
lines changed

CMakeLists.txt

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
2+
3+
## project settings
4+
PROJECT(QTweetLib)
5+
SET( QTWEETLIB_MAJOR_VERSION 0 )
6+
SET( QTWEETLIB_MINOR_VERSION 0 )
7+
SET( QTWEETLIB_PATCH_VERSION 0 )
8+
9+
SET( QTWEETLIB_VERSION ${QTWEETLIB_MAJOR_VERSION}.${QTWEETLIB_MINOR_VERSION}.${QTWEETLIB_PATCH_VERSION} )
10+
SET( QTWEETLIB_SONAME ${QTWEETLIB_MAJOR_VERSION}.${QTWEETLIB_MINOR_VERSION} )
11+
12+
MESSAGE(STATUS "Building QTweetLib " ${QTWEETLIB_VERSION} )
13+
14+
# cmake modules
15+
SET( CMAKE_MODULE_PATH "${CMAKE_MODULE_PATH}" "${CMAKE_SOURCE_DIR}/cmake/modules" )
16+
17+
## required deps
18+
# qt4
19+
FIND_PACKAGE( Qt4 COMPONENTS QtCore QtNetwork QtGui REQUIRED )
20+
INCLUDE( ${QT_USE_FILE} )
21+
# qjson
22+
FIND_PACKAGE( QJSON REQUIRED )
23+
24+
# definitions
25+
ADD_DEFINITIONS( ${QT_DEFINITIONS} )
26+
ADD_DEFINITIONS( -DQT_SHARED )
27+
ADD_DEFINITIONS( -DQTWEETLIB_MAKEDLL )
28+
29+
# build actual source dir
30+
ADD_SUBDIRECTORY( src )

cmake/modules/FindQJSON.cmake

+50
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
# Find QJSON - JSON handling library for Qt
2+
#
3+
# This module defines
4+
# QJSON_FOUND - whether the qsjon library was found
5+
# QJSON_LIBRARIES - the qjson library
6+
# QJSON_INCLUDE_DIR - the include path of the qjson library
7+
#
8+
if (QJSON_INCLUDE_DIR AND QJSON_LIBRARIES)
9+
10+
# Already in cache
11+
set (QJSON_FOUND TRUE)
12+
13+
else (QJSON_INCLUDE_DIR AND QJSON_LIBRARIES)
14+
15+
if (NOT WIN32)
16+
# Disabled because it broke compilation for people by
17+
# adding a "QtCore" to QJSON_LIBRARIES
18+
# also ${QJSON_INCLUDE_DIRS} pointed to /usr/include/QtCore
19+
# and ${QJSON_LIBRARY_DIRS} was empty which makes no sense either
20+
21+
# use pkg-config to get the values of QJSON_INCLUDE_DIRS
22+
# and QJSON_LIBRARY_DIRS to add as hints to the find commands.
23+
#include (FindPkgConfig)
24+
#pkg_check_modules (QJSON REQUIRED QJson>=0.5)
25+
endif (NOT WIN32)
26+
27+
find_library (QJSON_LIBRARIES
28+
NAMES
29+
qjson
30+
PATHS
31+
${QJSON_LIBRARY_DIRS}
32+
${LIB_INSTALL_DIR}
33+
${KDE4_LIB_DIR}
34+
)
35+
36+
find_path (QJSON_INCLUDE_DIR
37+
NAMES
38+
parser.h
39+
PATH_SUFFIXES
40+
qjson
41+
PATHS
42+
${QJSON_INCLUDE_DIRS}
43+
${INCLUDE_INSTALL_DIR}
44+
${KDE4_INCLUDE_DIR}
45+
)
46+
47+
include(FindPackageHandleStandardArgs)
48+
find_package_handle_standard_args(QJSON DEFAULT_MSG QJSON_LIBRARIES QJSON_INCLUDE_DIR)
49+
50+
endif (QJSON_INCLUDE_DIR AND QJSON_LIBRARIES)

src/CMakeLists.txt

+186
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,186 @@
1+
SET(QTWEETLIB_SOURCES
2+
oauth.cpp
3+
oauthtwitter.cpp
4+
qtweetfriendstimeline.cpp
5+
qtweethometimeline.cpp
6+
qtweetmentions.cpp
7+
qtweetnetbase.cpp
8+
qtweetretweetbyme.cpp
9+
qtweetretweetsofme.cpp
10+
qtweetretweettome.cpp
11+
qtweetstatus.cpp
12+
qtweetstatusshow.cpp
13+
qtweetstatusupdate.cpp
14+
qtweetuser.cpp
15+
qtweetusertimeline.cpp
16+
qtweetstatusdestroy.cpp
17+
qtweetstatusretweet.cpp
18+
qtweetstatusretweets.cpp
19+
qtweetusershow.cpp
20+
qtweetuserlookup.cpp
21+
qtweetdirectmessages.cpp
22+
qtweetuserstream.cpp
23+
qtweetdmstatus.cpp
24+
qtweetusersearch.cpp
25+
qtweetuserstatusesfriends.cpp
26+
qtweetuserstatusesfollowers.cpp
27+
qtweetlist.cpp
28+
qtweetlistcreate.cpp
29+
qtweetlistupdate.cpp
30+
qtweetlistgetlists.cpp
31+
qtweetlistshowlist.cpp
32+
qtweetlistdeletelist.cpp
33+
qtweetliststatuses.cpp
34+
qtweetlistmemberships.cpp
35+
qtweetlistsubscriptions.cpp
36+
qtweetlistgetmembers.cpp
37+
qtweetlistaddmember.cpp
38+
qtweetlistdeletemember.cpp
39+
qtweetlistsubscribers.cpp
40+
qtweetlistsubscribe.cpp
41+
qtweetlistunsubscribe.cpp
42+
qtweetdirectmessagessent.cpp
43+
qtweetdirectmessagenew.cpp
44+
qtweetdirectmessagedestroy.cpp
45+
qtweetfriendshipcreate.cpp
46+
qtweetfriendshipdestroy.cpp
47+
qtweetfriendsid.cpp
48+
qtweetfollowersid.cpp
49+
qtweetaccountverifycredentials.cpp
50+
qtweetaccountratelimitstatus.cpp
51+
qtweetfavorites.cpp
52+
qtweetfavoritescreate.cpp
53+
qtweetfavoritesdestroy.cpp
54+
qtweetsearch.cpp
55+
qtweetsearchresult.cpp
56+
qtweetsearchpageresults.cpp
57+
qtweetplace.cpp
58+
qtweetgeoreversegeocode.cpp
59+
qtweetgeosearch.cpp
60+
qtweetgeosimilarplaces.cpp
61+
qtweetgeoplaceid.cpp
62+
qtweetgeoplacecreate.cpp
63+
qtweetgeocoord.cpp
64+
qtweetgeoboundingbox.cpp
65+
qtweetconvert.cpp
66+
qtweetentityurl.cpp
67+
qtweetentityhashtag.cpp
68+
qtweetentityusermentions.cpp
69+
qtweetblocksblocking.cpp
70+
qtweetblocksblockingids.cpp
71+
qtweetblockscreate.cpp
72+
qtweetblocksdestroy.cpp
73+
qtweetblocksexists.cpp
74+
)
75+
76+
SET(QTWEETLIB_MOC_HEADERS
77+
oauth.h
78+
oauthtwitter.h
79+
qtweetfriendstimeline.h
80+
qtweethometimeline.h
81+
qtweetmentions.h
82+
qtweetnetbase.h
83+
qtweetretweetbyme.h
84+
qtweetretweetsofme.h
85+
qtweetretweettome.h
86+
qtweetstatusshow.h
87+
qtweetstatusupdate.h
88+
qtweetusertimeline.h
89+
qtweetstatusdestroy.h
90+
qtweetstatusretweet.h
91+
qtweetstatusretweets.h
92+
qtweetusershow.h
93+
qtweetuserlookup.h
94+
qtweetdirectmessages.h
95+
qtweetuserstream.h
96+
qtweetusersearch.h
97+
qtweetuserstatusesfriends.h
98+
qtweetuserstatusesfollowers.h
99+
qtweetlistcreate.h
100+
qtweetlistupdate.h
101+
qtweetlistgetlists.h
102+
qtweetlistshowlist.h
103+
qtweetlistdeletelist.h
104+
qtweetliststatuses.h
105+
qtweetlistmemberships.h
106+
qtweetlistsubscriptions.h
107+
qtweetlistgetmembers.h
108+
qtweetlistaddmember.h
109+
qtweetlistdeletemember.h
110+
qtweetlistsubscribers.h
111+
qtweetlistsubscribe.h
112+
qtweetlistunsubscribe.h
113+
qtweetdirectmessagessent.h
114+
qtweetdirectmessagenew.h
115+
qtweetdirectmessagedestroy.h
116+
qtweetfriendshipcreate.h
117+
qtweetfriendshipdestroy.h
118+
qtweetfriendsid.h
119+
qtweetfollowersid.h
120+
qtweetaccountverifycredentials.h
121+
qtweetaccountratelimitstatus.h
122+
qtweetfavorites.h
123+
qtweetfavoritescreate.h
124+
qtweetfavoritesdestroy.h
125+
qtweetsearch.h
126+
qtweetgeoreversegeocode.h
127+
qtweetgeosearch.h
128+
qtweetgeosimilarplaces.h
129+
qtweetgeoplaceid.h
130+
qtweetgeoplacecreate.h
131+
qtweetblocksblocking.h
132+
qtweetblocksblockingids.h
133+
qtweetblockscreate.h
134+
qtweetblocksdestroy.h
135+
qtweetblocksexists.h
136+
)
137+
138+
SET(QTWEETLIB_HEADERS
139+
${QTWEETLIB_MOC_HEADERS}
140+
qtweetlib_global.h
141+
qtweetstatus.h
142+
qtweetuser.h
143+
qtweetdmstatus.h
144+
qtweetlist.h
145+
qtweetsearchresult.h
146+
qtweetsearchpageresults.h
147+
qtweetplace.h
148+
qtweetgeocoord.h
149+
qtweetgeoboundingbox.h
150+
qtweetconvert.h
151+
qtweetentityurl.h
152+
qtweetentityhashtag.h
153+
qtweetentityusermentions.h
154+
)
155+
156+
INCLUDE_DIRECTORIES(
157+
.
158+
${QT_INCLUDE_DIR}
159+
${QT_INCLUDES}
160+
${QJSON_INCLUDE_DIR}
161+
)
162+
163+
QT4_WRAP_CPP( QTWEETLIB_MOC ${QTWEETLIB_MOC_HEADERS} )
164+
165+
ADD_LIBRARY( QTweetLib SHARED ${QTWEETLIB_SOURCES} ${QTWEETLIB_MOC} )
166+
167+
SET_TARGET_PROPERTIES( QTweetLib PROPERTIES
168+
VERSION ${QTWEETLIB_VERSION}
169+
SOVERSION ${QTWEETLIB_SONAME}
170+
)
171+
172+
TARGET_LINK_LIBRARIES( QTweetLib
173+
${QT_LIBRARIES}
174+
${QJSON_LIBRARIES}
175+
)
176+
177+
INSTALL( TARGETS QTweetLib
178+
RUNTIME DESTINATION bin
179+
LIBRARY DESTINATION lib${LIB_SUFFIX}
180+
ARCHIVE DESTINATION lib${LIB_SUFFIX}
181+
BUNDLE DESTINATION library
182+
)
183+
184+
INSTALL( FILES ${QTWEETLIB_HEADERS}
185+
DESTINATION include/QTweetLib
186+
)

0 commit comments

Comments
 (0)