Menu

#24 [PATCH] Fix build with cmake >= 3.12

SVN TRUNK
closed
nobody
None
2018-12-30
2018-07-20
heirecka
No

Podofo currently fails to build with cmake 3.12.0:

[ 64%] Linking CXX executable TokenizerTest ...
Error copying directory from "/var/tmp/paludis/build/app-text-podofo-0.9.6/work/podofo-0.9.6/test/TokenizerTest/objects" to "/var/tmp
/paludis/build/app-text-podofo-0.9.6/work/build/test/TokenizerTest/objects".

This is because cmake 3.12.0 changed the behaviour of cmake -E copy_directory [1] and test/TokenizerTest/objects doesn't exist (contrary to ObjectParserTest/objects and CreationTest/resources which also use cmake -E copy_directory). I honestly don't know why that's the case and as a workaround just changed the CMakeLists.txt to stop copying a non-existant directory.

[1] https://cmake.org/cmake/help/v3.12/release/3.12.html#other-changes

1 Attachments

Discussion

  • Matthew Brincke

    Matthew Brincke - 2018-08-28

    Why shouldn't I just create the missing directory? I wouldn't like to lose the copying code in case some files could be added to it in the future.

     
  • heirecka

    heirecka - 2018-08-29

    Well, I'd argue that "copying" nothing obviously does nothing and when some files were to be added in the future the need to re-add this code will become apparent easily enough. Plus, the code is under version control and there are two other instances, so nothing would be lost.

    It's easy enough to add a COMMAND "${CMAKE_COMMAND}" -E make_directory "${CMAKE_CURRENT_SOURCE_DIR}/objects" if you prefer that though.

     
  • zyx

    zyx - 2018-09-30

    I agree with heirecka, if the code does nothing, then there's no need to maintain it.

     
  • zyx

    zyx - 2018-09-30

    I committed your patch as r1942:
    http://sourceforge.net/p/podofo/code/1942

     
  • zyx

    zyx - 2018-09-30
    • status: open --> closed
     
  • deema alomair

    deema alomair - 2018-12-29

    hello
    i tried to installed the latest version of podofo in mac os but i have the same error
    where should i put the patch becasue i tried to place it in the cmakelist at the end of the file but it's does not work and i really need it
    please any help ?

     
    • Matthew Brincke

      Matthew Brincke - 2018-12-29

      The attached patch contains input for the (or a) patch tool, it isn't made for placing manually (applies generally with source code patch files in open source). Anyway, in this specific case, it just means to remove the lines with a (single) - character before them in the patch from the file named in the second line of the patch after the +++ (between the spaces, what follows is a timestamp). That is, if you have problems opening the patch file for looking at it, in the TokenizerTest's CMakeLists.txt remove the lines from the empty one directly before "# Copy the test samples over to the build tree" (without the " of course) to the line which is the nearest one (reading toward the end) which has just a ) closing parenthese character after spaces on it (inclusive, that is both the beginning and the ending line of the described part of the file are to be removed).

       

      Last edit: Matthew Brincke 2018-12-29
  • deema alomair

    deema alomair - 2018-12-29

    hello again
    sorry about that but i did not understand what you are tring to say
    it seems confusing for me
    is there any other way to do that ?

     
    • Matthew Brincke

      Matthew Brincke - 2018-12-30

      Just create the directory objects in test/TokenizerTest (relative to the top-level PoDoFo source directory). Then the build should work.

       
  • deema alomair

    deema alomair - 2018-12-30

    thank you so much i got your point and i installed it correctly