Commit b021be29 authored by David Zemon's avatar David Zemon

Add support for .tar.gz and .zip packages via CPack

parent 55e7844c
......@@ -91,13 +91,27 @@ if(SPDLOG_BUILD_BENCH)
add_subdirectory(bench)
endif()
#---------------------------------------------------------------------------------------
# install
#---------------------------------------------------------------------------------------
install(DIRECTORY ${HEADER_BASE} DESTINATION include)
install(TARGETS spdlog DESTINATION lib)
if (SPDLOG_INSTALL)
#---------------------------------------------------------------------------------------
# install
#---------------------------------------------------------------------------------------
install(DIRECTORY include/ DESTINATION include)
install(TARGETS spdlog EXPORT ${PROJECT_NAME} DESTINATION lib)
install(EXPORT ${PROJECT_NAME}
DESTINATION lib/${PROJECT_NAME}/cmake
NAMESPACE ${PROJECT_NAME}::
FILE ${PROJECT_NAME}Config.cmake
)
#---------------------------------------------------------------------------------------
# Support creation of installable packages
#---------------------------------------------------------------------------------------
include(SpdlogCPack.cmake)
endif ()
#---------------------------------------------------------------------------------------
# register project in CMake user registry
# register project in CMake user registry - disabled by default since the
# installed/packaged version of the project is preferred.
#---------------------------------------------------------------------------------------
option(CMAKE_EXPORT_NO_PACKAGE_REGISTRY "Disable registration of CMake's build directory." ON)
export(PACKAGE ${PROJECT_NAME})
set(CPACK_GENERATOR
TGZ
ZIP
)
set(CPACK_INCLUDE_TOPLEVEL_DIRECTORY 0)
set(CPACK_INSTALL_CMAKE_PROJECTS
"${CMAKE_BINARY_DIR}"
"${PROJECT_NAME}"
ALL
.
)
set(CPACK_PROJECT_URL "https://github.com/gabime/spdlog")
set(CPACK_PACKAGE_VENDOR "Gabi Melman")
set(CPACK_PACKAGE_CONTACT "Gabi Melman <gmelman1@gmail.com>")
set(CPACK_PACKAGE_VERSION_MAJOR ${PROJECT_VERSION_MAJOR})
set(CPACK_PACKAGE_VERSION_MINOR ${PROJECT_VERSION_MINOR})
set(CPACK_PACKAGE_VERSION_PATCH ${PROJECT_VERSION_PATCH})
set(CPACK_PACKAGE_VERSION ${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH})
if (PROJECT_VERSION_TWEAK)
set(CPACK_PACKAGE_VERSION ${CPACK_PACKAGE_VERSION}.${PROJECT_VERSION_TWEAK})
endif ()
set(CPACK_PACKAGE_RELOCATABLE ON)
include(CPack)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment