2023-01-31 12:31:12 +00:00
|
|
|
project(DOtherSide)
|
|
|
|
|
2020-05-25 00:22:41 +00:00
|
|
|
include(GNUInstallDirs)
|
|
|
|
|
2023-01-31 12:31:12 +00:00
|
|
|
# Macro for merging common code between static and shared
|
|
|
|
macro(add_target name type)
|
2020-07-15 01:00:50 +00:00
|
|
|
find_package(Qt5 COMPONENTS Core Qml Gui Quick QuickControls2 Widgets Network REQUIRED)
|
2023-01-31 12:31:12 +00:00
|
|
|
|
|
|
|
add_library(${name} ${type}
|
|
|
|
include/DOtherSide/DOtherSideTypes.h
|
|
|
|
include/DOtherSide/DOtherSideTypesCpp.h
|
|
|
|
include/DOtherSide/DOtherSide.h
|
|
|
|
include/DOtherSide/DosQDeclarative.h
|
|
|
|
include/DOtherSide/DosQObjectWrapper.h
|
|
|
|
include/DOtherSide/DosQAbstractItemModelWrapper.h
|
|
|
|
include/DOtherSide/DosQObject.h
|
|
|
|
include/DOtherSide/DosQObjectImpl.h
|
|
|
|
include/DOtherSide/DosIQObjectImpl.h
|
|
|
|
include/DOtherSide/DosQMetaObject.h
|
|
|
|
include/DOtherSide/DosIQAbstractItemModelImpl.h
|
|
|
|
include/DOtherSide/DosQAbstractItemModel.h
|
|
|
|
include/DOtherSide/Utils.h
|
2021-08-12 11:31:02 +00:00
|
|
|
include/DOtherSide/StatusEvents/StatusDockShowAppEvent.h
|
|
|
|
include/DOtherSide/StatusEvents/StatusOSThemeEvent.h
|
2021-05-19 14:09:03 +00:00
|
|
|
include/DOtherSide/DOtherSideStatusWindow.h
|
2021-07-21 16:34:28 +00:00
|
|
|
include/DOtherSide/DOtherSideSingleInstance.h
|
2023-01-31 12:31:12 +00:00
|
|
|
src/DOtherSide.cpp
|
|
|
|
src/DosQMetaObject.cpp
|
|
|
|
src/DosQDeclarative.cpp
|
|
|
|
src/DosQObject.cpp
|
|
|
|
src/DOtherSideTypesCpp.cpp
|
|
|
|
src/DosQObjectImpl.cpp
|
|
|
|
src/DosQAbstractItemModel.cpp
|
|
|
|
src/DosQQuickImageProvider.cpp
|
2021-08-12 11:31:02 +00:00
|
|
|
src/StatusEvents/StatusDockShowAppEvent.cpp
|
|
|
|
src/StatusEvents/StatusOSThemeEvent.cpp
|
2021-05-19 14:09:03 +00:00
|
|
|
src/DOtherSideStatusWindow.cpp
|
2021-07-21 16:34:28 +00:00
|
|
|
src/DOtherSideSingleInstance.cpp
|
2023-01-31 12:31:12 +00:00
|
|
|
)
|
|
|
|
|
2021-05-19 14:09:03 +00:00
|
|
|
if (APPLE)
|
|
|
|
target_sources(${name} PUBLIC src/DOtherSideStatusWindow_osx.mm)
|
|
|
|
else()
|
|
|
|
target_sources(${name} PUBLIC ${CMAKE_SOURCE_DIR}/lib/src/DOtherSideStatusWindow_other.cpp)
|
|
|
|
endif()
|
|
|
|
|
2023-01-31 12:31:12 +00:00
|
|
|
if (WIN32)
|
|
|
|
target_compile_definitions(${name} PRIVATE -DWIN32)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
set_target_properties(${name} PROPERTIES CXX_STANDARD 11 AUTOMOC ON)
|
|
|
|
|
|
|
|
target_include_directories(${name} PUBLIC include include/Qt)
|
|
|
|
|
2020-07-15 01:00:50 +00:00
|
|
|
target_link_libraries(${name} PRIVATE Qt5::Core Qt5::Gui Qt5::Widgets Qt5::Qml Qt5::Quick Qt5::Network)
|
2023-01-31 12:31:12 +00:00
|
|
|
|
2020-05-25 00:22:41 +00:00
|
|
|
# for DOtherSide.pc
|
2020-07-15 01:00:50 +00:00
|
|
|
set(PC_REQUIRES "Qt5Core, Qt5Gui, Qt5Widgets, Qt5Qml, Qt5Quick, Qt5Network, Qt5DBus")
|
2023-01-31 12:31:12 +00:00
|
|
|
if (${Qt5QuickControls2_FOUND})
|
|
|
|
target_link_libraries(${name} PRIVATE Qt5::QuickControls2)
|
2020-05-25 00:22:41 +00:00
|
|
|
set(PC_REQUIRES "${PC_REQUIRES}, Qt5QuickControls2")
|
2023-01-31 12:31:12 +00:00
|
|
|
endif()
|
|
|
|
endmacro()
|
|
|
|
|
|
|
|
set(major 0)
|
|
|
|
set(minor 6)
|
|
|
|
set(patch 4)
|
2020-05-25 00:22:41 +00:00
|
|
|
set(DOTHERSIDE_VERSION "${major}.${minor}.${patch}")
|
|
|
|
|
|
|
|
# Add shared version
|
|
|
|
if(ENABLE_DYNAMIC_LIBS)
|
|
|
|
add_target(${PROJECT_NAME} SHARED)
|
|
|
|
set_target_properties(${PROJECT_NAME}
|
|
|
|
PROPERTIES
|
|
|
|
SOVERSION "${major}.${minor}"
|
|
|
|
VERSION "${major}.${minor}.${patch}"
|
|
|
|
)
|
|
|
|
install(TARGETS ${PROJECT_NAME}
|
|
|
|
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
|
|
|
)
|
|
|
|
endif(ENABLE_DYNAMIC_LIBS)
|
2023-01-31 12:31:12 +00:00
|
|
|
|
|
|
|
# Add static version
|
2020-05-25 00:22:41 +00:00
|
|
|
if(ENABLE_STATIC_LIBS)
|
|
|
|
add_target(${PROJECT_NAME}Static STATIC)
|
|
|
|
install(TARGETS ${PROJECT_NAME}Static
|
|
|
|
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
|
|
|
)
|
|
|
|
endif(ENABLE_STATIC_LIBS)
|
2023-01-31 12:31:12 +00:00
|
|
|
|
|
|
|
# Install directive for header files
|
|
|
|
install(FILES
|
2020-05-25 00:22:41 +00:00
|
|
|
include/DOtherSide/DOtherSide.h
|
|
|
|
include/DOtherSide/DOtherSideTypes.h
|
|
|
|
DESTINATION include/DOtherSide
|
2023-01-31 12:31:12 +00:00
|
|
|
)
|
|
|
|
|
2020-05-25 00:22:41 +00:00
|
|
|
# pkg-config file
|
|
|
|
configure_file(${CMAKE_SOURCE_DIR}/DOtherSide.pc.cmake ${CMAKE_BINARY_DIR}/DOtherSide.pc @ONLY)
|
|
|
|
install(FILES ${CMAKE_BINARY_DIR}/DOtherSide.pc DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig)
|
|
|
|
|