mirror of
https://github.com/ToruNiina/toml11.git
synced 2024-11-26 14:20:05 +00:00
style: format CMakelists.txt
This commit is contained in:
parent
dee32e7d5e
commit
cab3144507
@ -53,53 +53,53 @@ set(toml11_config ${toml11_config_dir}/toml11Config.cmake)
|
|||||||
set(toml11_config_version ${toml11_config_dir}/toml11ConfigVersion.cmake)
|
set(toml11_config_version ${toml11_config_dir}/toml11ConfigVersion.cmake)
|
||||||
|
|
||||||
add_library(toml11 INTERFACE)
|
add_library(toml11 INTERFACE)
|
||||||
target_include_directories(toml11 INTERFACE
|
target_include_directories(toml11 INTERFACE
|
||||||
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
|
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
|
||||||
$<INSTALL_INTERFACE:${toml11_install_include_dir}>
|
$<INSTALL_INTERFACE:${toml11_install_include_dir}>
|
||||||
)
|
)
|
||||||
add_library(toml11::toml11 ALIAS toml11)
|
add_library(toml11::toml11 ALIAS toml11)
|
||||||
|
|
||||||
# Write config and version config files
|
# Write config and version config files
|
||||||
include(CMakePackageConfigHelpers)
|
include(CMakePackageConfigHelpers)
|
||||||
write_basic_package_version_file(
|
write_basic_package_version_file(
|
||||||
${toml11_config_version}
|
${toml11_config_version}
|
||||||
VERSION ${toml11_VERSION}
|
VERSION ${toml11_VERSION}
|
||||||
COMPATIBILITY SameMajorVersion
|
COMPATIBILITY SameMajorVersion
|
||||||
)
|
)
|
||||||
|
|
||||||
configure_package_config_file(
|
configure_package_config_file(
|
||||||
cmake/toml11Config.cmake.in
|
cmake/toml11Config.cmake.in
|
||||||
${toml11_config}
|
${toml11_config}
|
||||||
INSTALL_DESTINATION ${toml11_install_cmake_dir}
|
INSTALL_DESTINATION ${toml11_install_cmake_dir}
|
||||||
PATH_VARS toml11_install_cmake_dir
|
PATH_VARS toml11_install_cmake_dir
|
||||||
)
|
)
|
||||||
|
|
||||||
# Install config files
|
# Install config files
|
||||||
install(FILES ${toml11_config} ${toml11_config_version}
|
install(FILES ${toml11_config} ${toml11_config_version}
|
||||||
DESTINATION ${toml11_install_cmake_dir}
|
DESTINATION ${toml11_install_cmake_dir}
|
||||||
)
|
)
|
||||||
|
|
||||||
# Install header files
|
# Install header files
|
||||||
install(
|
install(
|
||||||
FILES toml.hpp
|
FILES toml.hpp
|
||||||
DESTINATION "${toml11_install_include_dir}"
|
DESTINATION "${toml11_install_include_dir}"
|
||||||
)
|
)
|
||||||
install(
|
install(
|
||||||
DIRECTORY "toml"
|
DIRECTORY "toml"
|
||||||
DESTINATION "${toml11_install_include_dir}"
|
DESTINATION "${toml11_install_include_dir}"
|
||||||
FILES_MATCHING PATTERN "*.hpp"
|
FILES_MATCHING PATTERN "*.hpp"
|
||||||
)
|
)
|
||||||
|
|
||||||
# Export targets and install them
|
# Export targets and install them
|
||||||
install(TARGETS toml11
|
install(TARGETS toml11
|
||||||
EXPORT toml11Targets
|
EXPORT toml11Targets
|
||||||
)
|
)
|
||||||
install(EXPORT toml11Targets
|
install(EXPORT toml11Targets
|
||||||
FILE toml11Targets.cmake
|
FILE toml11Targets.cmake
|
||||||
DESTINATION ${toml11_install_cmake_dir}
|
DESTINATION ${toml11_install_cmake_dir}
|
||||||
NAMESPACE toml11::
|
NAMESPACE toml11::
|
||||||
)
|
)
|
||||||
|
|
||||||
if (toml11_BUILD_TEST)
|
if (toml11_BUILD_TEST)
|
||||||
add_subdirectory(tests)
|
add_subdirectory(tests)
|
||||||
endif ()
|
endif ()
|
||||||
|
@ -105,4 +105,4 @@ endforeach(TEST_NAME)
|
|||||||
add_executable(test_multiple_translation_unit
|
add_executable(test_multiple_translation_unit
|
||||||
test_multiple_translation_unit_1.cpp
|
test_multiple_translation_unit_1.cpp
|
||||||
test_multiple_translation_unit_2.cpp)
|
test_multiple_translation_unit_2.cpp)
|
||||||
target_link_libraries(test_multiple_translation_unit toml11::toml11)
|
target_link_libraries(test_multiple_translation_unit toml11::toml11)
|
||||||
|
Loading…
Reference in New Issue
Block a user