Skip to content
Snippets Groups Projects
Commit 6975c8c8 authored by Guillaume Pasero's avatar Guillaume Pasero
Browse files

BUG: Mantis-1428: undefined variables when building outside OTB

parent 12722ef7
No related branches found
No related tags found
No related merge requests found
...@@ -67,7 +67,7 @@ macro(otb_create_application) ...@@ -67,7 +67,7 @@ macro(otb_create_application)
endif() endif()
else() else()
install(TARGETS ${APPLICATION_TARGET_NAME} install(TARGETS ${APPLICATION_TARGET_NAME}
LIBRARY DESTINATION ${CMAKE_INSTALL_PREFIX}/lib LIBRARY DESTINATION lib
COMPONENT RuntimeLibraries) COMPONENT RuntimeLibraries)
endif() endif()
...@@ -79,9 +79,19 @@ macro(otb_create_application) ...@@ -79,9 +79,19 @@ macro(otb_create_application)
set(APPLICATION_BINARY_PATH ${CMAKE_CURRENT_BINARY_DIR}) set(APPLICATION_BINARY_PATH ${CMAKE_CURRENT_BINARY_DIR})
endif() endif()
if(CMAKE_RUNTIME_OUTPUT_DIRECTORY)
set(_script_output_dir ${CMAKE_RUNTIME_OUTPUT_DIRECTORY})
else()
set(_script_output_dir ${CMAKE_BINARY_DIR}/bin)
endif()
if(OTB_INSTALL_RUNTIME_DIR)
set(_script_install_dir ${OTB_INSTALL_RUNTIME_DIR})
else()
set(_script_install_dir bin)
endif()
set(INTERMEDIATE_DIR ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}) set(INTERMEDIATE_DIR ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY})
set(SCRIPT_EXT "") set(SCRIPT_EXT "")
if (WIN32) if(WIN32)
set(SCRIPT_EXT ".bat") set(SCRIPT_EXT ".bat")
endif() endif()
...@@ -95,11 +105,11 @@ macro(otb_create_application) ...@@ -95,11 +105,11 @@ macro(otb_create_application)
TYPE ${type}) TYPE ${type})
# Copy it next to the application shared lib, and give executable rights # Copy it next to the application shared lib, and give executable rights
file(COPY ${INTERMEDIATE_DIR}/${SCRIPT_NAME} file(COPY ${INTERMEDIATE_DIR}/${SCRIPT_NAME}
DESTINATION ${CMAKE_RUNTIME_OUTPUT_DIRECTORY} DESTINATION ${_script_output_dir}
FILE_PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE) FILE_PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE)
# Install a version of this script if we are inside the OTB build # Install a version of this script if we are inside the OTB build
install(PROGRAMS ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${SCRIPT_NAME} install(PROGRAMS ${_script_output_dir}/${SCRIPT_NAME}
DESTINATION ${OTB_INSTALL_RUNTIME_DIR} DESTINATION ${_script_install_dir}
COMPONENT Runtime) COMPONENT Runtime)
endforeach() endforeach()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment