Improved setup process
This commit is contained in:
@@ -4,6 +4,11 @@
|
||||
cmake_minimum_required (VERSION 3.0)
|
||||
project (glowbox)
|
||||
|
||||
#
|
||||
# Set python 3 name
|
||||
#
|
||||
set (PYTHON_3 "python")
|
||||
|
||||
#
|
||||
# CMake setup
|
||||
#
|
||||
@@ -37,6 +42,27 @@ option (SFML_BUILD_WINDOW OFF)
|
||||
option (SFML_BUILD_NETWORK OFF)
|
||||
add_subdirectory(lib/SFML)
|
||||
|
||||
#
|
||||
# GLAD
|
||||
#
|
||||
if (NOT EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/lib/glad/include)
|
||||
message("Generating glad library files")
|
||||
execute_process(COMMAND ${PYTHON_3} ${CMAKE_CURRENT_SOURCE_DIR}/lib/verify_version.py OUTPUT_VARIABLE PY_VER)
|
||||
string(REGEX REPLACE "\n$" "" PY_VER "${PY_VER}")
|
||||
if (PY_VER)
|
||||
execute_process(
|
||||
COMMAND python -m glad --profile core --out-path . --generator c --spec gl
|
||||
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/lib/glad
|
||||
)
|
||||
else()
|
||||
execute_process(
|
||||
COMMAND python3 -m glad --profile core --out-path . --generator c --spec gl
|
||||
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/lib/glad
|
||||
)
|
||||
endif()
|
||||
message("Finished generating glad library files")
|
||||
endif()
|
||||
|
||||
#
|
||||
# Set include paths
|
||||
#
|
||||
|
||||
@@ -1,3 +0,0 @@
|
||||
!#/bin/bash
|
||||
cd glad
|
||||
python3 -m glad --profile core --out-path . --generator c --spec gl
|
||||
@@ -1,3 +0,0 @@
|
||||
cd glad
|
||||
python -m glad --profile core --out-path . --generator c --spec gl
|
||||
pause
|
||||
5
lib/verify_version.py
Normal file
5
lib/verify_version.py
Normal file
@@ -0,0 +1,5 @@
|
||||
import sys
|
||||
if sys.version_info[0] < 3:
|
||||
print('0')
|
||||
else:
|
||||
print('1')
|
||||
6403
src/utilities/lodepng.cpp
Normal file
6403
src/utilities/lodepng.cpp
Normal file
File diff suppressed because it is too large
Load Diff
1945
src/utilities/lodepng.h
Normal file
1945
src/utilities/lodepng.h
Normal file
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user