This repository has been archived by the owner on May 8, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add cmake building, with support for: * Qt4 / Qt5 * Enable Updater support * Enable check for only one instance
- Loading branch information
Showing
14 changed files
with
215 additions
and
47 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
*.pro.user | ||
build/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,126 @@ | ||
project(dukto) | ||
cmake_minimum_required(VERSION 2.8.12) | ||
|
||
OPTION(USE_QT5 "Build with qt5" OFF) | ||
OPTION(USE_UPDATER "Add updater for application" OFF) | ||
OPTION(USE_SINGLE_APP "Enable only single instance" OFF) | ||
|
||
if(USE_UPDATER) | ||
add_definitions("-DUPDATER") | ||
endif() | ||
if(USE_SINGLE_APP) | ||
add_definitions("-DSINGLE_APP") | ||
endif() | ||
|
||
if(NOT CMAKE_BUILD_TYPE) | ||
set(CMAKE_BUILD_TYPE "Release") | ||
endif() | ||
|
||
if(USE_QT5) | ||
find_package(Qt5Widgets REQUIRED) | ||
find_package(Qt5Network REQUIRED) | ||
find_package(Qt5Declarative REQUIRED) | ||
set(CMAKE_AUTOMOC ON) | ||
set(CMAKE_INCLUDE_CURRENT_DIR ON) | ||
else() | ||
find_package(Qt4 COMPONENTS QtCore QtGui QtNetwork QtDeclarative REQUIRED) | ||
include("${QT_USE_FILE}") | ||
add_definitions(${QT_DEFINITIONS}) | ||
include_directories(${QT_MKSPECS_DIR}/default) | ||
endif() | ||
|
||
set(DUKTO_HDR | ||
platform.h | ||
buddylistitemmodel.h | ||
peer.h | ||
ipaddressitemmodel.h | ||
) | ||
|
||
set(DUKTO_MOC_HDR | ||
destinationbuddy.h | ||
duktoprotocol.h | ||
duktowindow.h | ||
guibehind.h | ||
miniwebserver.h | ||
recentlistitemmodel.h | ||
settings.h | ||
systemtray.h | ||
theme.h | ||
qmlapplicationviewer/qmlapplicationviewer.h | ||
) | ||
|
||
set(DUKTO_SRC | ||
main.cpp | ||
guibehind.cpp | ||
platform.cpp | ||
buddylistitemmodel.cpp | ||
duktoprotocol.cpp | ||
miniwebserver.cpp | ||
ipaddressitemmodel.cpp | ||
recentlistitemmodel.cpp | ||
settings.cpp | ||
destinationbuddy.cpp | ||
duktowindow.cpp | ||
theme.cpp | ||
systemtray.cpp | ||
qmlapplicationviewer/qmlapplicationviewer.cpp | ||
) | ||
|
||
set(DUKTO_RESOURCES | ||
qml.qrc | ||
) | ||
|
||
if(USE_UPDATER) | ||
list(APPEND DUKTO_SRC updateschecker.cpp) | ||
list(APPEND DUKTO_MOC_HDR updateschecker.h) | ||
endif() | ||
|
||
if(WIN32) | ||
list(APPEND DUKTO_SRC ecwin7.cpp) | ||
list(APPEND DUKTO_HDR ecwin7.h) | ||
endif() | ||
|
||
if(USE_QT5) | ||
qt5_add_resources(DUKTO_RESOURCES_RCC ${DUKTO_RESOURCES}) | ||
else() | ||
QT4_WRAP_CPP(DUKTO_MOC ${DUKTO_MOC_HDR}) | ||
QT4_ADD_RESOURCES(DUKTO_RESOURCES_RCC ${DUKTO_RESOURCES}) | ||
endif() | ||
|
||
include_directories(qmlapplicationviewer) | ||
|
||
if(USE_SINGLE_APP) | ||
add_subdirectory(qtsingleapplication) | ||
include_directories(qtsingleapplication) | ||
endif() | ||
|
||
add_executable(${PROJECT_NAME} | ||
${DUKTO_HDR} | ||
${DUKTO_SRC} | ||
${DUKTO_MOC} | ||
${DUKTO_RESOURCES_RCC}) | ||
if(USE_QT5) | ||
qt5_use_modules(${PROJECT_NAME} Gui Widgets Network Declarative) | ||
set(QT_LIBRARIES "") | ||
endif() | ||
|
||
if(USE_SINGLE_APP) | ||
add_dependencies(${PROJECT_NAME} qtsingleapplication) | ||
link_directories("${CMAKE_CURRENT_BINARY_DIR}/qtsingleapplication") | ||
target_link_libraries(${PROJECT_NAME} qtsingleapplication) | ||
endif() | ||
|
||
target_link_libraries(${PROJECT_NAME} ${QT_LIBRARIES}) | ||
|
||
if(WIN32) | ||
target_link_libraries(${PROJECT_NAME} libWs2_32 libole32 libNetapi32) | ||
endif() | ||
|
||
if(UNIX AND NOT APPLE) | ||
install(TARGETS ${PROJECT_NAME} | ||
DESTINATION bin) | ||
install(FILES dukto.png | ||
DESTINATION share/pixmaps/) | ||
install(FILES dukto.desktop | ||
DESTINATION share/applications/) | ||
endif() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
cmake_minimum_required(VERSION 2.8.12) | ||
|
||
set(SINGLEAPP-SOURCES | ||
qtsingleapplication.cpp | ||
qtlocalpeer.cpp | ||
) | ||
|
||
set(SINGLEAPP-MOC-HEADERS | ||
qtsingleapplication.h | ||
qtlocalpeer.h | ||
) | ||
|
||
if(USE_QT5) | ||
find_package(Qt5Widgets REQUIRED) | ||
find_package(Qt5Network REQUIRED) | ||
set(QT_LIBRARIES "") | ||
set(CMAKE_AUTOMOC ON) | ||
set(CMAKE_INCLUDE_CURRENT_DIR ON) | ||
else() | ||
find_package(Qt4 COMPONENTS QtCore QtNetwork REQUIRED) | ||
include("${QT_USE_FILE}") | ||
add_definitions(${QT_DEFINITIONS}) | ||
QT4_WRAP_CPP(SINGLEAPP-SOURCES-MOC ${SINGLEAPP-MOC-HEADERS}) | ||
include_directories(${QT_MKSPECS_DIR}/default) | ||
endif() | ||
|
||
ADD_LIBRARY(qtsingleapplication STATIC | ||
${SINGLEAPP-SOURCES} | ||
${SINGLEAPP-SOURCES-MOC} | ||
) | ||
|
||
if(USE_QT5) | ||
qt5_use_modules(qtsingleapplication Network Widgets) | ||
endif() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -43,8 +43,7 @@ | |
** contact the sales department at [email protected]. | ||
** | ||
****************************************************************************/ | ||
|
||
#ifndef QT_SINGALAPPLICATION_H | ||
#if defined(SINGLE_APP) && !defined(QT_SINGALAPPLICATION_H) | ||
#define QT_SINGALAPPLICATION_H | ||
|
||
#include <QApplication> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
SOURCES += $$PWD/qtsingleapplication.cpp $$PWD/qtlocalpeer.cpp | ||
HEADERS += $$PWD/qtsingleapplication.h $$PWD/qtlocalpeer.h | ||
INCLUDEPATH += $$PWD | ||
|
||
OTHER_FILES += $$PWD/CMakeLists.txt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.