1# 2# Copyright (C) 2018 Huawei Technologies Co, Ltd. 3# 4 5cmake_minimum_required(VERSION 3.18) 6 7project(ComponentHelperSDK) 8 9if (NOT DEFINED CORE_ROOT_DIRECTORY) 10 set(CORE_ROOT_DIRECTORY "${CMAKE_CURRENT_LIST_DIR}/../" CACHE PATH "Path engine sdk root dir") 11endif() 12 13if (NOT DEFINED BASE_ROOT_DIRECTORY) 14 set(BASE_ROOT_DIRECTORY "${CMAKE_CURRENT_LIST_DIR}/../LumeBase" CACHE PATH "Base root dir") 15endif() 16 17include(${CORE_ROOT_DIRECTORY}/cmake/cmake_tools.cmake) 18force_static_link() 19 20# 21# Pure interface api targets. (includes, shared sources only) 22# todo: check install, create cmake modules.. etc 23# 24#Most of these are pure helpers which in theory might not even be used by actual component/system/etc implementations. 25#This part will receive more cleanup. (ie. these files should be moved OUT of the engine src/include/api folders ) 26add_library(ComponentHelperSDK INTERFACE) 27add_library(AGPEngine::ComponentHelperSDK ALIAS ComponentHelperSDK) 28 29set (ComponentHelperSDK_HeaderPath 30 $<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}>$<INSTALL_INTERFACE:${inc_dest}/ComponentHelperSDK> 31) 32set(ComponentHelperSDK_Sources 33 ComponentTools/base_manager.inl 34 ComponentTools/base_manager.h 35 ComponentTools/component_query.h 36 ComponentTools/component_query.cpp 37) 38 39# Prefixing the filenames here with either the generator expression or the relative path for source_group. 40# (because source_group does not understand generator expressions). 41 42set_list_prefix(ComponentHelperSDK_Sources_Generator ComponentHelperSDK_Sources "${ComponentHelperSDK_HeaderPath}/") 43target_sources(ComponentHelperSDK INTERFACE ${ComponentHelperSDK_Sources_Generator}) 44 45set_list_prefix(ComponentHelperSDK_Sources_Build ComponentHelperSDK_Sources "${CMAKE_CURRENT_LIST_DIR}/") 46source_group(TREE ${CMAKE_CURRENT_LIST_DIR}/ 47 PREFIX component_sdk 48 FILES ${ComponentHelperSDK_Sources_Build}) 49 50target_include_directories(ComponentHelperSDK SYSTEM INTERFACE 51 ${ComponentHelperSDK_HeaderPath} 52) 53 54install(DIRECTORY ${CMAKE_CURRENT_LIST_DIR}/ 55 DESTINATION ${inc_dest}/ComponentHelperSDK 56) 57 58install(TARGETS ComponentHelperSDK 59 EXPORT ComponentHelperSDKConfig 60 DESTINATION ${lib_dest} 61) 62install(EXPORT ComponentHelperSDKConfig 63 FILE ComponentHelperSDKConfig.cmake 64 NAMESPACE AGPEngine:: 65 DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/ComponentHelperSDK 66) 67 68# Make it possible to import from a build tree. 69export(TARGETS ComponentHelperSDK 70 NAMESPACE AGPEngine:: 71 FILE ComponentHelperSDKConfig.cmake 72) 73