mirror of
https://git.code.sf.net/p/zint/code
synced 2025-05-23 03:26:56 -04:00
CMake: use "GNUInstallDirs" instead of old (2008) KDE
"SetPaths.cmake" (removed) - resolves absolute paths in "zint-targets.cmake", ticket #318, props John Alexander; also remove "FindZint.cmake" install as not best practice (Daniel Pfeifer “Effective CMake"), but retain in tree for now; also remove APPLE stuff re UNIVERSAL build, obsolete, and setting of CMAKE_OSX_SYSROOT, seems unnecessary
This commit is contained in:
parent
04e8cacb81
commit
d97fc7e110
6 changed files with 23 additions and 324 deletions
|
@ -1,5 +1,5 @@
|
|||
# Copyright (C) 2008 by BogDan Vatra < bogdan@licentia.eu >
|
||||
# Copyright (C) 2009-2022 Robin Stuart <rstuart114@gmail.com>
|
||||
# Copyright (C) 2009-2024 Robin Stuart <rstuart114@gmail.com>
|
||||
# vim: set ts=4 sw=4 et :
|
||||
|
||||
project(zint)
|
||||
|
@ -93,17 +93,22 @@ endif()
|
|||
|
||||
zint_target_include_directories(PUBLIC
|
||||
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
|
||||
$<INSTALL_INTERFACE:${INCLUDE_INSTALL_DIR}>
|
||||
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
|
||||
)
|
||||
|
||||
# Adapted from old (2008) KDE "SetPaths.cmake" to use GNUInstallDirs
|
||||
set(INSTALL_TARGETS_DEFAULT_ARGS RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}"
|
||||
LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}"
|
||||
ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}" COMPONENT Devel)
|
||||
|
||||
if(ZINT_SHARED)
|
||||
install(TARGETS zint EXPORT zint-targets ${INSTALL_TARGETS_DEFAULT_ARGS})
|
||||
endif()
|
||||
if(ZINT_STATIC)
|
||||
install(TARGETS zint-static EXPORT zint-targets ${INSTALL_TARGETS_DEFAULT_ARGS})
|
||||
endif()
|
||||
install(EXPORT zint-targets NAMESPACE zint:: DESTINATION "${SHARE_INSTALL_PREFIX}/zint")
|
||||
install(FILES zint.h DESTINATION ${INCLUDE_INSTALL_DIR} COMPONENT Devel)
|
||||
install(EXPORT zint-targets NAMESPACE zint:: DESTINATION "${CMAKE_INSTALL_DATADIR}/zint")
|
||||
install(FILES zint.h DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} COMPONENT Devel)
|
||||
|
||||
if(ZINT_TEST)
|
||||
add_subdirectory(tests)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue