@ -2,13 +2,8 @@
add_subdirectory ( test )
# C o m m a n d t o g e n e r a t e t h e s w i g - c o r e - u t i l s - p y t h o n . c w r a p p e r f i l e
gnc_add_swig_python_command ( swig-core-utils-python
S W I G _ C O R E _ U T I L S _ P Y T H O N _ C S W I G _ C O R E _ U T I L S _ P Y T H O N _ P Y
s w i g - c o r e - u t i l s - p y t h o n . c s w _ c o r e _ u t i l s . p y
$ { C M A K E _ S O U R C E _ D I R } / b i n d i n g s / c o r e - u t i l s . i $ { C M A K E _ C U R R E N T _ S O U R C E _ D I R }
)
# # # l i b g n c - c o r e - u t i l s
set ( core_utils_SOURCES
b i n r e l o c . c
g n c - p r e f s . c
@ -26,51 +21,6 @@ set (core_utils_SOURCES
# A d d d e p e n d e n c y o n c o n f i g . h
set_source_files_properties ( ${ core_utils_SOURCES } PROPERTIES OBJECT_DEPENDS ${ CONFIG_H } )
set ( prefix ${ CMAKE_INSTALL_PREFIX } )
set ( datadir ${ CMAKE_INSTALL_FULL_DATADIR } )
set ( bindir ${ CMAKE_INSTALL_FULL_BINDIR } )
set ( libdir ${ CMAKE_INSTALL_FULL_LIBDIR } )
set ( sysconfdir ${ CMAKE_INSTALL_FULL_SYSCONFDIR } )
set ( localedir "${CMAKE_INSTALL_FULL_DATAROOTDIR}/locale" )
configure_file ( gncla-dir.h.in gncla-dir.h )
# - - -
if ( BUILDING_FROM_VCS )
set ( VCS_INFO_BASE_DIR ${ CMAKE_BINARY_DIR } )
else ( )
set ( VCS_INFO_BASE_DIR ${ CMAKE_SOURCE_DIR } )
endif ( )
set ( VCS_INFO_FILE ${ VCS_INFO_BASE_DIR } /libgnucash/core-utils/gnc-vcs-info.h CACHE STRING "path to gnc-vcs-info.h file" )
# # # C r e a t e g n c - v c s - i n f o . h
# T h i s c a n o n l y b e d o n e w h e n b u i l d i n g f r o m a vcs ( git/svn/bzr/svk ) w o r k i n g d i r e c t o r y .
# T h i s f i l e i s s h i p p e d i n t h e d i s t r i b u t i o n t a r b a l l , s o n o n e e d t o g e n e r a t e i t i n t h a t c a s e a n y w a y .
# T h e m e t a - c m a k e g y m n a s t i c s h e r e c o m e f r o m h t t p s : / / c m a k e . o r g / p i p e r m a i l / c m a k e / 2 0 1 0 - J u l y / 0 3 8 0 1 5 . h t m l
if ( BUILDING_FROM_VCS )
file ( WRITE ${ CMAKE_CURRENT_BINARY_DIR } /gnc-vcs-info.h.in
" / * A u t o g e n e r a t e d . D o n o t c h a n g e . * /
# d e f i n e G N C _ V C S _ R E V \ " @ G N C _ V C S _ R E V @ \ "
# d e f i n e G N C _ V C S _ R E V _ D A T E \ " @ G N C _ V C S _ R E V _ D A T E @ \ "
# d e f i n e G N C _ V C S _ R E V _ Y E A R \ " @ G N C _ V C S _ R E V _ Y E A R @ \ "
# d e f i n e G N C _ V C S _ R E V _ Y _ M \ " @ G N C _ V C S _ R E V _ Y _ M @ \ "
" )
add_custom_target ( gnc-vcs-info ALL
B Y P R O D U C T S $ { C M A K E _ C U R R E N T _ B I N A R Y _ D I R } / g n c - v c s - i n f o . h
C O M M A N D $ { C M A K E _ C O M M A N D } - D S R C = $ { C M A K E _ C U R R E N T _ B I N A R Y _ D I R } / g n c - v c s - i n f o . h . i n
- D D S T = $ { C M A K E _ C U R R E N T _ B I N A R Y _ D I R } / g n c - v c s - i n f o . h
- D S R C _ D I R = $ { C M A K E _ S O U R C E _ D I R }
- D S H E L L = " $ { S H E L L } "
- P $ { C M A K E _ S O U R C E _ D I R } / c m a k e / g i t 2 v e r s i o n - i n f o . c m a k e
)
else ( BUILDING_FROM_VCS )
add_custom_target ( gnc-vcs-info DEPENDS ${ VCS_INFO_FILE } )
endif ( BUILDING_FROM_VCS )
dist_add_generated ( ${ BUILDING_FROM_VCS } gnc-vcs-info.h )
# # # C o m p i l e l i b r a r y
set ( core_utils_noinst_HEADERS
b i n r e l o c . h
g n c - p r e f s . h
@ -86,13 +36,8 @@ set(core_utils_noinst_HEADERS
g n c - v e r s i o n . h
)
set ( core_utils_ALL_SOURCES ${ core_utils_SOURCES } ${ core_utils_noinst_HEADERS } )
set_local_dist ( core_utils_DIST_local ${ core_utils_ALL_SOURCES } CMakeLists.txt gncla-dir.h.in )
set ( core_utils_DIST ${ core_utils_DIST_local } ${ test_core_utils_DIST } PARENT_SCOPE )
add_library ( gnc-core-utils ${ core_utils_SOURCES } ${ core_utils_noinst_HEADERS } )
add_library ( gnc-core-utils ${ core_utils_ALL_SOURCES } )
add_dependencies ( gnc-core-utils gnc-vcs-info )
target_include_directories ( gnc-core-utils
@ -127,6 +72,57 @@ install(TARGETS gnc-core-utils
R U N T I M E D E S T I N A T I O N $ { C M A K E _ I N S T A L L _ B I N D I R }
)
# # # g n c l a - d i r . h
set ( prefix ${ CMAKE_INSTALL_PREFIX } )
set ( datadir ${ CMAKE_INSTALL_FULL_DATADIR } )
set ( bindir ${ CMAKE_INSTALL_FULL_BINDIR } )
set ( libdir ${ CMAKE_INSTALL_FULL_LIBDIR } )
set ( sysconfdir ${ CMAKE_INSTALL_FULL_SYSCONFDIR } )
set ( localedir "${CMAKE_INSTALL_FULL_DATAROOTDIR}/locale" )
configure_file ( gncla-dir.h.in gncla-dir.h )
# # # C r e a t e g n c - v c s - i n f o . h
# T h i s c a n o n l y b e d o n e w h e n b u i l d i n g f r o m a vcs ( git/svn/bzr/svk ) w o r k i n g d i r e c t o r y .
# T h i s f i l e i s s h i p p e d i n t h e d i s t r i b u t i o n t a r b a l l , s o n o n e e d t o g e n e r a t e i t i n t h a t c a s e a n y w a y .
# T h e m e t a - c m a k e g y m n a s t i c s h e r e c o m e f r o m h t t p s : / / c m a k e . o r g / p i p e r m a i l / c m a k e / 2 0 1 0 - J u l y / 0 3 8 0 1 5 . h t m l
if ( BUILDING_FROM_VCS )
set ( VCS_INFO_BASE_DIR ${ CMAKE_BINARY_DIR } )
else ( )
set ( VCS_INFO_BASE_DIR ${ CMAKE_SOURCE_DIR } )
endif ( )
set ( VCS_INFO_FILE ${ VCS_INFO_BASE_DIR } /libgnucash/core-utils/gnc-vcs-info.h CACHE STRING "path to gnc-vcs-info.h file" )
if ( BUILDING_FROM_VCS )
file ( WRITE ${ CMAKE_CURRENT_BINARY_DIR } /gnc-vcs-info.h.in
" / * A u t o g e n e r a t e d . D o n o t c h a n g e . * /
# d e f i n e G N C _ V C S _ R E V \ " @ G N C _ V C S _ R E V @ \ "
# d e f i n e G N C _ V C S _ R E V _ D A T E \ " @ G N C _ V C S _ R E V _ D A T E @ \ "
# d e f i n e G N C _ V C S _ R E V _ Y E A R \ " @ G N C _ V C S _ R E V _ Y E A R @ \ "
# d e f i n e G N C _ V C S _ R E V _ Y _ M \ " @ G N C _ V C S _ R E V _ Y _ M @ \ "
" )
add_custom_target ( gnc-vcs-info ALL
B Y P R O D U C T S $ { C M A K E _ C U R R E N T _ B I N A R Y _ D I R } / g n c - v c s - i n f o . h
C O M M A N D $ { C M A K E _ C O M M A N D } - D S R C = $ { C M A K E _ C U R R E N T _ B I N A R Y _ D I R } / g n c - v c s - i n f o . h . i n
- D D S T = $ { C M A K E _ C U R R E N T _ B I N A R Y _ D I R } / g n c - v c s - i n f o . h
- D S R C _ D I R = $ { C M A K E _ S O U R C E _ D I R }
- D S H E L L = " $ { S H E L L } "
- P $ { C M A K E _ S O U R C E _ D I R } / c m a k e / g i t 2 v e r s i o n - i n f o . c m a k e
)
else ( BUILDING_FROM_VCS )
add_custom_target ( gnc-vcs-info DEPENDS ${ VCS_INFO_FILE } )
endif ( BUILDING_FROM_VCS )
dist_add_generated ( ${ BUILDING_FROM_VCS } gnc-vcs-info.h )
# C o m m a n d t o g e n e r a t e t h e s w i g - c o r e - u t i l s - p y t h o n . c w r a p p e r f i l e
gnc_add_swig_python_command ( swig-core-utils-python
S W I G _ C O R E _ U T I L S _ P Y T H O N _ C S W I G _ C O R E _ U T I L S _ P Y T H O N _ P Y
s w i g - c o r e - u t i l s - p y t h o n . c s w _ c o r e _ u t i l s . p y
$ { C M A K E _ S O U R C E _ D I R } / b i n d i n g s / c o r e - u t i l s . i $ { C M A K E _ C U R R E N T _ S O U R C E _ D I R }
)
if ( WITH_PYTHON )
add_library ( sw_core_utils MODULE ${ SWIG_CORE_UTILS_PYTHON_C } )
@ -162,5 +158,10 @@ if (WITH_PYTHON)
endif ( )
# N o h e a d e r s t o i n s t a l l
# D i s t f i l e s
set_local_dist ( core_utils_DIST_local
$ { c o r e _ u t i l s _ S O U R C E S }
$ { c o r e _ u t i l s _ n o i n s t _ H E A D E R S }
C M a k e L i s t s . t x t
g n c l a - d i r . h . i n )
set ( core_utils_DIST ${ core_utils_DIST_local } ${ test_core_utils_DIST } PARENT_SCOPE )