-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
231 additions
and
53 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
# CMakeLists.txt for libyui-mga-gtk | ||
# | ||
# Usage: | ||
# | ||
# mkdir build | ||
# cd build | ||
# cmake .. | ||
# | ||
# make | ||
# sudo make install | ||
# | ||
# Restart with a clean build environment: | ||
# rm -rf build | ||
# | ||
# Show the complete compiler commands with all arguments: | ||
# make VERBOSE=1 | ||
|
||
cmake_minimum_required( VERSION 3.17 ) | ||
project( libyui-mga-gtk ) | ||
|
||
# Options usage: | ||
# | ||
# cmake -DBUILD_DOC=on -DBUILD_EXAMPLES=off .. | ||
|
||
option( BUILD_SRC "Build in src/ subdirectory" on ) | ||
option( BUILD_DOC "Build class documentation" off ) | ||
option( WERROR "Treat all compiler warnings as errors" off ) | ||
|
||
# Non-boolean options | ||
set( DOC_DESTDIR "" CACHE STRING "Destination directory prefix for installing docs" ) | ||
|
||
#---------------------------------------------------------------------- | ||
|
||
|
||
set( CMAKE_INSTALL_MESSAGE LAZY ) # Suppress "up-to-date" messages during "make install" | ||
|
||
add_compile_options( "-Wall" ) | ||
IF (NOT CMAKE_BUILD_TYPE STREQUAL "Debug") | ||
# Initialize compiler flags for all targets in all subdirectories | ||
add_compile_options( "-Os" ) # Optimize for size (overrides CMake's -O3 in RELEASE builds) | ||
endif() | ||
|
||
if ( WERROR ) | ||
add_compile_options( "-Werror" ) | ||
endif() | ||
|
||
|
||
# | ||
# Descend into subdirectories | ||
# | ||
|
||
if ( BUILD_SRC ) | ||
add_subdirectory( src ) | ||
endif() | ||
|
||
# TODO | ||
#if ( BUILD_DOC ) | ||
# add_subdirectory( doc ) | ||
#endif() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,120 @@ | ||
PROCESS_SOURCES() | ||
# CMakeLists.txt for libyui-qt/src | ||
|
||
include( ../VERSION.cmake ) | ||
include( GNUInstallDirs ) # set CMAKE_INSTALL_INCLUDEDIR, ..._LIBDIR | ||
|
||
# Use the package PkgConfig to detect GTK+ headers/library files | ||
FIND_PACKAGE(PkgConfig REQUIRED) | ||
PKG_CHECK_MODULES(GTK3 REQUIRED gtk+-3.0) | ||
|
||
PKG_CHECK_MODULES(YUI REQUIRED libyui) | ||
pkg_get_variable(YUI_SO_VERSION libyui soversion) | ||
pkg_get_variable(YUI_SO_MAJOR libyui soversion_major) | ||
#pkg_get_variable(YUI_SO_MINOR libyui soversion_minor) | ||
#pkg_get_variable(YUI_SO_PATCH libyui soversion_patch) | ||
|
||
message (STATUS "Using ${YUI_LIBRARY_DIRS}/libyui.so.${YUI_SO_VERSION}") | ||
find_package(Boost COMPONENTS system filesystem REQUIRED) | ||
|
||
##### This is needed to be set for the libyui core | ||
SET( SONAME_MAJOR ${YUI_SO_MAJOR} ) | ||
SET( SONAME ${YUI_SO_VERSION} ) | ||
|
||
PKG_CHECK_MODULES(YUIMGA REQUIRED libyui-mga) | ||
|
||
# | ||
# libyui plugin specific | ||
# | ||
|
||
set( TARGETLIB libyui-mga-gtk ) | ||
set( TARGETLIB_BASE yui-mga-gtk ) | ||
|
||
set( HEADERS_INSTALL_DIR ${CMAKE_INSTALL_INCLUDEDIR}/yui/mga/gtk ) | ||
set( PLUGIN_DIR ${CMAKE_INSTALL_LIBDIR}/yui ) # /usr/lib64/yui | ||
|
||
# if DESTDIR is set, CMAKE_INSTALL_INCLUDEDIR already contains it | ||
# during "make install" (but not for other make targets!): | ||
# | ||
# sudo make install DESTDIR=/work/foo | ||
# or | ||
# DESTDIR=/work/foo sudo make install | ||
# | ||
# -> the include files are installed to /work/foo/usr/include/... | ||
# We need that for RPM builds to install everything to $RPM_BUILD_ROOT. | ||
|
||
|
||
set( SOURCES | ||
YGWE.cc | ||
YMGAGMenuBar.cc | ||
YMGA_GCBTable.cc | ||
YMGAGWidgetFactory.cc | ||
) | ||
|
||
|
||
set( HEADERS | ||
YGWE.h | ||
YMGAGMenuBar.h | ||
YMGA_GCBTable.h | ||
YMGAGWidgetFactory.h | ||
) | ||
|
||
|
||
# Add shared lib to be built | ||
add_library( ${TARGETLIB} SHARED | ||
${SOURCES} | ||
${HEADERS} | ||
) | ||
|
||
|
||
# Include directories and compile options | ||
# | ||
|
||
# Setup CMake to use GTK+, tell the compiler where to look for headers | ||
# and to the linker where to look for libraries | ||
INCLUDE_DIRECTORIES(${GTK3_INCLUDE_DIRS} ${YUI_INCLUDE_DIRS} ${YUIMGA_INCLUDE_DIRS} ${CMAKE_CURRENT_SOURCE_DIR}) | ||
|
||
|
||
# Make the version from ../../VERSION.cmake available as a #define | ||
target_compile_definitions( ${TARGETLIB} PUBLIC VERSION="${VERSION}" ) | ||
|
||
|
||
# | ||
# Linking | ||
# | ||
|
||
# https://cmake.org/cmake/help/latest/command/link_directories.html suggests to use target_link_libraries | ||
# and anyway LINK_DIRECTORIES command will apply only to targets created after it is called, so must be set | ||
# before add_library in the case. | ||
target_link_directories( ${TARGETLIB} | ||
PUBLIC ${YUI_LIBRARY_DIRS} | ||
PUBLIC ${YUIMGA_LIBRARY_DIRS} | ||
PUBLIC ${GTK3_LIBRARY_DIRS} | ||
) | ||
|
||
|
||
# Libraries that are needed to build this shared lib | ||
# | ||
# If in doubt what is really needed, check with "ldd -u" which libs are unused. | ||
target_link_libraries( ${TARGETLIB} | ||
${YUI_LIBRARIES} | ||
${YUIMGA_LIBRARIES} | ||
${GTK3_LIBRARIES} | ||
${Boost_FILESYSTEM_LIBRARY} | ||
) | ||
|
||
|
||
# https://cmake.org/cmake/help/latest/manual/cmake-properties.7.html#target-properties | ||
set_target_properties( ${TARGETLIB} PROPERTIES | ||
VERSION ${SONAME} # From ../../VERSION.cmake | ||
SOVERSION ${SONAME_MAJOR} # From ../../VERSION.cmake | ||
OUTPUT_NAME ${TARGETLIB_BASE} | ||
) | ||
|
||
|
||
# | ||
# Install | ||
# | ||
|
||
# Install the headers first so the message about the lib does not scroll away | ||
install( FILES ${HEADERS} DESTINATION ${HEADERS_INSTALL_DIR} ) | ||
install( TARGETS ${TARGETLIB} LIBRARY DESTINATION ${PLUGIN_DIR} ) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,13 +22,13 @@ | |
Author: Angelo Naselli <[email protected]> | ||
/-*/ | ||
#define YUILogComponent "mga-gtk-ui" | ||
#include <yui/YUILog.h> | ||
|
||
#include <yui/gtk/YGi18n.h> | ||
|
||
#define YUILogComponent "mga-gtk-ui" | ||
|
||
#include <yui/YUILog.h> | ||
#include <yui/gtk/YGUI.h> | ||
// #include <yui/gtk/YGUI.h> | ||
#include <yui/gtk/YGUtils.h> | ||
#include <yui/gtk/YGWidget.h> | ||
#include <YSelectionWidget.h> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.