gnucash/common/CMakeLists.txt
Geert Janssens ff24970f5f Add GENERATE_SWIG_WRAPPERS option to control the generation of swig wrappers independently of whether we're building from git
The swig wrappers don't really depend on git (but rather on swig) and there can be
situations the builder wants to generate the wrappers also from a tar ball.
2018-01-31 16:16:59 +01:00

34 lines
1015 B
CMake

# CMakeLists.txt for common/
# The subdirectories
ADD_SUBDIRECTORY (cmake_modules)
ADD_SUBDIRECTORY (debug)
ADD_SUBDIRECTORY (test-core)
SET(common_EXTRA_DIST
base-typemaps.i
config.h.cmake.in
gnc-test-env.pl
guile-mappings.h
platform.h)
if (GENERATE_SWIG_WRAPPERS)
set (SWIG_RUNTIME_H ${CMAKE_CURRENT_BINARY_DIR}/swig-runtime.h)
# Command to generate the swig-runtime.h header
add_custom_command (
OUTPUT ${SWIG_RUNTIME_H}
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt
COMMAND ${SWIG_EXECUTABLE} -guile -external-runtime ${SWIG_RUNTIME_H}
)
else()
set (SWIG_RUNTIME_H ${CMAKE_CURRENT_SOURCE_DIR}/swig-runtime.h)
endif()
dist_add_generated (${GENERATE_SWIG_WRAPPERS} swig-runtime.h)
add_custom_target (swig-runtime-h DEPENDS ${SWIG_RUNTIME_H})
SET_LOCAL_DIST(common_DIST_local CMakeLists.txt ${common_EXTRA_DIST})
SET(common_DIST ${common_DIST_local} ${cmake_modules_DIST} ${debug_DIST} ${test_core_DIST} PARENT_SCOPE)