Browse Source

update

master
Arwed Mett 4 years ago
parent
commit
a5cd2ea389
Signed by: Pfeifenjoy GPG Key ID: 86943827297DA9FC
  1. 27
      CMakeLists.txt
  2. 2
      LoggingConfig.cmake

27
CMakeLists.txt

@ -1,34 +1,35 @@
cmake_minimum_required(VERSION 3.5)
project(logging.h VERSION 0.0.1 LANGUAGES C)
project(Logging VERSION 0.0.1 LANGUAGES C)
add_library(logging.h src/logging.c)
target_include_directories(logging.h PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
add_library(Logging src/logging.c)
target_include_directories(Logging PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}/include>
$<INSTALL_INTERFACE:include>
)
add_executable(example example/main.c)
target_link_libraries(example logging.h)
target_link_libraries(example Logging)
install(TARGETS logging.h EXPORT Targets
install(TARGETS Logging EXPORT LoggingTargets
ARCHIVE DESTINATION lib
LIBRARY DESTINATION lib
RUNTIME DESTINATION bin
INCLUDES DESTINATION include
)
install(DIRECTORY include/logging DESTINATION include)
install(EXPORT Targets
FILE Targets.cmake
NAMESPACE logging.h::
DESTINATION lib/cmake/logging.h
install(EXPORT LoggingTargets
FILE LoggingTargets.cmake
NAMESPACE Logging::
DESTINATION lib/cmake/Logging
)
include(CMakePackageConfigHelpers)
write_basic_package_version_file(Logging.hConfig.cmake
write_basic_package_version_file("LoggingConfigVersion.cmake"
VERSION ${Logging_VERSION}
COMPATIBILITY SameMajorVersion
)
install(FILES build/Logging.hConfig.cmake DESTINATION lib/cmake/logging.h)
install(FILES "LoggingConfig.cmake" "${CMAKE_CURRENT_BINARY_DIR}/LoggingConfigVersion.cmake" DESTINATION lib/cmake/Logging)
#CPack
set(CPACK_PACKAGE_CONTACT "arwed.mett@googlemail.com")

2
LoggingConfig.cmake

@ -0,0 +1,2 @@
include(CMakeFindDependencyMacro)
include("${CMAKE_CURRENT_LIST_DIR}/LoggingTargets.cmake")
Loading…
Cancel
Save