From 05f79e1cdf72a3a6ebdeac229842e39577e6700b Mon Sep 17 00:00:00 2001 From: nightwalker-87 <15526941+Nightwalker-87@users.noreply.github.com> Date: Thu, 4 Jun 2020 21:33:34 +0200 Subject: [PATCH] [regression] Fixed GTK3 detection --- CMakeLists.txt | 2 +- doc/dev/developer.txt | 7 +------ src/stlink-gui/CMakeLists.txt | 7 ++++--- 3 files changed, 6 insertions(+), 10 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 0538f3b..4055110 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -140,7 +140,7 @@ endif () set(STLINK_LIBRARY_PATH ${CMAKE_INSTALL_LIBDIR} CACHE PATH "Main library install directory") # Set the environment variable LD_LIBRARY_PATH to point to /usr/local/lib (per default). -execute_process (COMMAND bash -c "export LD_LIBRARY_PATH="${CMAKE_INSTALL_LIBDIR}" ") +execute_process (COMMAND bash -c "export LD_LIBRARY_PATH=${CMAKE_INSTALL_LIBDIR}") ### diff --git a/doc/dev/developer.txt b/doc/dev/developer.txt index 4032eca..32afd43 100644 --- a/doc/dev/developer.txt +++ b/doc/dev/developer.txt @@ -8,14 +8,9 @@ In order to use pkg-config for development purposes, add the following lines to ## Package configuration (pkg-config) on unix-based systems if (NOT WIN32 AND NOT CMAKE_CROSSCOMPILING) - add_subdirectory(doc/dev/pkg-config) # Option A: external tool pkg-config - find_package(PkgConfig) # Option B: internal cmake module for pkg-config integration - pkg_check_modules(GTK3 gtk+-3.0) + add_subdirectory(doc/dev/pkg-config) # external tool pkg-config endif () -ToDo: Check for compatibility issues between options A and B. - - === Target Identification === The following information is available about the target: diff --git a/src/stlink-gui/CMakeLists.txt b/src/stlink-gui/CMakeLists.txt index cc68509..89e5403 100644 --- a/src/stlink-gui/CMakeLists.txt +++ b/src/stlink-gui/CMakeLists.txt @@ -2,7 +2,10 @@ # Build GUI ### -if (NOT WIN32) +if (NOT WIN32 AND NOT CMAKE_CROSSCOMPILING) + find_package(PkgConfig) + pkg_check_modules(GTK3 gtk+-3.0) + ## GUI-Building requires the presence of a GTK3 toolset if (NOT GTK3_FOUND) message(STATUS "GTK3 not found!") @@ -35,7 +38,5 @@ if (NOT WIN32) COMPILE_DEFINITIONS STLINK_UI_DIR="${CMAKE_INSTALL_PREFIX}/bin") target_link_libraries(stlink-gui ${STLINK_LIB_SHARED} ${SSP_LIB} ${GTK3_LDFLAGS}) install(TARGETS stlink-gui DESTINATION ${CMAKE_INSTALL_BINDIR}) - - endif () endif ()