2022-08-08 22:46:51 +03:00
|
|
|
#
|
2023-12-31 09:24:12 +01:00
|
|
|
# Copyright (C) 2020-2024 QuasarApp.
|
2022-08-08 22:46:51 +03:00
|
|
|
# Distributed under the GPLv3 software license, see the accompanying
|
|
|
|
# Everyone is permitted to copy and distribute verbatim copies
|
|
|
|
# of this license document, but changing it is not allowed.
|
|
|
|
#
|
|
|
|
|
|
|
|
cmake_minimum_required(VERSION 3.18)
|
|
|
|
|
|
|
|
get_filename_component(CURRENT_PROJECT_DIR ${CMAKE_CURRENT_SOURCE_DIR} NAME)
|
|
|
|
|
2022-08-13 21:37:08 +03:00
|
|
|
set(CURRENT_PROJECT "${PROJECT_NAME}-${CURRENT_PROJECT_DIR}")
|
2022-08-08 22:46:51 +03:00
|
|
|
|
2022-10-21 11:12:56 +03:00
|
|
|
file(GLOB MAIN_CPP
|
2022-08-08 22:46:51 +03:00
|
|
|
"*.cpp" "*.h" "*.qrc"
|
2022-08-24 22:55:22 +03:00
|
|
|
"units/*.cpp" "units/*.h"
|
|
|
|
"modules/*.cpp" "modules/*.h"
|
2022-08-08 22:46:51 +03:00
|
|
|
)
|
|
|
|
|
2022-10-21 11:00:56 +03:00
|
|
|
if (UNIX)
|
2022-10-21 11:12:56 +03:00
|
|
|
file(GLOB UNITS_CPP
|
2022-10-21 11:00:56 +03:00
|
|
|
"units/linux/*.cpp" "units/linux/*.h"
|
|
|
|
)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
if (WIN32)
|
2022-10-21 11:12:56 +03:00
|
|
|
file(GLOB UNITS_CPP
|
2022-10-21 11:00:56 +03:00
|
|
|
"units/win/*.cpp" "units/win/*.h"
|
|
|
|
)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
set(SOURCE_CPP ${MAIN_CPP} ${UNITS_CPP})
|
|
|
|
|
2022-08-08 22:46:51 +03:00
|
|
|
set(PUBLIC_INCUDE_DIR "${CMAKE_CURRENT_SOURCE_DIR}")
|
|
|
|
set(PUBLIC_INCUDE_DIR ${PUBLIC_INCUDE_DIR} "${CMAKE_CURRENT_SOURCE_DIR}/units")
|
2022-10-21 11:00:56 +03:00
|
|
|
|
|
|
|
if (UNIX)
|
|
|
|
set(PUBLIC_INCUDE_DIR ${PUBLIC_INCUDE_DIR} "${CMAKE_CURRENT_SOURCE_DIR}/units/linux")
|
|
|
|
endif()
|
|
|
|
|
|
|
|
if (WIN32)
|
|
|
|
set(PUBLIC_INCUDE_DIR ${PUBLIC_INCUDE_DIR} "${CMAKE_CURRENT_SOURCE_DIR}/units/win")
|
|
|
|
endif()
|
|
|
|
|
2022-08-24 22:55:22 +03:00
|
|
|
set(PUBLIC_INCUDE_DIR ${PUBLIC_INCUDE_DIR} "${CMAKE_CURRENT_SOURCE_DIR}/modules")
|
2022-08-08 22:46:51 +03:00
|
|
|
|
2022-08-27 22:30:55 +03:00
|
|
|
add_definitions(-DQT_BASE_DIR="${QT_QT_ROOT}/")
|
2022-08-22 22:39:15 +03:00
|
|
|
add_definitions(-DTEST_BIN_DIR="${CMAKE_CURRENT_LIST_DIR}/../testcases/bin/")
|
2022-08-08 22:46:51 +03:00
|
|
|
|
|
|
|
add_executable(${CURRENT_PROJECT} ${SOURCE_CPP})
|
2022-08-27 22:30:55 +03:00
|
|
|
target_link_libraries(${CURRENT_PROJECT} PRIVATE Qt${QT_VERSION_MAJOR}::Test Deploy)
|
2022-08-08 22:46:51 +03:00
|
|
|
|
|
|
|
target_include_directories(${CURRENT_PROJECT} PUBLIC ${PUBLIC_INCUDE_DIR})
|
|
|
|
|
|
|
|
|
|
|
|
initTests()
|
2022-10-07 11:06:23 +03:00
|
|
|
|
|
|
|
SET(QT_TEST_EXTRA_ARGS -maxwarnings 0)
|
|
|
|
addTestsArg(${PROJECT_NAME} ${CURRENT_PROJECT} "${QT_TEST_EXTRA_ARGS}")
|
2022-08-17 23:35:03 +03:00
|
|
|
|