CMake Issue - Need Help Getting it to work with GLEW and SFML

Started by
24 comments, last by hatfarm 10 years, 8 months ago

Actually, it's not finding GLM. That's the first file included that it cannot find, so the problem is that it's not getting my include files right. I checked that I have the environment variables setup, and they are, and they point to the correct place, but it says "cannot find glm/glm.h". However, I didn't compile SFML in Linux, so I'll have to do that also. I was thinking I could just put the libraries I'm using into the include path directory if I really need to, but I'd prefer to not have to do that, since CMake should be doing that work for me.

Advertisement

Well, that is a separate issue. Glm is not part of, nor included with SFML, that's the GL math library which you have to install/build separately. I don't believe that Linux distro's include that normally so you likely need to make sure it is all good. Another item to keep in mind is that you may need to deal with the differences in '/' and '\', if you have '\' it could screw up CMake though it usually takes care of such things. Hmm, can't think of anything else at the moment though, I have never used GLM myself so not familiar with it's setup.

Yeah, I understand that, but at the beginning of my CmakeLists.txt file I have:


include_directories(
	"${PROJECT_BINARY_DIR}"
	$ENV{GLM_ROOT}
	$ENV{RAPIDXML_ROOT}
	$ENV{SFML_ROOT}/extlibs/headers
	$ENV{SFML_ROOT}/include
)

And the environment variable "GLM_ROOT" points to the location where I have GLM (it's a header only library, so nothing to compile). I have it point to the root directory /home/glm, which is where I have it point to in Windows (essentially... c:\glm there) and it works, but in Linux I have no such luck. The Makefile created under Linux doesn't seem to know where the include file is located.

Well, I figured it out. It was an issues with / vs \ . I had to fix that in the files including my included files. Now I've got to sift through all the errors and resolve them. I'm glad that defines are so easy in CMake, so I can define smart_ptr differently in windows and linux. Thanks for your help. I apologize it wasn't actually Cmake related, but it was build environment related :)

Glad it worked out again. Those slashes are a pain in the ass given that Windows just "had" to be different than everything else. :(

Yeah, it's incredibly frustrating. At least Visual Studio accepts / as well as \ .

This topic is closed to new replies.

Advertisement