mirror of
https://github.com/michaelrsweet/mxml.git
synced 2024-11-24 03:15:30 +00:00
Add CMakeLists.txt stuff
This commit is contained in:
parent
ab78fd816f
commit
e11139a18c
55
CMakeLists.txt
Normal file
55
CMakeLists.txt
Normal file
@ -0,0 +1,55 @@
|
||||
cmake_minimum_required(VERSION 3.8)
|
||||
|
||||
set(VERSION 3.2)
|
||||
|
||||
project(
|
||||
mxml
|
||||
VERSION ${VERSION}
|
||||
LANGUAGES C)
|
||||
|
||||
set(SOURCES
|
||||
mxml-attr.c
|
||||
mxml-entity.c
|
||||
mxml-file.c
|
||||
mxml-get.c
|
||||
mxml-index.c
|
||||
mxml-node.c
|
||||
mxml-private.c
|
||||
mxml-search.c
|
||||
mxml-set.c
|
||||
mxml-string.c)
|
||||
|
||||
set(HEADERS mxml-private.h)
|
||||
|
||||
configure_file(config.h.in config.h)
|
||||
|
||||
add_library(${PROJECT_NAME} ${SOURCES} ${HEADERS})
|
||||
target_include_directories(
|
||||
${PROJECT_NAME} PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
|
||||
$<INSTALL_INTERFACE:include>)
|
||||
add_library(MSweet::${PROJECT_NAME} ALIAS ${PROJECT_NAME})
|
||||
|
||||
# install library
|
||||
install(
|
||||
TARGETS ${PROJECT_NAME}
|
||||
EXPORT ${PROJECT_NAME}Targets
|
||||
LIBRARY DESTINATION lib
|
||||
ARCHIVE DESTINATION lib
|
||||
RUNTIME DESTINATION bin
|
||||
INCLUDES
|
||||
DESTINATION include)
|
||||
|
||||
install(
|
||||
EXPORT ${PROJECT_NAME}Targets
|
||||
DESTINATION lib/cmake/${PROJECT_NAME}
|
||||
FILE ${PROJECT_NAME}Targets.cmake
|
||||
NAMESPACE MSweet::)
|
||||
|
||||
install(FILES mxml.h DESTINATION include)
|
||||
|
||||
include(CMakePackageConfigHelpers)
|
||||
write_basic_package_version_file(${PROJECT_NAME}ConfigVersion.cmake
|
||||
COMPATIBILITY SameMajorVersion)
|
||||
install(FILES ${PROJECT_NAME}Config.cmake
|
||||
${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}ConfigVersion.cmake
|
||||
DESTINATION lib/cmake/${PROJECT_NAME})
|
2
mxmlConfig.cmake
Normal file
2
mxmlConfig.cmake
Normal file
@ -0,0 +1,2 @@
|
||||
include(CMakeFindDependencyMacro)
|
||||
include("${CMAKE_CURRENT_LIST_DIR}/mxmlTargets.cmake")
|
Loading…
Reference in New Issue
Block a user