diff options
author | Slávek Banko <slavek.banko@axis.cz> | 2021-10-18 23:39:52 +0200 |
---|---|---|
committer | Slávek Banko <slavek.banko@axis.cz> | 2021-10-18 23:56:58 +0200 |
commit | 5728ee11b05c6ab177c8a5d4a5330b210a22e927 (patch) | |
tree | ca44a27c6cc0ed15cdee1916b77e9ce42bbfc5a5 /gtk2/CMakeLists.txt | |
parent | ff093aacb444803e5d7f3945e33e8ab1525544b4 (diff) | |
download | kgtk-qt3-5728ee11b05c6ab177c8a5d4a5330b210a22e927.tar.gz kgtk-qt3-5728ee11b05c6ab177c8a5d4a5330b210a22e927.zip |
Housekeeping in CMake rules:
+ Removed detailed DL library detection - the results were not used.
+ Added test whether the DL library contains _dl_sym function.
+ GTK presence test moved to ConfigureChecks.cmake.
+ Added GTHREAD presence test.
+ Used tde_add_library macro.
Signed-off-by: Slávek Banko <slavek.banko@axis.cz>
(cherry picked from commit 06e967574741ce2f3b29ba4ed4d5e2629c47553c)
Diffstat (limited to 'gtk2/CMakeLists.txt')
-rw-r--r-- | gtk2/CMakeLists.txt | 43 |
1 files changed, 27 insertions, 16 deletions
diff --git a/gtk2/CMakeLists.txt b/gtk2/CMakeLists.txt index 36b3e3f..9210e8c 100644 --- a/gtk2/CMakeLists.txt +++ b/gtk2/CMakeLists.txt @@ -1,22 +1,33 @@ -include(FindPkgConfig) -pkg_check_modules(GTK gtk+-2.0>=2.6) +include_directories( + ${CMAKE_SOURCE_DIR} + ${CMAKE_SOURCE_DIR}/common + ${CMAKE_CURRENT_BINARY_DIR} + ${CMAKE_BINARY_DIR} + ${GTK_INCLUDE_DIRS} +) -if (GTK_FOUND) - message("** INFORMATION: Gtk2 LD_PRELOAD library will be built.") - # set(LIB_SUFFIX "" CACHE STRING "Define suffix of directory name (32/64)" ) - set(LIB_INSTALL_DIR ${CMAKE_INSTALL_PREFIX}/lib${LIB_SUFFIX} CACHE PATH "The subdirectory relative to the install prefix where libraries will be installed (default is /lib${LIB_SUFFIX})" FORCE) +##### kgtk2 (shared) - include_directories (${CMAKE_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_SOURCE_DIR}/common ${CMAKE_BINARY_DIR} ${GTK_INCLUDE_DIRS}) - set(kgtk2_SRCS kgtk2.c) - add_library(kgtk2 SHARED ${kgtk2_SRCS}) - target_link_libraries(kgtk2 ${GTK_LDFLAGS} -lgthread-2.0 -lglib-2.0 -lc -ldl) +tde_add_library( kgtk2 SHARED NO_LIBTOOL_FILE + SOURCES + kgtk2.c - install(TARGETS kgtk2 LIBRARY DESTINATION ${LIB_INSTALL_DIR}/kgtk ) + LINK + ${GTK_LIBRARIES} + ${GTHREAD_LIBRARIES} + ${CMAKE_DL_LIBS} - configure_file (kgtk2-wrapper.cmake ${CMAKE_CURRENT_BINARY_DIR}/kgtk2-wrapper @ONLY) - install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/kgtk2-wrapper DESTINATION bin) -else (GTK_FOUND) - message("** ERROR : Could not locate Gtk2 headers, Gtk2 LD_PRELOAD library will not be built.") -endif (GTK_FOUND) + DESTINATION ${LIB_INSTALL_DIR}/kgtk +) + + +##### other data + +configure_file( kgtk2-wrapper.cmake kgtk2-wrapper @ONLY ) + +install( + PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/kgtk2-wrapper + DESTINATION ${BIN_INSTALL_DIR} +) |