-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add (Rust) MM Scene Graph proto-type.
Issue #114
- Loading branch information
1 parent
ad33a4c
commit eaa1dff
Showing
20 changed files
with
1,513 additions
and
10 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,96 @@ | ||
# Copyright (C) 2020, 2021 David Cattermole. | ||
# | ||
# This file is part of mmSolver. | ||
# | ||
# mmSolver is free software: you can redistribute it and/or modify it | ||
# under the terms of the GNU Lesser General Public License as | ||
# published by the Free Software Foundation, either version 3 of the | ||
# License, or (at your option) any later version. | ||
# | ||
# mmSolver is distributed in the hope that it will be useful, | ||
# but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
# GNU Lesser General Public License for more details. | ||
# | ||
# You should have received a copy of the GNU Lesser General Public License | ||
# along with mmSolver. If not, see <https://www.gnu.org/licenses/>. | ||
# --------------------------------------------------------------------- | ||
# | ||
# CMake utilities for mmSolver using Rust. | ||
# | ||
|
||
|
||
# Find the Rust compiled library | ||
function(find_rust_library lib_name build_dir out_linktime_file) | ||
if (MSVC) | ||
set(staticlib_name "${lib_name}.lib") | ||
|
||
# Get the Rust Library .lib (for Windows). | ||
message(STATUS "Finding: ${staticlib_name}") | ||
message(STATUS "RUST BUILD DIR: ${build_dir}") | ||
find_path(linktime_dir ${staticlib_name} | ||
HINTS ${build_dir} | ||
PATHS ${build_dir} | ||
) | ||
if(EXISTS ${linktime_dir}) | ||
set(${out_linktime_file} ${linktime_dir}/${staticlib_name} PARENT_SCOPE) | ||
endif() | ||
|
||
elseif (UNIX) | ||
set(archive_name "lib${lib_name}.a") | ||
|
||
# Get the Rust Library .a (for Linux). | ||
message(STATUS "Finding: ${archive_name}") | ||
message(DEBUG "RUST BUILD DIR: ${build_dir}") | ||
find_path(linktime_dir ${archive_name} | ||
HINTS ${build_dir} | ||
PATHS ${build_dir} | ||
) | ||
if(EXISTS ${linktime_dir}) | ||
set(${out_linktime_file} ${linktime_dir}/${archive_name} PARENT_SCOPE) | ||
endif() | ||
|
||
else () | ||
message(FATAL_ERROR "Only Linux and Windows are supported.") | ||
endif () | ||
endfunction() | ||
|
||
|
||
macro(set_relative_library_rpath target relative_path) | ||
# HACK: We must change the RPATH variable for the library so that a | ||
# binary can find the shared object, even if it's not in the | ||
# $LD_LIBRARY_PATH. | ||
if (UNIX) | ||
# We must escape the '$' symbol to make sure it is passed to the | ||
# compiler. | ||
set_target_properties(${target} PROPERTIES | ||
BUILD_WITH_INSTALL_RPATH ON | ||
INSTALL_RPATH "\$ORIGIN/${relative_path}" | ||
) | ||
endif () | ||
endmacro() | ||
|
||
|
||
macro(set_rpath_to_cwd target) | ||
# HACK: We must change the RPATH variable for the library so that a | ||
# binary can find the shared object, even if it's not in the | ||
# $LD_LIBRARY_PATH. | ||
if (UNIX) | ||
# We must escape the '$' symbol to make sure it is passed to the | ||
# compiler. | ||
set_target_properties(${target} PROPERTIES | ||
BUILD_WITH_INSTALL_RPATH ON | ||
INSTALL_RPATH "\$ORIGIN/." | ||
) | ||
endif () | ||
endmacro() | ||
|
||
|
||
function(add_target_link_library_names target names) | ||
string(STRIP ${names} names_strip) | ||
string(REPLACE " " ";" names_list ${names_strip}) | ||
foreach (name IN LISTS names_list) | ||
target_link_libraries(${target} ${name}) | ||
endforeach () | ||
endfunction() | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# Copyright (C) 2021 David Cattermole. | ||
# | ||
# This file is part of mmSolver. | ||
# | ||
# mmSolver is free software: you can redistribute it and/or modify it | ||
# under the terms of the GNU Lesser General Public License as | ||
# published by the Free Software Foundation, either version 3 of the | ||
# License, or (at your option) any later version. | ||
# | ||
# mmSolver is distributed in the hope that it will be useful, | ||
# but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
# GNU Lesser General Public License for more details. | ||
# | ||
# You should have received a copy of the GNU Lesser General Public License | ||
# along with mmSolver. If not, see <https://www.gnu.org/licenses/>. | ||
# --------------------------------------------------------------------- | ||
# | ||
# | ||
|
||
add_subdirectory(cppbind) |
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,10 @@ | ||
# MM Scene Graph | ||
|
||
MatchMove Scene Graph (MM Scene Graph or 'mmscenegraph') is for representing a 3D Scene | ||
Graph for MatchMove solving. | ||
|
||
Solving MatchMove cameras and objects for Visual Effects (VFX) may | ||
require the use of a 3D transform a hierarchy, known as a DAG | ||
(Directed Acyclic Graph). The MM Scene Graph is designed to model the | ||
Scene Graph for MatchMove tasks and provide efficent functions for | ||
evaluation. |
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,4 @@ | ||
**/*.rs.bk | ||
Cargo.lock | ||
*~ | ||
*target/* |
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,22 @@ | ||
# Copyright (C) 2020, 2021 David Cattermole. | ||
# | ||
# This file is part of mmSolver. | ||
# | ||
# mmSolver is free software: you can redistribute it and/or modify it | ||
# under the terms of the GNU Lesser General Public License as | ||
# published by the Free Software Foundation, either version 3 of the | ||
# License, or (at your option) any later version. | ||
# | ||
# mmSolver is distributed in the hope that it will be useful, | ||
# but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
# GNU Lesser General Public License for more details. | ||
# | ||
# You should have received a copy of the GNU Lesser General Public License | ||
# along with mmSolver. If not, see <https://www.gnu.org/licenses/>. | ||
# --------------------------------------------------------------------- | ||
# | ||
|
||
set(target_release_lib_name "mmscenegraph") | ||
|
||
add_subdirectory(src) |
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 @@ | ||
[package] | ||
name = "mmscenegraph_cppbind" | ||
version = "0.1.0" | ||
authors = ["david-cattermole <cattermole91@gmail.com>"] | ||
edition = "2018" | ||
publish = false | ||
|
||
[lib] | ||
name = "mmscenegraph" | ||
path = "./src/lib.rs" | ||
# NOTE: 'lib' is used to link with Rust crates, staticlib' is used to | ||
# link with C++. | ||
crate_type = ["staticlib"] | ||
|
||
[dependencies] | ||
cxx = "=1.0.60" | ||
|
||
[profile.release] | ||
opt-level = 2 | ||
debug = false | ||
rpath = false | ||
lto = false | ||
# NOTE: If we use 'panic = "abort"' then we are unable to produce tests. | ||
# # https://github.com/rust-lang/cargo/issues/6313 | ||
# | ||
# panic = "abort" | ||
debug-assertions = false |
Oops, something went wrong.