summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorgregory guy <g-gregory@gmx.fr>2019-02-24 14:16:00 +0100
committerSlávek Banko <slavek.banko@axis.cz>2019-02-24 14:28:39 +0100
commitdabe93bad27870ad3f52ec56c02e090a9384524a (patch)
tree2133e58fbfacfc34f01f09f4340c487f3fe04a4f
parentee94e3dcbe5a7c9d76a49811e101333d5a6fbf89 (diff)
downloadkbarcode-dabe93bad27870ad3f52ec56c02e090a9384524a.zip
kbarcode-dabe93bad27870ad3f52ec56c02e090a9384524a.tar.gz
cmake: add WITH_NATIVE_GNU_BARCODE and WITH_JAVASCRIPT build options
Signed-off-by: gregory guy <g-gregory@gmx.fr> Signed-off-by: Slávek Banko <slavek.banko@axis.cz>
-rw-r--r--CMakeLists.txt3
-rw-r--r--ConfigureChecks.cmake26
-rw-r--r--config.h.cmake5
3 files changed, 30 insertions, 4 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 18f5ed7..78cc020 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -22,6 +22,7 @@ include( FindPkgConfig )
include( CheckFunctionExists )
include( CheckSymbolExists )
include( CheckIncludeFile )
+include( CheckIncludeFileCXX )
include( CheckLibraryExists )
include( CheckCSourceCompiles )
include( CheckCXXSourceCompiles )
@@ -43,6 +44,8 @@ tde_setup_paths( )
option( WITH_ALL_OPTIONS "Enable all optional support" OFF )
option( WITH_GCC_VISIBILITY "Enable fvisibility and fvisibility-inlines-hidden" ${WITH_ALL_OPTIONS} )
+option( WITH_NATIVE_GNU_BARCODE "Enable GNU Barcode" OFF )
+option( WITH_JAVASCRIPT "Enable Javascript" ${WITH_ALL_OPTIONS} )
##### user requested modules
diff --git a/ConfigureChecks.cmake b/ConfigureChecks.cmake
index c76d602..6805bd8 100644
--- a/ConfigureChecks.cmake
+++ b/ConfigureChecks.cmake
@@ -28,9 +28,29 @@ endif( WITH_GCC_VISIBILITY )
#### check for headers
-check_include_file( "barcode.h" _ENABLE_NATIVE_GNU_BARCODE )
-check_include_file( "kjs/interpreter.h" USE_JAVASCRIPT )
-
+if( WITH_NATIVE_GNU_BARCODE )
+ check_include_file( "barcode.h" HAVE_NATIVE_GNU_BARCODE )
+ if( HAVE_NATIVE_GNU_BARCODE )
+ set( _ENABLE_NATIVE_GNU_BARCODE 1 )
+ else()
+ tde_message_fatal( "Barcode is requested, but GNU Barcode header was not found on your system" )
+ endif()
+endif( WITH_NATIVE_GNU_BARCODE )
+
+if( WITH_JAVASCRIPT )
+ tde_save( CMAKE_REQUIRED_INCLUDES )
+ list( APPEND CMAKE_REQUIRED_INCLUDES ${TQT_INCLUDE_DIRS} ${TDE_INCLUDE_DIR} )
+ check_include_file_cxx( "kjs/interpreter.h" HAVE_JAVASCRIPT )
+ if( HAVE_JAVASCRIPT )
+ set( USE_JAVASCRIPT 1 )
+ set( NO_KJS_EMBED 1 )
+ else()
+ tde_message_fatal( "Javascript interpreter is requested, but tdelibs Javascript header (kjs) was not found on your system" )
+ endif( HAVE_JAVASCRIPT )
+ tde_restore( CMAKE_REQUIRED_INCLUDES )
+ else()
+ set( USE_JAVASCRIPT false )
+endif( WITH_JAVASCRIPT )
#### check for pcre
diff --git a/config.h.cmake b/config.h.cmake
index 4304829..bbda9a3 100644
--- a/config.h.cmake
+++ b/config.h.cmake
@@ -7,8 +7,11 @@
significant byte first (like Motorola and SPARC, unlike Intel). */
#cmakedefine WORDS_BIGENDIAN @WORDS_BIGENDIAN@
-/* Define to 1 if you have <barcode.h header> file. */
+/* Define to 1 if you have <barcode.h> header file. */
#cmakedefine _ENABLE_NATIVE_GNU_BARCODE 1
/* Define to 1 if you have <kjs/interpreter.h> header file. */
#cmakedefine USE_JAVASCRIPT 1
+
+/* Define to 1 for use tdelibs javascript interpreter */
+#cmakedefine NO_KJS_EMBED 1