[sword-devel] CMake: Sword SVN trunk fails to configure without SVN
Jaak Ristioja
jaak at ristioja.ee
Thu Jan 7 18:49:12 EST 2021
Hello!
The capricious CI for BibleTime again fails to build the latest SVN
trunk version of Sword with CMake:
-- Found Subversion: /usr/bin/svn (found version "1.9.7")
CMake Error at
/usr/local/cmake-3.12.4/share/cmake-3.12/Modules/FindSubversion.cmake:99
(message):
Command "/usr/bin/svn info /tmp/tmp.Tii77pWpje/source" failed with
output:
svn: E155007: '/tmp/tmp.Tii77pWpje/source' is not a working copy
I took a look at the recent Subversion related changes in CMakeLists.txt
and propose to add detection that "${CMAKE_CURRENT_SOURCE_DIR}/.svn"
exists and that the the Subversion client executable is available on the
system, e.g.:
if(IS_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/.svn")
find_package(Subversion)
if(COMMAND Subversion_WC_INFO)
Subversion_WC_INFO("${CMAKE_CURRENT_SOURCE_DIR}" MYSVN
IGNORE_SVN_FAILURE)
endif()
endif()
Note also that I double quoted "${CMAKE_CURRENT_SOURCE_DIR}" in the
above so that directories with spaces wouldn't cause an incorrect number
of arguments getting passed to Subversion_WC_INFO(). Using if(COMMAND
Subversion_WC_INFO) instead of if(Subversion_FOUND) is safer as it
allows users to provide their own Subversion_WC_INFO() command in cases
where FindSubversion() doesn't work for them (e.g. when subversion is
not installed, not found by FindSubversion.cmake or FindSubversion fails
to define Subversion_WC_INFO()).
Best regards,
J
More information about the sword-devel
mailing list