155 lines
4.7 KiB
CMake
Raw Normal View History

# Copyright 2006 The QElectroTech Team
# This file is part of QElectroTech.
#
# QElectroTech is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 2 of the License, or
# (at your option) any later version.
#
# QElectroTech is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with QElectroTech. If not, see <http://www.gnu.org/licenses/>.
2020-12-13 15:44:01 +01:00
include(cmake/hoto_update_cmake_message.cmake)
cmake_minimum_required(VERSION 3.14...3.19 FATAL_ERROR)
2020-12-08 15:20:48 +01:00
project(qelectrotech
2021-03-02 22:15:44 +01:00
VERSION 0.9.0
DESCRIPTION "QET is a CAD/CAE editor focusing on schematics drawing features."
HOMEPAGE_URL "https://qelectrotech.org/"
LANGUAGES CXX)
include(cmake/copyright_message.cmake)
set(QET_DIR ${PROJECT_SOURCE_DIR})
# Add sub directories
option(PACKAGE_TESTS "Build the tests" ON)
if(PACKAGE_TESTS)
message("Add sub directory tests")
add_subdirectory(tests)
2020-12-11 14:47:40 +01:00
endif()
include(cmake/paths_compilation_installation.cmake)
include(cmake/start_options.cmake)
include(cmake/developer_options.cmake)
include(cmake/git_update_submodules.cmake)
include(cmake/git_last_commit_sha.cmake)
include(cmake/fetch_kdeaddons.cmake)
include(cmake/fetch_singleapplication.cmake)
include(cmake/fetch_pugixml.cmake)
include(cmake/qet_compilation_vars.cmake)
2020-12-09 15:28:43 +01:00
set(CMAKE_INCLUDE_CURRENT_DIR ON)
2020-12-09 15:28:43 +01:00
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)
set(CMAKE_AUTOUIC ON)
2020-12-09 15:28:43 +01:00
SET(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
2020-12-10 18:56:30 +01:00
2020-12-11 00:45:43 +01:00
find_package(
QT
NAMES
Qt6
Qt5
COMPONENTS
${QET_COMPONENTS}
REQUIRED
)
find_package(
Qt${QT_VERSION_MAJOR}
COMPONENTS
${QET_COMPONENTS}
REQUIRED)
2020-12-11 14:47:40 +01:00
set(CMAKE_AUTOUIC_SEARCH_PATHS ${QET_DIR}/sources/ui)
qt5_create_translation(QM_FILES ${CMAKE_SOURCE_DIR} ${TS_FILES})
2020-12-14 21:30:40 +01:00
set_source_files_properties(${TS_FILES} PROPERTIES OUTPUT_LOCATION "${QET_DIR}/lang")
qt5_add_translation(QM_FILES ${TS_FILES})
2020-12-08 15:20:48 +01:00
# als laatse
include(cmake/define_definitions.cmake)
2020-12-08 15:20:48 +01:00
2020-12-11 00:45:43 +01:00
add_executable(
${PROJECT_NAME}
2020-12-17 21:43:23 +01:00
${QET_RES_FILES}
2020-12-11 00:45:43 +01:00
${QET_SRC_FILES}
2020-12-11 16:17:15 +01:00
${QM_FILES}
${QET_DIR}/qelectrotech.qrc
2020-12-11 00:45:43 +01:00
)
2020-12-09 15:28:43 +01:00
2020-12-11 00:45:43 +01:00
target_link_libraries(
${PROJECT_NAME}
PUBLIC
PRIVATE
pugixml::pugixml
SingleApplication::SingleApplication
${KF5_PRIVATE_LIBRARIES}
${QET_PRIVATE_LIBRARIES}
)
target_include_directories(
${PROJECT_NAME}
PRIVATE
${QET_DIR}/sources/titleblock
${QET_DIR}/sources/ui
${QET_DIR}/sources/qetgraphicsitem
${QET_DIR}/sources/qetgraphicsitem/ViewItem
${QET_DIR}/sources/qetgraphicsitem/ViewItem/ui
${QET_DIR}/sources/richtext
${QET_DIR}/sources/factory
${QET_DIR}/sources/properties
${QET_DIR}/sources/dvevent
${QET_DIR}/sources/editor
${QET_DIR}/sources/editor/esevent
${QET_DIR}/sources/editor/graphicspart
${QET_DIR}/sources/editor/ui
${QET_DIR}/sources/editor/UndoCommand
${QET_DIR}/sources/undocommand
${QET_DIR}/sources/diagramevent
${QET_DIR}/sources/ElementsCollection
${QET_DIR}/sources/ElementsCollection/ui
${QET_DIR}/sources/autoNum
${QET_DIR}/sources/autoNum/ui
${QET_DIR}/sources/ui/configpage
${QET_DIR}/sources/SearchAndReplace
${QET_DIR}/sources/SearchAndReplace/ui
${QET_DIR}/sources/NameList
${QET_DIR}/sources/NameList/ui
${QET_DIR}/sources/utils
2023-11-08 13:38:55 +01:00
${QET_DIR}/pugixml/src
${QET_DIR}/sources/dataBase
${QET_DIR}/sources/dataBase/ui
${QET_DIR}/sources/factory/ui
${QET_DIR}/sources/print
)
install(TARGETS ${PROJECT_NAME})
2021-03-22 08:15:37 +01:00
if (NOT MINGW)
install(DIRECTORY ico/breeze-icons/16x16 DESTINATION ${QET_ICONS_PATH})
install(DIRECTORY ico/breeze-icons/22x22 DESTINATION ${QET_ICONS_PATH})
install(DIRECTORY ico/breeze-icons/32x32 DESTINATION ${QET_ICONS_PATH})
install(DIRECTORY ico/breeze-icons/48x48 DESTINATION ${QET_ICONS_PATH})
install(DIRECTORY ico/breeze-icons/64x64 DESTINATION ${QET_ICONS_PATH})
install(DIRECTORY ico/breeze-icons/128x128 DESTINATION ${QET_ICONS_PATH})
install(DIRECTORY ico/breeze-icons/256x256 DESTINATION ${QET_ICONS_PATH})
install(DIRECTORY elements DESTINATION share/qelectrotech)
install(DIRECTORY examples DESTINATION share/qelectrotech)
install(DIRECTORY titleblocks DESTINATION share/qelectrotech)
install(FILES LICENSE ELEMENTS.LICENSE CREDIT README ChangeLog DESTINATION share/doc/qelectrotech)
2024-12-15 15:05:23 +01:00
install(FILES misc/org.qelectrotech.qelectrotech.desktop DESTINATION share/applications)
install(FILES misc/qelectrotech.xml DESTINATION share/mime/packages)
install(FILES misc/qelectrotech.appdata.xml DESTINATION ${QET_APPDATA_PATH})
install(FILES ${QM_FILES} DESTINATION ${QET_LANG_PATH})
2021-03-22 08:15:37 +01:00
endif()