From 20060920765ccbddb83685708d26df0da08b3911 Mon Sep 17 00:00:00 2001 From: PatTheMav Date: Wed, 3 Aug 2022 17:02:10 +0200 Subject: [PATCH] cmake: Fix missing header installation for libobs and obs-frontend-api --- cmake/Modules/ObsHelpers.cmake | 17 +++++++++++------ cmake/Modules/ObsHelpers_Linux.cmake | 9 +++------ 2 files changed, 14 insertions(+), 12 deletions(-) diff --git a/cmake/Modules/ObsHelpers.cmake b/cmake/Modules/ObsHelpers.cmake index a5ec54c5b..e7998c96f 100644 --- a/cmake/Modules/ObsHelpers.cmake +++ b/cmake/Modules/ObsHelpers.cmake @@ -249,24 +249,29 @@ endfunction() function(export_target target) set(CMAKE_EXPORT_PACKAGE_REGISTRY OFF) + if(OS_LINUX) + set(_EXCLUDE "") + else() + set(_EXCLUDE "EXCLUDE_FROM_ALL") + endif() install( TARGETS ${target} EXPORT ${target}Targets RUNTIME DESTINATION ${OBS_EXECUTABLE_DESTINATION} COMPONENT obs_libraries - EXCLUDE_FROM_ALL + ${_EXCLUDE} LIBRARY DESTINATION ${OBS_LIBRARY_DESTINATION} COMPONENT obs_libraries - EXCLUDE_FROM_ALL + ${_EXCLUDE} ARCHIVE DESTINATION ${OBS_LIBRARY_DESTINATION} COMPONENT obs_libraries - EXCLUDE_FROM_ALL + ${_EXCLUDE} INCLUDES DESTINATION ${OBS_INCLUDE_DESTINATION} PUBLIC_HEADER DESTINATION ${OBS_INCLUDE_DESTINATION} COMPONENT obs_libraries - EXCLUDE_FROM_ALL) + ${_EXCLUDE}) include(GenerateExportHeader) generate_export_header(${target} EXPORT_FILE_NAME @@ -301,14 +306,14 @@ function(export_target target) NAMESPACE OBS:: DESTINATION ${OBS_CMAKE_DESTINATION}/${target} COMPONENT obs_libraries - EXCLUDE_FROM_ALL) + ${_EXCLUDE}) install( FILES ${CMAKE_CURRENT_BINARY_DIR}/${target}Config.cmake ${CMAKE_CURRENT_BINARY_DIR}/${target}ConfigVersion.cmake DESTINATION ${OBS_CMAKE_DESTINATION}/${target} COMPONENT obs_libraries - EXCLUDE_FROM_ALL) + ${_EXCLUDE}) endfunction() # Helper function to define available graphics modules for targets diff --git a/cmake/Modules/ObsHelpers_Linux.cmake b/cmake/Modules/ObsHelpers_Linux.cmake index 66b80b7dc..a4c663eb9 100644 --- a/cmake/Modules/ObsHelpers_Linux.cmake +++ b/cmake/Modules/ObsHelpers_Linux.cmake @@ -93,23 +93,20 @@ function(install_headers target) FILES "${CMAKE_CURRENT_SOURCE_DIR}/audio-monitoring/pulse/pulseaudio-wrapper.h" DESTINATION "${OBS_INCLUDE_DESTINATION}/audio-monitoring/pulse/" - COMPONENT obs_libraries - EXCLUDE_FROM_ALL) + COMPONENT obs_libraries) endif() if(ENABLE_HEVC) install( FILES "${CMAKE_CURRENT_SOURCE_DIR}/obs-hevc.h" DESTINATION "${OBS_INCLUDE_DESTINATION}" - COMPONENT obs_libraries - EXCLUDE_FROM_ALL) + COMPONENT obs_libraries) endif() if(NOT EXISTS "${OBS_INCLUDE_DESTINATION}/obsconfig.h") install( FILES "${CMAKE_BINARY_DIR}/config/obsconfig.h" DESTINATION "${OBS_INCLUDE_DESTINATION}" - COMPONENT obs_libraries - EXCLUDE_FROM_ALL) + COMPONENT obs_libraries) endif() endfunction()