-
Notifications
You must be signed in to change notification settings - Fork 92
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Restructure examples to use shared cubescape libraries per GL API
- Loading branch information
Showing
58 changed files
with
571 additions
and
3,043 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,135 @@ | ||
|
||
# | ||
# External dependencies | ||
# | ||
|
||
find_package(glfw3 QUIET) | ||
|
||
|
||
# | ||
# Executable name and options | ||
# | ||
|
||
# Target name | ||
set(target cubescape-glfw) | ||
|
||
# Exit here if required dependencies are not met | ||
if (NOT glfw3_FOUND) | ||
message("Example ${target} skipped: glfw3 not found") | ||
return() | ||
endif() | ||
|
||
|
||
# | ||
# Sources | ||
# | ||
|
||
set(sources | ||
main.cpp | ||
) | ||
|
||
|
||
# | ||
# Create executable | ||
# | ||
|
||
# Build executable | ||
add_executable(${target} | ||
MACOSX_BUNDLE | ||
${sources} | ||
) | ||
|
||
# Create namespaced alias | ||
add_executable(${META_PROJECT_NAME}::${target} ALIAS ${target}) | ||
|
||
|
||
# | ||
# Project options | ||
# | ||
|
||
set_target_properties(${target} | ||
PROPERTIES | ||
${DEFAULT_PROJECT_OPTIONS} | ||
INSTALL_RPATH "${EXECUTABLE_INSTALL_RPATH}" | ||
FOLDER "${IDE_FOLDER}" | ||
) | ||
|
||
|
||
# | ||
# Include directories | ||
# | ||
|
||
target_include_directories(${target} | ||
PRIVATE | ||
${DEFAULT_INCLUDE_DIRECTORIES} | ||
${PROJECT_BINARY_DIR}/source/include | ||
SYSTEM | ||
) | ||
|
||
|
||
# | ||
# Libraries | ||
# | ||
|
||
target_link_libraries(${target} | ||
PRIVATE | ||
${DEFAULT_LIBRARIES} | ||
glfw | ||
${META_PROJECT_NAME}::glbinding | ||
${META_PROJECT_NAME}::glbinding-aux | ||
${META_PROJECT_NAME}::cubescape-shared-gl | ||
) | ||
|
||
|
||
# | ||
# Compile definitions | ||
# | ||
|
||
target_compile_definitions(${target} | ||
PRIVATE | ||
${DEFAULT_COMPILE_DEFINITIONS} | ||
GLFW_INCLUDE_NONE | ||
) | ||
|
||
|
||
# | ||
# Compile options | ||
# | ||
|
||
target_compile_options(${target} | ||
PRIVATE | ||
${DEFAULT_COMPILE_OPTIONS_PRIVATE} | ||
PUBLIC | ||
${DEFAULT_COMPILE_OPTIONS_PUBLIC} | ||
) | ||
|
||
|
||
# | ||
# Linker options | ||
# | ||
|
||
target_link_libraries(${target} | ||
PRIVATE | ||
${DEFAULT_LINKER_OPTIONS} | ||
) | ||
|
||
|
||
# | ||
# Target Health | ||
# | ||
|
||
perform_health_checks( | ||
${target} | ||
${sources} | ||
) | ||
|
||
|
||
# | ||
# Deployment | ||
# | ||
|
||
# Executable | ||
install(TARGETS ${target} | ||
RUNTIME DESTINATION ${INSTALL_EXAMPLES} COMPONENT examples_glfw | ||
BUNDLE DESTINATION ${INSTALL_EXAMPLES} COMPONENT examples_glfw | ||
) |
Oops, something went wrong.