Am Dienstag, 2. Januar 2018 um 23:25:55, schrieb Joel Kulesza 
<jkule...@gmail.com>
> LyX Developers,
> 
> I'm having a problem building with macOS 10.12.6 and cmake 3.10.1 (with
> cmake, Qt, libmagic, autoconf, etc. provided via homebrew).
> 
> I have previously (with MacPorts) and recently (more successfully with
> homebrew) built LyX on macOS using configure.  I have never succeeded with
> cmake.  The issue comes down to magic.h not being found during 'make'.
> 
> Details below my signature suggest that libmagic is where it needs to be
> such that it should be found/included.  Configure log and CMakeCache files
> attached.
> 
> Some questions:
> 
>    1. What more can I do to coax cmake (and configure) into seeing magic.h?

You could check if cmake really didn't find magic.h
Insert at CMakeLists.txt:699
        message(STATUS "Magic_INCLUDE_DIR = ${Magic_INCLUDE_DIR}")

Also you may change the line 695 to
        ind_package(Magic REQUIRED)

>    2. Why is it that cmake cannot/does not fall back to the same builtin
>    file format detection as configure?

They are different ...

>    3. Can/should a cmake step be made to test for #include <magic.h> like
>    with configure to catch this at the cmake stage rather than later during
>    make?
> 
> Please let me know what other details would be helpful to identify why
> magic.h isn't getting included and is being treated/tested for differently
> between configure and cmake.
> 
> Thank you,
> Joel
> 
> --
> 
> I can use configure && make to build because, while it cannot find magic.h
> on my system, it has a built-in mechanism to bypass the "inadequacy."
> Following ./configure, I see:
> 
> == cannot find magic.h. Please check that the libmagic library
>    is correctly installed on your system.
>    Falling back to builtin file format detection.
> 
> 
> Note that my configure line is:
> 
> ./configure --enable-qt5 --libdir=/local/brew/lib
> --includedir=/local/brew/include --with-qt-dir=/local/brew/opt/qt5
> 
> 
> However, cmake, despite being able to locate libmagic, cannot build failing
> with:
> 
> /Users/jkulesza/GIT/lyx/src/support/filetools.cpp:48:10: fatal error:
> 'magic.h' file not found
> 

Seems, you do not have the devel package for libmagic installed

> despite having
> 
> 8874 jkulesza@gale[~/GIT/lyx/build]> la /local/brew/lib/libmagic.*
> lrwxr-xr-x  1 jkulesza  admin  44 Dec 29 21:21
> /local/brew/lib/libmagic.1.dylib ->
> ../Cellar/libmagic/5.32/lib/libmagic.1.dylib
> lrwxr-xr-x  1 jkulesza  admin  38 Dec 29 21:21 /local/brew/lib/libmagic.a
> -> ../Cellar/libmagic/5.32/lib/libmagic.a
> lrwxr-xr-x  1 jkulesza  admin  42 Dec 29 21:21
> /local/brew/lib/libmagic.dylib -> ../Cellar/libmagic/5.32/lib/libmagic.dylib
> 
> 
> and
> 
> 8875 jkulesza@gale[~/GIT/lyx/build]> la /local/brew/include/magic.h

That's it. We are searching /usr/include and /usr/local/include.
Try to add to development/cmake/modules/FindMagic.cmake:50
        find_path(Magic_INCLUDE_DIR magic.h PATHS
                /usr/include
                /usr/local/include
                /local/brew/include)


> lrwxr-xr-x  1 jkulesza  admin  39 Dec 29 21:21 /local/brew/include/magic.h
> -> ../Cellar/libmagic/5.32/include/magic.h
> 
> 
> and in my CMakeCache.txt:

        Kornel

Attachment: signature.asc
Description: This is a digitally signed message part.

Reply via email to