Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SVN] Append Homebrewed Qt5 path to CMake search prefix #36

Closed
wants to merge 1 commit into from
Closed

[SVN] Append Homebrewed Qt5 path to CMake search prefix #36

wants to merge 1 commit into from

Conversation

mofeing
Copy link

@mofeing mofeing commented Jan 21, 2020

I had some problems while trying to compile TeXmacs in macOS with Qt5. Apparently, it is a recurrent problem in homebrew-installed qt that Homebrew installs it in a non-expected path by the CMake config files (Homebrew/homebrew-core#8392).

This PR commits the solution proposed in Homebrew/homebrew-core#8392 (comment) and ensures that Qt5 can be found by CMake.

I now manage to build it but still got problems when launching it.

This ensures it can be found by CMake since it is not in the default /usr/local prefix. Homebrew installs Qt5 in /usr/local/opt/qt5. More info in Homebrew/homebrew-core#8392 (comment)
@mofeing mofeing requested a review from da-liii January 22, 2020 14:29
@da-liii
Copy link
Contributor

da-liii commented Jan 23, 2020

Please read the wiki:

https://github.com/texmacs/texmacs/wiki/Build-with-CMake-on-MacOS

Follow it, and after make install, you will get a TeXmacs.app directory.

@da-liii
Copy link
Contributor

da-liii commented Jan 23, 2020

Please post your problems here. I need to reproduce the problem.

Copy link
Contributor

@da-liii da-liii left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please describe what is the problem and what the PR solves in detail.

@mofeing
Copy link
Author

mofeing commented Jan 23, 2020

@sadhen I now see that the description of the PR message is not very detailed. My bad.

Environment:

  • OS: macOS Catalina v10.15.2
  • Qt 5.14.0, installed through Homebrew (no qt4 installed)

Steps to reproduce:

mkdir build && cd build
cmake -DCMAKE_INSTALL_PREFIX=./TeXmacs.app/Contents/Resources -DTEXMACS_GUI=Qt ..

Output:

-- The CXX compiler identification is AppleClang 11.0.0.11000033
-- The C compiler identification is AppleClang 11.0.0.11000033
-- Check for working CXX compiler: /Library/Developer/CommandLineTools/usr/bin/c++
-- Check for working CXX compiler: /Library/Developer/CommandLineTools/usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Check for working C compiler: /Library/Developer/CommandLineTools/usr/bin/cc
-- Check for working C compiler: /Library/Developer/CommandLineTools/usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Found SQLITE3: /usr/lib/libsqlite3.dylib
-- Found Freetype: /usr/local/lib/libfreetype.dylib (found version "2.10.1")
-- Found GMP: /usr/local/include
-- Found PkgConfig: /usr/local/bin/pkg-config (found version "0.29.2")
-- Found X11: /usr/X11R6/include
-- Looking for XOpenDisplay in /usr/X11R6/lib/libX11.dylib;/usr/X11R6/lib/libXext.dylib
-- Looking for XOpenDisplay in /usr/X11R6/lib/libX11.dylib;/usr/X11R6/lib/libXext.dylib - found
-- Looking for gethostbyname
-- Looking for gethostbyname - found
-- Looking for connect
-- Looking for connect - found
-- Looking for remove
-- Looking for remove - found
-- Looking for shmat
-- Looking for shmat - found
-- Looking for IceConnectionNumber in ICE
-- Looking for IceConnectionNumber in ICE - found
-- Looking for sys/types.h
-- Looking for sys/types.h - found
-- Looking for stdint.h
-- Looking for stdint.h - found
-- Looking for stddef.h
-- Looking for stddef.h - found
-- Check size of FILE
-- Check size of FILE - failed
-- Check size of intptr_t
-- Check size of intptr_t - done
-- Check size of time_t
-- Check size of time_t - done
-- Looking for inttypes.h
-- Looking for inttypes.h - found
-- Looking for memory.h
-- Looking for memory.h - found
-- Looking for stdlib.h
-- Looking for stdlib.h - found
-- Looking for strings.h
-- Looking for strings.h - found
-- Looking for string.h
-- Looking for string.h - found
-- Looking for sys/stat.h
-- Looking for sys/stat.h - found
-- Looking for unistd.h
-- Looking for unistd.h - found
-- Looking for X11/Xlib.h
-- Looking for X11/Xlib.h - not found
-- Looking for X11/Xutil.h
-- Looking for X11/Xutil.h - not found
-- Looking for pty.h
-- Looking for pty.h - not found
-- Looking for util.h
-- Looking for util.h - found
-- Looking for gettimeofday
-- Looking for gettimeofday - found
-- Looking for dlopen
-- Looking for dlopen - found
-- Check size of void*
-- Check size of void* - done
-- Check if we are on a 64-bits computer
-- -lguile-lltdl-lgmp-lm-lltdl

>>> /usr/local/Cellar/guile@1.8/1.8.8/include
>>>/usr/local/lib/libguile.dylib;/usr/local/lib/libltdl.dylib;/usr/local/lib/libgmp.dylib;/usr/lib/libm.dylib;/usr/local/lib/libltdl.dylib
>>>
>>>guile-config - Guile version 1.8.8

-- Found ZLIB: /usr/lib/libz.dylib (found version "1.2.11")
-- Found PNG: /usr/local/lib/libpng.dylib (found version "1.6.37")
-- Performing Test ICONV_SECOND_ARGUMENT_IS_CONST
-- Performing Test ICONV_SECOND_ARGUMENT_IS_CONST - Failed
-- Found Iconv: /usr/lib/libiconv.dylib
-- Found JPEG: /usr/local/lib/libjpeg.dylib (found version "90")
-- Checking the size_t of guile strings
-- Performing Test _guile_str_size_test
-- Performing Test _guile_str_size_test - Failed
-- Checking whether ... arguments behave correctly
-- Performing Test _guile_dots_test
-- Performing Test _guile_dots_test - Failed
CMake Error at /usr/local/lib/cmake/Qt5Core/Qt5CoreConfig.cmake:15 (message):
  The imported target "Qt5::Core" references the file

     "/usr/local/.//mkspecs/macx-clang"

  but this file does not exist.  Possible reasons include:

  * The file was deleted, renamed, or moved to another location.

  * An install or uninstall procedure did not complete successfully.

  * The installation package was faulty and contained

     "/usr/local/lib/cmake/Qt5Core/Qt5CoreConfigExtras.cmake"

  but not all the files it references.

Call Stack (most recent call first):
  /usr/local/lib/cmake/Qt5Core/Qt5CoreConfigExtras.cmake:52 (_qt5_Core_check_file_exists)
  /usr/local/lib/cmake/Qt5Core/Qt5CoreConfig.cmake:202 (include)
  /usr/local/lib/cmake/Qt5/Qt5Config.cmake:28 (find_package)
  CMakeLists.txt:550 (find_package)


-- Configuring incomplete, errors occurred!
See also "/Users/mofeing/Develop/texmacs/build/CMakeFiles/CMakeOutput.log".
See also "/Users/mofeing/Develop/texmacs/build/CMakeFiles/CMakeError.log".

Description

Basically, CMake expects Qt5 to be installed in the /usr/local but Homebrew installs it in /usr/local/opt/qt5. A more detailed discussion on this problem is found in Homebrew/homebrew-core#8392, where the solution proposed is to make CMake check whether Qt5 is installed in your system using Homebrew and if so, change its search path to /usr/local/opt/qt5.

This PR applies the proposed patch. Now my machine manages to compile TeXmacs.

@da-liii
Copy link
Contributor

da-liii commented Jan 24, 2020

Thanks for you Pull Request.

After this pull request applied, we do not need to brew link qt.

@da-liii da-liii added the SVN Merged into SVN repo label Jan 24, 2020
@da-liii da-liii changed the title Append Homebrewed Qt5 path to CMake search prefix [SVN] Append Homebrewed Qt5 path to CMake search prefix Jan 24, 2020
@da-liii da-liii closed this Jan 24, 2020
@XVilka
Copy link

XVilka commented Sep 21, 2020

Hijacking the pull request because issues are disabled for some reason. Please add support of the Guile 2.x and 3.x series, TeXmacs is the only package that prevents the upgrade in the RHEL/Fedora: https://bugzilla.redhat.com/show_bug.cgi?id=1828124

Also it's time to drop 1.8 support since it's very old and being removed from many distributions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
SVN Merged into SVN repo
Projects
None yet
3 participants