-
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added new samples, HelloScreen and HelloTriangle (#133)
feat: added HelloScreen and HelloTriangle example These two samples showcase basic initialization as well as basic rendering output for the library. Additionally various smaller fixes were done in this commit. By default the examples are disabled, but can be enabled using the `PE_EXAMPLES` cmake arg. fix: - path transformer would crash when a directory of 0 sized was used as arg - library had competing default constructors - when using an optional library path it would fail due to tests that could only run with a valid library - psl::meta::library did not handle relative paths well misc: - added a readme for the examples - silenced a warning related to nothrow - ability to specify sub-directories for cmake targets - added warning when the gpu_camera system runs without a camera
- Loading branch information
Showing
44 changed files
with
1,105 additions
and
59 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,39 @@ | ||
|
||
macro(set_target_output_directory target) | ||
foreach(OUTPUTCONFIG ${CMAKE_CONFIGURATION_TYPES}) | ||
string(TOUPPER ${OUTPUTCONFIG} OUTPUTCONFIG) | ||
string(TOLOWER ${OUTPUTCONFIG} OUTPUTCONFIG_FOLDERNAME) | ||
set_target_properties(${target} | ||
PROPERTIES | ||
ARCHIVE_OUTPUT_DIRECTORY_${OUTPUTCONFIG} "${PE_BUILD_DIR}/${OUTPUTCONFIG_FOLDERNAME}/${ARCHI}/lib" | ||
LIBRARY_OUTPUT_DIRECTORY_${OUTPUTCONFIG} "${PE_BUILD_DIR}/${OUTPUTCONFIG_FOLDERNAME}/${ARCHI}/lib" | ||
RUNTIME_OUTPUT_DIRECTORY_${OUTPUTCONFIG} "${PE_BUILD_DIR}/${OUTPUTCONFIG_FOLDERNAME}/${ARCHI}/bin") | ||
macro(set_target_output_directory) | ||
set(oneValueArgs DIRECTORY) | ||
set(multiValueArgs TARGET) | ||
cmake_parse_arguments(SET_TARGET_OUTPUT_DIRECTORY "" "${oneValueArgs}" "${multiValueArgs}" ${ARGN}) | ||
if(NOT DEFINED ${SET_TARGET_OUTPUT_DIRECTORY_DIRECTORY}) | ||
set(${SET_TARGET_OUTPUT_DIRECTORY_DIRECTORY} "") | ||
endif() | ||
foreach(targ ${SET_TARGET_OUTPUT_DIRECTORY_TARGET}) | ||
get_target_property(target_type ${targ} TYPE) | ||
foreach(OUTPUTCONFIG ${CMAKE_CONFIGURATION_TYPES}) | ||
string(TOUPPER ${OUTPUTCONFIG} OUTPUTCONFIG) | ||
string(TOLOWER ${OUTPUTCONFIG} OUTPUTCONFIG_FOLDERNAME) | ||
# mostly done so the directories don't get created in the output for binaries when unneeded. | ||
if (target_type STREQUAL "EXECUTABLE") | ||
set_target_properties(${targ} | ||
PROPERTIES | ||
RUNTIME_OUTPUT_DIRECTORY_${OUTPUTCONFIG} "${PE_BUILD_DIR}/${OUTPUTCONFIG_FOLDERNAME}/${ARCHI}/bin/${SET_TARGET_OUTPUT_DIRECTORY_DIRECTORY}") | ||
else() | ||
set_target_properties(${targ} | ||
PROPERTIES | ||
ARCHIVE_OUTPUT_DIRECTORY_${OUTPUTCONFIG} "${PE_BUILD_DIR}/${OUTPUTCONFIG_FOLDERNAME}/${ARCHI}/lib/${SET_TARGET_OUTPUT_DIRECTORY_DIRECTORY}" | ||
LIBRARY_OUTPUT_DIRECTORY_${OUTPUTCONFIG} "${PE_BUILD_DIR}/${OUTPUTCONFIG_FOLDERNAME}/${ARCHI}/lib/${SET_TARGET_OUTPUT_DIRECTORY_DIRECTORY}" | ||
RUNTIME_OUTPUT_DIRECTORY_${OUTPUTCONFIG} "${PE_BUILD_DIR}/${OUTPUTCONFIG_FOLDERNAME}/${ARCHI}/bin/${SET_TARGET_OUTPUT_DIRECTORY_DIRECTORY}") | ||
endif() | ||
endforeach() | ||
if (target_type STREQUAL "EXECUTABLE") | ||
set_target_properties(${targ} | ||
PROPERTIES | ||
RUNTIME_OUTPUT_DIRECTORY "${PE_BUILD_DIR}/default/bin/${SET_TARGET_OUTPUT_DIRECTORY_DIRECTORY}") | ||
else () | ||
set_target_properties(${targ} | ||
PROPERTIES | ||
ARCHIVE_OUTPUT_DIRECTORY "${PE_BUILD_DIR}/default/lib/${SET_TARGET_OUTPUT_DIRECTORY_DIRECTORY}" | ||
LIBRARY_OUTPUT_DIRECTORY "${PE_BUILD_DIR}/default/lib/${SET_TARGET_OUTPUT_DIRECTORY_DIRECTORY}" | ||
RUNTIME_OUTPUT_DIRECTORY "${PE_BUILD_DIR}/default/bin/${SET_TARGET_OUTPUT_DIRECTORY_DIRECTORY}") | ||
endif() | ||
endforeach() | ||
set_target_properties(${target} | ||
PROPERTIES | ||
ARCHIVE_OUTPUT_DIRECTORY "${PE_BUILD_DIR}/default/lib" | ||
LIBRARY_OUTPUT_DIRECTORY "${PE_BUILD_DIR}/default/lib" | ||
RUNTIME_OUTPUT_DIRECTORY "${PE_BUILD_DIR}/default/bin") | ||
endmacro() |
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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
add_library(android_native_glue STATIC ${ANDROID_NDK}/sources/android/native_app_glue/android_native_app_glue.c) | ||
set_target_properties(android_native_glue PROPERTIES LINKER_LANGUAGE C) | ||
add_library(paradigm::android_native_glue ALIAS android_native_glue) | ||
set_target_output_directory(android_native_glue) | ||
set_target_output_directory(TARGET android_native_glue) |
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,2 @@ | ||
add_subdirectory(HelloScreen) | ||
add_subdirectory(HelloTriangle) |
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,10 @@ | ||
add_executable(ex_hello_screen main.cpp) | ||
add_executable(paradigm::examples::hello_screen ALIAS ex_hello_screen) | ||
target_link_libraries(ex_hello_screen PUBLIC paradigm::psl ${PE_DL_LIBS} paradigm::core) | ||
|
||
target_compile_features(ex_hello_screen PUBLIC ${PE_COMPILER_FEATURES}) | ||
target_compile_options(ex_hello_screen PRIVATE ${PE_COMPILE_OPTIONS} ${PE_COMPILE_OPTIONS_EXE}) | ||
set_target_properties(ex_hello_screen PROPERTIES LINKER_LANGUAGE CXX) | ||
|
||
set_property(TARGET ex_hello_screen PROPERTY FOLDER "paradigm-engine/examples") | ||
set_target_output_directory(TARGET ex_hello_screen DIRECTORY "examples/HelloScreen") |
Oops, something went wrong.