Skip to content
Snippets Groups Projects
Commit c870f6d2 authored by Joseph Walton-Rivers's avatar Joseph Walton-Rivers
Browse files

fix error with glfw import

parent 3e5b6b4a
No related branches found
No related tags found
No related merge requests found
...@@ -28,6 +28,7 @@ if (CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME) ...@@ -28,6 +28,7 @@ if (CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME)
cmake_find_package cmake_find_package
cmake_find_package_multi cmake_find_package_multi
OPTIONS OPTIONS
glfw:shared=True
glad:gl_profile=core glad:gl_profile=core
glad:gl_version=4.5 glad:gl_version=4.5
glad:extensions="GL_ARB_get_program_binary" glad:extensions="GL_ARB_get_program_binary"
...@@ -51,8 +52,6 @@ if (CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME) ...@@ -51,8 +52,6 @@ if (CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME)
) )
endif() endif()
execute_process( COMMAND ls ${CMAKE_BINARY_DIR} )
# testing support # testing support
include(CTest) include(CTest)
...@@ -81,13 +80,6 @@ endif() ...@@ -81,13 +80,6 @@ endif()
# end windows support # end windows support
## ##
set(FGGL_WAYLAND True)
include(GNUInstallDirs)
# depedencies
# engine # engine
#add_subdirectory(vendor/imgui/) #add_subdirectory(vendor/imgui/)
...@@ -101,6 +93,8 @@ add_subdirectory(demo) ...@@ -101,6 +93,8 @@ add_subdirectory(demo)
# INSTALL PHASE # INSTALL PHASE
# see https://decovar.dev/blog/2021/03/08/cmake-cpp-library/ # see https://decovar.dev/blog/2021/03/08/cmake-cpp-library/
## ##
include(GNUInstallDirs)
file(GLOB_RECURSE public_headers file(GLOB_RECURSE public_headers
${PROJECT_SOURCE_DIR}/include/${PROJECT_NAME}/*.hpp ${PROJECT_SOURCE_DIR}/include/${PROJECT_NAME}/*.hpp
${PROJECT_SOURCE_DIR}/include/${PROJECT_NAME}/*.h ${PROJECT_SOURCE_DIR}/include/${PROJECT_NAME}/*.h
......
...@@ -2,13 +2,9 @@ ...@@ -2,13 +2,9 @@
CACHE=/tmp/fggl/ CACHE=/tmp/fggl/
LOG=$CACHE/demo.log LOG=$CACHE/demo.log
EXE="../builds/cli/bin/FgglDemo"
# check build directory exists BUILD_PATH="builds/cli"
if [[ ! -d "builds/cli/" ]] DEMO_EXE="$PWD/$BUILD_PATH/demo/FgglDemo"
then
mkdir -p builds/cli
fi
# check cmake exists # check cmake exists
if [ ! -x "$(command -v cmake)" ]; then if [ ! -x "$(command -v cmake)" ]; then
...@@ -18,30 +14,31 @@ if [ ! -x "$(command -v cmake)" ]; then ...@@ -18,30 +14,31 @@ if [ ! -x "$(command -v cmake)" ]; then
fi fi
# if doing shader development, disable the cache to make sure changes take affect # if doing shader development, disable the cache to make sure changes take affect
rm -rf builds/cli
rm -rf $CACHE rm -rf $CACHE
# #
# build step # build step
# #
cmake -S . -B build -DCMAKE_BUILD_TYPE=debug cmake -S . -B $BUILD_PATH -DCMAKE_BUILD_TYPE=debug
cmake --build build cmake --build $BUILD_PATH
# #
# additional stuff # additional stuff
# #
EXE="gdb $EXE" #EXE="gdb $EXE"
# gamemoderun # gamemoderun
if [ -x "$(command -v gamemoderun)" ]; then if [ -x "$(command -v gamemoderun)" ]; then
EXE="gamemoderun $EXE" DEMO_EXE="gamemoderun $DEMO_EXE"
fi fi
# mangohud # mangohud
if [ -x "$(command -v mangohud)" ]; then if [ -x "$(command -v mangohud)" ]; then
EXE="mangohud --dlsym $EXE" DEMO_EXE="mangohud --dlsym $DEMO_EXE"
fi fi
pushd demo pushd demo
$EXE $DEMO_EXE
popd popd
# Executable # Executable
add_executable(FgglDemo main.cpp) add_executable(FgglDemo main.cpp)
target_link_libraries(FgglDemo fggl) target_link_libraries(FgglDemo fggl)
target_include_directories(FgglDemo PUBLIC ${PROJECT_BINARY_DIR}) #target_include_directories(FgglDemo PUBLIC ${PROJECT_BINARY_DIR})
# rssources # rssources
file(GLOB_RECURSE data data/*) file(GLOB_RECURSE data data/*)
......
...@@ -60,7 +60,6 @@ target_link_libraries(${PROJECT_NAME} PRIVATE spdlog::spdlog) ...@@ -60,7 +60,6 @@ target_link_libraries(${PROJECT_NAME} PRIVATE spdlog::spdlog)
# Graphics backend # Graphics backend
add_subdirectory(gfx) add_subdirectory(gfx)
target_link_libraries(${PROJECT_NAME} PUBLIC glfw)
# Debug backend # Debug backend
add_subdirectory(debug) add_subdirectory(debug)
......
# Sources # Sources
find_package( glfw3 REQUIRED ) find_package( glfw3 REQUIRED )
target_link_libraries(fggl PUBLIC glfw)
include(CMakePrintHelpers)
cmake_print_variables(GLFW_TARGETS)
target_link_libraries(fggl PUBLIC glfw::glfw )
target_sources(fggl target_sources(fggl
PRIVATE PRIVATE
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment