Merge pull request #185 from ax3l/topic-installEmbed

CMake: Optional Install if Embedded
This commit is contained in:
Toru Niina
2022-03-07 23:12:33 +09:00
committed by GitHub

View File

@@ -4,6 +4,7 @@ enable_testing()
project(toml11 VERSION 3.7.0) project(toml11 VERSION 3.7.0)
option(toml11_BUILD_TEST "Build toml tests" OFF) option(toml11_BUILD_TEST "Build toml tests" OFF)
option(toml11_INSTALL "Install CMake targets during install step." ON)
option(toml11_TEST_WITH_ASAN "use LLVM address sanitizer" OFF) option(toml11_TEST_WITH_ASAN "use LLVM address sanitizer" OFF)
option(toml11_TEST_WITH_UBSAN "use LLVM undefined behavior sanitizer" OFF) option(toml11_TEST_WITH_UBSAN "use LLVM undefined behavior sanitizer" OFF)
@@ -75,6 +76,7 @@ write_basic_package_version_file(
COMPATIBILITY SameMajorVersion COMPATIBILITY SameMajorVersion
) )
if (toml11_INSTALL)
configure_package_config_file( configure_package_config_file(
cmake/toml11Config.cmake.in cmake/toml11Config.cmake.in
${toml11_config} ${toml11_config}
@@ -107,6 +109,7 @@ install(EXPORT toml11Targets
DESTINATION ${toml11_install_cmake_dir} DESTINATION ${toml11_install_cmake_dir}
NAMESPACE toml11:: NAMESPACE toml11::
) )
endif()
if (toml11_BUILD_TEST) if (toml11_BUILD_TEST)
add_subdirectory(tests) add_subdirectory(tests)