Skip to content

Commit 27966f2

Browse files
authored
Remove MATX_ROOT macro (#937)
1 parent 3ae4b13 commit 27966f2

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -316,7 +316,6 @@ if (MATX_EN_FILEIO OR MATX_EN_VISUALIZATION OR MATX_EN_PYBIND11 OR MATX_BUILD_EX
316316
set(MATX_EN_PYBIND11 ON)
317317
target_compile_definitions(matx INTERFACE MATX_ENABLE_PYBIND11)
318318
target_compile_definitions(matx INTERFACE MATX_ENABLE_FILEIO)
319-
target_compile_options(matx INTERFACE -DMATX_ROOT="${PROJECT_SOURCE_DIR}")
320319

321320
include(cmake/GetPyBind11.cmake)
322321
find_package(Python3 REQUIRED COMPONENTS Interpreter Development)

include/matx/core/pybind.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,9 @@
3939
#include <pybind11/embed.h>
4040
#include <pybind11/numpy.h>
4141
#include <optional>
42+
#include <filesystem>
43+
44+
namespace fs = std::filesystem;
4245

4346
namespace matx {
4447

@@ -94,7 +97,8 @@ class MatXPybind {
9497
}
9598
}
9699

97-
AddPath(std::string(MATX_ROOT) + GENERATORS_PATH);
100+
const auto current_dir = fs::path(__FILE__).parent_path();
101+
AddPath((current_dir.string() + "/../../..") + GENERATORS_PATH);
98102
}
99103

100104
void AddPath(const std::string &path)

0 commit comments

Comments
 (0)