macro(skullc_install_packages in_project in_component in_version) # reference: https://stackoverflow.com/questions/54702582/how-to-configure-project-with-components-in-cmake install(TARGETS ${in_component} EXPORT ${in_component}-targets COMPONENT ${in_component} LIBRARY DESTINATION lib ARCHIVE DESTINATION lib RUNTIME DESTINATION bin INCLUDES DESTINATION include ) install(EXPORT ${in_component}-targets FILE "${in_project}-${in_component}-targets.cmake" NAMESPACE ${in_project}:: DESTINATION lib/cmake/${in_project} COMPONENT ${in_component} ) configure_file("${in_component}-config.cmake.in" "${CMAKE_BINARY_DIR}/${in_project}-${in_component}-config.cmake" @ONLY ) include(CMakePackageConfigHelpers) write_basic_package_version_file( "${CMAKE_BINARY_DIR}/${in_project}-${in_component}-config-version.cmake" VERSION ${in_version} COMPATIBILITY AnyNewerVersion ) install( FILES "${CMAKE_BINARY_DIR}/${in_project}-${in_component}-config.cmake" "${CMAKE_BINARY_DIR}/${in_project}-${in_component}-config-version.cmake" DESTINATION lib/cmake/${in_project} COMPONENT ${in_component} ) install( DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/Inc/ COMPONENT ${in_component} DESTINATION ${CMAKE_INSTALL_PREFIX}/include ) endmacro()