Commit 50254d3c authored by Guillaume Pasero's avatar Guillaume Pasero

Merge branch '1676-qgis-descriptor-lib64' into 'develop'

Resolve "Build fails on OtbQgisDescriptor usage if OTB_INSTALL_APP_DIR is set to lib64/otb/applications"

Closes #1676

See merge request orfeotoolbox/otb!218
parents 31c5dbb5 450962e2
......@@ -156,16 +156,16 @@ if(NOT OTB_INSTALL_INCLUDE_DIR)
set(OTB_INSTALL_INCLUDE_DIR include/OTB-${OTB_VERSION_MAJOR}.${OTB_VERSION_MINOR})
endif()
if(NOT OTB_INSTALL_APP_DIR)
set(OTB_INSTALL_APP_DIR "lib/otb/applications")
set(OTB_INSTALL_APP_DIR "${OTB_INSTALL_LIBRARY_DIR}/otb/applications")
endif()
if(NOT OTB_INSTALL_PYTHON_DIR)
set(OTB_INSTALL_PYTHON_DIR "lib/otb/python")
set(OTB_INSTALL_PYTHON_DIR "${OTB_INSTALL_LIBRARY_DIR}/otb/python")
endif()
if(NOT OTB_INSTALL_PYTHON3_DIR)
set(OTB_INSTALL_PYTHON3_DIR "lib/otb/python3")
set(OTB_INSTALL_PYTHON3_DIR "${OTB_INSTALL_LIBRARY_DIR}/otb/python3")
endif()
if(NOT OTB_INSTALL_JAVA_DIR)
set(OTB_INSTALL_JAVA_DIR "lib/otb/java")
set(OTB_INSTALL_JAVA_DIR "${OTB_INSTALL_LIBRARY_DIR}/otb/java")
endif()
if(NOT OTB_INSTALL_DATA_DIR)
set(OTB_INSTALL_DATA_DIR "share/otb")
......
......@@ -27,6 +27,8 @@ add_custom_command(TARGET otbQgisDescriptor PRE_BUILD
COMMAND "${CMAKE_COMMAND}" "-E" "make_directory" "${OTB_BINARY_DIR}/${OTB_INSTALL_DATA_DIR}/description/"
)
file(RELATIVE_PATH app_location ${OTB_BINARY_DIR} ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/otb/applications)
set(app_names ${OTB_APPLICATIONS_NAME_LIST})
list(REMOVE_ITEM app_names "TestApplication")
list(REMOVE_ITEM app_names "ApplicationExample")
......@@ -44,9 +46,9 @@ foreach(app_name ${app_names})
set(dfile "${OTB_BINARY_DIR}/${OTB_INSTALL_DATA_DIR}/description/${app_name}.txt")
add_custom_command(OUTPUT "${dfile}"
COMMAND ${generate_descriptor_cmd}
"${app_name}" "${OTB_BINARY_DIR}/${OTB_INSTALL_APP_DIR}" "${OTB_BINARY_DIR}/${OTB_INSTALL_DATA_DIR}/description/"
"${app_name}" "${app_location}" "./${OTB_INSTALL_DATA_DIR}/description/"
WORKING_DIRECTORY ${OTB_BINARY_DIR}
COMMENT "./bin/otbQgisDescriptor ${app_name} ./${OTB_INSTALL_APP_DIR} ./${OTB_INSTALL_DATA_DIR}/description/"
COMMENT "./bin/otbQgisDescriptor ${app_name} ${app_location} ./${OTB_INSTALL_DATA_DIR}/description/"
VERBATIM)
list(APPEND dfiles "${dfile}")
endforeach()
......
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