diff --git a/common/CMakeLists.txt b/common/CMakeLists.txt index aba02d6e6..fc2665065 100644 --- a/common/CMakeLists.txt +++ b/common/CMakeLists.txt @@ -45,6 +45,7 @@ set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR}/cmake) include(FindPkgConfig) include(FeatureSummary) +include(GNUInstallDirs) include(GetVersion) # Get version info and buildid from Git diff --git a/common/lib/CMakeLists.txt b/common/lib/CMakeLists.txt index 47eb3ac13..c4f103d7e 100644 --- a/common/lib/CMakeLists.txt +++ b/common/lib/CMakeLists.txt @@ -87,3 +87,26 @@ target_link_libraries(villas-common PUBLIC target_compile_definitions(villas-common PUBLIC -D__STDC_FORMAT_MACROS -D_GNU_SOURCE ) + +install( + TARGETS villas-common + EXPORT VILLASCommonConfig + COMPONENT lib + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} +) + +install( + DIRECTORY ${PROJECT_SOURCE_DIR}/include/villas/ + DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/villas + COMPONENT devel + FILES_MATCHING + PATTERN "*.h" +) + +install( + DIRECTORY ${PROJECT_BINARY_DIR}/include/villas/ + DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/villas + COMPONENT devel + FILES_MATCHING + PATTERN "*.h" +)