Bug 376896 - Unable to build master branch from github
Summary: Unable to build master branch from github
Status: RESOLVED NOT A BUG
Alias: None
Product: Skanlite
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: Kåre Särs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-02-24 23:27 UTC by Alexander Trufanov
Modified: 2017-03-14 04:48 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Alexander Trufanov 2017-02-24 23:27:08 UTC
Have just got up-to-date version of Skanlite sources from Github page: 
https://github.com/KDE/skanlite
Then tried cmake CMakeLists.cmake && make all
And got following error messages:

[  9%] Automatic moc for target skanlite
[  9%] Built target skanlite_automoc
Scanning dependencies of target skanlite
[ 18%] Building CXX object src/CMakeFiles/skanlite.dir/main.cpp.o
In file included from /home/truf/dev/skanlite/src/main.cpp:33:0:
/home/truf/dev/skanlite/src/version.h:1:3: error: invalid preprocessing directive #This
 # This is a basic version file for the Config-mode of find_package().
...

It seems that CMakeLists.cmake contains error. Looks like skanlite generates version.h from version.h.cmake with help of configure_file().
But before that it calls ecm_setup_version() which overwrites version.h.cmake template with package version file. Then nothing works. I don't understand why package version file is created on top of version file and how it's supposed to be used.

To be able to build the sources I had to comment ecm_setup_version() invocation in CMakeLists.cmake before calling cmake first time.
Comment 1 Alexander Trufanov 2017-03-14 04:48:24 UTC
It works if cmake is called from subfolder like:

mkdir build
cd build
cmake ..
make

And doesn't work if only executed from project's root folder.