LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 05-07-2020, 09:41 AM   #1
timsoft
Member
 
Registered: Oct 2004
Location: scotland
Distribution: slackware 15.0 64bit, 14.2 64 and 32bit and arm, ubuntu and rasbian
Posts: 495

Rep: Reputation: 144Reputation: 144
Question 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.
 
Old 05-07-2020, 10:26 AM   #2
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware, Slarm64 & Android
Posts: 16,415

Rep: Reputation: 2338Reputation: 2338Reputation: 2338Reputation: 2338Reputation: 2338Reputation: 2338Reputation: 2338Reputation: 2338Reputation: 2338Reputation: 2338Reputation: 2338
The obvious way out of that is to go with both versions. Check for your cmake version:what follows is no script.

If 'cmake --version' ≤3.13(or whatever)
then
<do one thing>
elsif 'cmake --version' >3.13(or whatever)
then
<do another thing>
fi

You could probably pick the version up from pkgconfig, or /var/log/packages. Whatever is handiest.
 
Old 05-07-2020, 10:52 AM   #3
timsoft
Member
 
Registered: Oct 2004
Location: scotland
Distribution: slackware 15.0 64bit, 14.2 64 and 32bit and arm, ubuntu and rasbian
Posts: 495

Original Poster
Rep: Reputation: 144Reputation: 144
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.
 
Old 05-08-2020, 08:30 AM   #4
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware, Slarm64 & Android
Posts: 16,415

Rep: Reputation: 2338Reputation: 2338Reputation: 2338Reputation: 2338Reputation: 2338Reputation: 2338Reputation: 2338Reputation: 2338Reputation: 2338Reputation: 2338Reputation: 2338
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.
 
Old 05-27-2020, 05:55 AM   #5
timsoft
Member
 
Registered: Oct 2004
Location: scotland
Distribution: slackware 15.0 64bit, 14.2 64 and 32bit and arm, ubuntu and rasbian
Posts: 495

Original Poster
Rep: Reputation: 144Reputation: 144
Smile 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.
 
1 members found this post helpful.
Old 05-28-2020, 02:51 PM   #6
crts
Senior Member
 
Registered: Jan 2010
Posts: 2,020

Rep: Reputation: 757Reputation: 757Reputation: 757Reputation: 757Reputation: 757Reputation: 757Reputation: 757
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?
 
Old 05-31-2020, 07:51 AM   #7
timsoft
Member
 
Registered: Oct 2004
Location: scotland
Distribution: slackware 15.0 64bit, 14.2 64 and 32bit and arm, ubuntu and rasbian
Posts: 495

Original Poster
Rep: Reputation: 144Reputation: 144
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.
 
2 members found this post helpful.
  


Reply

Tags
bibletime, cmake, slackware, xiphos



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] cmake: how to list package-specific options jr_bob_dobbs Linux - Software 3 01-22-2019 05:16 PM
Hi all, i am new to cmake in linux so i am trying to design a c++ project that connects to mariadb using cmake, but i run into an error. Naptar Linux - Newbie 0 01-19-2019 11:46 AM
Slackware-current: /usr/share/cmake and /usr/share/cmake-3.3 directories igor29768 Slackware 1 11-07-2015 12:37 AM
CMake Strange "Install" behaviour with home-grown software [Linux x86_64, CMake 2.8] ajschaeffer Programming 0 10-24-2011 03:21 AM
cmake: Using find_package(Boost) when FindBoost.cmake is not in the default location damien_d Programming 3 10-27-2010 03:40 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 09:41 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration