Merge pull request #12732 from birarda/bug/scripts-copy-in-dev

fix cmake changes for script copy for dev builds
This commit is contained in:
Stephen Birarda 2018-03-28 15:55:37 -07:00 committed by GitHub
commit a697f971bb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -312,7 +312,7 @@ if (APPLE)
COMPONENT ${CLIENT_COMPONENT} COMPONENT ${CLIENT_COMPONENT}
) )
set(RESOURCES_INSTALL_DIR "${INTERFACE_INSTALL_APP_PATH}/Contents/Resources") set(SCRIPTS_INSTALL_DIR "${INTERFACE_INSTALL_APP_PATH}/Contents/Resources")
set(RESOURCES_DEV_DIR "$<TARGET_FILE_DIR:${TARGET_NAME}>/../Resources") set(RESOURCES_DEV_DIR "$<TARGET_FILE_DIR:${TARGET_NAME}>/../Resources")
# copy script files beside the executable # copy script files beside the executable
@ -326,13 +326,14 @@ if (APPLE)
fixup_interface() fixup_interface()
else() else()
set(RESOURCES_DEV_DIR "$<TARGET_FILE_DIR:${TARGET_NAME}>/resources") set(INTERFACE_EXEC_DIR "$<TARGET_FILE_DIR:${TARGET_NAME}>")
set(RESOURCES_DEV_DIR "${INTERFACE_EXEC_DIR}/resources")
# copy the resources files beside the executable # copy the resources files beside the executable
add_custom_command(TARGET ${TARGET_NAME} POST_BUILD add_custom_command(TARGET ${TARGET_NAME} POST_BUILD
COMMAND "${CMAKE_COMMAND}" -E copy_if_different COMMAND "${CMAKE_COMMAND}" -E copy_if_different
"${RESOURCES_RCC}" "${RESOURCES_RCC}"
"$<TARGET_FILE_DIR:interface>" "${INTERFACE_EXEC_DIR}"
# FIXME, the edit script code loads HTML from the scripts folder # FIXME, the edit script code loads HTML from the scripts folder
# which in turn relies on CSS that refers to the fonts. In theory # which in turn relies on CSS that refers to the fonts. In theory
# we should be able to modify the CSS to reference the QRC path to # we should be able to modify the CSS to reference the QRC path to
@ -340,13 +341,13 @@ else()
# so we have to retain a copy of the fonts outside of the resources binary # so we have to retain a copy of the fonts outside of the resources binary
COMMAND "${CMAKE_COMMAND}" -E copy_directory COMMAND "${CMAKE_COMMAND}" -E copy_directory
"${PROJECT_SOURCE_DIR}/resources/fonts" "${PROJECT_SOURCE_DIR}/resources/fonts"
"$<TARGET_FILE_DIR:${TARGET_NAME}>/resources/fonts" "${RESOURCES_DEV_DIR}/fonts"
COMMAND "${CMAKE_COMMAND}" -E copy_directory COMMAND "${CMAKE_COMMAND}" -E copy_directory
"${CMAKE_SOURCE_DIR}/scripts" "${CMAKE_SOURCE_DIR}/scripts"
"${RESOURCES_DEV_DIR}/scripts" "${INTERFACE_EXEC_DIR}/scripts"
COMMAND "${CMAKE_COMMAND}" -E copy_if_different COMMAND "${CMAKE_COMMAND}" -E copy_if_different
"${PROJECT_SOURCE_DIR}/resources/serverless/tutorial.json" "${PROJECT_SOURCE_DIR}/resources/serverless/tutorial.json"
"$<TARGET_FILE_DIR:${TARGET_NAME}>/resources/serverless/tutorial.json" "${RESOURCES_DEV_DIR}/serverless/tutorial.json"
) )
# link target to external libraries # link target to external libraries
@ -363,7 +364,7 @@ else()
PATTERN "*.exp" EXCLUDE PATTERN "*.exp" EXCLUDE
) )
set(RESOURCES_INSTALL_DIR "${INTERFACE_INSTALL_DIR}") set(SCRIPTS_INSTALL_DIR "${INTERFACE_INSTALL_DIR}")
set(EXECUTABLE_COMPONENT ${CLIENT_COMPONENT}) set(EXECUTABLE_COMPONENT ${CLIENT_COMPONENT})
@ -371,11 +372,11 @@ else()
endif() endif()
endif() endif()
if (RESOURCES_INSTALL_DIR) if (SCRIPTS_INSTALL_DIR)
# setup install of scripts beside interface executable # setup install of scripts beside interface executable
install( install(
DIRECTORY "${CMAKE_SOURCE_DIR}/scripts/" DIRECTORY "${CMAKE_SOURCE_DIR}/scripts/"
DESTINATION ${RESOURCES_INSTALL_DIR}/scripts DESTINATION ${SCRIPTS_INSTALL_DIR}/scripts
COMPONENT ${CLIENT_COMPONENT} COMPONENT ${CLIENT_COMPONENT}
) )
endif() endif()