mirror of https://github.com/status-im/evmc.git
CMake: Export CMake package config
This commit is contained in:
parent
cb2288b49d
commit
4e91af62d3
|
@ -14,7 +14,9 @@ option(EVMC_EXAMPLES "Build EVMC examples" OFF)
|
||||||
option(HUNTER_ENABLED "Enable Hunter package manager support" "${EVMC_TESTING}")
|
option(HUNTER_ENABLED "Enable Hunter package manager support" "${EVMC_TESTING}")
|
||||||
|
|
||||||
include(cmake/cable/bootstrap.cmake)
|
include(cmake/cable/bootstrap.cmake)
|
||||||
|
include(CableBuildType)
|
||||||
include(CableCompilerSettings)
|
include(CableCompilerSettings)
|
||||||
|
include(CMakePackageConfigHelpers)
|
||||||
include(HunterGate)
|
include(HunterGate)
|
||||||
include(GNUInstallDirs)
|
include(GNUInstallDirs)
|
||||||
include(defaults/HunterCacheServers)
|
include(defaults/HunterCacheServers)
|
||||||
|
@ -30,13 +32,16 @@ HunterGate(
|
||||||
project(evmc)
|
project(evmc)
|
||||||
set(PROJECT_VERSION "0.1.0.dev0")
|
set(PROJECT_VERSION "0.1.0.dev0")
|
||||||
|
|
||||||
|
cable_set_build_type(DEFAULT Release CONFIGURATION_TYPES Debug Release)
|
||||||
|
|
||||||
cable_configure_compiler(NO_STACK_PROTECTION)
|
cable_configure_compiler(NO_STACK_PROTECTION)
|
||||||
|
|
||||||
set(include_dir ${PROJECT_SOURCE_DIR}/include)
|
set(include_dir ${PROJECT_SOURCE_DIR}/include)
|
||||||
|
|
||||||
add_library(evmc INTERFACE)
|
add_library(evmc INTERFACE)
|
||||||
add_library(evmc::evmc ALIAS evmc)
|
add_library(evmc::evmc ALIAS evmc)
|
||||||
target_include_directories(evmc INTERFACE ${include_dir})
|
target_include_directories(evmc INTERFACE $<BUILD_INTERFACE:${include_dir}>$<INSTALL_INTERFACE:include>)
|
||||||
|
install(TARGETS evmc EXPORT evmcTargets)
|
||||||
|
|
||||||
install(DIRECTORY include/evmc DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
|
install(DIRECTORY include/evmc DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
|
||||||
|
|
||||||
|
@ -51,6 +56,25 @@ if(EVMC_EXAMPLES)
|
||||||
add_subdirectory(examples)
|
add_subdirectory(examples)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
write_basic_package_version_file(evmcConfigVersion.cmake COMPATIBILITY ExactVersion)
|
||||||
|
|
||||||
|
configure_package_config_file(
|
||||||
|
cmake/Config.cmake.in
|
||||||
|
evmcConfig.cmake
|
||||||
|
INSTALL_DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/evmc
|
||||||
|
)
|
||||||
|
|
||||||
|
install(
|
||||||
|
EXPORT evmcTargets
|
||||||
|
NAMESPACE evmc::
|
||||||
|
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/evmc
|
||||||
|
)
|
||||||
|
install(
|
||||||
|
FILES
|
||||||
|
${CMAKE_CURRENT_BINARY_DIR}/evmcConfig.cmake
|
||||||
|
${CMAKE_CURRENT_BINARY_DIR}/evmcConfigVersion.cmake
|
||||||
|
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/evmc
|
||||||
|
)
|
||||||
|
|
||||||
if(WIN32)
|
if(WIN32)
|
||||||
set(CPACK_GENERATOR ZIP)
|
set(CPACK_GENERATOR ZIP)
|
||||||
|
|
|
@ -0,0 +1,4 @@
|
||||||
|
@PACKAGE_INIT@
|
||||||
|
|
||||||
|
include("${CMAKE_CURRENT_LIST_DIR}/evmcTargets.cmake")
|
||||||
|
check_required_components(evmc)
|
|
@ -10,6 +10,6 @@ add_library(
|
||||||
)
|
)
|
||||||
|
|
||||||
add_library(evmc::instructions ALIAS instructions)
|
add_library(evmc::instructions ALIAS instructions)
|
||||||
target_include_directories(instructions PUBLIC ${include_dir})
|
target_include_directories(instructions PUBLIC $<BUILD_INTERFACE:${include_dir}>$<INSTALL_INTERFACE:include>)
|
||||||
|
|
||||||
install(TARGETS instructions EXPORT evmcTargets DESTINATION ${CMAKE_INSTALL_LIBDIR})
|
install(TARGETS instructions EXPORT evmcTargets DESTINATION ${CMAKE_INSTALL_LIBDIR})
|
||||||
|
|
Loading…
Reference in New Issue