Commit 6918df69 authored by Rashad Kanavath's avatar Rashad Kanavath

BUG: error generating qgis descriptors

below commit uses POST_BUILD and PRE_BUILD to generate a fresh copy of
descriptor files for all OTB applications.
b963a177

This has broken dashboard due to a dependency issue.
https://dash.orfeo-toolbox.org/buildSummary.php?buildid=318175

otbQgisDescriptor is not dependent on any otb applications and it is
TRUE. But it has a run-time dependency to all otb applications when we
auto-generating all depscriptors. This situation forces us to add a
dependency so that POST, PRE building targets works. These are only
executed if otbQgisDescriptor target is rebuilt hence, it is not run
everytime with make.

Revert of the initial commit[2] is to get source tree in to a stage which
was reviewed. The first version of post,pre build was pushed directly to
release rather than via MR. Current state in release-6.6 will result in
broken dashboard.

[2] 3f7b6d40
parent 3f7b6d40
......@@ -20,42 +20,28 @@
add_executable(otbQgisDescriptor otbQgisDescriptor.cxx)
target_link_libraries(otbQgisDescriptor ${OTBQgis_LIBRARIES})
otb_module_target(otbQgisDescriptor)
set(dfiles)
foreach(app_name ${OTB_APPLICATIONS_NAME_LIST})
add_dependencies(otbQgisDescriptor otbapp_${app_name})
endforeach()
set(app_names ${OTB_APPLICATIONS_NAME_LIST})
list(REMOVE_ITEM app_names "TestApplication")
list(REMOVE_ITEM app_names "ApplicationExample")
list(REMOVE_DUPLICATES app_names)
foreach(app_name ${app_names})
set(dfile "${OTB_BINARY_DIR}/descriptors/${app_name}.txt")
add_custom_command(OUTPUT "${dfile}"
add_custom_command(TARGET otbQgisDescriptor POST_BUILD
COMMAND "$<TARGET_FILE:otbQgisDescriptor>"
"${app_name}" "${OTB_BINARY_DIR}/${OTB_INSTALL_APP_DIR}" "${OTB_BINARY_DIR}/${OTB_INSTALL_DESCR_DIR}/"
DEPENDS otbQgisDescriptor
WORKING_DIRECTORY ${OTB_BINARY_DIR}
COMMENT "./bin/otbQgisDescriptor ${app_name} ./${OTB_INSTALL_APP_DIR} ./${OTB_INSTALL_DESCR_DIR}/"
VERBATIM)
list(APPEND dfiles "${dfile}")
endforeach()
add_custom_target(clean_descr.dirs
add_custom_command(TARGET otbQgisDescriptor PRE_BUILD
COMMAND "${CMAKE_COMMAND}" "-E" "echo" "Cleaning ${OTB_BINARY_DIR}/${OTB_INSTALL_DESCR_DIR}/"
COMMAND "${CMAKE_COMMAND}" "-E" "remove_directory" "${OTB_BINARY_DIR}/${OTB_INSTALL_DESCR_DIR}/"
COMMAND "${CMAKE_COMMAND}" "-E" "make_directory" "${OTB_BINARY_DIR}/${OTB_INSTALL_DESCR_DIR}/"
DEPENDS otbQgisDescriptor
)
add_custom_target(generate_descriptors
COMMAND "${CMAKE_COMMAND}" "-E" "echo" "Generated descriptor files for QGIS"
DEPENDS clean_descr.dirs ${dfiles}
)
install(CODE "
message(STATUS \"Generating descriptor files for QGIS in ${OTB_INSTALL_DESCR_DIR}\")
execute_process(
COMMAND ${CMAKE_COMMAND} --build \"${OTB_BINARY_DIR}\" --target generate_descriptors
COMMAND ${CMAKE_COMMAND} -E echo \"Installing: ${CMAKE_INSTALL_PREFIX}/${OTB_INSTALL_DESCR_DIR}/\"
COMMAND ${CMAKE_COMMAND} -E copy_directory \"${OTB_BINARY_DIR}/${OTB_INSTALL_DESCR_DIR}\" \"${CMAKE_INSTALL_PREFIX}/${OTB_INSTALL_DESCR_DIR}\"
WORKING_DIRECTORY \"${OTB_BINARY_DIR}\"
)
")
install(DIRECTORY ${OTB_BINARY_DIR}/${OTB_INSTALL_DESCR_DIR}
DESTINATION share/otb)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment