widberg / bgfx.cmake

https://github.com/bkaradzic/bgfx.cmake. Independently maintained CMake build scripts for bgfx. Released under public domain.
https://github.com/bkaradzic/bgfx.cmake
Creative Commons Zero v1.0 Universal
286 stars 254 forks source link

VS 2017 compile error, bimg header not found #49

Closed VelocityRa closed 4 years ago

VelocityRa commented 5 years ago

I imported this to my project with

add_subdirectory(bgfx.cmake)

And I'm getting this when trying to build:

11>image.cpp
11>D:\Nikos\Programming\cpp\pctation\external\bgfx.cmake\bimg\src\image.cpp(9): fatal error C1083: Cannot open include file: 'astc-codec/astc-codec.h': No such file or directory

no errors on CMake configure.

Generator is Visual Studio 15 2017 Win64, project files generated with cmake-gui.

The file exists and it's in bgfx.cmake\bimg\3rdparty\astc-codec\include\astc-codec, but that directory is not present in the bimg project's include dirs. Putting it manually in bimg Property Pages works, but of course that's not really a solution, CMake should handle this.

Also, after doing the above hack, linking fails because ASTCDecompressToRGBA which is defined in the above file is unresolved.

I'd appreciate any help, thanks.

VelocityRa commented 5 years ago

I switched to https://github.com/JoshuaBrookover/bigg and it works fine for some reason.

JoshuaBrookover commented 5 years ago

bigg is using a pretty old version of bgfx.cmake, and also an old version of bgfx/bimg, so that could be why that works. We do build VS in our travis CI so I do not think it is broken, this might be specific to linking in bgfx to another project, which I must admit that I do not attempt very often.

I was able to build it on OS X using this method. I will have to try on Windows later.

VelocityRa commented 5 years ago

I see, thanks.