2010-03-04 11:48:36 -06:00
# CMakeLists.txt for the cutecash sub-project of gnucash
# This is very EXPERIMENTAL! We will see how far this project will
# get.
CMAKE_MINIMUM_REQUIRED ( VERSION 2.6 )
PROJECT ( cutecash )
2010-05-06 06:40:55 -05:00
# Version number of cutecash
SET ( CUTECASH_VERSION_MAJOR "0" )
SET ( CUTECASH_VERSION_MINOR "1" )
SET ( CUTECASH_VERSION_PATCH "0" )
2011-01-30 04:25:07 -06:00
# Change this in development versions when changing anything that
# affects stored data structures. Reset to zero when bumping version.
SET ( CUTECASH_VERSION_NANO "0" )
2011-02-02 14:31:10 -06:00
SET ( GNUCASH_RESAVE_VERSION "19920" )
2011-01-30 04:25:07 -06:00
2010-03-04 11:48:36 -06:00
# Extra cmake macros
SET ( CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/src/cmake_modules;${CMAKE_MODULE_PATH}" )
INCLUDE ( MacroAppendForeach )
INCLUDE ( MacroAddSourceFileCompileFlags )
INCLUDE ( GncAddSwigCommand )
2010-05-06 06:40:55 -05:00
INCLUDE ( CheckIncludeFiles )
2010-03-04 11:48:36 -06:00
# ############################################################
2010-03-27 15:27:10 -05:00
OPTION ( WITH_SQL "Build this project with SQL (libdbi) support" OFF )
2011-05-03 15:08:34 -05:00
OPTION ( WITH_AQBANKING "Build this project with aqbanking (online banking) support" OFF )
2010-03-27 15:27:10 -05:00
# ############################################################
2010-03-04 11:48:36 -06:00
# Find pkg-config
FIND_PACKAGE ( PkgConfig REQUIRED )
IF ( NOT PKG_CONFIG_FOUND )
MESSAGE ( SEND_ERROR "pkg-config not found, but is required" )
ENDIF ( NOT PKG_CONFIG_FOUND )
# glib et al.
2011-03-26 07:50:06 -05:00
PKG_CHECK_MODULES ( GLIB2 glib-2.0>=2.20 )
PKG_CHECK_MODULES ( GCONF2 gconf-2.0>=2.22 )
PKG_CHECK_MODULES ( GOBJECT gobject-2.0>=2.20 )
PKG_CHECK_MODULES ( GMODULE gmodule-2.0>=2.20 )
PKG_CHECK_MODULES ( GTHREAD gthread-2.0>=2.20 )
2011-10-24 02:59:30 -05:00
PKG_CHECK_MODULES ( GLIBMM glibmm-2.4>=2.24 )
2011-12-19 05:37:36 -06:00
PKG_CHECK_MODULES ( LIBXML2 libxml-2.0>=2.7.0 )
2010-03-04 11:48:36 -06:00
IF ( MSVC )
MESSAGE ( STATUS "Hint: To create the import libraries for the gnome DLLs (e.g. gconf-2.lib), use the dlltool as follows: pexports bin/libgconf-2-4.dll > lib/libgconf-2.def ; dlltool -d lib/libgconf-2.def -D bin/libgconf-2-4.dll -l lib/gconf-2.lib" )
2010-03-11 15:59:45 -06:00
# Disable the obnoxious min/max macros in MSVC - we want to use the
# function versions of them.
ADD_DEFINITIONS ( -DNOMINMAX )
2010-03-04 11:48:36 -06:00
ENDIF ( MSVC )
2011-12-19 05:37:36 -06:00
## Libxml2
#FIND_PACKAGE (LibXml2 REQUIRED)
2013-11-18 02:00:44 -06:00
FIND_PACKAGE ( ZLIB REQUIRED )
2010-03-04 11:48:36 -06:00
IF ( NOT GLIB2_FOUND )
MESSAGE ( SEND_ERROR "Glib2 not found, but is required" )
ENDIF ( NOT GLIB2_FOUND )
FIND_PATH ( LIBINTL_INCLUDE_PATH NAMES libintl.h
P A T H S / u s r / i n c l u d e / o p t / g n o m e / i n c l u d e )
FIND_LIBRARY ( LIBINTL_LIBRARY NAMES intl )
FIND_PATH ( REGEX_INCLUDE_PATH NAMES regex.h
P A T H S / u s r / i n c l u d e / o p t / g n o m e / i n c l u d e )
FIND_LIBRARY ( REGEX_LIBRARY NAMES regex )
2010-03-14 16:01:32 -05:00
IF ( WIN32 )
FIND_PATH ( HTMLHELP_INCLUDE_PATH NAMES htmlhelp.h
P A T H S / u s r / i n c l u d e )
ENDIF ( WIN32 )
2010-03-04 11:48:36 -06:00
# ############################################################
# SWIG
FIND_PACKAGE ( SWIG REQUIRED )
INCLUDE ( ${ SWIG_USE_FILE } )
2010-03-06 05:00:54 -06:00
# guile library and include dir
2011-05-01 15:56:33 -05:00
PKG_CHECK_MODULES ( GUILE guile-1.8>=1.8.0 )
ADD_DEFINITIONS ( -DHAVE_GUILE18 )
2010-03-06 05:00:54 -06:00
# We also need to look up the executable
FIND_PROGRAM ( GUILE_EXECUTABLE guile )
2010-03-05 14:41:40 -06:00
2011-05-03 14:24:49 -05:00
IF ( NOT GUILE_FOUND )
2011-05-01 15:56:33 -05:00
MESSAGE ( SEND_ERROR "Guile was not found, but is required. Please set PKG_CONFIG_PATH so that guile-1.8.pc is found." )
2011-05-03 14:24:49 -05:00
ENDIF ( NOT GUILE_FOUND )
2010-03-06 05:00:54 -06:00
IF ( NOT GUILE_EXECUTABLE )
MESSAGe ( SEND_ERROR "The guile executable was not found, but is required. Please set GUILE_EXECUTABLE." )
ENDIF ( NOT GUILE_EXECUTABLE )
2010-03-04 11:48:36 -06:00
# ############################################################
2015-04-22 15:33:58 -05:00
# xsltproc
FIND_PROGRAM ( XSLTPROC xsltproc )
# ############################################################
2010-03-27 15:27:10 -05:00
# libdbi
FIND_PATH ( LIBDBI_INCLUDE_PATH dbi/dbi.h )
FIND_LIBRARY ( LIBDBI_LIBRARY dbi )
IF ( WITH_SQL )
IF ( NOT LIBDBI_INCLUDE_PATH )
MESSAGE ( SEND_ERROR "Include file <dbi/dbi.h> was not found - did you install libdbi0-dev or libdbi-dev?" )
ENDIF ( NOT LIBDBI_INCLUDE_PATH )
IF ( NOT LIBDBI_LIBRARY )
MESSAGE ( SEND_ERROR "Library libdbi was not found" )
ENDIF ( NOT LIBDBI_LIBRARY )
ENDIF ( WITH_SQL )
# ############################################################
2010-03-04 11:48:36 -06:00
# Qt
SET ( QT_MIN_VERSION "4.5.0" )
FIND_PACKAGE ( Qt4 REQUIRED ) # find and setup Qt4 for this project
2011-05-03 15:08:34 -05:00
# ############################################################
IF ( WITH_AQBANKING )
PKG_CHECK_MODULES ( GWENHYWFAR REQUIRED gwenhywfar )
PKG_CHECK_MODULES ( AQBANKING REQUIRED aqbanking )
ENDIF ( WITH_AQBANKING )
2010-03-04 11:48:36 -06:00
# ############################################################
# Compiler flags
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" )
2013-11-18 02:00:44 -06:00
SET ( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-error=deprecated-declarations" )
2010-03-04 11:48:36 -06:00
ENDIF ( UNIX )
IF ( MINGW )
SET ( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Werror -Wdeclaration-after-statement -Wall -Wunused -Wmissing-prototypes -Wmissing-declarations -Wno-unused" )
ENDIF ( MINGW )
# ############################################################
# The subdirectories
ADD_SUBDIRECTORY ( src )
2010-04-12 14:21:14 -05:00
# ############################################################
# Package creation rules
SET ( CPACK_PACKAGE_NAME "Cutecash" )
SET ( CPACK_PACKAGE_DESCRIPTION_SUMMARY "Cutecash Free Finance Software" )
2010-05-06 06:40:55 -05:00
SET ( CPACK_PACKAGE_VERSION_MAJOR ${ CUTECASH_VERSION_MAJOR } )
SET ( CPACK_PACKAGE_VERSION_MINOR ${ CUTECASH_VERSION_MINOR } )
SET ( CPACK_PACKAGE_VERSION_PATCH ${ CUTECASH_VERSION_PATCH } )
2010-04-12 14:21:14 -05:00
SET ( CPACK_PACKAGE_VENDOR "Christian Stimming" )
SET ( CPACK_SOURCE_IGNORE_FILES "/\\\\.svn/;/\\\\.git/;.*~;build.*;html;Debug;Release" )
SET ( CPACK_STRIP_FILES "bin/cutecash" )
#SET (CPACK_PACKAGE_EXECUTABLES "bin/carclient")
IF ( UNIX )
SET ( CPACK_GENERATOR "TGZ" )
ENDIF ( UNIX )
INCLUDE ( CPack )