summaryrefslogtreecommitdiffstats
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorAlexander Golubev <fatzer2@gmail.com>2024-02-03 11:47:04 +0300
committerAlexander Golubev <fatzer2@gmail.com>2024-02-06 04:09:42 +0300
commitc3ef8bdc0d7a325c8ece072a2c38d1dbc290adb5 (patch)
treebdaabd74241e05623b020b0d3aec1197139eb787 /CMakeLists.txt
parent57b8158b9acd3e5f24fde99b6f86a2d8b26174b6 (diff)
downloadlibr-c3ef8bdc0d7a325c8ece072a2c38d1dbc290adb5.tar.gz
libr-c3ef8bdc0d7a325c8ece072a2c38d1dbc290adb5.zip
Make dependency upon gtk optional
Signed-off-by: Alexander Golubev <fatzer2@gmail.com>
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt20
1 files changed, 13 insertions, 7 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 97ca9fd..7e48150 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -46,10 +46,14 @@ tde_setup_paths( )
##### optional stuff ############################
-option( WITH_BACKEND_LIBBFD "Build with libbfd backend" "ON" )
-option( WITH_BACKEND_LIBELF "Build with libelf backend" "OFF" )
-option( WITH_BACKEND_READONLY "Build with read-only backend" "OFF" )
+option( WITH_BACKEND_LIBBFD "Build with libbfd backend" ON )
+option( WITH_BACKEND_LIBELF "Build with libelf backend" OFF )
+option( WITH_BACKEND_READONLY "Build with read-only backend" OFF )
+option( WITH_GTK "Build support for GTK" OFF )
+# NOTE: WITH_GTK build gtk bindings to ease libr in gtk applications.
+# It uses weak linkage, so gtk will be required during build
+# only and not strictly necessary during runtime.
#### configure checks ###########################
@@ -95,10 +99,12 @@ if( NOT ZLIB_FOUND )
tde_message_fatal( "zlib are required, but not found on your system" )
endif( NOT ZLIB_FOUND )
-pkg_search_module( GTK gtk+-2.0 )
-if( NOT GTK_FOUND )
- tde_message_fatal( "gtk2 is required but was not found on your system" )
-endif( )
+if( WITH_GTK )
+ pkg_search_module( GTK gtk+-2.0 )
+ if( NOT GTK_FOUND )
+ tde_message_fatal( "gtk2 is required but was not found on your system" )
+ endif( )
+endif( WITH_GTK )
set( DL_LIBRARIES dl )
check_library_exists( ${DL_LIBRARIES} dlopen /lib HAVE_LIBDL )