our_knp/examples/knp/meta-library/CMakeLists.txt
int 8f43927575 Initial import: KNP experiments (examples, viz, cats-dogs, reports)
examples/ is based on KasperskyLab/knp at 55470ed6 with local changes
to the mnist-learn altai/blifat models, cuda-backend CMake and model_loader.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-14 18:17:15 +03:00

71 lines
2.3 KiB
CMake

#[[
© 2024 AO Kaspersky Lab
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
]]
cmake_minimum_required(VERSION 3.25)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
# Required for the linters.
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
if(CMAKE_VERSION VERSION_GREATER_EQUAL "3.30")
# Suppress Boost warning.
cmake_policy(SET CMP0167 OLD)
endif()
project(knp-meta VERSION "${KNP_VERSION}" LANGUAGES C CXX
DESCRIPTION "Kaspersky Neuromorphic Platform meta functions and templates library"
HOMEPAGE_URL "https://neuro.kaspersky.ru/neyromorfnye-tekhnologii/")
set(${PROJECT_NAME}_PUBLIC_INCLUDE_DIR "knp/meta")
include(GNUInstallDirs)
include(clang-tidy)
include(knp-functions)
if(NOT TARGET Boost::boost)
find_package(Boost ${KNP_BOOST_MIN_VERSION} REQUIRED)
endif()
file(GLOB_RECURSE ${PROJECT_NAME}_headers include/${${PROJECT_NAME}_PUBLIC_INCLUDE_DIR}/*.h)
source_group(headers FILES ${${PROJECT_NAME}_headers} REGULAR_EXPRESSION "include/.*")
add_library("${PROJECT_NAME}"
INTERFACE
${${PROJECT_NAME}_headers})
add_library(KNP::Meta ALIAS "${PROJECT_NAME}")
target_include_directories("${PROJECT_NAME}" INTERFACE
"$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>"
"$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>")
target_include_directories("${PROJECT_NAME}" INTERFACE ${Boost_INCLUDE_DIRS})
if (KNP_INSTALL)
set(COMPONENT_NAME "cpp-framework")
install(TARGETS "${PROJECT_NAME}"
EXPORT "${COMPONENT_NAME}-dev_targets"
COMPONENT "${COMPONENT_NAME}-dev")
install(DIRECTORY "include/${${PROJECT_NAME}_PUBLIC_INCLUDE_DIR}"
COMPONENT "${COMPONENT_NAME}-dev"
DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/knp"
FILES_MATCHING PATTERN "*.h")
endif()