rougier / freetype-gl

OpenGL text using one vertex buffer, one texture and FreeType
Other
1.63k stars 262 forks source link

cmake error related to glfw3 #94

Open matthewpiatt opened 8 years ago

matthewpiatt commented 8 years ago

I am unable to build this project. cmake mentions something about not having a configuration file that is able to find glfw3. I have glfw3 installed, and am compiling/linking against it just fine in other contexts.

The error is below, along with the output log that it mentions.

CMakeOutput.log.txt

mpiatt@ubu1404vm:~/Downloads/freetype-gl$ cmake .
-- The C compiler identification is GNU 4.8.4
-- The CXX compiler identification is GNU 4.8.4
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Looking for XOpenDisplay in /usr/lib/x86_64-linux-gnu/libX11.so;/usr/lib/x86_64-linux-gnu/libXext.so
-- Looking for XOpenDisplay in /usr/lib/x86_64-linux-gnu/libX11.so;/usr/lib/x86_64-linux-gnu/libXext.so - 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
-- Found X11: /usr/lib/x86_64-linux-gnu/libX11.so
-- Found OpenGL: /usr/lib/x86_64-linux-gnu/libGL.so  
-- checking for module 'freetype2'
--   found freetype2, version 17.1.11
-- Found Freetype: /usr/lib/x86_64-linux-gnu/libfreetype.so (found version "17.1.11") 
-- Found GLEW: /usr/lib/x86_64-linux-gnu/libGLEW.so  
CMake Error at CMakeLists.txt:81 (FIND_PACKAGE):
  By not providing "Findglfw3.cmake" in CMAKE_MODULE_PATH this project has
  asked CMake to find a package configuration file provided by "glfw3", but
  CMake did not find one.

  Could not find a package configuration file provided by "glfw3" with any of
  the following names:

    glfw3Config.cmake
    glfw3-config.cmake

  Add the installation prefix of "glfw3" to CMAKE_PREFIX_PATH or set
  "glfw3_DIR" to a directory containing one of the above files.  If "glfw3"
  provides a separate development package or SDK, be sure it has been
  installed.

-- Configuring incomplete, errors occurred!
See also "/home/mpiatt/Downloads/freetype-gl/CMakeFiles/CMakeOutput.log".
rougier commented 8 years ago

There is a problem with glfw3 installation. See #78. Simple fix is:

ln -s /usr/local/lib/cmake/glfw /usr/local/lib/cmake/glfw3
matthewpiatt commented 8 years ago

@rougier - thanks for responding. sorry, I quickly did a keyword search for my issue but didn't come across #78. (doh, must have only looked at "open" issues).

anyways, that command (and a few other attempts) doesn't work for me. I'm using Ubuntu 14.04. I have libglfw3 and libglfw3-dev installed, (both are 3.0.4-2~trusty)

$ ln -s /usr/local/lib/cmake/glfw /usr/local/lib/cmake/glfw3
ln: failed to create symbolic link ‘/usr/local/lib/cmake/glfw3’: No such file or directory
adrianbroher commented 8 years ago

@rougier

Simple fix is: ln -s /usr/local/lib/cmake/glfw /usr/local/lib/cmake/glfw3

This applies only to Mac, when you have installed GLFW3 with homebrew.

@matthewpiatt

anyways, that command (and a few other attempts) doesn't work for me. I'm using Ubuntu 14.04. I have libglfw3 and libglfw3-dev installed, (both are 3.0.4-2~trusty)

The directories are somewhat different on Ubuntu. Check if my comment on the initial pull request fixes the problem for you. Don't forget to delete the CMakeCache beforehand to prevent cmake from taking old or wrong cache entries. Also you should file a bug in Ubuntu against the GLFW3 package so that they either fix it in the package or upstream (see glfw/glfw#483 and glfw/glfw#460 for more details).

rougier commented 8 years ago

Has this issue been fixed in the end ?

cirosantilli commented 8 years ago

@rougier I'm also on Ubuntu (15.10).

Like the OP, I also have libglfw3-dev installed.

The required files simply do not exist in any Ubuntu package:

apt-file search glfw3-config.cmake
apt-file search glfw3Config.cmake
cirosantilli commented 8 years ago

Ah, think I've found a Debian packaging bug report that requests cmake files to be packaged: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=812853

Also, if you clone https://github.com/glfw/glfw and build, glfw3Config.cmake appears under build/src (generated from https://github.com/glfw/glfw/blob/master/src/glfw3Config.cmake.in I suppose).

Arch properly packages them for example: https://www.archlinux.org/packages/community/x86_64/glfw/files/

rougier commented 8 years ago

So it's mostly a glfw issue I guess

cirosantilli commented 8 years ago

Debian packaging bug it seems

cirosantilli commented 8 years ago

Ah, and installing from source as in https://github.com/rougier/freetype-gl/blob/a4cfb9abac19a0ab62b625a9b6f856e032fe3732/.travis.yml#L16 works as well of course... had missed it, great work. Don't forget to apply the fix https://github.com/rougier/freetype-gl/blob/master/.travis.yml#L23

rougier commented 8 years ago

Thanks for all your effort ! Would you care writing the INSTALL.txt file since you've gone through all the problems ?