#4706: Build fails when using cmake
-------------------------------------------------+-------------------------
        Reporter:  _Marc0_                       |      Owner:
            Type:  patch (an actual patch, not   |     Status:  new
  a request for one)                             |  Milestone:  unspecified
        Priority:  normal                        |    Version:  git/master
       Component:  Build System Issues           |
Operating System:  All/Non-Specific              |
-------------------------------------------------+-------------------------
 Builds fail when cmake copies files from a RCS source directory (here
 `../warzone2100-github`) to a build directory:

 {{{
     $ cmake ../warzone2100-github
     $ make -j9
     ...
     [ 53%] Generating moc_qtscriptdebug.cpp
     error: No repo or cache detected.
     make[2]: *** [src/autorevision.h] Error 1
     make[2]: *** Deleting file `src/autorevision.h'
     make[2]: *** Waiting for unfinished jobs....
     make[1]: *** [src/CMakeFiles/warzone2100.dir/all] Error 2
     make: *** [all] Error 2
 }}}

 Without changing directory to `$CMAKE_SOURCE_DIR` the `autorevision`
 script is executed within the `src` directory of the build directory. This
 fails silently as there is no RCS information available. Both
 `src/autorevision.cache` and `src/autorevision.h` are missing during
 build.

 See this (part of the) diff, `warzone2100-build-alt` without patch,
 `warzone2100-build-neu` contains the patch, `/tmp/warzone2100-github` is
 the source directory:

 {{{
     diff -ruw warzone2100-build-
 alt/src/CMakeFiles/warzone2100.dir/build.make warzone2100-build-
 neu/src/CMakeFiles/warzone2100.dir/build.make
     --- warzone2100-build-alt/src/CMakeFiles/warzone2100.dir/build.make
 2018-01-14 16:37:34.000000000 +0100
     +++ warzone2100-build-neu/src/CMakeFiles/warzone2100.dir/build.make
 2018-01-14 16:37:52.000000000 +0100
     @@ -46,7 +46,7 @@

      ...

      src/autorevision.h:
     -       @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --blue
 --bold --progress-dir=/tmp/warzone2100-build-alt/CMakeFiles --progress-
 num=$(CMAKE_PROGRESS_3) "Generating autorevision.h"
     -       cd /tmp/warzone2100-build-alt/src &&
 /tmp/warzone2100-github/build_tools/autorevision -t h -o /tmp/warzone2100
 -build-alt/src/autorevision.cache > /tmp/warzone2100-build-
 alt/src/autorevision.h
     +       @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --blue
 --bold --progress-dir=/tmp/warzone2100-build-neu/CMakeFiles --progress-
 num=$(CMAKE_PROGRESS_3) "Generating autorevision.h"
     +       cd /tmp/warzone2100-github &&
 /tmp/warzone2100-github/build_tools/autorevision -t h -o /tmp/warzone2100
 -build-neu/src/autorevision.cache > /tmp/warzone2100-build-
 neu/src/autorevision.h
 }}}

--
Ticket URL: <http://developer.wz2100.net/ticket/4706>
Warzone 2100 Trac <http://developer.wz2100.net/>
The Warzone 2100 Project
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Warzone2100-project mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/warzone2100-project

Reply via email to