Hi guys,
I have been trying to setup for a couple of days a new project using the cpp gradle (2.9) plugin with GLM and GLFW as pre-built library projects but have not managed yet. I am not really familiar myself with this libraries, so maybe has already experience including them in a project.
This is my build.gradle file:
model {
repositories {
libs(PrebuiltLibraries) {
glfw {
headers.srcDir "libs/glfw-3.1.2/include"
}
glm {
// There no convenient way to include headers recursively (this seems to be a bug?)
//headers.srcDir "libs/glm/glm/**/*.hpp"
headers.srcDir "lib/glm"
}
}
}
}
// Executables
model {
components {
main(NativeExecutableSpec) {
// Source-library
sources {
cpp {
source {
srcDir "src/"
}
lib library: "glfw", linkage: "api"
lib library: "glm", linkage: "api"
}
}
}
}
}
// All-binaries
model {
binaries {
all {
// Define a preprocessor macro for every binary
cppCompiler.define "NDEBUG"
// Define toolchain-specific compiler and linker options
if (toolChain in Gcc) {
cppCompiler.args "-O2", "-fno-access-control"
linker.args "-Xlinker", "-S"
}
if (toolChain in VisualCpp) {
cppCompiler.args "/Zi"
linker.args "/DEBUG"
}
}
}
}
My problem is that when I try to compile the application, does not manage to find glm headers. The application using CMake is just working fine.
:compileMainExecutableMainCpp
/Users/javier-tarazaga/Development/personal/engine-POC/superName/sdk/engine/src/renderer.cpp:2:10: fatal error: 'glm/gtc/matrix_transform.hpp' file not found
#include <glm/gtc/matrix_transform.hpp>
^
1 error generated.
:compileMainExecutableMainCpp FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':compileMainExecutableMainCpp'.
> A build operation failed.
C++ compiler failed while compiling renderer.cpp.
Thanks!