[SOLVED] problem with newer cmake options run on slackware cmake 3.5.2
SlackwareThis Forum is for the discussion of Slackware Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Distribution: slackware 15.0 64bit, 14.2 64 and 32bit and arm, ubuntu and rasbian
Posts: 495
Rep:
problem with newer cmake options run on slackware cmake 3.5.2
Hi all, I look after the slackbuild for xiphos, which has switched it's build system from waf to cmake for the next release version. Unfortunately it targets cmake v3.11 and allthough I can patch the hard version check to get it to run with slackware's cmake it chokes on 3 lines, where the usage allowed has changed between cmake versions. I am looking for a work-around so it will work with slackare 14.2's existing cmake.
it currently stalls with the following error..
Quote:
-- Found Biblesync: /usr/include/biblesync (found version "2.0.1")
CMake Error at cmake/modules/FindBiblesync.cmake:75 (target_include_directories):
Cannot specify include directories for imported target
"PkgConfig::Biblesync".
Call Stack (most recent call first):
cmake/XiphosDependencies.cmake:51 (find_package)
CMakeLists.txt:88 (include)
CMake Error at cmake/modules/FindBiblesync.cmake:76 (target_link_libraries):
Cannot specify link libraries for target "PkgConfig::Biblesync" which is
not built by this project.
Call Stack (most recent call first):
cmake/XiphosDependencies.cmake:51 (find_package)
CMakeLists.txt:88 (include)
-- Configuring incomplete, errors occurred!
See also "/tmp/SBo/xiphos-4.2.0/build/CMakeFiles/CMakeOutput.log".
and the relevant part of cmake/modules/FindBiblesync.cmake is
Code:
# If found, add target
if(BIBLESYNC_FOUND AND NOT TARGET Biblesync::Biblesync)
add_library(PkgConfig::Biblesync INTERFACE IMPORTED)
target_include_directories(PkgConfig::Biblesync INTERFACE ${BIBLESYNC_INCLUDE_DIR})
target_link_libraries(PkgConfig::Biblesync INTERFACE ${BIBLESYNC_LIBRARY_DIR})
endif()
(line 75 is the target_include_directories line )
according to the cmake docs for 3.5.2 add_library cannot be used with INTERFACE IMPORTED and the docs for 3.11 (which the cmake file is targetted for) allows that as long as it isn't type ALIAS.
what I haven't been able to find out is how to work around this issue so it does what is intended without choking. Any pointers would be helpful.
I'm not even sure if those lines are needed, as the biblesync lib is included in the biblesync sbo package, but removeing those lines causes other errors, and my cmake knowledge is sadly lacking.
Distribution: slackware 15.0 64bit, 14.2 64 and 32bit and arm, ubuntu and rasbian
Posts: 495
Original Poster
Rep:
my problem is that upstream have targeted cmake >=3.11 which is not in slackware 14.2
I need to patch it to work with the version in stable. I don't have a working CMakeLists.txt for the version of cmake that comes with slackware stable.
my progress so far is overwriding the version check in CMakeLists.txt with a
Code:
sed -i "s/3.11/3.5.2/g" CMakeLists.txt
in the xiphos.SlackBuild so that it doesn't stop before it starts.
at this point It progresses through its checks and fails as shown in the first post.
If they're incompatible, forcing a version won't work.
I appreciate your need, but I'm sorted for Bible research stuff with http://www.wol.jw.org, and a dvd version for members under wine. Probably not your flavour.
It strikes me you may get out of that be setting the variables earlier on in the compile. Variables are often set blank, and then searched for; If you specified things more closely, it might help.
Distribution: slackware 15.0 64bit, 14.2 64 and 32bit and arm, ubuntu and rasbian
Posts: 495
Original Poster
Rep:
inline private copy of newer cmake
To answer my own question,(reference for others) include a private copy of a more recent cmake in the slackbuild.
steps to do above.
1. add DOWNLOAD location "https://github.com/KitWare/CMake/archive/v3.17.2/cmake-3.17.2.tar.gz" to info file
(and add md5 sum 41e0259ede89083081d3276ecaba5b38 )
2. in the slackbuild, and variable
Code:
CMVERSION=${CMVERSION:-3.17.2}
in the slackbuild, after the
Code:
cd $PRGNAM-$VERSION
add the following lines
Code:
#we need a private copy of a newer version of cmake (at least 3.11)
tar xvf $CWD/cmake-$CMVERSION.tar.gz
then after the permissions sanitising of everything, add
Code:
#now do private cmake stuff - note capital C
cd CMake-$CMVERSION
mkdir cmake-build
cd cmake-build
CFLAGS="$SLKCFLAGS" \
CXXFLAGS="$SLKCFLAGS" \
../configure \
--prefix=$TMP/$PRGNAM-$VERSION/tmpcmake \
--docdir=/doc \
--no-qt-gui \
--system-curl \
--system-expat \
--no-system-jsoncpp \
--system-zlib \
--system-bzip2 \
--system-libarchive
#we don't care about the docs really as this is a temp install.
make
make install
#hopefully that has installed our tmp cmake in the right place
#in $TMP/$PRGNAM-$VERSION/tmpcmake/bin
#lets make it available to the xiphos build
OLDPATH=$PATH
export PATH=$TMP/$PRGNAM-$VERSION/tmpcmake/bin:$PATH
#move back to the right directory
cd ../../
then run your project cmake command. after that add the following
Code:
#cmake should have created make file so restore PATH
export PATH=$OLDPATH
then the rest of your slackbuild follows as normal (make etc.)
Note: although the download location for cmake creates a lower case cmake-$CMVERSION.tar.gz (using wget) the directory inside the tar.gz uppercases the first character. If you are trying this method with older versions of cmake the packaging may be slightly different so you will have to adjust accordingly.
Thanks for posting the solution, this surely is better than rewriting the entire CMakeLists.txt file. Point of interest, how long did it take to build cmake?
Distribution: slackware 15.0 64bit, 14.2 64 and 32bit and arm, ubuntu and rasbian
Posts: 495
Original Poster
Rep:
just over 12minutes.
It does add quite a bit of time to the whole build, but, as you comment, that is easier that rewriting the entire project's cmake files. it has made debugging the slackbuild take much longer than normal, though.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.