← Back to team overview

kicad-developers team mailing list archive

Re: OSX glm include dir incorrect

 

My mistake - it was only concidence that the FindGLM script worked since the
default search paths happened to have a glm/ directory.

The attached patch should fix the problem.

- Cirilo


On Thu, Dec 10, 2015 at 12:08 AM, Brano Panak <bpanak@xxxxxxxxx> wrote:

> Hi,
> on OSX in CMakeLists.txt
> find_package( GLM 0.9.5.4 REQUIRED ) in my setup (osx + brew) returns
> incorrect path resulting in compiling error glm/glm.hpp not found. Include
> path found is: /usr/local/include/glm.
> Correct should be: /usr/local/include because of includes from sources are
> <glm/glm.hpp>
> workaround could be changes in source to include <glm.hpp> or change
> includes from cmake
>
> my workaround:
> # Find GLM library
> find_path(GLM_INCLUDE_DIR "glm/glm.hpp")
> if(GLM_INCLUDE_DIR STREQUAL "GLM_INCLUDE_DIR-NOTFOUND")
>     message(STATUS "glm not found")
> else()
>     message(STATUS "glm include dir: ${GLM_INCLUDE_DIR}")
>     include_directories("${GLM_INCLUDE_DIR}")
> endif()
>
> however this will not check glm version, could you please evaluate this
> workaround?
> regards
> Brano
>
> _______________________________________________
> Mailing list: https://launchpad.net/~kicad-developers
> Post to     : kicad-developers@xxxxxxxxxxxxxxxxxxx
> Unsubscribe : https://launchpad.net/~kicad-developers
> More help   : https://help.launchpad.net/ListHelp
>
=== modified file 'CMakeModules/FindGLM.cmake'
--- CMakeModules/FindGLM.cmake	2015-12-08 10:52:09 +0000
+++ CMakeModules/FindGLM.cmake	2015-12-09 19:55:47 +0000
@@ -8,13 +8,13 @@
 endif()
 
 
-find_path( GLM_INCLUDE_DIR glm.hpp PATH_SUFFIXES glm )
+find_path( GLM_INCLUDE_DIR glm/glm.hpp )
 
 
 if( NOT ${GLM_INCLUDE_DIR} STREQUAL "" )
    
     # attempt to extract the GLM Version information from setup.hpp
-    find_file( GLM_SETUP setup.hpp PATHS ${GLM_INCLUDE_DIR} PATH_SUFFIXES core detail NO_DEFAULT_PATH )
+    find_file( GLM_SETUP setup.hpp PATHS ${GLM_INCLUDE_DIR} PATH_SUFFIXES glm/core glm/detail NO_DEFAULT_PATH )
 
     if( GLM_SETUP )
         # extract the "#define GLM_VERSION*" lines


Follow ups

References