summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorgregory guy <gregory-tde@laposte.net>2020-04-23 11:23:38 +0200
committerSlávek Banko <slavek.banko@axis.cz>2020-05-26 15:02:26 +0200
commit970528b7299b0bd73b663e0b73eca25abb382c76 (patch)
tree2e269dc708ab8a18951e4a9d480d2e73ebf4e157
parentaf55371990047efd9de6b4980285d44f8de6d1d4 (diff)
downloadkscope-970528b7299b0bd73b663e0b73eca25abb382c76.tar.gz
kscope-970528b7299b0bd73b663e0b73eca25abb382c76.zip
Conversion to the cmake building system.
Signed-off-by: gregory guy <gregory-tde@laposte.net> Signed-off-by: Slávek Banko <slavek.banko@axis.cz> (cherry picked from commit 8e16b376dc531edfdf7b7d8dc13d3d9a15d81c0c)
-rw-r--r--CMakeLists.txt79
-rw-r--r--ConfigureChecks.cmake32
-rw-r--r--config.h.cmake8
-rw-r--r--src/CMakeLists.txt123
-rw-r--r--src/makelayout.ui17
-rw-r--r--src/newprojectlayout.ui14
-rw-r--r--src/openprojectlayout.ui10
-rw-r--r--src/preffrontendlayout.ui16
-rw-r--r--src/symbollayout.ui8
-rw-r--r--src/welcomedlg.ui6
10 files changed, 273 insertions, 40 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
new file mode 100644
index 0000000..6e59733
--- /dev/null
+++ b/CMakeLists.txt
@@ -0,0 +1,79 @@
+############################################
+# #
+# Improvements and feedbacks are welcome #
+# #
+# This file is released under GPL >= 3 #
+# #
+############################################
+
+
+cmake_minimum_required( VERSION 2.8 )
+
+
+#### general package setup
+
+project( kscope )
+set( VERSION R14.0.9 )
+
+
+#### include essential cmake modules
+
+include( FindPkgConfig )
+include( CheckFunctionExists )
+include( CheckSymbolExists )
+include( CheckIncludeFile )
+include( CheckIncludeFileCXX )
+include( CheckLibraryExists )
+include( CheckCSourceCompiles )
+include( CheckCXXSourceCompiles )
+
+
+#### include our cmake modules
+
+set( CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake/modules" )
+include( TDEMacros )
+
+
+##### setup install paths
+
+include( TDESetupPaths )
+tde_setup_paths( )
+
+
+##### optional stuff
+
+option( WITH_ALL_OPTIONS "Enable all optional support" OFF )
+option( WITH_GCC_VISIBILITY "Enable fvisibility and fvisibility-inlines-hidden" ${WITH_ALL_OPTIONS} )
+
+
+##### user requested modules
+
+option( BUILD_ALL "Build all" ON )
+option( BUILD_DOC "Build documentation" ${BUILD_ALL} )
+option( BUILD_TRANSLATIONS "Build translations" ${BUILD_ALL} )
+
+
+##### configure checks
+
+include( ConfigureChecks.cmake )
+
+
+###### global compiler settings
+
+add_definitions( -DHAVE_CONFIG_H -UQT_NO_ASCII_CAST )
+
+set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${TQT_CXX_FLAGS}" )
+set( CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--no-undefined" )
+set( CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} -Wl,--no-undefined" )
+
+
+##### directories
+
+add_subdirectory( src )
+#tde_conditional_add_subdirectory( BUILD_DOC doc )
+#tde_conditional_add_subdirectory( BUILD_TRANSLATIONS po )
+
+
+##### write configure files
+
+configure_file( config.h.cmake config.h @ONLY )
diff --git a/ConfigureChecks.cmake b/ConfigureChecks.cmake
new file mode 100644
index 0000000..50718fc
--- /dev/null
+++ b/ConfigureChecks.cmake
@@ -0,0 +1,32 @@
+############################################
+# #
+# Improvements and feedbacks are welcome #
+# #
+# This file is released under GPL >= 3 #
+# #
+############################################
+
+
+# required stuff
+find_package( TQt )
+find_package( TDE )
+
+tde_setup_architecture_flags( )
+
+include(TestBigEndian)
+test_big_endian(WORDS_BIGENDIAN)
+
+tde_setup_largefiles( )
+
+
+##### check for gcc visibility support
+
+if( WITH_GCC_VISIBILITY )
+ tde_setup_gcc_visibility( )
+endif( WITH_GCC_VISIBILITY )
+
+
+##### check for yacc (bison)
+
+find_program( BISON_EXECUTABLE bison )
+find_program( FLEX_EXECUTABLE NAMES flex lex )
diff --git a/config.h.cmake b/config.h.cmake
new file mode 100644
index 0000000..61ede3a
--- /dev/null
+++ b/config.h.cmake
@@ -0,0 +1,8 @@
+#define VERSION "@VERSION@"
+
+// Defined if you have fvisibility and fvisibility-inlines-hidden support.
+#cmakedefine __KDE_HAVE_GCC_VISIBILITY 1
+
+/* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most
+ significant byte first (like Motorola and SPARC, unlike Intel). */
+#cmakedefine WORDS_BIGENDIAN @WORDS_BIGENDIAN@
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
new file mode 100644
index 0000000..12efd27
--- /dev/null
+++ b/src/CMakeLists.txt
@@ -0,0 +1,123 @@
+
+include_directories(
+ ${CMAKE_BINARY_DIR}
+ ${CMAKE_CURRENT_BINARY_DIR}
+ ${CMAKE_CURRENT_SOURCE_DIR}
+ ${TDE_INCLUDE_DIR}
+ ${TQT_INCLUDE_DIRS}
+)
+
+link_directories(
+ ${TQT_LIBRARY_DIRS}
+)
+
+tde_import( kate )
+
+add_custom_command(
+ OUTPUT dotparse.cpp dotparse.hpp
+ COMMAND ${BISON_EXECUTABLE}
+ ARGS -y --output dotparse.cpp --defines=dotparse.hpp ${CMAKE_CURRENT_SOURCE_DIR}/dotparse.ypp
+ DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/dotparse.ypp
+)
+
+add_custom_target(
+ dotparse.bison
+ DEPENDS
+ ${CMAKE_CURRENT_BINARY_DIR}/dotparse.cpp
+ ${CMAKE_CURRENT_BINARY_DIR}/dotparse.hpp
+)
+
+add_custom_command(
+ OUTPUT dotscan.cc
+ COMMAND ${FLEX_EXECUTABLE}
+ ARGS ${CMAKE_CURRENT_SOURCE_DIR}/dotscan.lpp
+ COMMAND ${CMAKE_COMMAND}
+ ARGS -E rename lex.yy.c dotscan.cc
+ DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/dotscan.lpp
+)
+
+add_custom_target(
+ dotscan.lex
+ DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/dotscan.cc
+)
+
+##### kscope (executable)
+
+tde_add_executable( kscope AUTOMOC
+
+ SOURCES
+ autocompletionlayout.ui bookmarkslayout.ui
+ calltreelayout.ui cscopemsglayout.ui
+ fileviewlayout.ui graphpreflayout.ui
+ makelayout.ui newprojectlayout.ui
+ openprojectlayout.ui prefcolorlayout.ui
+ preffontlayout.ui preffrontendlayout.ui
+ prefoptlayout.ui projectfileslayout.ui
+ queryviewlayout.ui querywidgetlayout.ui
+ scanprogresslayout.ui searchresultslayout.ui
+ symbollayout.ui welcomedlg.ui
+ bookmarksdlg.cpp calltreedlg.cpp
+ calltreemanager.cpp configfrontend.cpp
+ cscopefrontend.cpp cscopemsgdlg.cpp
+ ctagsfrontend.cpp ctagslist.cpp
+ dirscanner.cpp dotfrontend.cpp
+ editormanager.cpp
+ editorpage.cpp editortabs.cpp
+ encoder.cpp filelist.cpp
+ fileview.cpp frontend.cpp
+ graphedge.cpp graphnode.cpp
+ graphprefdlg.cpp graphwidget.cpp
+ historypage.cpp historyview.cpp
+ kscope.cpp kscopeactions.cpp
+ kscopeconfig.cpp kscopepixmaps.cpp
+ main.cpp makedlg.cpp makefrontend.cpp
+ newprojectdlg.cpp openprojectdlg.cpp
+ prefcolor.cpp preferencesdlg.cpp
+ preffont.cpp preffrontend.cpp
+ prefopt.cpp progressdlg.cpp
+ project.cpp projectbase.cpp
+ projectfilesdlg.cpp projectmanager.cpp
+ querypage.cpp querypagebase.cpp
+ queryresultsmenu.cpp queryview.cpp
+ queryviewdlg.cpp queryviewdriver.cpp
+ querywidget.cpp scanprogressdlg.cpp
+ searchlist.cpp searchresultsdlg.cpp
+ symbolcompletion.cpp symboldlg.cpp
+ tabwidget.cpp treewidget.cpp
+ ${CMAKE_CURRENT_BINARY_DIR}/dotparse.cpp
+ ${CMAKE_CURRENT_BINARY_DIR}/dotscan.cc
+ LINK
+ tdeui-shared
+ tdeio-shared
+ tdecore-shared
+ tdeparts-shared
+ kateinterfaces-shared
+ katepartinterfaces-shared
+
+ DESTINATION ${BIN_INSTALL_DIR}
+ DEPENDENCIES dotparse.bison dotscan.lex
+)
+
+
+##### icons
+
+tde_install_icons( kscope )
+
+
+##### other data
+
+install(
+ FILES kscopeui.rc kscope_config
+ DESTINATION ${DATA_INSTALL_DIR}/kscope
+)
+
+install(
+ FILES file_ro.png file_rw.png file_save.png query_locked.png
+ query_unlocked.png tab_list.png call_graph.png called_tree.png
+ calling_tree.png bookmark.png
+ DESTINATION ${DATA_INSTALL_DIR}/kscope/pics
+)
+
+install( FILES kscope.desktop
+ DESTINATION ${APPS_INSTALL_DIR}/Development
+)
diff --git a/src/makelayout.ui b/src/makelayout.ui
index d36dae1..eb3dcfd 100644
--- a/src/makelayout.ui
+++ b/src/makelayout.ui
@@ -233,13 +233,12 @@
<slot access="protected">slotMake()</slot>
</slots>
<layoutdefaults spacing="6" margin="11"/>
-<includehints>
- <includehint>kcombobox.h</includehint>
- <includehint>klineedit.h</includehint>
- <includehint>kurlrequester.h</includehint>
- <includehint>klineedit.h</includehint>
- <includehint>kpushbutton.h</includehint>
- <includehint>ktextbrowser.h</includehint>
- <includehint>queryview.h</includehint>
-</includehints>
+<includes>
+ <include location="global" impldecl="in implementation">kpushbutton.h</include>
+ <include location="global" impldecl="in implementation">kcombobox.h</include>
+ <include location="global" impldecl="in implementation">klineedit.h</include>
+ <include location="global" impldecl="in implementation">kurlrequester.h</include>
+ <include location="global" impldecl="in implementation">ktextbrowser.h</include>
+ <include location="local" impldecl="in implementation">queryview.h</include>
+</includes>
</UI>
diff --git a/src/newprojectlayout.ui b/src/newprojectlayout.ui
index 4374e3c..830579f 100644
--- a/src/newprojectlayout.ui
+++ b/src/newprojectlayout.ui
@@ -767,12 +767,10 @@ path for all source files, but is not required.&lt;/blockquote&gt;</string>
<slot access="protected">slotAvailTypesChanged(const TQString&amp;)</slot>
</slots>
<layoutdefaults spacing="6" margin="11"/>
-<includehints>
- <includehint>kurlrequester.h</includehint>
- <includehint>klineedit.h</includehint>
- <includehint>kpushbutton.h</includehint>
- <includehint>kurlrequester.h</includehint>
- <includehint>klineedit.h</includehint>
- <includehint>kpushbutton.h</includehint>
-</includehints>
+<includes>
+ <include location="global" impldecl="in implementation">kpushbutton.h</include>
+ <include location="global" impldecl="in implementation">kcombobox.h</include>
+ <include location="global" impldecl="in implementation">klineedit.h</include>
+ <include location="global" impldecl="in implementation">kurlrequester.h</include>
+</includes>
</UI>
diff --git a/src/openprojectlayout.ui b/src/openprojectlayout.ui
index a1c24b4..a346e15 100644
--- a/src/openprojectlayout.ui
+++ b/src/openprojectlayout.ui
@@ -194,9 +194,9 @@
<slot access="protected">slotProjectSelected(const TQString&amp;)</slot>
</slots>
<layoutdefaults spacing="6" margin="11"/>
-<includehints>
- <includehint>kurlrequester.h</includehint>
- <includehint>klineedit.h</includehint>
- <includehint>kpushbutton.h</includehint>
-</includehints>
+<includes>
+ <include location="global" impldecl="in implementation">kpushbutton.h</include>
+ <include location="global" impldecl="in implementation">klineedit.h</include>
+ <include location="global" impldecl="in implementation">kurlrequester.h</include>
+</includes>
</UI>
diff --git a/src/preffrontendlayout.ui b/src/preffrontendlayout.ui
index 71afeed..0487089 100644
--- a/src/preffrontendlayout.ui
+++ b/src/preffrontendlayout.ui
@@ -179,15 +179,9 @@
<tabstops>
</tabstops>
<layoutdefaults spacing="6" margin="11"/>
-<includehints>
- <includehint>kurlrequester.h</includehint>
- <includehint>klineedit.h</includehint>
- <includehint>kpushbutton.h</includehint>
- <includehint>kurlrequester.h</includehint>
- <includehint>klineedit.h</includehint>
- <includehint>kpushbutton.h</includehint>
- <includehint>kurlrequester.h</includehint>
- <includehint>klineedit.h</includehint>
- <includehint>kpushbutton.h</includehint>
-</includehints>
+<includes>
+ <include location="global" impldecl="in implementation">kpushbutton.h</include>
+ <include location="global" impldecl="in implementation">kurlrequester.h</include>
+ <include location="global" impldecl="in implementation">klineedit.h</include>
+</includes>
</UI>
diff --git a/src/symbollayout.ui b/src/symbollayout.ui
index 4ffe188..a0bf353 100644
--- a/src/symbollayout.ui
+++ b/src/symbollayout.ui
@@ -290,8 +290,8 @@
<tabstop>m_pContainRadio</tabstop>
</tabstops>
<layoutdefaults spacing="6" margin="11"/>
-<includehints>
- <includehint>kcombobox.h</includehint>
- <includehint>klineedit.h</includehint>
-</includehints>
+<includes>
+ <include location="global" impldecl="in implementation">kcombobox.h</include>
+ <include location="global" impldecl="in implementation">klineedit.h</include>
+</includes>
</UI>
diff --git a/src/welcomedlg.ui b/src/welcomedlg.ui
index dde3cdd..09398be 100644
--- a/src/welcomedlg.ui
+++ b/src/welcomedlg.ui
@@ -120,7 +120,7 @@ Enjoy!
</connection>
</connections>
<layoutdefaults spacing="6" margin="11"/>
-<includehints>
- <includehint>ktextbrowser.h</includehint>
-</includehints>
+<includes>
+ <include location="global" impldecl="in implementation">ktextbrowser.h</include>
+</includes>
</UI>