r18721 - gnucash/trunk/src - More experimental cmake building.

Christian Stimming cstim at code.gnucash.org
Wed Feb 24 14:44:59 EST 2010


Author: cstim
Date: 2010-02-24 14:44:59 -0500 (Wed, 24 Feb 2010)
New Revision: 18721
Trac: http://svn.gnucash.org/trac/changeset/18721

Added:
   gnucash/trunk/src/core-utils/CMakeLists.txt
   gnucash/trunk/src/engine/CMakeLists.txt
Modified:
   gnucash/trunk/src/CMakeLists.txt
Log:
More experimental cmake building.

Except for the scheme wrappers this seems to work until
at least the engine module. However, I didn't tackle the issue
with the generated headers which contain some installation
paths - but those we should get rid of anyway.

Modified: gnucash/trunk/src/CMakeLists.txt
===================================================================
--- gnucash/trunk/src/CMakeLists.txt	2010-02-24 19:44:11 UTC (rev 18720)
+++ gnucash/trunk/src/CMakeLists.txt	2010-02-24 19:44:59 UTC (rev 18721)
@@ -6,11 +6,14 @@
 CMAKE_MINIMUM_REQUIRED (VERSION 2.6)
 PROJECT (gnucash)
 
+# ############################################################
+
 # Find pkg-config
 FIND_PACKAGE (PkgConfig REQUIRED)
 
 # glib
 PKG_CHECK_MODULES (GLIB2 glib-2.0>=2.12.0)
+PKG_CHECK_MODULES (GCONF2 gconf-2.0>=2.0)
 
 IF (NOT GLIB2_FOUND)
    MESSAGE (SEND_ERROR "Gtk not found, but is required")
@@ -21,16 +24,28 @@
 FIND_PATH (REGEX_INCLUDE_PATH NAMES regex.h
 		  PATHS /usr/include /opt/gnome/include)
 
+FIND_PACKAGE (SWIG REQUIRED)
+INCLUDE (${SWIG_USE_FILE})
+
+#FIND_PACKAGE (GUILE REQUIRED)
+
+# Workaround to create a dummy swig-runtime.h file
+FILE (WRITE ${CMAKE_CURRENT_BINARY_DIR}/swig-runtime.h "")
+
+# ############################################################
+
 #SET (QT_MIN_VERSION "4.5.0") # We need at least 4.5.0 (because only this is LGPL)
 #FIND_PACKAGE (Qt4 REQUIRED) # find and setup Qt4 for this project
 #INCLUDE_DIRECTORIES (${QT_INCLUDES})
 
-ADD_DEFINITIONS (-DHAVE_CONFIG_H)
-
 IF (UNIX)
   SET( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Werror -Wdeclaration-after-statement -Wno-pointer-sign -D_FORTIFY_SOURCE=2 -Wall -Wunused -Wmissing-prototypes -Wmissing-declarations  -Wno-unused")
 ENDIF (UNIX)
 
+# ############################################################
+
+ADD_DEFINITIONS (-DHAVE_CONFIG_H)
+
 # Create config.h
 SET (CONFIG_H ${CMAKE_CURRENT_BINARY_DIR}/config.h)
 FILE (WRITE ${CONFIG_H} "#define PACKAGE \"gnucash\"\n")
@@ -136,8 +151,22 @@
 ")
 ENDIF (UNIX)
 
+
+FILE (APPEND ${CONFIG_H} "
+/* GnuCash Major version number */
+#define GNUCASH_MAJOR_VERSION 2
+
+/* GnuCash Micro version number */
+#define GNUCASH_MICRO_VERSION 10
+
+/* GnuCash Minor version number */
+#define GNUCASH_MINOR_VERSION 3
+")
+
 # ############################################################
 
 # The subdirectories
 ADD_SUBDIRECTORY (libqof)
+ADD_SUBDIRECTORY (core-utils)
+ADD_SUBDIRECTORY (engine)
 

Added: gnucash/trunk/src/core-utils/CMakeLists.txt
===================================================================
--- gnucash/trunk/src/core-utils/CMakeLists.txt	                        (rev 0)
+++ gnucash/trunk/src/core-utils/CMakeLists.txt	2010-02-24 19:44:59 UTC (rev 18721)
@@ -0,0 +1,41 @@
+# CMakeLists.txt for src/libqof
+
+# EXPERIMENTAL! This is just a trial of how far we can get for a cmake
+# build system.
+
+ADD_DEFINITIONS (-DG_LOG_DOMAIN=\"gnc.core-utils\")
+
+INCLUDE_DIRECTORIES (${GLIB2_INCLUDE_DIRS})
+INCLUDE_DIRECTORIES (${GCONF2_INCLUDE_DIRS})
+INCLUDE_DIRECTORIES (${LIBINTL_INCLUDE_PATH})
+INCLUDE_DIRECTORIES (${REGEX_INCLUDE_PATH})
+INCLUDE_DIRECTORIES (${CMAKE_BINARY_DIR} ) # for config.h
+INCLUDE_DIRECTORIES (${CMAKE_SOURCE_DIR}) # for gnc-ui.h
+
+# FIXME: I still need to look up SWIG wrapper generation in cmake...
+#SWIG_ADD_MODULE (core_utils c swig-core-utils.i swig-core-utils.c)
+
+SET (libgnc_core_utils_SOURCES
+  gnc-main.c 
+  gnc-gconf-utils.c 
+  gnc-gdate-utils.c 
+  gnc-gkeyfile-utils.c 
+  gnc-glib-utils.c 
+  ../gnc-module/gnc-module.c
+)
+
+SET (libgnc_core_utils_HEADERS
+  gnc-main.h 
+  gnc-gconf-utils.h 
+  gnc-gdate-utils.h 
+  gnc-gkeyfile-utils.h 
+  gnc-glib-utils.h
+  ../gnc-module/gnc-module.h
+  ../gnc-module/gnc-module-api.h
+)
+
+ADD_LIBRARY	(core-utils
+  ${libgnc_core_utils_SOURCES}
+  ${libgnc_core_utils_HEADERS}
+  )
+

Added: gnucash/trunk/src/engine/CMakeLists.txt
===================================================================
--- gnucash/trunk/src/engine/CMakeLists.txt	                        (rev 0)
+++ gnucash/trunk/src/engine/CMakeLists.txt	2010-02-24 19:44:59 UTC (rev 18721)
@@ -0,0 +1,105 @@
+# CMakeLists.txt for src/libqof
+
+# EXPERIMENTAL! This is just a trial of how far we can get for a cmake
+# build system.
+
+ADD_DEFINITIONS (-DG_LOG_DOMAIN=\"gnc.engine\")
+
+INCLUDE_DIRECTORIES (${GLIB2_INCLUDE_DIRS})
+INCLUDE_DIRECTORIES (${LIBINTL_INCLUDE_PATH})
+INCLUDE_DIRECTORIES (${REGEX_INCLUDE_PATH})
+INCLUDE_DIRECTORIES (${CMAKE_BINARY_DIR} ) # for config.h
+INCLUDE_DIRECTORIES (${CMAKE_SOURCE_DIR}) # for gnc-ui.h
+INCLUDE_DIRECTORIES (${CMAKE_SOURCE_DIR}/libqof/qof) # for qof.h
+INCLUDE_DIRECTORIES (${CMAKE_SOURCE_DIR}/gnc-module) # for gnc-glib-utils.h
+INCLUDE_DIRECTORIES (${CMAKE_SOURCE_DIR}/core-utils) # for gnc-glib-utils.h
+INCLUDE_DIRECTORIES (${CMAKE_CURRENT_SOURCE_DIR}) # for <Account.h>
+INCLUDE_DIRECTORIES (${CMAKE_CURRENT_BINARY_DIR}) # for gncla-dir.h
+MESSAGE(STATUS "SWIG_DIR=${SWIG_DIR}")
+# FIXME: I still need to look up SWIG wrapper generation in cmake...
+#SWIG_ADD_MODULE (engine guile swig-engine.i swig-engine.c)
+
+# Workaround to create a dummy gncla-dir.h file
+FILE (WRITE ${CMAKE_CURRENT_BINARY_DIR}/gncla-dir.h "")
+
+SET (libgncmod_engine_SOURCES
+  Account.c 
+  Recurrence.c 
+  Period.c 
+  Query.c 
+  SchedXaction.c 
+  SX-book.c 
+  SX-ttinfo.c 
+  Scrub.c 
+  Scrub2.c 
+  Scrub3.c 
+  Split.c 
+  TransLog.c 
+  Transaction.c 
+  binreloc.c 
+  cap-gains.c 
+  cashobjects.c 
+  gnc-associate-account.c 
+  gnc-budget.c 
+#  gnc-commodity.c 
+  gnc-engine.c 
+  gnc-filepath-utils.c 
+  gnc-hooks.c 
+  gnc-lot.c 
+  gnc-path.c 
+  gnc-pricedb.c 
+  gnc-session.c 
+  gnc-session-scm.c 
+  gncmod-engine.c 
+  kvp-scm.c 
+  engine-helpers.c 
+  glib-helpers.c  
+  policy.c
+)
+
+SET (libgncmod_engine_HEADERS
+  Account.h 
+  FreqSpec.h 
+  Recurrence.h 
+  GNCId.h 
+  Period.h 
+  SchedXaction.h 
+  SX-book.h 
+  SX-ttinfo.h 
+  Query.h 
+  QueryNew.h 
+  QueryObject.h 
+  QueryCore.h 
+  Scrub.h 
+  Scrub2.h 
+  Scrub3.h 
+  Split.h 
+  TransLog.h 
+  Transaction.h 
+  binreloc.h 
+  cap-gains.h 
+  cashobjects.h 
+  engine-helpers.h 
+  glib-helpers.h 
+  gnc-associate-account.h 
+  gnc-book.h 
+  gnc-budget.h 
+  gnc-commodity.h 
+  gnc-engine.h 
+  gnc-event.h 
+  gnc-filepath-utils.h 
+  gnc-hooks.h 
+  gnc-path.h 
+  gnc-pricedb.h 
+  gnc-session.h 
+  gnc-session-scm.h 
+  gncObject.h 
+  kvp-scm.h 
+  policy.h
+)
+
+ADD_LIBRARY	(engine
+  ${libgncmod_engine_SOURCES}
+  ${libgncmod_engine_HEADERS}
+  )
+



More information about the gnucash-changes mailing list