add basic cmake support

This commit is contained in:
Eugene Shalygin 2015-11-06 19:03:18 +01:00 committed by Eugene Shalygin
commit 64daecb266
26 changed files with 1242 additions and 0 deletions

109
src/CMakeLists.txt Normal file
View file

@ -0,0 +1,109 @@
set(CMAKE_CXX_STANDARD_REQUIRED True)
set(CMAKE_CXX_STANDARD "11")
add_definitions(-DBOOST_NO_CXX11_RVALUE_REFERENCES)
include(MacroLinkQtComponents)
find_package(LibtorrentRasterbar REQUIRED)
include_directories(SYSTEM ${LibtorrentRasterbar_INCLUDE_DIRS})
add_compile_options(${LibtorrentRasterbar_DEFINITIONS})
# Boost
set(Boost_USE_MULTITHREADED ON)
find_package(Boost 1.35 REQUIRED COMPONENTS system)
include_directories(SYSTEM ${Boost_INCLUDE_DIRS})
# Qt
if (QT5)
add_definitions(-DQBT_USES_QT5)
list(APPEND QBT_QT_COMPONENTS Core Network Xml)
if (GUI)
list (APPEND QBT_QT_COMPONENTS Concurrent Gui Widgets)
endif (GUI)
if (DBUS)
list (APPEND QBT_QT_COMPONENTS DBus)
endif (DBUS)
find_package(Qt5 5.5.0 COMPONENTS ${QBT_QT_COMPONENTS} REQUIRED)
else (QT5)
list(APPEND QBT_QT_COMPONENTS QtCore QtNetwork QtXml)
if (GUI)
list (APPEND QBT_QT_COMPONENTS QtGui)
endif (GUI)
if (DBUS)
list (APPEND QBT_QT_COMPONENTS QtDBus)
endif (DBUS)
find_package(Qt4 4.8.7 COMPONENTS ${QBT_QT_COMPONENTS} REQUIRED)
include(${QT_USE_FILE})
endif (QT5)
set(CMAKE_AUTOMOC True)
list(APPEND CMAKE_AUTORCC_OPTIONS -compress 9 -threshold 5)
include_directories(${CMAKE_CURRENT_SOURCE_DIR})
# defines
add_definitions(-DQT_NO_CAST_TO_ASCII)
# Fast concatenation (Qt >= 4.6)
add_definitions(-DQT_USE_FAST_CONCATENATION -DQT_USE_FAST_OPERATOR_PLUS)
if (WIN32)
add_definitions(-DNOMINMAX)
endif (WIN32)
if (NOT GUI)
add_definitions(-DDISABLE_GUI -DDISABLE_COUNTRIES_RESOLUTION)
endif (NOT GUI)
if (NOT WEBUI)
add_definitions(-DDISABLE_WEBUI)
endif (NOT WEBUI)
if (STACKTRACE_WIN)
add_definitions(-DSTACKTRACE_WIN)
endif(STACKTRACE_WIN)
# nogui {
# TARGET = qbittorrent-nox
# } else {
# CONFIG(static) {
# DEFINES += QBT_STATIC_QT
# QTPLUGIN += qico
# }
# TARGET = qbittorrent
# }
if (UNIX AND NOT APPLE)
add_compile_options(-Wformat -Wformat-security)
endif ()
if (CMAKE_BUILD_TYPE STREQUAL "Debug")
message(STATUS "Project is built in DEBUG mode.")
else (CMAKE_BUILD_TYPE STREQUAL "Debug")
message(STATUS "Project is built in RELEASE mode.")
message(STATUS "Disabling debug output.")
add_definitions(-DQT_NO_DEBUG_OUTPUT)
endif (CMAKE_BUILD_TYPE STREQUAL "Debug")
set(QBT_USE_GUI ${GUI})
set(QBT_USE_WEBUI ${WEBUI})
set(QBT_USES_QT5 ${QT5})
configure_file(config.h.cmakein ${CMAKE_CURRENT_BINARY_DIR}/config.h)
add_subdirectory(base)
if (SYSTEM_QTSINGLEAPPLICATION)
find_package(QtSingleApplication REQUIRED)
include_directories(${QTSINGLEAPPLICATION_INCLUDE_DIR})
else (SYSTEM_QTSINGLEAPPLICATION)
include_directories(app/qtsingleapplication)
endif (SYSTEM_QTSINGLEAPPLICATION)
if (GUI)
add_subdirectory(gui)
endif (GUI)
if (WEBUI)
add_subdirectory(webui)
endif (WEBUI)
add_subdirectory(app)

122
src/app/CMakeLists.txt Normal file
View file

@ -0,0 +1,122 @@
include_directories(${CMAKE_CURRENT_BINARY_DIR})
set(QBT_APP_HEADERS
application.h
)
set(QBT_APP_SOURCES
application.cpp
main.cpp
)
# translations
file(GLOB QBT_TS_FILES ../lang/*.ts)
get_filename_component(QBT_QM_FILES_BINARY_DIR "${CMAKE_CURRENT_BINARY_DIR}/../lang" ABSOLUTE)
set_source_files_properties(${QBT_TS_FILES} PROPERTIES OUTPUT_LOCATION "${QBT_QM_FILES_BINARY_DIR}")
if (QT5)
find_package(Qt5 COMPONENTS LinguistTools REQUIRED)
qt5_add_translation(QBT_QM_FILES ${QBT_TS_FILES})
else (QT5)
qt4_add_translation(QBT_QM_FILES ${QBT_TS_FILES})
endif (QT5)
get_filename_component(_lang_qrc_src "${CMAKE_CURRENT_SOURCE_DIR}/../lang.qrc" ABSOLUTE)
get_filename_component(_lang_qrc_dst "${CMAKE_CURRENT_BINARY_DIR}/../lang.qrc" ABSOLUTE)
get_filename_component(_lang_qrc_dst_dir "${CMAKE_CURRENT_BINARY_DIR}/../" ABSOLUTE)
message(STATUS "copying ${_lang_qrc_src} -> ${_lang_qrc_dst}")
file(COPY ${_lang_qrc_src} DESTINATION ${_lang_qrc_dst_dir})
set_source_files_properties("${_lang_qrc_dst}" PROPERTIES GENERATED True)
foreach(qm_file ${QBT_QM_FILES})
set_source_files_properties("${_lang_qrc_dst}" PROPERTIES OBJECT_DEPENDS ${qm_file})
endforeach()
set(QBT_APP_RESOURCES
../icons.qrc
"${_lang_qrc_dst}"
)
# With AUTORCC rcc is ran by cmake before language files are generated,
# and thus we call rcc explicitly
if (QT5)
qt5_add_resources(QBT_APP_RESOURCE_SOURCE ${QBT_APP_RESOURCES})
else (QT5)
qt4_add_resources(QBT_APP_RESOURCE_SOURCE ${QBT_APP_RESOURCES})
endif (QT5)
if (WIN32)
if (MINGW)
list (APPEND QBT_APP_SOURCES ../qbittorrent_mingw.rc)
else (MINGW)
list (APPEND QBT_APP_SOURCES ../qbittorrent.rc)
endif (MINGW)
endif (WIN32)
if (UNIX)
list(APPEND QBT_APP_HEADERS stacktrace.h)
endif (UNIX)
if (STACKTRACE_WIN)
list(APPEND QBT_APP_HEADERS stacktrace_win.h)
if (GUI)
list(APPEND QBT_APP_HEADERS stacktrace_win_dlg.h)
endif (GUI)
endif (STACKTRACE_WIN)
# usesystemqtsingleapplication {
# nogui {
# CONFIG += qtsinglecoreapplication
# } else {
# CONFIG += qtsingleapplication
# }
# } else {
# nogui {
# include(qtsingleapplication/qtsinglecoreapplication.pri)
# } else {
# include(qtsingleapplication/qtsingleapplication.pri)
# }
# }
# upgrade code
list(APPEND QBT_APP_HEADERS upgrade.h)
list(APPEND QBT_TARGET_LIBRARIES qbt_base)
if (GUI)
set(QBT_TARGET_NAME qbittorrent)
list(APPEND QBT_TARGET_LIBRARIES qbt_searchengine qbt_gui)
include_directories(../gui
${CMAKE_CURRENT_BINARY_DIR}/../gui
)
else (GUI)
set(QBT_TARGET_NAME qbittorrent-nox)
endif (GUI)
if (WEBUI)
list(APPEND QBT_TARGET_LIBRARIES qbt_webui)
endif (WEBUI)
add_executable(${QBT_TARGET_NAME} ${QBT_APP_HEADERS} ${QBT_APP_SOURCES} ${QBT_QM_FILES} ${QBT_APP_RESOURCE_SOURCE})
set_target_properties(${QBT_TARGET_NAME} PROPERTIES AUTOUIC True)
if (GUI)
if (WIN32)
set_target_properties(${QBT_TARGET_NAME} PROPERTIES WIN32_EXECUTABLE True)
endif (WIN32)
if (APPLE)
set_target_properties(${QBT_TARGET_NAME} PROPERTIES MACOSX_BUNDLE True)
endif (APPLE)
endif (GUI)
target_link_libraries(${QBT_TARGET_NAME} ${QBT_TARGET_LIBRARIES})
if (SYSTEM_QTSINGLEAPPLICATION)
target_link_libraries(${QBT_TARGET_NAME} ${QTSINGLEAPPLICATION_LIBRARIES})
else (SYSTEM_QTSINGLEAPPLICATION)
add_subdirectory(qtsingleapplication)
target_link_libraries(${QBT_TARGET_NAME} qtsingleapplication)
endif (SYSTEM_QTSINGLEAPPLICATION)
# installation
install(TARGETS ${QBT_TARGET_NAME} DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT runtime)

View file

@ -0,0 +1,32 @@
set(QBT_QTSINGLEAPPLICATION_HEADERS
qtlocalpeer.h
)
set(QBT_QTSINGLEAPPLICATION_SOURCES
qtlocalpeer.cpp
)
if (GUI)
list(APPEND QBT_QTSINGLEAPPLICATION_HEADERS qtsingleapplication.h)
list(APPEND QBT_QTSINGLEAPPLICATION_SOURCES qtsingleapplication.cpp)
else (GUI)
list(APPEND QBT_QTSINGLEAPPLICATION_HEADERS qtsinglecoreapplication.h)
list(APPEND QBT_QTSINGLEAPPLICATION_SOURCES qtsinglecoreapplication.cpp)
endif (GUI)
add_library(qtsingleapplication ${QBT_QTSINGLEAPPLICATION_HEADERS} ${QBT_QTSINGLEAPPLICATION_SOURCES})
if (QT4_FOUND)
target_link_libraries(qtsingleapplication Qt4::QtNetwork)
else (QT4_FOUND)
target_link_libraries(qtsingleapplication Qt5::Network)
endif (QT4_FOUND)
if (GUI)
if (QT4_FOUND)
target_link_libraries(qtsingleapplication Qt4::QtGui)
else (QT4_FOUND)
target_link_libraries(qtsingleapplication Qt5::Widgets)
endif(QT4_FOUND)
endif (GUI)

124
src/base/CMakeLists.txt Normal file
View file

@ -0,0 +1,124 @@
find_package(ZLIB REQUIRED)
include_directories(SYSTEM ${ZLIB_INCLUDE_DIRS})
set(QBT_BASE_HEADERS
bittorrent/cachestatus.h
bittorrent/infohash.h
bittorrent/magneturi.h
bittorrent/peerinfo.h
bittorrent/private/bandwidthscheduler.h
bittorrent/private/filterparserthread.h
bittorrent/private/resumedatasavingmanager.h
bittorrent/private/speedmonitor.h
bittorrent/private/statistics.h
bittorrent/session.h
bittorrent/sessionstatus.h
bittorrent/torrentcreatorthread.h
bittorrent/torrenthandle.h
bittorrent/torrentinfo.h
bittorrent/tracker.h
bittorrent/trackerentry.h
http/connection.h
http/irequesthandler.h
http/requestparser.h
http/responsebuilder.h
http/responsegenerator.h
http/server.h
http/types.h
net/dnsupdater.h
net/downloadhandler.h
net/downloadmanager.h
net/geoipmanager.h
net/portforwarder.h
net/private/geoipdatabase.h
net/reverseresolution.h
net/smtp.h
rss/private/rssparser.h
rss/rssarticle.h
rss/rssdownloadrule.h
rss/rssdownloadrulelist.h
rss/rssfeed.h
rss/rssfile.h
rss/rssfolder.h
rss/rssmanager.h
utils/fs.h
utils/gzip.h
utils/misc.h
utils/string.h
filesystemwatcher.h
iconprovider.h
logger.h
preferences.h
qinisettings.h
scanfoldersmodel.h
searchengine.h
torrentfilter.h
tristatebool.h
types.h
unicodestrings.h
)
set(QBT_BASE_SOURCES
bittorrent/cachestatus.cpp
bittorrent/infohash.cpp
bittorrent/magneturi.cpp
bittorrent/peerinfo.cpp
bittorrent/private/bandwidthscheduler.cpp
bittorrent/private/filterparserthread.cpp
bittorrent/private/resumedatasavingmanager.cpp
bittorrent/private/speedmonitor.cpp
bittorrent/private/statistics.cpp
bittorrent/session.cpp
bittorrent/sessionstatus.cpp
bittorrent/torrentcreatorthread.cpp
bittorrent/torrenthandle.cpp
bittorrent/torrentinfo.cpp
bittorrent/tracker.cpp
bittorrent/trackerentry.cpp
http/connection.cpp
http/requestparser.cpp
http/responsebuilder.cpp
http/responsegenerator.cpp
http/server.cpp
net/dnsupdater.cpp
net/downloadhandler.cpp
net/downloadmanager.cpp
net/geoipmanager.cpp
net/portforwarder.cpp
net/private/geoipdatabase.cpp
net/reverseresolution.cpp
net/smtp.cpp
rss/private/rssparser.cpp
rss/rssarticle.cpp
rss/rssdownloadrule.cpp
rss/rssdownloadrulelist.cpp
rss/rssfeed.cpp
rss/rssfile.cpp
rss/rssfolder.cpp
rss/rssmanager.cpp
utils/fs.cpp
utils/gzip.cpp
utils/misc.cpp
utils/string.cpp
filesystemwatcher.cpp
iconprovider.cpp
logger.cpp
preferences.cpp
scanfoldersmodel.cpp
searchengine.cpp
torrentfilter.cpp
tristatebool.cpp
)
add_library(qbt_base STATIC ${QBT_BASE_HEADERS} ${QBT_BASE_SOURCES})
target_link_libraries(qbt_base ${ZLIB_LIBRARIES} ${LibtorrentRasterbar_LIBRARIES})
target_link_qt_components(qbt_base Core Network Xml)
if (QT4_FOUND)
if (GUI)
target_link_libraries(qbt_base Qt4::QtGui)
endif (GUI)
else (QT4_FOUND)
if (GUI)
target_link_libraries(qbt_base Qt5::Gui Qt5::Widgets)
endif (GUI)
endif (QT4_FOUND)

15
src/config.h.cmakein Normal file
View file

@ -0,0 +1,15 @@
#cmakedefine QBT_USES_QT5
#cmakedefine QBT_USE_GUI
#ifndef QBT_USE_GUI
#define DISABLE_GUI
#define DISABLE_COUNTRIES_RESOLUTION
#endif
#cmakedefine QBT_USE_WEBUI
#ifndef QBT_USE_WEBUI
#define DISABLE_WEBUI
#endif
#cmakedefine STACKTRACE_WIN

128
src/gui/CMakeLists.txt Normal file
View file

@ -0,0 +1,128 @@
set(CMAKE_AUTORCC True)
set(CMAKE_AUTOUIC True)
include_directories(${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR})
add_subdirectory(lineedit)
add_subdirectory(properties)
add_subdirectory(powermanagement)
add_subdirectory(rss)
add_subdirectory(search)
if (UNIX AND NOT APPLE AND DBUS)
add_subdirectory(qtnotify)
include_directories(qtnotify)
list(APPEND QBT_GUI_OPTIONAL_LINK_LIBRARIES qbt_qtnotify)
endif (UNIX AND NOT APPLE AND DBUS)
include_directories(
${CMAKE_CURRENT_BINARY_DIR}/properties
${CMAKE_CURRENT_BINARY_DIR}/rss
${CMAKE_CURRENT_BINARY_DIR}/search
lineedit/src
powermanagement
properties
rss
../app
)
set(QBT_GUI_HEADERS
about_imp.h
addnewtorrentdialog.h
advancedsettings.h
advancedsettings.h
autoexpandabledialog.h
deletionconfirmationdlg.h
downloadfromurldlg.h
executionlog.h
guiiconprovider.h
hidabletabwidget.h
ico.h
loglistwidget.h
mainwindow.h
messageboxraised.h
options_imp.h
previewlistdelegate.h
previewselect.h
scanfoldersdelegate.h
shutdownconfirm.h
speedlimitdlg.h
statsdialog.h
statusbar.h
torrentcontentfiltermodel.h
torrentcontentmodel.h
torrentcontentmodelfile.h
torrentcontentmodelfolder.h
torrentcontentmodelitem.h
torrentcontenttreeview.h
torrentcreatordlg.h
torrentimportdlg.h
torrentmodel.h
trackerlogin.h
transferlistdelegate.h
transferlistfilterswidget.h
transferlistsortmodel.h
transferlistwidget.h
updownratiodlg.h
)
set(QBT_GUI_SOURCES
addnewtorrentdialog.cpp
advancedsettings.cpp
autoexpandabledialog.cpp
executionlog.cpp
guiiconprovider.cpp
ico.cpp
loglistwidget.cpp
mainwindow.cpp
messageboxraised.cpp
options_imp.cpp
previewselect.cpp
scanfoldersdelegate.cpp
shutdownconfirm.cpp
speedlimitdlg.cpp
statsdialog.cpp
statusbar.cpp
torrentcontentfiltermodel.cpp
torrentcontentmodel.cpp
torrentcontentmodelfile.cpp
torrentcontentmodelfolder.cpp
torrentcontentmodelitem.cpp
torrentcontenttreeview.cpp
torrentcreatordlg.cpp
torrentimportdlg.cpp
torrentmodel.cpp
trackerlogin.cpp
transferlistdelegate.cpp
transferlistfilterswidget.cpp
transferlistsortmodel.cpp
transferlistwidget.cpp
updownratiodlg.cpp
)
if (WIN32 OR APPLE)
list(APPEND QBT_GUI_HEADERS programupdater.h)
list(APPEND QBT_GUI_SOURCES programupdater.cpp)
endif (WIN32 OR APPLE)
set(QBT_GUI_FORMS
mainwindow.ui
about.ui
preview.ui
login.ui
downloadfromurldlg.ui
bandwidth_limit.ui
updownratiodlg.ui
confirmdeletiondlg.ui
torrentimportdlg.ui
executionlog.ui
addnewtorrentdialog.ui
autoexpandabledialog.ui
statsdialog.ui
options.ui
torrentcreatordlg.ui
)
set(QBT_GUI_RESOURCES about.qrc)
add_library(qbt_gui STATIC ${QBT_GUI_HEADERS} ${QBT_GUI_SOURCES} ${QBT_GUI_RESOURCES})
target_link_libraries(qbt_gui qbt_lineedit qbt_powermanagement qbt_rss qbt_properties qbt_searchengine ${QBT_GUI_OPTIONAL_LINK_LIBRARIES} qbt_base)

View file

@ -0,0 +1,18 @@
set(QBT_LINEEDIT_SOURCES
src/lineedit.cpp
)
set(QBT_LINEEDIT_HEADERS
src/lineedit.h
)
set(QBT_LINEEDIT_RESOURCES
resources/lineeditimages.qrc
)
add_library(qbt_lineedit STATIC ${QBT_LINEEDIT_SOURCES} ${QBT_LINEEDIT_HEADERS} ${QBT_LINEEDIT_RESOURCES})
if (QT4_FOUND)
target_link_libraries(qbt_lineedit Qt4::QtGui)
else (QT4_FOUND)
target_link_libraries(qbt_lineedit Qt5::Widgets)
endif (QT4_FOUND)

View file

@ -0,0 +1,25 @@
set(QBT_POWERMANAGEMENT_HEADERS
powermanagement.h
)
set(QBT_POWERMANAGEMENT_SOURCES
powermanagement.cpp
)
if (UNIX AND DBUS)
find_package(X11)
if (X11_FOUND)
list(APPEND QBT_POWERMANAGEMENT_HEADERS powermanagement_x11.h)
list(APPEND QBT_POWERMANAGEMENT_SOURCES powermanagement_x11.cpp)
endif (X11_FOUND)
endif (UNIX AND DBUS)
add_library(qbt_powermanagement STATIC ${QBT_POWERMANAGEMENT_SOURCES} ${QBT_POWERMANAGEMENT_HEADERS})
set_target_properties(qbt_powermanagement PROPERTIES AUTOUIC False AUTORCC False)
target_link_qt_components(qbt_powermanagement Core)
if (X11_FOUND)
target_link_qt_components(qbt_powermanagement DBus)
endif (X11_FOUND)
if (WIN32)
target_link_libraries(qbt_powermanagement PowrProf)
endif (WIN32)

View file

@ -0,0 +1,47 @@
include_directories(
${CMAKE_CURRENT_BINARY_DIR}
${CMAKE_CURRENT_SOURCE_DIR}
../lineedit/src/
)
set(QBT_PROPERTIES_FORMS
propertieswidget.ui
trackersadditiondlg.ui
peersadditiondlg.ui
)
set(QBT_PROPERTIES_HEADERS
propertieswidget.h
peerlistwidget.h
proplistdelegate.h
trackerlist.h
downloadedpiecesbar.h
peerlistdelegate.h
peerlistsortmodel.h
peersadditiondlg.h
trackersadditiondlg.h
pieceavailabilitybar.h
proptabbar.h
speedwidget.h
speedplotview.h
)
set(QBT_PROPERTIES_SOURCES
propertieswidget.cpp
proplistdelegate.cpp
peerlistwidget.cpp
trackerlist.cpp
peersadditiondlg.cpp
downloadedpiecesbar.cpp
trackersadditiondlg.cpp
pieceavailabilitybar.cpp
proptabbar.cpp
speedwidget.cpp
speedplotview.cpp
)
add_library(qbt_properties STATIC ${QBT_PROPERTIES_HEADERS} ${QBT_PROPERTIES_SOURCES})
target_link_libraries(qbt_properties qbt_base)
if (NOT QT4_FOUND)
target_link_libraries(qbt_properties Qt5::Widgets Qt5::Concurrent)
endif (NOT QT4_FOUND)

View file

@ -0,0 +1,11 @@
set(QBT_QTNOTIFY_SOURCES
notifications.cpp
)
set(QBT_QTNOTIFY_HEADERS
notifications.h
)
add_library(qbt_qtnotify STATIC ${QBT_QTNOTIFY_SOURCES} ${QBT_QTNOTIFY_HEADERS})
set_target_properties(qbt_qtnotify PROPERTIES AUTOUIC False AUTORCC False)
target_link_qt_components(qbt_qtnotify DBus)

View file

@ -0,0 +1,33 @@
include_directories(${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR})
set(QBT_RSS_HEADERS
automatedrssdownloader.h
cookiesdlg.h
feedlistwidget.h
htmlbrowser.h
rss_imp.h
rsssettingsdlg.h
)
set(QBT_RSS_SOURCE
automatedrssdownloader.cpp
cookiesdlg.cpp
feedlistwidget.cpp
htmlbrowser.cpp
rss_imp.cpp
rsssettingsdlg.cpp
)
set(QBT_RSS_FORMS
automatedrssdownloader.ui
cookiesdlg.ui
rss.ui
rsssettingsdlg.ui
)
add_library(qbt_rss STATIC ${QBT_RSS_HEADERS} ${QBT_RSS_SOURCE} ${QBT_RSS_FORMS})
if (QT4_FOUND)
target_link_libraries(qbt_rss Qt4::QtGui Qt4::QtNetwork)
else (QT4_FOUND)
target_link_libraries(qbt_rss Qt5::Gui Qt5::Widgets Qt5::Network)
endif (QT4_FOUND)

View file

@ -0,0 +1,38 @@
include_directories(
${CMAKE_CURRENT_BINARY_DIR}
${CMAKE_CURRENT_SOURCE_DIR}/..
${CMAKE_CURRENT_SOURCE_DIR}/../lineedit/src
)
set(QBT_SEARCHENGINE_FORMS
pluginselectdlg.ui
pluginsourcedlg.ui
searchwidget.ui
)
set(QBT_SEARCHENGINE_HEADERS
pluginselectdlg.h
pluginsourcedlg.h
searchlistdelegate.h
searchsortmodel.h
searchtab.h
searchwidget.h
)
set(QBT_SEARCHENGINE_SOURCES
pluginselectdlg.cpp
pluginsourcedlg.cpp
searchlistdelegate.cpp
searchsortmodel.cpp
searchtab.cpp
searchwidget.cpp
../ico.cpp
)
set(QBT_SEARCHENGINE_RESOURCES
# search.qrc
)
add_library(qbt_searchengine STATIC ${QBT_SEARCHENGINE_HEADERS} ${QBT_SEARCHENGINE_SOURCES} ${QBT_SEARCHENGINE_RESOURCES} ${QBT_SEARCHENGINE_FORMS})
target_link_libraries(qbt_searchengine qbt_base)

35
src/webui/CMakeLists.txt Normal file
View file

@ -0,0 +1,35 @@
set(QBT_WEBUI_HEADERS
abstractwebapplication.h
btjson.h
extra_translations.h
jsonutils.h
prefjson.h
webapplication.h
websessiondata.h
webui.h
)
set(QBT_WEBUI_SOURCES
abstractwebapplication.cpp
btjson.cpp
prefjson.cpp
webapplication.cpp
webui.cpp
)
if (QT4_FOUND)
if (NOT SYSTEM_QJSON)
add_subdirectory(qjson)
else (NOT SYSTEM_QJSON)
find_package(QJSON REQUIRED)
add_definitions(-DUSE_SYSTEM_QJSON)
endif(NOT SYSTEM_QJSON)
endif (QT4_FOUND)
set(QBT_WEBUI_RESOURCES webui.qrc)
add_library(qbt_webui STATIC ${QBT_WEBUI_HEADERS} ${QBT_WEBUI_SOURCES} ${QBT_WEBUI_RESOURCES})
target_link_libraries(qbt_webui qbt_base)
if (QT4_FOUND)
target_link_libraries(qbt_webui qjson)
endif (QT4_FOUND)

View file

@ -0,0 +1,25 @@
include_directories("${CMAKE_CURRENT_SOURCE_DIR}")
set(QJSON_HEADERS
FlexLexer.h
stack.hh
position.hh
location.hh
json_parser.hh
json_scanner.h
parser.h
parser_p.h
qjson_debug.h
qjson_export.h
serializer.h
)
set(QJSON_SOURCES
json_parser.cc
json_scanner.cc
json_scanner.cpp
parser.cpp
serializer.cpp
)
add_library(qjson STATIC ${QJSON_HEADERS} ${QJSON_SOURCES})