Files
qt-creator/tests/manual/debugger/gui/CMakeLists.txt
Eike Ziller 3381a6219a Debugger test: Automatically sign on macOS
The "gui" manual test is used for release testing attaching a running
application and a core file to the debugger. For this, the application
must be signed with the right entitlements.

Since ad-hoc signing is sufficient, this doesn't require any setup on the
testers computer. So, make this signing automatic.

Change-Id: I7042a3091848ee1c9f7f3843507f3ca616d36179
Reviewed-by: Robert Löhning <robert.loehning@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2023-06-09 11:02:42 +00:00

35 lines
1.1 KiB
CMake

cmake_minimum_required(VERSION 3.16)
project(manual_test_debugger_gui LANGUAGES CXX)
set(CMAKE_AUTOUIC ON)
set(CMAKE_AUTOMOC ON)
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
find_package(QT NAMES Qt6 Qt5 REQUIRED COMPONENTS Widgets)
find_package(Qt${QT_VERSION_MAJOR} REQUIRED COMPONENTS Widgets)
add_executable(manual_test_debugger_gui
mainwindow.cpp mainwindow.h mainwindow.ui
tst_gui.cpp
)
target_link_libraries(manual_test_debugger_gui PRIVATE Qt${QT_VERSION_MAJOR}::Widgets)
if(APPLE)
# codesign in a way that allows attaching a debugger and writing core files
add_custom_command(TARGET manual_test_debugger_gui
POST_BUILD
VERBATIM
COMMAND codesign -f -s "-" --entitlements "${CMAKE_CURRENT_SOURCE_DIR}/entitlements.plist" "$<TARGET_FILE:manual_test_debugger_gui>"
)
endif()
if (NOT QT_CREATOR_API_DEFINED)
if (CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
set (CMAKE_INSTALL_PREFIX "/tmp/manual_test_debugger_gui" CACHE PATH "default install path" FORCE)
endif()
install(TARGETS manual_test_debugger_gui)
endif()