mirror of https://github.com/cutefishos/terminal
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
67 lines
1.7 KiB
CMake
67 lines
1.7 KiB
CMake
cmake_minimum_required(VERSION 3.5)
|
|
|
|
set(PROJECT_NAME cutefish-terminal)
|
|
project(${PROJECT_NAME})
|
|
|
|
set(CMAKE_INCLUDE_CURRENT_DIR ON)
|
|
set(CMAKE_AUTOUIC ON)
|
|
set(CMAKE_AUTOMOC ON)
|
|
set(CMAKE_AUTORCC ON)
|
|
set(CMAKE_CXX_STANDARD 11)
|
|
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
|
|
|
set(QT Core Gui Quick QuickControls2 Widgets DBus LinguistTools)
|
|
find_package(Qt5 REQUIRED ${QT})
|
|
|
|
# Get the installation directory from qmake
|
|
get_target_property(QT_QMAKE_EXECUTABLE ${Qt5Core_QMAKE_EXECUTABLE} IMPORTED_LOCATION)
|
|
if(NOT QT_QMAKE_EXECUTABLE)
|
|
message(FATAL_ERROR "qmake is not found.")
|
|
endif()
|
|
|
|
execute_process(COMMAND ${QT_QMAKE_EXECUTABLE} -query QT_INSTALL_QML
|
|
OUTPUT_VARIABLE INSTALL_QMLDIR
|
|
OUTPUT_STRIP_TRAILING_WHITESPACE
|
|
)
|
|
if(INSTALL_QMLDIR)
|
|
message(STATUS "qml directory:" "${INSTALL_QMLDIR}")
|
|
else()
|
|
message(FATAL_ERROR "qml directory cannot be detected.")
|
|
endif()
|
|
|
|
set(SRCS
|
|
src/main.cpp
|
|
src/processhelper.h
|
|
src/processhelper.cpp
|
|
src/utils.cpp
|
|
src/fonts.cpp
|
|
)
|
|
|
|
set(RESOURCES
|
|
src/resources.qrc
|
|
)
|
|
|
|
add_subdirectory(qmltermwidget)
|
|
add_executable(${PROJECT_NAME} ${SRCS} ${RESOURCES})
|
|
target_link_libraries(${PROJECT_NAME}
|
|
Qt5::Core
|
|
Qt5::Quick
|
|
Qt5::QuickControls2
|
|
Qt5::Widgets
|
|
Qt5::DBus
|
|
)
|
|
|
|
file(GLOB TS_FILES translations/*.ts)
|
|
qt5_create_translation(QM_FILES ${TS_FILES})
|
|
add_custom_target(translations DEPENDS ${QM_FILES} SOURCES ${TS_FILES})
|
|
add_dependencies(${PROJECT_NAME} translations)
|
|
install(FILES ${QM_FILES} DESTINATION /usr/share/cutefish-terminal/translations)
|
|
|
|
install(TARGETS ${PROJECT_NAME} RUNTIME DESTINATION /usr/bin)
|
|
|
|
install(FILES
|
|
cutefish-terminal.desktop
|
|
DESTINATION /usr/share/applications/
|
|
COMPONENT Runtime
|
|
)
|