building from source
This commit is contained in:
commit
157dddbd90
|
@ -0,0 +1,6 @@
|
|||
CMakeFiles
|
||||
CMakeCache.txt
|
||||
CMakeDoxyfile.in
|
||||
CMakeDoxygenDefaults.cmake
|
||||
Makefile
|
||||
cmake_install.cmake
|
|
@ -0,0 +1,6 @@
|
|||
[submodule "lib/glfw"]
|
||||
path = lib/glfw
|
||||
url = https://github.com/glfw/glfw
|
||||
[submodule "lib/glad"]
|
||||
path = lib/glad
|
||||
url = https://github.com/Dav1dde/glad
|
|
@ -0,0 +1,44 @@
|
|||
cmake_minimum_required(VERSION 3.27)
|
||||
project(glsl-basic)
|
||||
|
||||
add_subdirectory(lib/glfw)
|
||||
|
||||
include_directories(
|
||||
include/
|
||||
lib/glad/include/
|
||||
lib/glfw/include/
|
||||
)
|
||||
file(
|
||||
GLOB VENDORS_SOURCES
|
||||
lib/glad/src/glad.c
|
||||
)
|
||||
file(
|
||||
GLOB PROJECT_HEADERS
|
||||
include/*.h
|
||||
)
|
||||
file(
|
||||
GLOB PROJECT_SOURCES
|
||||
src/*.cpp
|
||||
)
|
||||
file(
|
||||
GLOB PROJECT_SHADERS
|
||||
data/shader/*.glsl
|
||||
)
|
||||
|
||||
source_group("headers" FILES ${PROJECT_HEADERS})
|
||||
source_group("shaders" FILES ${PROJECT_SHADERS})
|
||||
source_group("sources" FILES ${PROJECT_SOURCES})
|
||||
source_group("vendors" FILES ${VENDORS_SOURCES})
|
||||
|
||||
set(EXE_1_NAME loader)
|
||||
file(
|
||||
GLOB EXE_1_SOURCES
|
||||
src/main.cpp
|
||||
)
|
||||
set(CMAKE_BINARY_DIR "bin")
|
||||
|
||||
add_executable(${EXE_1_NAME} ${EXE_1_SOURCES} ${PROJECT_HEADERS}
|
||||
${PROJECT_SHADERS} ${VENDORS_SOURCES})
|
||||
target_link_libraries(${EXE_1_NAME} glfw ${GLAD_LIBRARIES})
|
||||
set_target_properties(${EXE_1_NAME} PROPERTIES
|
||||
RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/${EXE_1_NAME})
|
|
@ -0,0 +1,5 @@
|
|||
#!/bin/bash
|
||||
set -e
|
||||
cmake .
|
||||
cmake --build .
|
||||
./bin/loader/loader
|
|
@ -0,0 +1 @@
|
|||
Subproject commit 2348b07c1ab4504d60398713781d8a57880234fa
|
|
@ -0,0 +1 @@
|
|||
Subproject commit 3eaf1255b29fdf5c2895856c7be7d7185ef2b241
|
|
@ -0,0 +1,12 @@
|
|||
#include <glad/glad.h>
|
||||
|
||||
#include <GLFW/glfw3.h>
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
int main() {
|
||||
printf("foo");
|
||||
}
|
Loading…
Reference in New Issue