mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
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. git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@18721 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
parent
f084ab3020
commit
04e042eb90
@ -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 (LIBINTL_INCLUDE_PATH NAMES libintl.h
|
||||
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 @@ IF (UNIX)
|
||||
")
|
||||
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)
|
||||
|
||||
|
41
src/core-utils/CMakeLists.txt
Normal file
41
src/core-utils/CMakeLists.txt
Normal file
@ -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}
|
||||
)
|
||||
|
105
src/engine/CMakeLists.txt
Normal file
105
src/engine/CMakeLists.txt
Normal file
@ -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}
|
||||
)
|
||||
|
Loading…
Reference in New Issue
Block a user