cmake_minimum_required(VERSION 3.10) project(spark_store) set(EXECUTABLE_NAME sparkstore) # Begin Compilation Options # When set to ON, DTK Plugin for DDE platform will be built. # Note that only machines with DTK and dev packages installed can build the plugin. set(SPARK_BUILD_DTK_PLUGIN ON) # When set to ON, store will transmit telemetry even in Debug builds. set(SPARK_FORCE_TELEMETRY OFF) # End Compilation Options set(CMAKE_CXX_STANDARD 14) set(CMAKE_AUTOMOC ON) set(CMAKE_AUTORCC ON) set(CMAKE_AUTOUIC ON) set(QT_VERSION 5) set(REQUIRED_LIBS Core Gui Widgets Concurrent) set(REQUIRED_LIBS_QUALIFIED Qt5::Core Qt5::Gui Qt5::Widgets Qt5::Concurrent) include_directories(inc) include_directories(plugin) set(CMAKE_INCLUDE_CURRENT_DIR ON) set(PRE_CONFIGURE_FILE "src/gitver.cpp.in") set(POST_CONFIGURE_FILE "${CMAKE_CURRENT_BINARY_DIR}/src/gitver.cpp") include(cmake/git_watcher.cmake) add_library(gitver STATIC ${POST_CONFIGURE_FILE}) #target_include_directories(gitver PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}) add_dependencies(gitver check_git) set(SOURCE_FILES src/main.cpp resource/resource.qrc inc/gitver.h gui/spkwindow.cpp inc/spkwindow.h gui/spktitlebar.cpp inc/spktitlebar.h inc/spkui_general.h gui/spkui_general.cpp inc/deepinplatform.h inc/dtk/spkdtkplugin.h src/spklogging.cpp inc/spklogging.h inc/spkuimsg.h src/spkuimsg.cpp inc/spkmainwindow.h inc/spkmsgbox.h gui/spkmsgbox.cpp inc/spkdialog.h gui/spkdialog.cpp inc/spkabout.h gui/spkabout.cpp inc/spkstore.h src/spkstore.cpp gui/spkmainwindow.cpp inc/spkpageqsstest.h gui/spkpageqsstest.cpp gui/spkcategoryselector.cpp inc/spkconfig.h inc/telemetry/collectid.h ) include(cmake/FindLibNotify.cmake) include(cmake/FindGlib.cmake) include(cmake/FindGdk3.cmake) include_directories(${GLIB_INCLUDE_DIRS}) include_directories(${GDK3_INCLUDE_DIRS}) set(LIBLINKING ${LIBLINKING} gitver ${LIBNOTIFY_LIBRARIES} ${GLIB_LIBRARIES} ${GDK3_LIBRARIES} ${CMAKE_DL_LIBS}) # Required for a good backtrace add_compile_options(-g) add_link_options(-rdynamic) # Find Qt before adding other build targets find_package(Qt${QT_VERSION} COMPONENTS ${REQUIRED_LIBS} REQUIRED) add_executable(${EXECUTABLE_NAME} ${SOURCE_FILES}) if(SPARK_BUILD_DTK_PLUGIN) add_subdirectory(plugin/dtkplugin) endif() target_link_libraries(${EXECUTABLE_NAME} ${REQUIRED_LIBS_QUALIFIED} ${LIBLINKING}) install(TARGETS ${EXECUTABLE_NAME} RUNTIME DESTINATION bin)