-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[build] CMake: no option to install extra headers: rcamera.h
, rlgl.h
, raymath.h
#4087
Comments
rcamera.h
, rlgl.h
, raymath.h
@Peter0x44 Please, could you take a look to this issue? Do you think those libraries should be exposed? |
Hello, I can see that you have changed the title to include the I have a PR (not posted yet) that adds these headers to the list of public headers (and thus installed) by default, and then you can use |
@raysan5 I don't have any opinion on that decision. Lines 807 to 811 in ec95ee8
The install target of the makefile currently only copies raylib.h, rlgl.h and raymath.h. CMake is not different in this regard.
|
I do see an argument for not exposing rcamera.h, as users can easily make their own camera controllers (and probably should). |
@Peter0x44 thanks for letting me know, I prefer to keep the build system aligned with Makefile, in any case, users requiring the additional headers can just copy them, they don't need to be included in the build system, adding complexity and maintenance cost. |
Why not add an option to the build system or simply copy it? I'm new to raylib and wanted to use some of the functions that rcamera.h provides. Copying is indeed an option doesn't work well when raylib is used as a dependency in another project. Instead of simply copying the header during install by default, I have to patch the CMakeLists.txt to make my build work. Nice thing about CMake is that you can easily automate building dependencies. Maybe I don't understand but what complexity are you talking about @raysan5? We're talking about one or two headers that get installed. |
@samsnori any line added to a build system increase complexity and potential failures, note that build systems could be used on multiple operating systems and copying a file could require different programs. I prefer to avoid that. Copy the files manually if you need them. |
Thank you for your quick response! I might not fully grasp the complexity involved, but it seems like adding a single line to the For anyone looking to include raylib as an external dependency in their CMake build, you can follow this approach:
And use this as your External Project:
|
Hello,
I trying to set up a simple 3D first person game by including the latest release of Raylib 5.0 through the Conan dependency manager, using the 3D first person example from this repository.
As you know, the example uses the
rcamera.h
header to do the camera calculations, but I have trouble including that header file.What I can read from https://github.com/raysan5/raylib/wiki/raylib-architecture , the
rcamera.h
header comes as a separated header modules located in the source directory of the raylib project. This is all fine if you have access to the source directory when you need to build the game, but I only have access to the header files installed by building theinstall
target (a standard CMake target) since these are prebuilt and downloaded by the Conan dependency manger.I have made an ticket with the Conan dependency manager (conan-io/conan-center-index#24368) and they have told me to contact you.
I have also tried doing
cmake --build <build> --target install
, after a configuration step where I set theCMAKE_INSTALL_TARGET
variable, to check the installed headers, and the header files installed are only:Which seems to correspond with the public header declaration in
https://github.com/raysan5/raylib/blob/ae50bfa2cc569c0f8d5bc4315d39db64005b1b08/src/CMakeLists.txt#L24
.There seems to some options to customize the build different in https://github.com/raysan5/raylib/blob/ae50bfa2cc569c0f8d5bc4315d39db64005b1b08/CMakeOptions.txt , but I have tried to enable
SUPPORT_CAMERA_SYSTEM
,CUSTOMIZE_BUILD
andINCLUDE_EVERYTHING
, to no avail; no extra headers were included in the install tree.What is the intended way of procuring headers from the extra modules such as
rcamera.h
and is there some way to install these through CMake?Would it not make sense to add
rcamera.h
to the list of public headers whenSUPPORT_CAMERA_SYSTEM
is on? Or add an extra option to do so?Thanks for your time.
Please, before submitting a new issue verify and check:
Issue description
See above.
Environment
Windows 10
CMake version 3.26.4
Visual Studio 17 2022
Issue Screenshot
Code Example
Get the Raylib 5.0 source, and in the root run:
In a terminal of your choice. Then after the build is done the
install
directory should contain theinclude
andlib
directories with the installed headers and libraries, respectively, but norcamera.h
header file.The text was updated successfully, but these errors were encountered: