CMakeLists
CMakeLists
# -----------------------------------------------------------------------------
# Project definition
# -----------------------------------------------------------------------------
project(tas_client_api
VERSION 1.0.2
DESCRIPTION "Infineon's Tool Access Socket (TAS) Client API"
HOMEPAGE_URL "https://github.com/Infineon/tas_client_api"
LANGUAGES CXX
)
set(TAS_CLIENT_COPYRIGHT "(c) Infineon Technologies AG 2024")
# -----------------------------------------------------------------------------
# Break in case of popular CMake configuration mistakes
# -----------------------------------------------------------------------------
if(NOT CMAKE_SIZEOF_VOID_P GREATER 0)
message(FATAL_ERROR "CMake fails to determine the bitness of the target
platform. Please check your CMake and compiler installation. If you are
cross-compiling then ensure that your CMake toolchain file correctly sets
the compiler details.")
endif()
# -----------------------------------------------------------------------------
# Project options
# -----------------------------------------------------------------------------
option(TAS_CLIENT_API_BUILD_PYTHON "Build Python interface if enabled" OFF)
option(TAS_CLIENT_API_BUILD_TEST "Build test binaries if enabled" OFF)
option(TAS_CLIENT_API_BUILD_DOCS "Build documentation using doxygen if enabled"
OFF)
# -----------------------------------------------------------------------------
# Soruce and test files
# -----------------------------------------------------------------------------
include(cmake/TasClientApiUtils.cmake)
include(GNUInstallDirs)
add_subdirectory(apps/tas_rw_api_demo)
add_subdirectory(apps/tas_chl_api_demo)
add_subdirectory(python)
add_subdirectory(src)
add_subdirectory(docs)
# -----------------------------------------------------------------------------
# Install
# -----------------------------------------------------------------------------
# export targets
install(EXPORT TasClientApiTargets
FILE TasClientApiTargets.cmake
NAMESPACE TasClientApi::
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/TasClientApi
)
# Package definition
# provides configure_package_config_file() which enables creation of relocatable
packages.
include(CMakePackageConfigHelpers)
install(FILES
"${CMAKE_CURRENT_BINARY_DIR}/TasClientApiConfig.cmake"
"${CMAKE_CURRENT_BINARY_DIR}/TasClientApiConfigVersion.cmake"
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/TasClientApi
)