Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
G
Game Library
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Monitor
Service Desk
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Onuralp SEZER
Game Library
Commits
f4884423
Commit
f4884423
authored
2 years ago
by
Joseph Walton-Rivers
Browse files
Options
Downloads
Patches
Plain Diff
make header-only glad an export target
parent
5a2a9b3c
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
CMakeLists.txt
+34
-40
34 additions, 40 deletions
CMakeLists.txt
fggl/gfx/CMakeLists.txt
+1
-1
1 addition, 1 deletion
fggl/gfx/CMakeLists.txt
vendor/header_only/CMakeLists.txt
+10
-3
10 additions, 3 deletions
vendor/header_only/CMakeLists.txt
with
45 additions
and
44 deletions
CMakeLists.txt
+
34
−
40
View file @
f4884423
...
...
@@ -8,63 +8,63 @@ option(FGGL_EXAMPLES "Should we build examples or just the library" ON)
option
(
FGGL_TESTS
"Should we enable the testing suite?"
ON
)
option
(
FGGL_DOCS
"Should we build documentation?"
ON
)
##
# Windows
# When on windows, integrate vcpkg
##
if
(
DEFINED ENV{VCPKG_ROOT} AND NOT DEFINED CMAKE_TOOLCHAIN_FILE
)
set
(
CMAKE_TOOLCHAIN_FILE
"$ENV{VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake"
CACHE STRING
""
)
endif
()
##
# /windows
##
# Define the project
project
(
fggl
VERSION 0.1
DESCRIPTION
""
HOMEPAGE_URL
""
DESCRIPTION
"
FOSS Galaxy Game Library, for use in Education, and Games
"
HOMEPAGE_URL
"
https://git.fossgalaxy.com/gamedev/fggl
"
LANGUAGES C CXX
)
include
(
GNUInstallDirs
)
if
(
CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME
)
# testing support
include
(
CTest
)
# Documentation support
if
(
FGGL_DOCS
)
find_package
(
Doxygen
)
if
(
Doxygen_FOUND
)
add_subdirectory
(
docs
)
else
()
message
(
STATUS
"Doxygen not found, not building docs"
)
endif
()
endif
()
endif
()
# export compile commands for vim/neovim users
set
(
CMAKE_EXPORT_COMPILE_COMMANDS ON
)
##
# end windows support
##
# vendor dependencies
add_subdirectory
(
vendor/imgui
)
add_subdirectory
(
vendor/header_only
)
# engine
# engine headers
file
(
GLOB_RECURSE public_headers
${
PROJECT_SOURCE_DIR
}
/include/fggl/*.hpp
)
# engine sources, enable strict compiler warnings
add_subdirectory
(
fggl
)
add_subdirectory
(
vendor/header_only
)
target_compile_options
(
fggl PRIVATE -Wall -Wpedantic -Wextra -Wodr -fno-strict-aliasing -fno-strict-overflow
)
set_property
(
TARGET fggl PROPERTY INTERPROCEDURAL_OPTIMIZATION True
)
# 3rd party integrations
add_subdirectory
(
integrations/bullet
)
## G++ enable insane checks
target_compile_options
(
${
PROJECT_NAME
}
PRIVATE -Wall -Wpedantic -Wextra -Wodr -fno-strict-aliasing -fno-strict-overflow
)
set_property
(
TARGET fggl PROPERTY INTERPROCEDURAL_OPTIMIZATION True
)
# extras
# Unit Tests
if
(
FGGL_TESTS
)
include
(
CTest
)
add_subdirectory
(
tests
)
endif
()
# Documentation support
if
(
FGGL_DOCS
)
find_package
(
Doxygen
)
if
(
Doxygen_FOUND
)
add_subdirectory
(
docs
)
else
()
message
(
STATUS
"Doxygen not found, not building docs"
)
endif
()
endif
()
# Demo project
if
(
FGGL_EXAMPLES
)
add_subdirectory
(
demo
)
target_compile_options
(
demo PRIVATE -Wall -Wextra -Wodr -Wdouble-promotion -fno-strict-aliasing -fno-strict-overflow
)
...
...
@@ -75,13 +75,7 @@ endif()
# INSTALL PHASE
# see https://decovar.dev/blog/2021/03/08/cmake-cpp-library/
##
file
(
GLOB_RECURSE public_headers
${
PROJECT_SOURCE_DIR
}
/include/
${
PROJECT_NAME
}
/*.hpp
${
PROJECT_SOURCE_DIR
}
/include/
${
PROJECT_NAME
}
/*.h
)
#include(CMakePrintHelpers)
include
(
GNUInstallDirs
)
# Structure preserving header macro
foreach
(
header
${
public_headers
}
)
...
...
This diff is collapsed.
Click to expand it.
fggl/gfx/CMakeLists.txt
+
1
−
1
View file @
f4884423
...
...
@@ -5,7 +5,7 @@ find_package( glfw3 REQUIRED )
include
(
CMakePrintHelpers
)
cmake_print_variables
(
GLFW_TARGETS
)
target_link_libraries
(
fggl PUBLIC glfw
)
target_link_libraries
(
fggl PUBLIC glfw
fggl-glad
)
target_sources
(
fggl
PRIVATE
...
...
This diff is collapsed.
Click to expand it.
vendor/header_only/CMakeLists.txt
+
10
−
3
View file @
f4884423
target_include_directories
(
fggl
PUBLIC
add_library
(
fggl-glad INTERFACE
)
target_include_directories
(
fggl-glad
INTERFACE
$<BUILD_INTERFACE:
${
CMAKE_CURRENT_LIST_DIR
}
/public>
$<INSTALL_INTERFACE:include/fggl>
)
...
...
@@ -11,10 +13,15 @@ install(
DESTINATION
${
CMAKE_INSTALL_INCLUDEDIR
}
/fggl/glad
)
install
(
FILES
public/KHR/khrplatform.h
DESTINATION
${
CMAKE_INSTALL_INCLUDEDIR
}
/fggl/KHR
)
install
(
TARGETS fggl-glad
EXPORT fgglTargets
DESTINATION
${
CMAKE_INSTALL_LIBDIR
}
/fggl/glad
)
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment