Closed Rinkaa closed 3 years ago
SDL must be built and installed first. Then SDL_PATH should point to the place where you install. (Not SDL repository)
If it is already installed with apt
you could try leaving SDL_PATH empty (so that it is searched system wide)
An alternative is building sonoro1234/anima (which include both of them) and just keep the parts you are interested in.
I tried leaving SDL_PATH
blank, but the problem still persists.
Edit: The output is also the same. What log should I provide to help locate the problem?
I tried leaving
SDL_PATH
blank, but the problem still persists.
Do you mean -DSDL_PATH=""
?
Do you mean
-DSDL_PATH=""
?
I tried both -DSDL_PATH=""
and omitting it at all, both no luck. The output is the same as above.
So, as you will still need LuaJIT and may be luafilesystem I would try building https://github.com/sonoro1234/anima.
The build process is longer but you can skip IM SNDFILE and RTAUDIO.
Otherwise you could try to edit CMakeLists.txt FIND_PACKAGE(SDL2 REQUIRED PATHS ${SDL_PATH})
to FIND_PACKAGE(SDL2 REQUIRED)
After changing FIND_PACKAGE(SDL2 REQUIRED PATHS ${SDL_PATH})
to FIND_PACKAGE(SDL2 REQUIRED)
, cmake
executed successfully! Thank you for your rescuing <3
After this make
couldn't find SDL headers since the code is including the headers with SDL.h
not SDL2/SDL.h
, so I again changed CMakeLists.txt a little, manually sended the SDL2 path to include, and finally it compiled all right.
After this
make
couldn't find SDL headers since the code is including the headers withSDL.h
notSDL2/SDL.h
, so I again changed CMakeLists.txt a little, manually
Could you please send cmake output after changing only FIND_PACKAGE(SDL2 REQUIRED)
?
Also what else did you changed manually?
Changing only FIND_PACKAGE(SDL2 REQUIRED)
:
SomeFolder/LuaJIT-ImGui/build$ cmake -G"Unix Makefiles" -DCMAKE_BUILD_TYPE=RelWithDebInfo -DIMPL_SDL=yes -DIMPL_OPENGL2=yes -DIMPL_OPENGL3=yes -DIMPL_EXTRAS=yes -DLUAJIT_BIN="/usr/local/share/luajit-imgui/" ..
-- The C compiler identification is GNU 9.3.0
-- The CXX compiler identification is GNU 9.3.0
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- GLFW_PATHnotdefined
-- SDL_PATH not defined
-- Configuring done
-- Generating done
-- Build files have been written to: SomeFolder/LuaJIT-ImGui/build
SomeFolder/LuaJIT-ImGui/build$ make
...
[ 86%] Built target cimgui_base
Scanning dependencies of target cimgui_sdl
[ 89%] Building CXX object CMakeFiles/cimgui_sdl.dir/cimgui/imgui/backends/imgui_impl_sdl.cpp.o
SomeFolder/LuaJIT-ImGui/cimgui/imgui/backends/imgui_impl_sdl.cpp:55:10: fatal error: SDL.h: No such file or directory
55 | #include <SDL.h>
| ^~~~~~~
compilation terminated.
make[2]: *** [CMakeFiles/cimgui_sdl.dir/build.make:63: CMakeFiles/cimgui_sdl.dir/cimgui/imgui/backends/imgui_impl_sdl.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:80: CMakeFiles/cimgui_sdl.dir/all] Error 2
make: *** [Makefile:130: all] Error 2
After this, I manually changed CMakeLists.txt by adding one line (At line 147):
else(DEFINED SDL_PATH)
message(STATUS "SDL_PATH not defined")
set(IMGUI_SDL_LIBRARY SDL2)
include_directories(${SDL2_INCLUDE_DIR}) # the added line
endif(DEFINED SDL_PATH)
Then remove the build folder, cmake again with SDL2_INCLUDE_DIR
set to a local position:
SomeFolder/LuaJIT-ImGui/build$ cmake -G"Unix Makefiles" -DCMAKE_BUILD_TYPE=RelWithDebInfo -DIMPL_SDL=yes -DIMPL_OPENGL2=yes -DIMPL_OPENGL3=yes -DIMPL_EXTRAS=yes -DSDL2_INCLUDE_DIR="/usr/include/SDL2/" -DLUAJIT_BIN="/usr/local/share/luajit-imgui/" ..
-- The C compiler identification is GNU 9.3.0
-- The CXX compiler identification is GNU 9.3.0
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- GLFW_PATHnotdefined
-- SDL_PATH not defined
-- Configuring done
-- Generating done
-- Build files have been written to: SomeFolder/LuaJIT-ImGui/build
SomeFolder/LuaJIT-ImGui/build$ make
Scanning dependencies of target cimgui_base
[ 3%] Building CXX object CMakeFiles/cimgui_base.dir/cimgui/cimgui.cpp.o
[ 6%] Building CXX object CMakeFiles/cimgui_base.dir/cimgui/imgui/imgui.cpp.o
[ 10%] Building CXX object CMakeFiles/cimgui_base.dir/cimgui/imgui/imgui_draw.cpp.o
[ 13%] Building CXX object CMakeFiles/cimgui_base.dir/cimgui/imgui/imgui_demo.cpp.o
[ 17%] Building CXX object CMakeFiles/cimgui_base.dir/cimgui/imgui/imgui_widgets.cpp.o
[ 20%] Building CXX object CMakeFiles/cimgui_base.dir/cimplot/cimplot.cpp.o
[ 24%] Building CXX object CMakeFiles/cimgui_base.dir/cimplot/implot/implot.cpp.o
[ 27%] Building CXX object CMakeFiles/cimgui_base.dir/cimplot/implot/implot_items.cpp.o
[ 31%] Building CXX object CMakeFiles/cimgui_base.dir/cimplot/implot/implot_demo.cpp.o
[ 34%] Building CXX object CMakeFiles/cimgui_base.dir/cimguizmo/cimguizmo.cpp.o
[ 37%] Building CXX object CMakeFiles/cimgui_base.dir/cimguizmo/ImGuizmo/ImGuizmo.cpp.o
[ 41%] Building CXX object CMakeFiles/cimgui_base.dir/cimguizmo_quat/cimguizmo_quat.cpp.o
[ 44%] Building CXX object CMakeFiles/cimgui_base.dir/cimguizmo_quat/imGuIZMO.quat/imGuIZMO.quat/imGuIZMOquat.cpp.o
[ 48%] Building CXX object CMakeFiles/cimgui_base.dir/cimnodes/cimnodes.cpp.o
[ 51%] Building CXX object CMakeFiles/cimgui_base.dir/cimnodes/imnodes/imnodes.cpp.o
[ 55%] Building CXX object CMakeFiles/cimgui_base.dir/cimnodes_r/cimnodes_r.cpp.o
[ 58%] Building CXX object CMakeFiles/cimgui_base.dir/cimnodes_r/ImNodes/ImNodes.cpp.o
[ 62%] Building CXX object CMakeFiles/cimgui_base.dir/cimnodes_r/ImNodes/ImNodesEz.cpp.o
[ 65%] Building CXX object CMakeFiles/cimgui_base.dir/cimgui/imgui/imgui_tables.cpp.o
[ 68%] Building CXX object CMakeFiles/cimgui_base.dir/cimgui/imgui/backends/imgui_impl_opengl3.cpp.o
[ 72%] Building C object CMakeFiles/cimgui_base.dir/cimgui/imgui/examples/libs/gl3w/GL/gl3w.c.o
[ 75%] Building CXX object CMakeFiles/cimgui_base.dir/extras/cimgui_extras.cpp.o
[ 79%] Building CXX object CMakeFiles/cimgui_base.dir/cimgui/imgui/backends/imgui_impl_opengl2.cpp.o
[ 82%] Building CXX object CMakeFiles/cimgui_base.dir/extras/knob.cpp.o
[ 86%] Building CXX object CMakeFiles/cimgui_base.dir/extras/curve.cpp.o
[ 86%] Built target cimgui_base
Scanning dependencies of target cimgui_sdl
[ 89%] Building CXX object CMakeFiles/cimgui_sdl.dir/cimgui/imgui/backends/imgui_impl_sdl.cpp.o
[ 93%] Linking CXX shared library libcimgui_sdl.so
[ 93%] Built target cimgui_sdl
Scanning dependencies of target cimgui_glfw
[ 96%] Building CXX object CMakeFiles/cimgui_glfw.dir/cimgui/imgui/backends/imgui_impl_glfw.cpp.o
[100%] Linking CXX shared library libcimgui_glfw.so
[100%] Built target cimgui_glfw
Thankyou but I would still need one test: only FIND_PACKAGE(SDL2 REQUIRED)
changed and in cmake -DSDL_PATH=""
Only FIND_PACKAGE(SDL2 REQUIRED)
, no added line, cmake with -DSDL_PATH=""
:
SomeFolder/LuaJIT-ImGui/build$ cmake -G"Unix Makefiles" -DCMAKE_BUILD_TYPE=RelWithDebInfo -DIMPL_SDL=yes -DIMPL_OPENGL2=yes -DIMPL_OPENGL3=yes -DIMPL_EXTRAS=yes -DSDL_PATH="" -DLUAJIT_BIN="/usr/local/share/luajit-imgui/" ..
-- The C compiler identification is GNU 9.3.0
-- The CXX compiler identification is GNU 9.3.0
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- GLFW_PATHnotdefined
-- SDL_PATH defined as
-- sdlfound
CMake Warning (dev) at CMakeLists.txt:134 (get_target_property):
Policy CMP0045 is not set: Error on non-existent target in
get_target_property. Run "cmake --help-policy CMP0045" for policy details.
Use the cmake_policy command to set the policy and suppress this warning.
get_target_property() called with non-existent target "SDL2::SDL2".
This warning is for project developers. Use -Wno-dev to suppress it.
-- sdlinclude is SDL_INCLUDE-NOTFOUND
CMake Error: The following variables are used in this project, but they are set to NOTFOUND.
Please set them or make sure they are set and tested correctly in the CMake files:
SDL_INCLUDE
used as include directory in directory SomeFolder/LuaJIT-ImGui
used as include directory in directory SomeFolder/LuaJIT-ImGui
used as include directory in directory SomeFolder/LuaJIT-ImGui
used as include directory in directory SomeFolder/LuaJIT-ImGui
used as include directory in directory SomeFolder/LuaJIT-ImGui
used as include directory in directory SomeFolder/LuaJIT-ImGui
used as include directory in directory SomeFolder/LuaJIT-ImGui
used as include directory in directory SomeFolder/LuaJIT-ImGui
used as include directory in directory SomeFolder/LuaJIT-ImGui
-- Configuring incomplete, errors occurred!
See also "SomeFolder/LuaJIT-ImGui/build/CMakeFiles/CMakeOutput.log".
Thanks
Just updated CMakeLists.txt to improve finding SDL
I am on Linux Mint 20, and
libsdl2-dev
is installed with apt. I checked out bothLuaJIT-ImGui
andLuaJIT-SDL2
. The folder structure was:After looking at the example build scirpt in
/build
, I was trying withThe output was:
Was I wrong pointing to a suitable
SDL_PATH
? I am a bit confused seeingsdlfound
. Reading up theCMakeLists.txt
I guess there was problem gettingSDL_INCLUDE
withSDL::SDL2
from the givenSDL_PATH
, but I can't figure out which folder I need to point it to. Sorry if my question is a bit dumb, I am not very familiar with cmake tbh.