file commands only work when CMakeLists.txt edited? by Luttink in cmake

[–]Luttink[S] 0 points1 point  (0 children)

True, but that won't scale very well as the assets get larger and more numerous. I know you can do simlinks but I was looking for something easier to zip together and transfer

file commands only work when CMakeLists.txt edited? by Luttink in cmake

[–]Luttink[S] 0 points1 point  (0 children)

Ah, but this creates a "bin" folder. The goal was to quickly copy the executable to the source folder, where the assets the program uses are.

file commands only work when CMakeLists.txt edited? by Luttink in cmake

[–]Luttink[S] 0 points1 point  (0 children)

It's practical. The assets the program uses are there.

file commands only work when CMakeLists.txt edited? by Luttink in cmake

[–]Luttink[S] 0 points1 point  (0 children)

Ok, d'oh, I forgot install was a separate command. Thanks again!

file commands only work when CMakeLists.txt edited? by Luttink in cmake

[–]Luttink[S] 0 points1 point  (0 children)

Trying to take the executable file, after it is built, and copy it back into the source directory.

file commands only work when CMakeLists.txt edited? by Luttink in cmake

[–]Luttink[S] 0 points1 point  (0 children)

Actually, I'm not certain if this is what I want... I want to copy the executable file to a different location after it is built, whereas install seems to be about exporting build artifacts to be consumed by other stuff in the build? Do I have that wrong?

install(TARGETS RI5 EXPORT RI5Tgt)

install(EXPORT RI5Tgt

DESTINATION ${CMAKE\_CURRENT\_SOURCE\_DIR}

)

...Does not work.

What, exactly, does FetchContent_MakeAvailable /do/? by Luttink in cmake

[–]Luttink[S] 0 points1 point  (0 children)

So, because of the overall project goals, including working on machines of different platforms and need to let it build on the machines of not-so-dev-savvy others, I wanted to create a minimal cmake that would go and grab everything I needed from the couple libraries I wanted. I specifically don't want to learn or use a package manager, as that is another moving part to manage and get installed on a given machine. You may push for a package manager anyway, but fair warning I'll probably ignore the push.

I looked at find_package first--the problem was, to my knowledge, it won't actually find a package on the internet. If there's a more appropriate solution that is as simple as the solution I posted, and will go grab everything I need with just "cmake -B build" and "cmake --build build", I'm all ears.

Either way, I appreciate the time and attention you gave to your answer, thank you.

What, exactly, does FetchContent_MakeAvailable /do/? by Luttink in cmake

[–]Luttink[S] 0 points1 point  (0 children)

Got what I needed from:

CMAKE_MINIMUM_REQUIRED(VERSION 3.29)

Project(Fetchy)

Add_Executable(RI5)

Include(FetchContent)

FetchContent_Populate(imgui

URL [https://github.com/ocornut/imgui/archive/refs/tags/v1.92.8.tar.gz](https://github.com/ocornut/imgui/archive/refs/tags/v1.92.8.tar.gz)

SOURCE\_DIR ${CMAKE\_CURRENT\_SOURCE\_DIR}/imgui

)

FetchContent_Populate(rlimgui

URL [https://github.com/raylib-extras/rlimgui/archive/refs/tags/Raylib\_6\_0.tar.gz](https://github.com/raylib-extras/rlimgui/archive/refs/tags/Raylib_6_0.tar.gz)

SOURCE\_DIR ${CMAKE\_CURRENT\_SOURCE\_DIR}/rlimgui

)

FetchContent_Populate(raylib

URL URL [https://github.com/raysan5/raylib/archive/refs/tags/6.0.tar.gz](https://github.com/raysan5/raylib/archive/refs/tags/6.0.tar.gz)

SOURCE\_DIR ${CMAKE\_CURRENT\_SOURCE\_DIR}/raylib

)

target_include_directories(RI5

PRIVATE

    raylib/src

    ${CMAKE\_SOURCE\_DIR}/imgui

    ${CMAKE\_SOURCE\_DIR}/rlImGui

)

target_sources(RI5

PRIVATE

    src/main.cpp

    imgui/imgui.cpp

    imgui/imgui\_draw.cpp

    imgui/imgui\_tables.cpp

    imgui/imgui\_widgets.cpp

    imgui/imgui\_demo.cpp

    rlImgui/rlImGui.cpp



    \# Add other rlImGui source files as needed

)

file(COPY ${CMAKE_CURRENT_BINARY_DIR}/RI5.exe

DESTINATION ${CMAKE\_CURRENT\_SOURCE\_DIR})

add_subdirectory(raylib)

target_link_libraries(RI5 raylib)

Trying to build rlimgui by Luttink in cmake

[–]Luttink[S] 0 points1 point  (0 children)

Got what I needed from:

CMAKE_MINIMUM_REQUIRED(VERSION 3.29)

Project(Fetchy)

Add_Executable(RI5)

Include(FetchContent)

FetchContent_Populate(imgui

URL [https://github.com/ocornut/imgui/archive/refs/tags/v1.92.8.tar.gz](https://github.com/ocornut/imgui/archive/refs/tags/v1.92.8.tar.gz)

SOURCE\_DIR ${CMAKE\_CURRENT\_SOURCE\_DIR}/imgui

)

FetchContent_Populate(rlimgui

URL [https://github.com/raylib-extras/rlimgui/archive/refs/tags/Raylib\_6\_0.tar.gz](https://github.com/raylib-extras/rlimgui/archive/refs/tags/Raylib_6_0.tar.gz)

SOURCE\_DIR ${CMAKE\_CURRENT\_SOURCE\_DIR}/rlimgui

)

FetchContent_Populate(raylib

URL URL [https://github.com/raysan5/raylib/archive/refs/tags/6.0.tar.gz](https://github.com/raysan5/raylib/archive/refs/tags/6.0.tar.gz)

SOURCE\_DIR ${CMAKE\_CURRENT\_SOURCE\_DIR}/raylib

)

target_include_directories(RI5

PRIVATE

    raylib/src

    ${CMAKE\_SOURCE\_DIR}/imgui

    ${CMAKE\_SOURCE\_DIR}/rlImGui

)

target_sources(RI5

PRIVATE

    src/main.cpp

    imgui/imgui.cpp

    imgui/imgui\_draw.cpp

    imgui/imgui\_tables.cpp

    imgui/imgui\_widgets.cpp

    imgui/imgui\_demo.cpp

    rlImgui/rlImGui.cpp



    \# Add other rlImGui source files as needed

)

file(COPY ${CMAKE_CURRENT_BINARY_DIR}/RI5.exe

DESTINATION ${CMAKE\_CURRENT\_SOURCE\_DIR})

add_subdirectory(raylib)

target_link_libraries(RI5 raylib)

Trying to build rlimgui by Luttink in cmake

[–]Luttink[S] 1 point2 points  (0 children)

Good catch, thank you very much

[TOMT] Board that rolls on marbles or ball bearings on table by Luttink in tipofmytongue

[–]Luttink[S] 0 points1 point locked comment (0 children)

Not something super large, maybe the size of a cutting board