2020-04-25 20:34:18 +00:00
|
|
|
###
|
|
|
|
# Build GUI
|
|
|
|
###
|
|
|
|
|
2023-12-23 23:34:29 +00:00
|
|
|
if (NOT WIN32)
|
2020-06-04 19:33:34 +00:00
|
|
|
find_package(PkgConfig)
|
|
|
|
pkg_check_modules(GTK3 gtk+-3.0)
|
|
|
|
|
2020-05-19 12:08:07 +00:00
|
|
|
## GUI-Building requires the presence of a GTK3 toolset
|
|
|
|
if (NOT GTK3_FOUND)
|
|
|
|
message(STATUS "GTK3 not found!")
|
|
|
|
return() # no GTK3 present => no GUI build
|
|
|
|
else (GTK3_FOUND)
|
|
|
|
message(STATUS "Found GTK3: -I${GTK3_INCLUDE_DIRS}, ${GTK3_LIBRARIES}")
|
|
|
|
include_directories(SYSTEM ${GTK3_INCLUDE_DIRS})
|
|
|
|
|
|
|
|
# Install desktop application entry
|
|
|
|
install(FILES stlink-gui.desktop
|
2023-08-15 08:44:18 +00:00
|
|
|
DESTINATION ${CMAKE_INSTALL_FULL_DATADIR}/applications)
|
2016-09-15 20:29:59 +00:00
|
|
|
|
2020-05-19 12:08:07 +00:00
|
|
|
# Install icons
|
|
|
|
install(FILES icons/stlink-gui.svg
|
2023-08-15 08:44:18 +00:00
|
|
|
DESTINATION ${CMAKE_INSTALL_FULL_DATADIR}/icons/hicolor/scalable/apps)
|
2016-09-15 20:29:59 +00:00
|
|
|
|
2020-05-19 12:08:07 +00:00
|
|
|
set(GUI_SOURCES gui.c gui.h)
|
2020-04-25 20:34:18 +00:00
|
|
|
|
2020-05-19 12:08:07 +00:00
|
|
|
## stlink-gui
|
|
|
|
add_executable(stlink-gui ${GUI_SOURCES})
|
2023-08-15 08:44:18 +00:00
|
|
|
install(FILES stlink-gui.ui DESTINATION ${CMAKE_INSTALL_FULL_DATADIR}/${PROJECT_NAME})
|
2020-05-19 12:08:07 +00:00
|
|
|
set_target_properties(stlink-gui PROPERTIES
|
2023-08-15 08:44:18 +00:00
|
|
|
COMPILE_DEFINITIONS STLINK_UI_DIR="${CMAKE_INSTALL_FULL_DATADIR}/${PROJECT_NAME}")
|
2020-05-19 12:08:07 +00:00
|
|
|
target_link_libraries(stlink-gui ${STLINK_LIB_SHARED} ${SSP_LIB} ${GTK3_LDFLAGS})
|
2023-03-19 14:43:37 +00:00
|
|
|
install(TARGETS stlink-gui DESTINATION ${CMAKE_BINDIR})
|
2023-06-24 21:55:12 +00:00
|
|
|
endif()
|
|
|
|
endif()
|