-
Notifications
You must be signed in to change notification settings - Fork 45
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
5f7f47a
commit e446586
Showing
32 changed files
with
971 additions
and
143 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 27 additions & 0 deletions
27
cmake/custom_targets/create_metavision_get_started_archive.cmake
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# Copyright (c) Prophesee S.A. | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 | ||
# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed | ||
# on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and limitations under the License. | ||
|
||
set(output_metavision_get_started_archive_dir_path "${GENERATE_FILES_DIRECTORY}/metavision_get_started_archive") | ||
|
||
add_custom_target(create_metavision_get_started_archive_folder | ||
COMMAND ${CMAKE_COMMAND} | ||
-DPROJECT_SOURCE_DIR="${PROJECT_SOURCE_DIR}" | ||
-DOUTPUT_DIR="${output_metavision_get_started_archive_dir_path}" | ||
-DCMAKE_MODULE_PATH="${CMAKE_MODULE_PATH}" | ||
-DGENERATE_FILES_DIRECTORY="${GENERATE_FILES_DIRECTORY}" | ||
-P ${CMAKE_CURRENT_LIST_DIR}/create_metavision_get_started_archive_folder.cmake | ||
) | ||
|
||
set(output_metavision_get_started_archive_path "${GENERATE_FILES_DIRECTORY}/metavision_get_started_${PROJECT_VERSION_FULL}.tar") | ||
|
||
add_custom_target(create_metavision_get_started_archive | ||
COMMAND ${CMAKE_COMMAND} -E chdir ${output_metavision_get_started_archive_dir_path} ${CMAKE_COMMAND} -E tar cvf ${output_metavision_get_started_archive_path} . | ||
COMMAND ${CMAKE_COMMAND} -E echo "File ${output_metavision_get_started_archive_path} generated" | ||
) | ||
add_dependencies(create_metavision_get_started_archive create_metavision_get_started_archive_folder) |
82 changes: 82 additions & 0 deletions
82
cmake/custom_targets/create_metavision_get_started_archive_folder.cmake
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
# Copyright (c) Prophesee S.A. | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 | ||
# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed | ||
# on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and limitations under the License. | ||
|
||
# Create directory where we will add the files needed to compile the open source offer | ||
file(REMOVE_RECURSE "${OUTPUT_DIR}") | ||
file(MAKE_DIRECTORY "${OUTPUT_DIR}") | ||
|
||
# For some reason, CMAKE_MODULE_PATH passed by create_metavision_open_archive | ||
# has spaces instead of semicolumns | ||
string(REPLACE " " ";" CMAKE_MODULE_PATH "${CMAKE_MODULE_PATH}") | ||
|
||
include(overridden_cmake_functions) | ||
|
||
set(MV_GET_STARTED_FILES images README.md) | ||
list_transform_prepend (MV_GET_STARTED_FILES metavision-get-started/) | ||
|
||
# Add the files and folders needed to compile open : | ||
foreach (file_or_dir ${MV_GET_STARTED_FILES}) | ||
if (EXISTS "${PROJECT_SOURCE_DIR}/${file_or_dir}") | ||
get_filename_component(dest "${OUTPUT_DIR}/${file_or_dir}" DIRECTORY) | ||
file(COPY "${PROJECT_SOURCE_DIR}/${file_or_dir}" | ||
DESTINATION "${dest}" | ||
PATTERN __pycache__ EXCLUDE | ||
) | ||
endif () | ||
endforeach(file_or_dir) | ||
|
||
set(METAVISION_GET_STARTED_FOLDER "${OUTPUT_DIR}/metavision-get-started/") | ||
|
||
function(copy_cpp_sample path) | ||
set(sample_path ${PROJECT_SOURCE_DIR}/${path}) | ||
if (EXISTS ${sample_path}) | ||
get_filename_component(dest_folder_name ${sample_path} NAME) | ||
set(dest_path "${METAVISION_GET_STARTED_FOLDER}") | ||
file(COPY "${sample_path}" | ||
DESTINATION "${dest_path}" | ||
) | ||
set(cmakelist_file ${dest_path}${dest_folder_name}/CMakeLists.txt) | ||
file (REMOVE ${cmakelist_file}) | ||
file (RENAME ${cmakelist_file}.install ${cmakelist_file}) | ||
else() | ||
message(FATAL_ERROR "The requested sample does not exist: ${sample_path}") | ||
endif () | ||
endfunction() | ||
|
||
function(copy_python_sample path) | ||
set(sample_path ${PROJECT_SOURCE_DIR}/${path}) | ||
if (EXISTS ${sample_path}) | ||
get_filename_component(dest_folder_name "${sample_path}" NAME) | ||
set(dest_path "${METAVISION_GET_STARTED_FOLDER}") | ||
file(COPY "${sample_path}" | ||
DESTINATION "${dest_path}" | ||
PATTERN __pycache__ EXCLUDE | ||
) | ||
file (REMOVE ${dest_path}${dest_folder_name}/CMakeLists.txt) | ||
else() | ||
message(FATAL_ERROR "The requested sample does not exist: ${sample_path}") | ||
endif () | ||
endfunction() | ||
|
||
# Add some Metavision Python samples to the metavision-get-started folder | ||
copy_python_sample("sdk/modules/core/python/samples/metavision_time_surface") | ||
copy_python_sample("sdk/modules/ml/python_extended/samples/flow_inference") | ||
|
||
# Add some Metavision C++ samples to the metavision-get-started folder | ||
copy_cpp_sample("sdk/modules/core/cpp/samples/metavision_time_surface") | ||
copy_cpp_sample("sdk/modules/core/cpp/samples/metavision_dummy_radar") | ||
|
||
# Copy license files | ||
set(LICENSE_FILES "licensing/LICENSE_METAVISION_SDK" "licensing/LICENSE_OPEN") | ||
foreach (file ${LICENSE_FILES}) | ||
file(COPY "${PROJECT_SOURCE_DIR}/${file}" | ||
DESTINATION "${METAVISION_GET_STARTED_FOLDER}/licensing" | ||
) | ||
endforeach(file) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.