Skip to content
Merged

Clean #155

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 20 additions & 29 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -34,35 +34,23 @@ set(PROJECT_USE_CMAKE_EXPORT TRUE)
set(PROJECT_USE_KEYWORD_LINK_LIBRARIES TRUE)
set(CXX_DISABLE_WERROR TRUE)

# Check if the submodule cmake have been initialized
set(JRL_CMAKE_MODULES "${CMAKE_CURRENT_LIST_DIR}/cmake")
if(EXISTS "${JRL_CMAKE_MODULES}/base.cmake")
message(STATUS "JRL cmakemodules found in 'cmake/' git submodule")
find_package(jrl-cmakemodules QUIET CONFIG)
if(jrl-cmakemodules_FOUND)
get_property(
JRL_CMAKE_MODULES
TARGET jrl-cmakemodules::jrl-cmakemodules
PROPERTY INTERFACE_INCLUDE_DIRECTORIES
)
message(STATUS "JRL cmakemodules found on system at ${JRL_CMAKE_MODULES}")
else()
find_package(jrl-cmakemodules QUIET CONFIG)
if(jrl-cmakemodules_FOUND)
get_property(
JRL_CMAKE_MODULES
TARGET jrl-cmakemodules::jrl-cmakemodules
PROPERTY INTERFACE_INCLUDE_DIRECTORIES
)
message(
STATUS
"JRL cmakemodules found on system at ${JRL_CMAKE_MODULES}"
)
else()
message(STATUS "JRL cmakemodules not found. Let's fetch it.")
include(FetchContent)
FetchContent_Declare(
"jrl-cmakemodules"
GIT_REPOSITORY "https://github.com/jrl-umi3218/jrl-cmakemodules.git"
)
FetchContent_MakeAvailable("jrl-cmakemodules")
FetchContent_GetProperties(
"jrl-cmakemodules"
SOURCE_DIR JRL_CMAKE_MODULES
)
endif()
message(STATUS "JRL cmakemodules not found. Let's fetch it.")
include(FetchContent)
FetchContent_Declare(
"jrl-cmakemodules"
GIT_REPOSITORY "https://github.com/jrl-umi3218/jrl-cmakemodules.git"
)
FetchContent_MakeAvailable("jrl-cmakemodules")
FetchContent_GetProperties("jrl-cmakemodules" SOURCE_DIR JRL_CMAKE_MODULES)
endif()

include("${JRL_CMAKE_MODULES}/hpp.cmake")
Expand All @@ -81,7 +69,10 @@ option(USE_JS "Run npm install and build from cmake" ON)
option(USE_QT "Start Qt window" OFF)

# Python bindings for native graph viewer
set(PYTHON_COMPONENTS Interpreter Development NumPy)
set(PYTHON_COMPONENTS Interpreter)
if(USE_QT)
set(PYTHON_COMPONENTS Interpreter Development NumPy)
endif()
findpython()

if(USE_QT)
Expand Down
2 changes: 1 addition & 1 deletion dockgen.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[hpp-plot]
apt_deps = ["npm", "python3-numpy"]
apt_deps = ["npm"]
url = "."
6 changes: 3 additions & 3 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

24 changes: 0 additions & 24 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
overrideAttrs.hpp-plot =
{
drv-final,
drv-prev,
pkgs-final,
...
}:
Expand All @@ -29,34 +28,11 @@
./src
];
};
cmakeFlags = [
(lib.cmakeBool "USE_JS" false) # build from nix not cmake
];
postPatch = ''
# prepare npm offline cache
mkdir -p node_modules
cd src/web_app
cp package.json package-lock.json ../..
ln -s ../../node_modules
cd -
'';
nativeBuildInputs = drv-prev.nativeBuildInputs ++ [
pkgs-final.npmHooks.npmConfigHook
pkgs-final.nodejs
];
npmDeps = pkgs-final.fetchNpmDeps {
name = "${drv-final.pname}-${drv-final.version}-npm-deps";
src = drv-final.src + "/src/web_app/";
hash = "sha256-GAYdugZFMygk0MXyXxf2wSsWRvn/aW4YeFH2v62IZjI=";
};
preBuild = ''
cd ../src/web_app
npm --offline run build
cd -
'';
postInstall = ''
cp -r ../src/web_app/dist $out/share/hpp-plot/webapp
'';
};
}
);
Expand Down
1 change: 0 additions & 1 deletion package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@

<depend>python3</depend>
<depend>python3-dev</depend>
<depend>python3-numpy</depend>

<buildtool_depend>cmake</buildtool_depend>
<build_depend>doxygen</build_depend>
Expand Down
20 changes: 18 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,21 @@
[tool.ruff]
extend-exclude = ["cmake"]
[build-system]
build-backend = "cmeel"
requires = [
"cmeel[build]",
"jrl-cmakemodules[build]"
]

[project]
description = "Plotting tools for HPP"
license = "BSD-2-Clause"
name = "hpp-plot"
requires-python = ">= 3.10"
version = "9.0.0"

[project.urls]
homepage = "https://github.com/cmake-wheel/hpp-plot"
repository = "https://github.com/cmake-wheel/hpp-plot.git"
upstream = "https://github.com/humanoid-path-planner/hpp-plot"

[tool.ruff.lint]
extend-select = ["I", "NPY", "RUF", "UP", "W"]
Expand Down