Palm-Studios / sh3redux

SILENT HILL 3 Engine Remake in OpenGL and C++
GNU General Public License v3.0
164 stars 15 forks source link

CMakesLists.txt problems #92

Closed Quaker762 closed 7 years ago

Quaker762 commented 7 years ago

I've switched over to Lubuntu (I gave up on Arch literally needing 24/7 care to work..) and I still have problems with cmake, though they aren't as bad as Arch.

  1. cmake still complains about glm not being found, however the error now gives is file or directory //include referenced by variable GLM_INCLUDE_DIRS does not exist !, which can be fixed by directly editing and removing a / from the /../../ string in usr/lib/cmake/glm/glmConfig.cmake

  2. I'm not sure what distro you're using @z33ky (you've mentioned it before but I've forgotten), but for me ld will fail trying to link -lOpenGL and -lZLIB, on Lubuntu they should be -lGL and -lz, which is similar to Windows (!?)

After all of these changes, I get an executable that can be run.

I'm going to start using cmake properly when I start working on this again (Code::Blocks on Windows though :P ), so I think these should be fixed up (plus I can learn a bit more about cmake)

z33ky commented 7 years ago

These sound like issues with (L)Ubuntu. The CMakeLists.txt does not specify -lOpenGL or -lZLIB, but uses the CMake configuration files from the system. I find this a dubious claim to make considering Ubuntu is one of the most popular distros and neither of these libraries are obscure. Are you certain your system is fully up-to-date and you didn't perhaps try this mid-update (or the system shutdown during an update)?

At least for glm I found this, so maybe check if you have version 0.9.7.6-1 installed or get a Debian package and hope it doesn't break Ubuntu.

We could also take a look at how other projects write their CMakeLists.txt to include these libraries.

Quaker762 commented 7 years ago

These sound like issues with (L)Ubuntu. The CMakeLists.txt does not specify -lOpenGL or -lZLIB, but uses the CMake configuration files from the system.

This is what was I thought was really strange. if I change PRIVATE OpenGL and PRIVATE ZLIB in source/CMakeLists.txt it will link properly (not sure how if this actually meant to affect anything???). It definitely does seem like a (L)Ubuntu problem.

Are you certain your system is fully up-to-date and you didn't perhaps try this mid-update (or the system shutdown during an update)?

Yeah, it's a fresh install of 16.04, though 17.04 is out now, so I might download and give that a crack. It is strange that this seems to happen on (as you've said) one of the most popular distros.

At least for glm I found this, so maybe check if you have version 0.9.7.6-1 installed or get a Debian package and hope it doesn't break Ubuntu.

I saw that last night, I'll give it a shot. I did fix the glm issues by modifying the glm cmake file in usr/lib/cmake/glm/

We could also take a look at how other projects write their CMakeLists.txt to include these libraries.

That might be a good idea, though I think our one is perfect and it's just the tools being petulant (which doesn't surprise me anymore laughs)