File tree Expand file tree Collapse file tree 2 files changed +29
-0
lines changed Expand file tree Collapse file tree 2 files changed +29
-0
lines changed Original file line number Diff line number Diff line change @@ -210,3 +210,27 @@ set_target_properties(${PROJECT_NAME}
210210 RUNTIME_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR} /bin"
211211 OUTPUT_NAME "${OUTPUT_NAME} "
212212)
213+
214+ install (TARGETS ${PROJECT_NAME} EXPORT godot_cpp_targets)
215+
216+ # Export the target to the build directory.
217+ # The target then can be imported by another cmake project like this:
218+ # find_package(godot-cpp CONFIG REQUIRED)
219+ #
220+ # add_library(libfoo SHARED)
221+ # set_target_properties(libfoo PROPERTIES POSITION_INDEPENDENT_CODE ON)
222+ # target_link_libraries(libfoo PUBLIC godot::godot-cpp)
223+ #
224+ # And user provides the build directory to cmake:
225+ # -DCMAKE_PREFIX_PATH=<absolute-path-to-godot-cpp-build-dir>.
226+
227+ export (EXPORT godot_cpp_targets
228+ FILE "${PROJECT_BINARY_DIR} /cmake/godot-cpp.cmake"
229+ NAMESPACE godot::
230+ )
231+
232+ include (CMakePackageConfigHelpers)
233+ configure_package_config_file(${PROJECT_SOURCE_DIR} /cmake/config.cmake.in
234+ "${PROJECT_BINARY_DIR} /cmake/godot-cpp-config.cmake"
235+ INSTALL_DESTINATION "lib/cmake/godot-cpp"
236+ )
Original file line number Diff line number Diff line change 1+ @PACKAGE_INIT@
2+
3+ include ("${CMAKE_CURRENT_LIST_DIR} /godot-cpp.cmake" )
4+
5+ check_required_components(godot-cpp)
You can’t perform that action at this time.
0 commit comments