cmake: Fix PACKAGE and INSTALL targets

INSTALL would incorrectly copy /data instead of the content of /data, resulting in the plugin not being able to load effects and default images.

PACKAGE was running from the wrong directory, resulting in an extra ".." directory being added, which was invisible for some decompression software.
This commit is contained in:
Michael Fabian 'Xaymar' Dirks 2017-11-03 10:48:06 +01:00
parent a0eb5444cd
commit 13fd771ab9

View file

@ -157,20 +157,18 @@ if(TARGET libobs)
else() else()
INSTALL(TARGETS obs-stream-effects DESTINATION "${INSTALL_DIR}/obs-plugins/${BITS}bit") INSTALL(TARGETS obs-stream-effects DESTINATION "${INSTALL_DIR}/obs-plugins/${BITS}bit")
INSTALL(FILES $<TARGET_PDB_FILE:obs-stream-effects> DESTINATION "${INSTALL_DIR}/obs-plugins/${BITS}bit" OPTIONAL) INSTALL(FILES $<TARGET_PDB_FILE:obs-stream-effects> DESTINATION "${INSTALL_DIR}/obs-plugins/${BITS}bit" OPTIONAL)
INSTALL(DIRECTORY "${PROJECT_SOURCE_DIR}/data" DESTINATION "${INSTALL_DIR}/data/obs-plugins/obs-stream-effects" OPTIONAL) INSTALL(DIRECTORY "${PROJECT_SOURCE_DIR}/data/" DESTINATION "${INSTALL_DIR}/data/obs-plugins/obs-stream-effects" OPTIONAL)
# Zip Generator # Zip Generator
ADD_CUSTOM_TARGET(PACKAGE_ZIP COMMAND ADD_CUSTOM_TARGET(PACKAGE_ZIP COMMAND
${CMAKE_COMMAND} -E tar "cfv" ${CMAKE_COMMAND} -E tar "cfv" "${INSTALL_DIR}/obs-stream-effects.${VERSION_STR}.zip" --format=zip -- "${INSTALL_DIR}/data/" "${INSTALL_DIR}/obs-plugins"
"${INSTALL_DIR}/obs-stream-effects.${VERSION_STR}.zip" DEPENDS INSTALL obs-stream-effects
--format=zip WORKING_DIRECTORY "${INSTALL_DIR}")
"${INSTALL_DIR}/data" "${INSTALL_DIR}/obs-plugins")
# 7-Zip Generator # 7-Zip Generator
ADD_CUSTOM_TARGET(PACKAGE_7ZIP COMMAND ADD_CUSTOM_TARGET(PACKAGE_7ZIP COMMAND
${CMAKE_COMMAND} -E tar "cfv" ${CMAKE_COMMAND} -E tar "cfv" "${INSTALL_DIR}/obs-stream-effects.${VERSION_STR}.7z" --format=7zip -- "${INSTALL_DIR}/data/" "${INSTALL_DIR}/obs-plugins"
"${INSTALL_DIR}/obs-stream-effects.${VERSION_STR}.7z" DEPENDS INSTALL obs-stream-effects
--format=7zip WORKING_DIRECTORY "${INSTALL_DIR}")
"${INSTALL_DIR}/data" "${INSTALL_DIR}/obs-plugins")
endif() endif()