add_library(ScopeGuard INTERFACE) | add_library(ScopeGuard INTERFACE) | ||||
target_include_directories(ScopeGuard INTERFACE "include") | |||||
target_include_directories(ScopeGuard INTERFACE | |||||
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include> | |||||
$<INSTALL_INTERFACE:include>) | |||||
if( UNITTEST ) | if( UNITTEST ) |
include(GNUInstallDirs) | |||||
install(TARGETS ScopeGuard | |||||
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} | |||||
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} | |||||
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} | |||||
) | |||||
install(TARGETS ScopeGuard EXPORT ScopeGuard-config DESTINATION include) | |||||
install(EXPORT ScopeGuard-config DESTINATION share/scopeguard/cmake) | |||||