Giter Club home page Giter Club logo

Comments (9)

scheibel avatar scheibel commented on June 12, 2024

The process you describe sounds like one of the intentionally supported ones.
When using a glbinding build from source, the glbinding-config.cmake should be right in the root of the repository and the environment variable glbinding_DIR should point to the repository root. Alternatively, you can point the environment variable CMAKE_PREFIX_PATH to the directory containing the glbinding directory (which is then expected to be named glbinding, cf. https://cmake.org/cmake/help/latest/variable/CMAKE_PREFIX_PATH.html).
There is one peculiarity regarding the CMake build: We expect a separate build directory and it is expected to be named build (cf. https://github.com/cginternals/glbinding/blob/master/glbinding-config.cmake#L49).

However, it seems as if there is an issue with finding the first glbinding-config.cmake file. Can you check why your source build seems to be missing this file although it should be provided with the sources?

from globjects.

GooksanGom avatar GooksanGom commented on June 12, 2024

When using a glbinding build from source, the glbinding-config.cmake should be right in the root of the repository

omg I didn't even think that that file is what I was looking for.
I was searching only in the build after I saw that glm generated its config file in its build. There is glbinding-config.cmake in the root of the repository, but I thought it is a different file that just have same name because CMake failed when I set glbinding_DIR to the root directory.

There is one peculiarity regarding the CMake build: We expect a separate build directory and it is expected to be named build

I had build directory in the root.
(I see cmake, deploy, source directories with the build... so that means it is not separate right?)
and I had created x86, x64 directories in the build. so... the actual name of build directory is not build.
These might be the reason that CMake failed when I set glbinding_DIR to the root and also the reason that glbinding_DIR is set to not found in the CMake GUI.

I moved build out of the root directory, removed x86, x64 and moved all contents in x86 into build. I copied glbinding-config.cmake into build and now CMake works!
(but what if I want to generate the x64 version too? do I have to just leave a room for x64 by putting the x86 version somewhere?)

Thanks!

from globjects.

scheibel avatar scheibel commented on June 12, 2024

I assume the x68 and x64 directories were the problem. Anyone using Windows has a hint? @sbusch42 @cgcostume

from globjects.

GooksanGom avatar GooksanGom commented on June 12, 2024

I think CMake with globjects works only if build is exactly one level out of the root directory.
For example, CMake worked without any error in the following directory structure:

glbinding-3.1.0
├ 3rdparty
├ cmake
├ data
├ deploy
├ docs
├ source
└ [files including glbinding-config.cmake]
build
├ 3rdparty
└ whatever CMake generated for glbinding

However, CMake failed with the following error message if build is not in the same level of the root (I did manually set glbinding_DIR to glbinding-3.1.0).

CMake Error at source/globjects/CMakeLists.txt:7 (find_package):
  Found package configuration file:

    D:/Libraries/glbinding-3.1.0/glbinding-config.cmake

  but it set glbinding_FOUND to FALSE so package "glbinding" is considered to
  be NOT FOUND.

In the above case, the build is in ..\builds\x86\ from the root directory.

A question I have is, is the purpose of glbinding_DIR to locate the root directory of the glbinding sources or to locate build?
I guessed it is for the root directory, because glmConfig.cmake tells CMake where the root directory of glm sources is. The glbinding-config.cmake is actually in the root directory so that I think CMake will succeed to find the root directory easily, and apparently it didn't.

I have been studying CMake in a tutorial website since when I faced this problem at the first place.
but I still need to study hard in order to understand the CMake script and figure out how to edit it to make it work.

Any answer or opinion will help me to solve the problem and to study CMake.
Thanks in advance.

EDIT: glm_DIR was actually GLM_INCLUDE_DIR. glmConfig.cmake has nothing to do with this. I misunderstood.

from globjects.

scheibel avatar scheibel commented on June 12, 2024

We actually expect the build directory to be one level below the root:

glbinding-3.1.0
├ build
└ [remaining glbinding source files]

The purpose of glbinding_DIR is to point to the glbinding-config.cmake. From there, our script within this file tries to locate the auto-generated import files (such as glbinding-export.cmake).
For this, we hard-coded some directories within the glbinding-config.cmake file, including a build directory that is located in the same directory as the config file.

from globjects.

GooksanGom avatar GooksanGom commented on June 12, 2024

I copied glbinding-config.cmake into each build (builds\x86\build, builds\x64\build) and CMake succeeded to generate solutions. I am not sure that the file is supposed to be copied into build.

I tried building the generated solution and the build failed with many lines of error messages that says "'glbinding/callbacks.h': No such file or directory".

In the [globjects]-[properties]-[C/C++]-[General]-[Additional Include Directories],
the following items are listed:

D:\Libraries\globjects-1.0.0-builds\vs15\x86-static\build\source\include
D:\Libraries\globjects-1.0.0\source\globjects\include
D:\Libraries\globjects-1.0.0-builds\vs15\x86-static\build\source\globjects\include
D:\Libraries\glm-0.9.9.5\glm
D:\Libraries\glbinding-3.1.0\source\glbinding\include
D:\Libraries\glbinding-3.1.0-builds\vs15\x86-static\build\source\glbinding\include
D:\Libraries\glbinding-3.1.0\3rdparty\KHR\include
%(AdditionalIncludeDirectories)

It seems that MSVC cannot find glbinding's files with the paths.
Maybe glbinding-config.cmake was not supposed to be copied?

The copied glbinding-config.cmake could direct wrong include paths.
Could you tell me some right include paths that CMake script originally intended to?
I think I can manage to build globjects if I set these to the right paths.

Thanks!

from globjects.

sbusch42 avatar sbusch42 commented on June 12, 2024

Don't copy the file into the build directory. This cannot work because the cmake file searches also for files which are not in the build directory (aka, the headers). Please try another approach: Just edit glbinding-config.cmake to fit your directory structure. At the end of the file, you see where we expect the build directory:

  • find_modules("build/cmake")
  • find_modules("build-debug/cmake")

Just add your build directory location there and point glbinding_DIR (or better CMAKE_PREFIX_PATH) to glbinding's root directory. Let us know if this works.

from globjects.

GooksanGom avatar GooksanGom commented on June 12, 2024

We actually expect the build directory to be one level below the root:

glbinding-3.1.0
├ build
└ [remaining glbinding source files]

The purpose of glbinding_DIR is to point to the glbinding-config.cmake. From there, our script within this file tries to locate the auto-generated import files (such as glbinding-export.cmake).
For this, we hard-coded some directories within the glbinding-config.cmake file, including a build directory that is located in the same directory as the config file.

You mean, build and glbinding-config.cmake should be in glbinding-3.1.0, and there cannot be any intermediate directories such as x86 in build right?

Now I understand what I should have done and shouldn't.
The problem was purely due to the x86 and 64 in build at the first place.
Hmm... I have done misunderstand everything.

Forget about my last comments. I think it will solve the problem clearly.
Thanks!

from globjects.

GooksanGom avatar GooksanGom commented on June 12, 2024

Don't copy the file into the build directory. This cannot work because the cmake file searches also for files which are not in the build directory (aka, the headers). Please try another approach: Just edit glbinding-config.cmake to fit your directory structure. At the end of the file, you see where we expect the build directory:

  • find_modules("build/cmake")
  • find_modules("build-debug/cmake")

Just add your build directory location there and point glbinding_DIR (or better CMAKE_PREFIX_PATH) to glbinding's root directory. Let us know if this works.

I set CMake build directory to glbinding-3.1.0\build\x86 for Win32 target platform
and edited the file as follows:

if("${CMAKE_VS_PLATFORM_NAME}" STREQUAL "Win32")
        find_modules("build/x86/cmake")
elseif("${CMAKE_VS_PLATFORM_NAME}" STREQUAL "x64")
        find_modules("build/x64/cmake")
endif()

It works without any errors.
That is exactly what I was looking for.

Thanks!

  • I could go further with ${CMAKE_GENERATOR} and ${BUILD_SHARED_LIBS} to set different paths depending on the settings.

from globjects.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.