Provide fallback value for test_core_dir in case it hasn't been built yet.

This commit is contained in:
John Ralls 2018-03-09 13:48:36 -08:00
parent fbb172d096
commit c9f3c0760c

View File

@ -1,6 +1,10 @@
IF (WITH_PYTHON)
find_path(test_core_dir "unittest_support.py" PATHS ${CMAKE_BINARY_DIR}/common/test-core ${CMAKE_SOURCE_DIR}/common/test-core)
if (${test_core_dir} STREQUAL "test_core_dir-NOTFOUND")
# Because it hasn't been built yet
set(test_core_dir ${CMAKE_BINARY_DIR}/common/test-core)
endif()
add_custom_target(test-python-bindings ALL DEPENDS unittest_support gnucash-core-c-build gnucash-core-c-py)
add_dependencies(check test-python-bindings)
ADD_TEST(python-bindings ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/runTests.py.in)