Browse Source

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>
pull/3/head
gregory guy 1 year ago
committed by Slávek Banko
parent
commit
dabe93bad2
Signed by: SlavekB GPG Key ID: 608F5293A04BE668
3 changed files with 30 additions and 4 deletions
  1. +3
    -0
      CMakeLists.txt
  2. +23
    -3
      ConfigureChecks.cmake
  3. +4
    -1
      config.h.cmake

+ 3
- 0
CMakeLists.txt View File

@@ -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


+ 23
- 3
ConfigureChecks.cmake View File

@@ -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



+ 4
- 1
config.h.cmake View File

@@ -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

Loading…
Cancel
Save