#3 cmake conversion

Merged
SlavekB merged 4 commits from feat/cmakeConv into master 2 months ago
cethyel commented 3 months ago

I’ve added a man page taken from your Debian building system.
The download location for kbarcode-2.0.0.pdf has been set to “gentoo.ussg.indiana.edu”, this could be change for an other location (wiki) later.

I've added a man page taken from your Debian building system. The download location for kbarcode-2.0.0.pdf has been set to "gentoo.ussg.indiana.edu", this could be change for an other location (wiki) later.
cethyel added the
PR/rfc
label 3 months ago
SlavekB reviewed 3 months ago
Please add the build options and adjust the tests as mentioned in the note below.
ConfigureChecks.cmake
@@ -0,0 +29,4 @@
29
+#### check for headers
30
+
31
+check_include_file( "barcode.h" _ENABLE_NATIVE_GNU_BARCODE )
32
+check_include_file( "kjs/interpreter.h" USE_JAVASCRIPT )
SlavekB

We should define options such as WITH_NATIVE_GNU_BARCODE (OFF by default) and WITH_JAVASCRIPT, and these tests should end by tde_message_fatal if the conditions are not met.

We should define options such as `WITH_NATIVE_GNU_BARCODE` (OFF by default) and `WITH_JAVASCRIPT`, and these tests should end by `tde_message_fatal` if the conditions are not met.
SlavekB

There are additional issues:

  1. Since TDE includes neither TQt include does not need to be on the usual paths, test for kjs/interpreter.h fails – we need to set CMAKE_REQUIRED_INCLUDES.
  2. Since kjs/interpreter.h is intended for C++, the check_include_file test fails because the build with C fails – we need to use check_include_file_cxx.

This means to add to CMakeLists.txt:

include( CheckIncludeFileCXX    )

And in ConfigureChecks.cmake change test:

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" USE_JAVASCRIPT )
  tde_restore( CMAKE_REQUIRED_INCLUDES )
endif( )
There are additional issues: 1. Since TDE includes neither TQt include does not need to be on the usual paths, test for `kjs/interpreter.h` fails – we need to set `CMAKE_REQUIRED_INCLUDES`. 2. Since `kjs/interpreter.h` is intended for C++, the `check_include_file` test fails because the build with C fails – we need to use `check_include_file_cxx`. This means to add to CMakeLists.txt: ``` include( CheckIncludeFileCXX ) ``` And in ConfigureChecks.cmake change test: ``` 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" USE_JAVASCRIPT ) tde_restore( CMAKE_REQUIRED_INCLUDES ) endif( ) ```
SlavekB reviewed 3 months ago
Sorry, but there are some new shortcomings – see comments.
CMakeLists.txt
@@ -0,0 +51,4 @@
51
+option( BUILD_DOC "Build documentation" ${BUILD_ALL}         )
52
+option( BUILD_TRANSLATIONS "Build translations" ${BUILD_ALL} )
53
+option( WITH_NATIVE_GNU_BARCODE "Enable GNU Barcode" OFF     )
54
+option( WITH_JAVASCRIPT "Enable Javascript" OFF              )
SlavekB

These are WITH_… options – they belong to the section ##### optional stuff. For WITH_JAVASCRIPT please use default value ${WITH_ALL_OPTIONS}.

These are `WITH_…` options – they belong to the section `##### optional stuff`. For `WITH_JAVASCRIPT` please use default value `${WITH_ALL_OPTIONS}`.
ConfigureChecks.cmake
@@ -0,0 +42,4 @@
42
+    list( APPEND CMAKE_REQUIRED_INCLUDES ${TQT_INCLUDE_DIRS} ${TDE_INCLUDE_DIR} )
43
+    check_include_file_cxx( "kjs/interpreter.h" HAVE_JAVASCRIPT )
44
+    if( HAVE_JAVASCRIPT )
45
+        set( USE_JAVASCRIPT 1 )
SlavekB

Here it would be good to add also set( NO_KJS_EMBED 1 ).

Here it would be good to add also `set( NO_KJS_EMBED 1 )`.
ConfigureChecks.cmake
@@ -0,0 +48,4 @@
48
+    endif( HAVE_JAVASCRIPT )    
49
+  else()
50
+    set( USE_JAVASCRIPT false )
51
+    tde_restore( CMAKE_REQUIRED_INCLUDES )
SlavekB

This tde_restore is misplaced – it belongs before else( )

This `tde_restore` is misplaced – it belongs before `else( )`
config.h.cmake
@@ -0,0 +11,4 @@
11
+#cmakedefine _ENABLE_NATIVE_GNU_BARCODE @_ENABLE_NATIVE_GNU_BARCODE@
12
+
13
+/* Define to 1 if you have <kjs/interpreter.h> header file. */
14
+#cmakedefine USE_JAVASCRIPT @USE_JAVASCRIPT@
SlavekB

Here, #cmakedefine NO_KJS_EMBED should also be set.

Here, `#cmakedefine NO_KJS_EMBED` should also be set.
SlavekB commented 2 months ago
Owner

Finished little things:

  1. Rebased to current HEAD.
  2. Fixed shortcomings in patch for cmake options.
  3. Added patch for automake options.
  4. Added patch for ascii cast.

Everything seems to be ready for merge.

Finished little things: 1. Rebased to current HEAD. 2. Fixed shortcomings in patch for cmake options. 3. Added patch for automake options. 4. Added patch for ascii cast. Everything seems to be ready for merge.
SlavekB removed the
PR/rfc
label 2 months ago
SlavekB approved these changes 2 months ago
Everything seems to be ready for merge.
SlavekB deleted branch feat/cmakeConv 2 months ago
SlavekB added this to the R14.0.6 release milestone 2 months ago

Reviewers

SlavekB approved these changes 2 months ago
The pull request has been merged.
Sign in to join this conversation.
Loading…
Cancel
Save
There is no content yet.