-
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.
- Loading branch information
Showing
18 changed files
with
1,096 additions
and
3 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
|
||
# GTK4::GTK4 | ||
# GTK4_FOUND | ||
# GTK4_INCLUDE_DIRS | ||
# GTK4_LIBRARIES | ||
|
||
include(FindPackageHandleStandardArgs) | ||
|
||
find_package(PkgConfig QUIET) | ||
pkg_check_modules(GTK4 QUIET IMPORTED_TARGET gtk4) | ||
|
||
set(GTK4_FOUND OFF) | ||
|
||
if(TARGET PkgConfig::GTK4) | ||
set(GTK4_FOUND ON) | ||
|
||
add_library(GTK4::GTK4 INTERFACE IMPORTED) | ||
|
||
set_target_properties(GTK4::GTK4 PROPERTIES | ||
INTERFACE_LINK_LIBRARIES PkgConfig::GTK4 | ||
) | ||
|
||
endif() | ||
|
||
find_package_handle_standard_args(GTK4 DEFAULT_MSG GTK4_FOUND) | ||
mark_as_advanced(GTK4_FOUND) |
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
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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,148 @@ | ||
|
||
# | ||
# External dependencies | ||
# | ||
|
||
find_package(GTK4 REQUIRED) | ||
find_package(cpplocate QUIET) | ||
|
||
|
||
# | ||
# Executable name and options | ||
# | ||
|
||
# Target name | ||
set(target cubescape-gtk4) | ||
|
||
# Exit here if required dependencies are not met | ||
if (NOT TARGET GTK4::GTK4) | ||
message("Example ${target} skipped: GTK 4 not found") | ||
return() | ||
endif() | ||
|
||
if (NOT cpplocate_FOUND) | ||
message(STATUS "Example ${target}: using static data path (cpplocate not found)") | ||
else() | ||
message(STATUS "Example ${target}") | ||
endif() | ||
|
||
|
||
# | ||
# Sources | ||
# | ||
|
||
set(sources | ||
main.cpp | ||
CubeScape.cpp | ||
CubeScape.h | ||
glutils.cpp | ||
glutils.h | ||
RawFile.cpp | ||
RawFile.h | ||
) | ||
|
||
|
||
# | ||
# 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} | ||
GTK4::GTK4 | ||
${META_PROJECT_NAME}::glbinding | ||
${META_PROJECT_NAME}::glbinding-aux | ||
$<$<BOOL:${cpplocate_FOUND}>:cpplocate::cpplocate> | ||
) | ||
|
||
|
||
# | ||
# Compile definitions | ||
# | ||
|
||
target_compile_definitions(${target} | ||
PRIVATE | ||
${DEFAULT_COMPILE_DEFINITIONS} | ||
$<$<BOOL:${cpplocate_FOUND}>:cpplocate_FOUND> | ||
) | ||
|
||
|
||
# | ||
# 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_sdl | ||
BUNDLE DESTINATION ${INSTALL_EXAMPLES} COMPONENT examples_sdl | ||
) |
Oops, something went wrong.