-
Notifications
You must be signed in to change notification settings - Fork 2
fix: macro path to refer install #48
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
b443121
cdd6351
ec03dfb
89c1c31
0acc3e5
88c425a
d1a02c9
75de3dc
7074dbe
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -17,32 +17,28 @@ install( | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| USE_SOURCE_PERMISSIONS | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # Collect system descriptions | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # Scans the workspace source directory | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # and generates resource manifests in the build directory. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| add_custom_target(collect_system_design_manifests ALL | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| COMMAND ${CMAKE_COMMAND} -E remove_directory ${CMAKE_BINARY_DIR}/resource | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| COMMAND ${CMAKE_COMMAND} -E make_directory ${CMAKE_BINARY_DIR}/resource | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| COMMAND ${Python3_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/script/collect_system_design_manifests.py | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ${CMAKE_CURRENT_SOURCE_DIR} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ${CMAKE_BINARY_DIR}/resource | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ${CMAKE_INSTALL_PREFIX} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| COMMENT "Collecting autoware system descriptions" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # Collect system descriptions at install time. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # ${CMAKE_CURRENT_SOURCE_DIR} and ${Python3_EXECUTABLE} are expanded at configure time; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| install(CODE " | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| set(_dest_prefix \"\$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX}\") | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| execute_process( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| COMMAND \"${CMAKE_COMMAND}\" -E remove_directory | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| \"\${_dest_prefix}/share/${PROJECT_NAME}/resource\" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| execute_process( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| COMMAND \"${Python3_EXECUTABLE}\" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| \"${CMAKE_CURRENT_SOURCE_DIR}/script/collect_system_design_manifests.py\" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| \"${CMAKE_CURRENT_SOURCE_DIR}\" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| \"\${_dest_prefix}/share/${PROJECT_NAME}/resource\" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| \"\${CMAKE_INSTALL_PREFIX}\" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| COMMAND_ERROR_IS_FATAL ANY | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ") | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+20
to
37
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # Collect system descriptions at install time. | |
| # ${CMAKE_CURRENT_SOURCE_DIR} and ${Python3_EXECUTABLE} are expanded at configure time; | |
| install(CODE " | |
| set(_dest_prefix \"\$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX}\") | |
| execute_process( | |
| COMMAND \"${CMAKE_COMMAND}\" -E remove_directory | |
| \"\${_dest_prefix}/share/${PROJECT_NAME}/resource\" | |
| ) | |
| execute_process( | |
| COMMAND \"${Python3_EXECUTABLE}\" | |
| \"${CMAKE_CURRENT_SOURCE_DIR}/script/collect_system_design_manifests.py\" | |
| \"${CMAKE_CURRENT_SOURCE_DIR}\" | |
| \"\${_dest_prefix}/share/${PROJECT_NAME}/resource\" | |
| \"\${CMAKE_INSTALL_PREFIX}\" | |
| COMMAND_ERROR_IS_FATAL ANY | |
| ) | |
| ") | |
| # Collect system descriptions at build time so the generated manifests match | |
| # the workspace that is building this package, then install the generated files. | |
| set(_generated_resource_dir "${CMAKE_CURRENT_BINARY_DIR}/resource") | |
| add_custom_target(generate_system_design_manifests ALL | |
| COMMAND "${CMAKE_COMMAND}" -E remove_directory | |
| "${_generated_resource_dir}" | |
| COMMAND "${Python3_EXECUTABLE}" | |
| "${CMAKE_CURRENT_SOURCE_DIR}/script/collect_system_design_manifests.py" | |
| "${CMAKE_CURRENT_SOURCE_DIR}" | |
| "${_generated_resource_dir}" | |
| "${CMAKE_INSTALL_PREFIX}" | |
| BYPRODUCTS "${_generated_resource_dir}" | |
| COMMENT "Generating system design manifests" | |
| VERBATIM | |
| ) | |
| install( | |
| DIRECTORY "${_generated_resource_dir}/" | |
| DESTINATION share/${PROJECT_NAME}/resource | |
| ) |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -58,10 +58,39 @@ macro(autoware_system_designer_build_deploy project_name) | |
| endforeach() | ||
| endif() | ||
|
|
||
| set(BUILD_PY_SCRIPT "${CMAKE_BINARY_DIR}/../autoware_system_designer/script/deployment_process.py") | ||
| set(SYSTEM_DESIGNER_RUNNER_SCRIPT "${CMAKE_BINARY_DIR}/../autoware_system_designer/script/system_designer_runner.py") | ||
| set(SYSTEM_DESIGNER_SOURCE_DIR "${CMAKE_SOURCE_DIR}/../autoware_system_designer") | ||
| set(SYSTEM_DESIGNER_RESOURCE_DIR "${CMAKE_BINARY_DIR}/../autoware_system_designer/resource") | ||
| # Always call find_package so Python3_VERSION_MAJOR/MINOR are guaranteed set, | ||
| # even when the caller already found Python3 before invoking this macro. | ||
| find_package(Python3 REQUIRED COMPONENTS Interpreter) | ||
|
|
||
| # autoware_system_designer_DIR = <prefix>/share/autoware_system_designer/cmake | ||
| get_filename_component(_AWSD_SCRIPT_DIR "${autoware_system_designer_DIR}/../script" ABSOLUTE) | ||
| set(BUILD_PY_SCRIPT "${_AWSD_SCRIPT_DIR}/deployment_process.py") | ||
| set(SYSTEM_DESIGNER_RUNNER_SCRIPT "${_AWSD_SCRIPT_DIR}/system_designer_runner.py") | ||
|
|
||
| # Derive the installed Python package dir from the interpreter version. | ||
| # Glob + lexicographic sort mis-orders versions (e.g. python3.10 sorts before python3.9), | ||
| # so we use Python3_VERSION_MAJOR/MINOR to construct the exact path instead. | ||
| get_filename_component(_AWSD_INSTALL_PREFIX "${autoware_system_designer_DIR}/../../.." ABSOLUTE) | ||
| set(_AWSD_PYVER "${Python3_VERSION_MAJOR}.${Python3_VERSION_MINOR}") | ||
| set(_AWSD_PYTHON_PATH "") | ||
| foreach(_AWSD_SUBDIR | ||
| "local/lib/python${_AWSD_PYVER}/dist-packages" | ||
| "local/lib/python${_AWSD_PYVER}/site-packages" | ||
| "lib/python${_AWSD_PYVER}/dist-packages" | ||
| "lib/python${_AWSD_PYVER}/site-packages" | ||
| ) | ||
| if(EXISTS "${_AWSD_INSTALL_PREFIX}/${_AWSD_SUBDIR}") | ||
| set(_AWSD_PYTHON_PATH "${_AWSD_INSTALL_PREFIX}/${_AWSD_SUBDIR}") | ||
| break() | ||
| endif() | ||
| endforeach() | ||
| set(_AWSD_PYTHONPATH_ARGS "") | ||
| if(_AWSD_PYTHON_PATH) | ||
| set(_AWSD_PYTHONPATH_ARGS "PYTHONPATH=${_AWSD_PYTHON_PATH}") | ||
| endif() | ||
|
|
||
| get_filename_component(SYSTEM_DESIGNER_RESOURCE_DIR "${autoware_system_designer_DIR}/../resource" ABSOLUTE) | ||
|
|
||
| set(OUTPUT_ROOT_DIR "${CMAKE_INSTALL_PREFIX}/share/${CMAKE_PROJECT_NAME}/") | ||
| get_filename_component(WORKSPACE_ROOT "${CMAKE_BINARY_DIR}/../.." ABSOLUTE) | ||
| set(LOG_DIR "${WORKSPACE_ROOT}/log/latest_build/${CMAKE_PROJECT_NAME}") | ||
|
|
@@ -95,9 +124,9 @@ macro(autoware_system_designer_build_deploy project_name) | |
| add_custom_target(run_build_py_${_INPUT_NAME} ALL | ||
| COMMAND ${CMAKE_COMMAND} -E make_directory ${LOG_DIR} | ||
| COMMAND ${CMAKE_COMMAND} -E env | ||
| PYTHONPATH=${SYSTEM_DESIGNER_SOURCE_DIR}:$ENV{PYTHONPATH} | ||
| ${_AWSD_PYTHONPATH_ARGS} | ||
| AUTOWARE_SYSTEM_DESIGNER_BUILD_DEPLOY_STRICT=${AUTOWARE_SYSTEM_DESIGNER_BUILD_DEPLOY_STRICT} | ||
| python3 ${SYSTEM_DESIGNER_RUNNER_SCRIPT} | ||
| ${Python3_EXECUTABLE} ${SYSTEM_DESIGNER_RUNNER_SCRIPT} | ||
|
Comment on lines
126
to
+129
|
||
| deploy | ||
| --log-file ${LOG_FILE} | ||
| --print-level ${_PRINT_LEVEL} | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
execute_process(COMMAND_ERROR_IS_FATAL ANY)requires a newer CMake than the currentcmake_minimum_required(VERSION 3.14). With CMake 3.14 this will error at configure/install time. Either bump the minimum required CMake version to one that supportsCOMMAND_ERROR_IS_FATALor replace it with explicitRESULT_VARIABLEchecking and amessage(FATAL_ERROR ...)on non-zero exit.