Skip to content

Commit

Permalink
Merge pull request #7 from AsulconS/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
AsulconS authored Oct 31, 2023
2 parents 14904b5 + 1e0a463 commit cffcc17
Show file tree
Hide file tree
Showing 100 changed files with 1,241 additions and 108,025 deletions.
15 changes: 15 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
*.h linguist-language=cpp
*.inc linguist-language=cpp
thirdparty/* linguist-vendored

* text=auto eol=lf
*.bat eol=crlf

*.icns binary
*.ico binary
*.jar binary
*.png binary
*.jpg binary
*.ttf binary
*.tza binary
Footer
9 changes: 9 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,16 @@
desktop.ini

# Builds
*.so
*.dll
*.lib
*.pdb
*.exe
examples/*.so

# Examples
examples/ball
examples/doubleWindow
examples/finn
examples/keys
examples/triangle
21 changes: 13 additions & 8 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
cmake_minimum_required(VERSION 3.12)
cmake_minimum_required(VERSION 3.20)

# Disable CYGWIN Legacy Warning
set(CMAKE_LEGACY_CYGWIN_WIN32 0)

# * Set where .dlls should go (in revision)
# Set where .dll should go
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY $<1:${CMAKE_SOURCE_DIR}>/lib)

# Set all version configuration
set(VERSION_MAJOR 0)
set(VERSION_MINOR 0)
set(VERSION_PATCH 2)
set(VERSION_MINOR 2)
set(VERSION_PATCH 0)
set(SO_VERSION ${VERSION_MAJOR}.${VERSION_MINOR})
set(FULL_VERSION ${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH})

Expand All @@ -19,9 +19,10 @@ project(HSGIL VERSION ${FULL_VERSION})
# Project options
option(HSGIL_BUILD_SHARED "Build HSGIL in shared mode [Static by default]." OFF)
option(HSGIL_BUILD_EXAMPLES "Build HSGIL examples." OFF)
option(HSGIL_DEV_OPT_1 OFF)

# Set C++11 as the standard
set(CMAKE_CXX_STANDARD 11)
# Set C++17 as the standard
set(CMAKE_CXX_STANDARD 17)

# Set generic lib name
set(HSGIL_LIB_NAME hsgil)
Expand Down Expand Up @@ -62,7 +63,7 @@ set_target_properties(${HSGIL_LIB_NAME}
PROPERTIES
VERSION ${PROJECT_VERSION}
SOVERSION ${SO_VERSION}
PUBLIC_HEADER include/hsgil.hpp
PUBLIC_HEADER include/HSGIL/hsgil.hpp
)
configure_file(${HSGIL_LIB_NAME}.pc.in ${HSGIL_LIB_NAME}.pc @ONLY)
if(HSGIL_BUILD_SHARED)
Expand Down Expand Up @@ -90,7 +91,11 @@ install(TARGETS ${HSGIL_LIB_NAME}
install(FILES ${CMAKE_BINARY_DIR}/${HSGIL_LIB_NAME}.pc
DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/pkgconfig
)
target_link_libraries(${HSGIL_LIB_NAME} opengl32)
if(WIN32)
target_link_libraries(${HSGIL_LIB_NAME} opengl32)
else()
target_link_libraries(${HSGIL_LIB_NAME} GL X11)
endif()

if(HSGIL_BUILD_EXAMPLES)
add_subdirectory(examples)
Expand Down
2 changes: 1 addition & 1 deletion LICENSE.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# HSGIL
## Handy Scalable Graphics Integration Library

HSGIL - Copyright (c) 2019-2021 Adrian Bedregal
HSGIL - Copyright (c) 2019-2022 Adrian Bedregal

This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
Expand Down
74 changes: 63 additions & 11 deletions examples/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,19 +1,71 @@
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY $<1:${CMAKE_SOURCE_DIR}/examples>)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY $<1:${CMAKE_SOURCE_DIR}>/examples)

if(HSGIL_BUILD_SHARED)
if(WIN32)
add_custom_command(
OUTPUT ${CMAKE_SOURCE_DIR}/examples/${HSGIL_LIB_NAME}.dll
$<$<CONFIG:Debug>:${CMAKE_SOURCE_DIR}/examples/${HSGIL_LIB_NAME}.pdb>
COMMAND ${CMAKE_COMMAND} -E copy
${CMAKE_SOURCE_DIR}/lib/${HSGIL_LIB_NAME}.dll
$<$<CONFIG:Debug>:${CMAKE_SOURCE_DIR}/lib/${HSGIL_LIB_NAME}.pdb>
${CMAKE_SOURCE_DIR}/examples
)
add_custom_target(HSGIL_COPY_LIBS_TO_EXAMPLES
DEPENDS ${CMAKE_SOURCE_DIR}/examples/${HSGIL_LIB_NAME}.dll
$<$<CONFIG:Debug>:${CMAKE_SOURCE_DIR}/examples/${HSGIL_LIB_NAME}.pdb>
)
else()
add_custom_command(
OUTPUT ${CMAKE_SOURCE_DIR}/examples/lib${HSGIL_LIB_NAME}.so
COMMAND ${CMAKE_COMMAND} -E copy
${CMAKE_SOURCE_DIR}/build/lib${HSGIL_LIB_NAME}.so
${CMAKE_SOURCE_DIR}/examples
)
add_custom_target(HSGIL_COPY_LIBS_TO_EXAMPLES
DEPENDS ${CMAKE_SOURCE_DIR}/examples/lib${HSGIL_LIB_NAME}.so
)
endif()
add_dependencies(HSGIL_COPY_LIBS_TO_EXAMPLES ${HSGIL_LIB_NAME})
endif()

macro(build_cpp_source filename)
add_executable(${filename} ${filename}.cpp)
add_executable(${filename} src/${filename}.cpp)
if(HSGIL_DEV_OPT_1)
target_compile_definitions(${filename}
PRIVATE
__STDC_LIB_EXT1__
C__HSGIL_DEV_OPT_1
)
else()
target_compile_definitions(${filename}
PRIVATE
__STDC_LIB_EXT1__
)
endif()
target_include_directories(${filename} PRIVATE ../include)
target_include_directories(${filename} PRIVATE ../include/HSGIL/external)
target_include_directories(${filename} PRIVATE "C:/Program Files (x86)/Visual Leak Detector/include")
target_link_directories(${filename} PRIVATE "C:/Program Files (x86)/Visual Leak Detector/lib/Win64")
target_link_libraries(${filename} LINK_PUBLIC ${HSGIL_LIB_NAME} opengl32 vld)
add_custom_command(TARGET ${filename} POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_if_different
$<TARGET_FILE:${HSGIL_LIB_NAME}>
${CMAKE_SOURCE_DIR}/examples
)
if(HSGIL_DEV_OPT_1)
target_include_directories(${filename} PRIVATE "C:/Program Files (x86)/Visual Leak Detector/include")
target_link_directories(${filename} PRIVATE "C:/Program Files (x86)/Visual Leak Detector/lib/Win64")
target_link_libraries(${filename} LINK_PUBLIC ${HSGIL_LIB_NAME} opengl32 vld)
else()
if(WIN32)
target_link_libraries(${filename} LINK_PUBLIC ${HSGIL_LIB_NAME} opengl32)
else()
target_link_libraries(${filename} LINK_PUBLIC ${HSGIL_LIB_NAME})
endif()
endif()
if(HSGIL_BUILD_SHARED)
add_dependencies(${filename} HSGIL_COPY_LIBS_TO_EXAMPLES)
endif()
endmacro(build_cpp_source)

build_cpp_source(map)
#build_cpp_source(map)
build_cpp_source(finn)
build_cpp_source(ball)
build_cpp_source(keys)
build_cpp_source(triangle)
build_cpp_source(gyroscope)
build_cpp_source(doubleWindow)
build_cpp_source(physicsTest)
build_cpp_source(shaderTester)
156 changes: 0 additions & 156 deletions examples/ball.cpp

This file was deleted.

Binary file removed examples/default.png
Binary file not shown.
Loading

0 comments on commit cffcc17

Please sign in to comment.