Menu

#226 Typo in CMakeLists.txt build script

closed-fixed
None
5
2014-08-21
2014-07-29
No

On line 221 of CMakeLists.txt there is an error:

else(WIN32 AND NOT CYGWIN AND NOT MSYS)

Should be

elseif(WIN32 AND NOT CYGWIN AND NOT MSYS)

This causes build errors on non-Windows systems because symlinks cannot be created.

Discussion

  • Glenn Randers-Pehrson

    Yes there is something wrong, but I think the line should
    simply be "else()"

     
  • Rolf Timmermans

    Rolf Timmermans - 2014-07-29

    Whoops, seems this is not a typo. Well, the failure is there anyway, so I'm not sure what the behaviour should be exactly. Errors I'm seeing:

    failed to create symbolic link 'lib/libpng.pc': No such file or directory
    failed to create symbolic link 'lib/libpng-config': No such file or directory
    failed to create symbolic link 'lib/libpng.a': No such file or directory

     
    • Glenn Randers-Pehrson

      Yes, there seems to be no typo. See

      http://www.cmake.org/cmake/help/v2.8.8/cmake.html#command:if

      or

      man cmake; search for "if("

      It's not 100% clear to me what is supposed to happen when "else()" contains an optional expression, but apparently it's supposed to be the same expression as in the corresponding "if()" and just serves as a comment.

       
  • Rolf Timmermans

    Rolf Timmermans - 2014-07-29

    Also, I should add that the reason this is important is that XCode complains very loudly if the output of a build contains such error messages. I think it must detect the word "failed" or something, because the build does in fact succeed (although the symlinks are not created, obviously).

     

    Last edit: Rolf Timmermans 2014-07-29
  • Glenn Randers-Pehrson

    • status: open --> open-accepted
    • assigned_to: Glenn Randers-Pehrson
     
  • Glenn Randers-Pehrson

    Please try with line 221 being "else()", without any expression in the "()".

     

    Last edit: Glenn Randers-Pehrson 2014-07-29
  • Rolf Timmermans

    Rolf Timmermans - 2014-07-29

    Please try with line 221 being "else()", without any comment.

    That doesn't work. Getting the same errors. The problem is that a link is being made into "lib", but there is no lib directory in the build dir (I'm using out of source builds). There is also no lib directory in the source dir, though.

     

    Last edit: Rolf Timmermans 2014-07-29
    • Glenn Randers-Pehrson

      OK. The makefiles and "configure" use "mkdir -p" so we need to do the equivalent here, I suppose.

       
  • Rolf Timmermans

    Rolf Timmermans - 2014-07-30

    CMake has "cmake -E make_directory" which is cross platform and can do that. So I guess somewhere there needs to be something like this?

    ${CMAKE_COMMAND} -E make_directory ${CMAKE_CURRENT_BINARY_DIR}/lib

     
  • Glenn Randers-Pehrson

    Just after the

    get_filename_component(LINK_TARGET "${SRC_FILE}" NAME)
    

    I added this line:

    execute_process(COMMAND ${CMAKE_COMMAND} -E make_directory
    ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_LIBRARY_OUTPUT_DIRECTORY})
    

    Seems to work for me on Ubuntu, but that doesn't prove anything
    because it also works in libpng-1.6.13beta02 unmodified.

     
  • Glenn Randers-Pehrson

    Fix has been checked in to the libpng16 branch of the libpng GIT repository. Please test it.

     

    Last edit: Glenn Randers-Pehrson 2014-07-30
  • Glenn Randers-Pehrson

    libpng-1.6.13beta03 has this bugfix. Please test it.

     
  • Rolf Timmermans

    Rolf Timmermans - 2014-08-04

    Works fine now, thanks!

     
  • Glenn Randers-Pehrson

    Fixed in libpng-1.6.13.

     
  • Glenn Randers-Pehrson

    • status: open-accepted --> closed-fixed
     

Log in to post a comment.