[Kst] branches/work/kst/portto4/kst

Peter Kümmel syntheticpp at gmx.net
Tue Jan 11 19:37:28 CET 2011


SVN commit 1213815 by kuemmel:

add svn revision number extraction

 M  +0 -9      INSTALL  
 M  +15 -9     cmake/CMakeLists.txt  
 M  +4 -1      cmake/config.h.cmake  
 M  +10 -6     cmake/modules/KstMacros.cmake  
 AM            cmake/modules/SubversionGenerator.cmake  
 AM            cmake/modules/SubversionHeader.cmake  
 M  +6 -6      cmake/src/kst/CMakeLists.txt  
 M  +1 -0      config.h  
 M  +3 -2      src/libkst/debug.cpp  
 D             src/libkst/kstrevision.h  
 D             src/libkst/kstrevision.h.cmake  
 M  +0 -1      src/libkst/libkst.pro  
 M  +1 -0      src/libkstapp/aboutdialog.cpp  


--- branches/work/kst/portto4/kst/INSTALL #1213814:1213815
@@ -128,16 +128,7 @@
 	TODOs:
 	- install on Mac
 	- add package rules
-	- add svn revision number extraction
 	- add support for pre-compiled headers
 	- only the kst binary is generated
 	- build and run tests
 	- have a look at kst1's cmake files, especially the 3rd party lib code
-
-
-
-
-
-
-
-
--- branches/work/kst/portto4/kst/cmake/CMakeLists.txt #1213814:1213815
@@ -2,11 +2,17 @@
 
 project(Kst)
 
-set(KST_VERSION 2.0.3)
-
 set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/modules")
 include(KstMacros)
 
+get_filename_component(kst_dir ${CMAKE_SOURCE_DIR}/.. ABSOLUTE)
+
+set(kst_version 2.0.3)
+
+include(SubversionHeader)
+SubversionHeader(${kst_dir} Revision ${CMAKE_BINARY_DIR}/svnrevision.h " modified")
+
+
 message(STATUS)
 message(STATUS "Build options:")
 message(STATUS)
@@ -52,6 +58,7 @@
 
 
 # React on options
+
 if(kst_release)
 	set(CMAKE_BUILD_TYPE Release)
 else()
@@ -91,10 +98,6 @@
 SET(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib")
 
 
-if(NOT KST_DIR)
-	set(KST_DIR ${CMAKE_SOURCE_DIR}/..)
-endif()
-
 if(MSVC)
 	add_definitions(-D_USE_MATH_DEFINES)
 endif()
@@ -103,7 +106,7 @@
 	set(CMAKE_DEBUG_POSTFIX d)
 endif()
 
-configure_file(${KST_DIR}/cmake/config.h.cmake ${CMAKE_BINARY_DIR}/config.h)
+configure_file(${kst_dir}/cmake/config.h.cmake ${CMAKE_BINARY_DIR}/config.h)
 
 include_directories(
 	${CMAKE_BINARY_DIR}
@@ -112,11 +115,14 @@
 
 
 message(STATUS "Build summary----------------------------------")
-message(STATUS "Version          : ${KST_VERSION}")
-message(STATUS "Path to source   : ${KST_DIR}")
+message(STATUS "Version          : ${kst_version}")
+message(STATUS "Path to source   : ${kst_dir}")
 message(STATUS "Installation path: ${CMAKE_INSTALL_PREFIX}")
 message(STATUS "-----------------------------------------------")
 message(STATUS)
 
+
 add_subdirectory(src)
 
+
+
--- branches/work/kst/portto4/kst/cmake/config.h.cmake #1213814:1213815
@@ -6,7 +6,10 @@
 //#define QT_NO_STL
 //#define QT_NO_KEYWORDS
 
-#define KSTVERSION "${KST_VERSION}"
+#include "svnrevision.h"
+
+#define KSTVERSION  "${kst_version}"
 #define INSTALL_LIBDIR "${CMAKE_INSTALL_PREFIX}"
 
+
 #endif
--- branches/work/kst/portto4/kst/cmake/modules/KstMacros.cmake #1213814:1213815
@@ -10,7 +10,7 @@
 
 
 macro(kst_files_find folder)
-	set(_folder ${KST_DIR}/${folder})
+	set(_folder ${kst_dir}/${folder})
 	file(GLOB _sources     ${_folder}/*.c) 
 	file(GLOB _sources_cpp ${_folder}/*.cpp)
 	file(GLOB _headers     ${_folder}/*.h)
@@ -59,9 +59,9 @@
 		set(depends_moc_uic ${kst_${kst_name}_headers} ${kst_${kst_name}_uis} ${kst_${kst_name}_ui_files} ${kst_${kst_name}_mocs})
 		set_source_files_properties(merged_const.cpp   PROPERTIES OBJECT_DEPENDS "${depends_moc_uic}")
 		set_source_files_properties(merged_touched.cpp PROPERTIES OBJECT_DEPENDS "${depends_moc_uic}")
-		add_library(${kst_name} ${type} ${merged_files} ${kst_${kst_name}_dont_merge} ${kst_${kst_name}_headers} ${kst_${kst_name}_uis} ${kst_${kst_name}_sources_not_generated})
+		add_library(${kst_name} ${type} ${merged_files} ${kst_${kst_name}_dont_merge} ${kst_${kst_name}_headers} ${kst_${kst_name}_uis} ${kst_${kst_name}_sources_not_generated} ${svnversion_h})
 	else()		
-		add_library(${kst_name} ${type} ${kst_${kst_name}_sources} ${kst_${kst_name}_headers})
+		add_library(${kst_name} ${type} ${kst_${kst_name}_sources} ${kst_${kst_name}_headers} ${svnversion_h})
 	endif()
 	target_link_libraries(${kst_name} ${QT_QTCORE_LIBRARY} ${QT_QTGUI_LIBRARY} ${QT_QTXML_LIBRARY})
 	if(WIN32)
@@ -116,7 +116,6 @@
 	set(kst_${kst_name}_ignore ${kst_${kst_name}_ignore} ${ARGV})
 endmacro()
 
-
 macro(kst_files_remove list)	
 	foreach(_item ${ARGN})
 		set(_file ${kst_${kst_name}_folder}/${_item})
@@ -127,9 +126,14 @@
 endmacro()
 
 
+macro(kst_add_files)
+	set(kst_${kst_name}_sources ${kst_${kst_name}_sources} ${ARGN})
+endmacro()
+
+
 macro(kst_add_resources filepath)
-	qt4_add_resources(_rcc ${KST_DIR}/${filepath})
-	set(kst_${kst_name}_sources ${kst_${kst_name}_sources} ${_rcc})
+	qt4_add_resources(_rcc ${kst_dir}/${filepath})
+	kst_add_files(${_rcc})
 endmacro()
 
 
--- branches/work/kst/portto4/kst/cmake/src/kst/CMakeLists.txt #1213814:1213815
@@ -5,20 +5,20 @@
 kst_files_find(src/kst)
 
 if(MSVC)
-	set(rc_file ${KST_DIR}/src/kst/kst_icon.rc)
+	set(rc_file ${kst_dir}/src/kst/kst_icon.rc)
 endif()
 
 kst_add_resources(src/images/images.qrc)
 
 kst_include_directories(kstapp)
 
-kst_find_info_files(KstCMakeFiles ${KST_DIR}/cmake/*)
-kst_find_info_files(KstCMakeFiles ${KST_DIR}/cmake/modules/*)
+kst_find_info_files(KstCMakeFiles ${kst_dir}/cmake/*)
+kst_find_info_files(KstCMakeFiles ${kst_dir}/cmake/modules/*)
 
 kst_add_info_files(KstInfoFiles 
-	${KST_DIR}/INSTALL
-	${KST_DIR}/NEWS
-	${KST_DIR}/README)
+	${kst_dir}/INSTALL
+	${kst_dir}/NEWS
+	${kst_dir}/README)
 
 add_executable(kst ${kst_win32} ${kst_kst_sources} ${rc_file} ${kst_kst_info_files})
 
--- branches/work/kst/portto4/kst/config.h #1213814:1213815
@@ -2,6 +2,7 @@
 #define KSTCONFIG_H
 
 #define KSTVERSION "2.0.3"
+#define SVN_REVISION "unknown"
 
 /* Define if you have unsetenv */
 #define HAVE_UNSETENV 1
--- branches/work/kst/portto4/kst/src/libkst/debug.cpp #1213814:1213815
@@ -10,9 +10,10 @@
  *                                                                         *
  ***************************************************************************/
 
+#include "config.h"
+
 #include "datasource.h"
 #include "debug.h"
-#include "kstrevision.h"
 #include "logevents.h"
 
 #include <qlocale.h>
@@ -48,7 +49,7 @@
 : QObject() {
   _applyLimit = false;
   _limit = 10000;
-  _kstRevision = QString::fromLatin1(KSTREVISION);
+  _kstRevision = QString::fromLatin1(SVN_REVISION);
   _hasNewError = false;
 }
 
--- branches/work/kst/portto4/kst/src/libkst/libkst.pro #1213814:1213815
@@ -89,7 +89,6 @@
     generatedvector.h \
     kst_export.h \
     kst_i18n.h \
-    kstrevision.h \
     ksttimers.h \
     index_kst.h \
     logevents.h \
--- branches/work/kst/portto4/kst/src/libkstapp/aboutdialog.cpp #1213814:1213815
@@ -44,6 +44,7 @@
 
   QStringList msg = QStringList()
   << tr("<qt><h2>Kst "KSTVERSION" - A data viewing program.</h2>")
+  << tr("Revision "SVN_REVISION"<br><hr>")
   << tr("Copyright &copy; 2000-2010 Barth Netterfield<br><hr>")
   << tr("Homepage: <a href=\"http://kst.kde.org/\">http://kst.kde.org/</a><br>")
   << tr("Please report bugs with the 'Bug Report Wizard' of the 'Help' menu.<br>")


More information about the Kst mailing list