Update cmake and make build and conan
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
cmake_minimum_required(VERSION 3.20)
|
||||
|
||||
project(Folding
|
||||
VERSION 1.1.1
|
||||
DESCRIPTION "Folding utility for BayesNet library"
|
||||
HOMEPAGE_URL "https://github.com/rmontanana/folding"
|
||||
LANGUAGES CXX
|
||||
@@ -25,6 +26,10 @@ SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pthread")
|
||||
# -------
|
||||
option(ENABLE_TESTING "Unit testing build" OFF)
|
||||
|
||||
# Subdirectories
|
||||
# --------------
|
||||
add_subdirectory(config)
|
||||
|
||||
# Testing
|
||||
# -------
|
||||
if (ENABLE_TESTING)
|
||||
@@ -39,3 +44,55 @@ endif (ENABLE_TESTING)
|
||||
# Library
|
||||
# --------
|
||||
add_library(folding INTERFACE folding.hpp)
|
||||
|
||||
target_include_directories(folding INTERFACE
|
||||
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
|
||||
$<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}/configured_files/include>
|
||||
$<INSTALL_INTERFACE:include>
|
||||
)
|
||||
|
||||
# Install
|
||||
# -------
|
||||
install(TARGETS folding EXPORT FoldingTargets
|
||||
INCLUDES DESTINATION include
|
||||
)
|
||||
install(EXPORT FoldingTargets
|
||||
FILE FoldingTargets.cmake
|
||||
NAMESPACE Folding::
|
||||
DESTINATION lib/cmake/Folding
|
||||
)
|
||||
|
||||
# Install the main header file
|
||||
install(FILES folding.hpp
|
||||
DESTINATION include
|
||||
)
|
||||
|
||||
# Install the generated configuration header
|
||||
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/configured_files/include/folding_config.h"
|
||||
DESTINATION include
|
||||
)
|
||||
|
||||
# Install documentation files
|
||||
install(FILES LICENSE README.md
|
||||
DESTINATION share/doc/Folding
|
||||
)
|
||||
|
||||
# Create and install package configuration files
|
||||
include(CMakePackageConfigHelpers)
|
||||
write_basic_package_version_file(
|
||||
"${CMAKE_CURRENT_BINARY_DIR}/FoldingConfigVersion.cmake"
|
||||
VERSION ${PROJECT_VERSION}
|
||||
COMPATIBILITY AnyNewerVersion
|
||||
)
|
||||
|
||||
configure_package_config_file(
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/cmake/FoldingConfig.cmake.in"
|
||||
"${CMAKE_CURRENT_BINARY_DIR}/FoldingConfig.cmake"
|
||||
INSTALL_DESTINATION lib/cmake/Folding
|
||||
)
|
||||
|
||||
install(FILES
|
||||
"${CMAKE_CURRENT_BINARY_DIR}/FoldingConfig.cmake"
|
||||
"${CMAKE_CURRENT_BINARY_DIR}/FoldingConfigVersion.cmake"
|
||||
DESTINATION lib/cmake/Folding
|
||||
)
|
||||
|
Reference in New Issue
Block a user