Skip to content

Commit

Permalink
Merge pull request orbitersim#448 from orbitersim/sdk_samples
Browse files Browse the repository at this point in the history
Install of SDK samples and LUA samples
  • Loading branch information
jarmonik authored Mar 22, 2024
2 parents 877340f + aafdccd commit 8852860
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 16 deletions.
5 changes: 0 additions & 5 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -261,11 +261,6 @@ option(ORBITER_MAKE_TESTS
ON
)

option(ORBITER_MAKE_SDK_SAMPLES
"Build the SDK sample projects"
OFF
)

option(ORBITER_SANITIZER
"Build binaries with Address Sanitizer"
OFF
Expand Down
21 changes: 14 additions & 7 deletions Orbitersdk/samples/AscentMFD/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,26 +4,33 @@
# The target directory for plugin DLLs
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${ORBITER_BINARY_PLUGIN_DIR})

add_library(AscentMFD SHARED
add_library(AscentMFD MODULE
AscentMFD.cpp
AscentMFD.rc
)

target_include_directories(AscentMFD
PUBLIC ${ORBITER_SOURCE_SDK_INCLUDE_DIR}
add_dependencies(AscentMFD
${OrbiterTgt}
Orbitersdk
)

target_link_libraries(AscentMFD
${ORBITER_LIB}
${ORBITER_SDK_LIB}
)

add_dependencies(AscentMFD
${OrbiterTgt}
Orbitersdk
target_include_directories(AscentMFD
PUBLIC ${ORBITER_SOURCE_SDK_INCLUDE_DIR}
)

set_target_properties(AscentMFD
PROPERTIES
FOLDER SDKSamples
LIBRARY_OUTPUT_DIRECTORY_DEBUG ${CMAKE_BINARY_DIR}/Modules/Plugin
LIBRARY_OUTPUT_DIRECTORY_RELEASE ${CMAKE_BINARY_DIR}/Modules/Plugin
FOLDER Modules
)

install(TARGETS AscentMFD
LIBRARY
DESTINATION ${ORBITER_INSTALL_PLUGIN_DIR}
)
9 changes: 6 additions & 3 deletions Orbitersdk/samples/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
# Copyright (c) Martin Schweiger
# Licensed under the MIT License

if (ORBITER_MAKE_SDK_SAMPLES)

add_subdirectory(AscentMFD)
add_subdirectory(DialogTemplate)
add_subdirectory(LaunchpadParamTemplate)
add_subdirectory(MFDTemplate)
add_subdirectory(Lua)

endif()
install(DIRECTORY ${ORBITER_SOURCE_SDK_DIR}/samples/AscentMFD/ DESTINATION ${ORBITER_INSTALL_ROOT_DIR}/Orbitersdk/samples/AscentMFD)
install(DIRECTORY ${ORBITER_SOURCE_SDK_DIR}/samples/DialogTemplate/ DESTINATION ${ORBITER_INSTALL_ROOT_DIR}/Orbitersdk/samples/DialogTemplate)
install(DIRECTORY ${ORBITER_SOURCE_SDK_DIR}/samples/LaunchpadParamTemplate/ DESTINATION ${ORBITER_INSTALL_ROOT_DIR}/Orbitersdk/samples/LaunchpadParamTemplate)
install(DIRECTORY ${ORBITER_SOURCE_SDK_DIR}/samples/MFDTemplate/ DESTINATION ${ORBITER_INSTALL_ROOT_DIR}/Orbitersdk/samples/MFDTemplate)
install(DIRECTORY ${ORBITER_SOURCE_SDK_DIR}/samples/Lua/ DESTINATION ${ORBITER_INSTALL_ROOT_DIR}/Orbitersdk/samples/Lua)

2 changes: 1 addition & 1 deletion Orbitersdk/samples/MFDTemplate/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ add_dependencies(MFDTemplate
Orbitersdk
)

set_target_properties(LaunchpadParamTemplate
set_target_properties(MFDTemplate
PROPERTIES
FOLDER SDKSamples
)

0 comments on commit 8852860

Please sign in to comment.