From 906814a9fee4b7d7b3c117d461220de9234d9486 Mon Sep 17 00:00:00 2001 From: Jacob Oursland Date: Tue, 21 Mar 2023 08:46:44 -0700 Subject: [PATCH] Add Conda Environment and VS Code configuration. --- .vscode/.gitignore | 1 + .vscode/c_cpp_properties.json | 12 ++++++++ .vscode/cmake-kits.json | 18 +++++++++++ .vscode/env.sh | 3 ++ .vscode/extensions.json | 6 ++++ .vscode/launch.json | 48 +++++++++++++++++++++++++++++ .vscode/settings.json | 15 +++++++++ .vscode/tasks.json | 58 +++++++++++++++++++++++++++++++++++ conda/conda-env.yaml | 5 +++ conda/environment.devenv.yml | 58 +++++++++++++++++++++++++++++++++++ 10 files changed, 224 insertions(+) create mode 100644 .vscode/.gitignore create mode 100644 .vscode/c_cpp_properties.json create mode 100644 .vscode/cmake-kits.json create mode 100755 .vscode/env.sh create mode 100644 .vscode/extensions.json create mode 100644 .vscode/launch.json create mode 100644 .vscode/settings.json create mode 100644 .vscode/tasks.json create mode 100644 conda/conda-env.yaml create mode 100644 conda/environment.devenv.yml diff --git a/.vscode/.gitignore b/.vscode/.gitignore new file mode 100644 index 0000000000..19b0cd20da --- /dev/null +++ b/.vscode/.gitignore @@ -0,0 +1 @@ +environment.yml diff --git a/.vscode/c_cpp_properties.json b/.vscode/c_cpp_properties.json new file mode 100644 index 0000000000..f0d3f36d36 --- /dev/null +++ b/.vscode/c_cpp_properties.json @@ -0,0 +1,12 @@ +{ + "configurations": [ + { + "name": "FreeCAD", + "includePath": ["${workspaceFolder}/**"], + "cStandard": "c17", + "cppStandard": "c++17", + "configurationProvider": "ms-vscode.cmake-tools" + } + ], + "version": 4 +} diff --git a/.vscode/cmake-kits.json b/.vscode/cmake-kits.json new file mode 100644 index 0000000000..bb35948554 --- /dev/null +++ b/.vscode/cmake-kits.json @@ -0,0 +1,18 @@ +[ + { + "name": "FreeCAD Linux", + "compilers": { + "C": "${workspaceFolder}/.conda/freecad/bin/cc", + "CXX": "${workspaceFolder}/.conda/freecad/bin/c++" + }, + "environmentSetupScript": "${workspaceFolder}/.vscode/env.sh" + }, + { + "name": "FreeCAD macOS", + "compilers": { + "C": "${workspaceFolder}/.conda/freecad/bin/clang", + "CXX": "${workspaceFolder}/.conda/freecad/bin/clang++" + }, + "environmentSetupScript": "${workspaceFolder}/.vscode/env.sh" + } +] diff --git a/.vscode/env.sh b/.vscode/env.sh new file mode 100755 index 0000000000..44b8d46883 --- /dev/null +++ b/.vscode/env.sh @@ -0,0 +1,3 @@ +#!/bin/bash + +source activate freecad diff --git a/.vscode/extensions.json b/.vscode/extensions.json new file mode 100644 index 0000000000..749d1b10af --- /dev/null +++ b/.vscode/extensions.json @@ -0,0 +1,6 @@ +{ + "recommendations": [ + "ms-vscode.cpptools-extension-pack", + "ms-python.python" + ] +} diff --git a/.vscode/launch.json b/.vscode/launch.json new file mode 100644 index 0000000000..28c13c94b9 --- /dev/null +++ b/.vscode/launch.json @@ -0,0 +1,48 @@ +{ + "version": "0.2.0", + "configurations": [ + { + "name": "C/C++: Linux: build and debug FreeCAD", + "type": "cppdbg", + "request": "launch", + "program": "${workspaceFolder}/build/bin/FreeCAD", + "args": [], + "stopAtEntry": false, + "cwd": "${workspaceFolder}", + "environment": [], + "externalConsole": false, + "preLaunchTask": "CMake: build" + }, + { + "name": "C/C++: macOS: build and debug FreeCAD", + "type": "cppdbg", + "request": "launch", + "program": "${workspaceFolder}/build/bin/FreeCAD", + "args": [], + "stopAtEntry": false, + "cwd": "${workspaceFolder}", + "environment": [], + "externalConsole": false, + "MIMode": "lldb", + "preLaunchTask": "CMake: build" + }, + { + "name": "Python: Remote Attach", + "type": "python", + "request": "attach", + "preLaunchTask": "conda: activate environment", + "redirectOutput": true, + "connect": { + "host": "localhost", + "port": 5678 + }, + "pathMappings": [ + { + "localRoot": "${workspaceFolder}", + "remoteRoot": "${workspaceFolder}" + } + ], + "justMyCode": false + } + ] +} diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000000..dddd1cbee3 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,15 @@ +{ + "files.associations": { + "__config": "cpp", + "iosfwd": "cpp" + }, + "editor.formatOnType": true, + "cmake.preferredGenerators": ["Ninja", "NMake Makefiles"], + "cmake.cmakePath": "${workspaceFolder}/.conda/freecad/bin/cmake", + "cmake.configureSettings": { + "BUILD_WITH_CONDA:BOOL": "ON", + "BUILD_FEM_NETGEN:BOOL": "ON", + "FREECAD_USE_PYBIND11:BOOL": "ON", + "FREECAD_USE_EXTERNAL_SMESH:BOOL": "ON" + } +} diff --git a/.vscode/tasks.json b/.vscode/tasks.json new file mode 100644 index 0000000000..52cc100ec9 --- /dev/null +++ b/.vscode/tasks.json @@ -0,0 +1,58 @@ +{ + "tasks": [ + { + "type": "shell", + "label": "conda: activate environment", + "command": "activate freecad", + "problemMatcher": [], + "detail": "Activate conda environment", + "group": "build" + }, + { + "type": "cmake", + "label": "CMake: configure", + "command": "configure", + "problemMatcher": [], + "detail": "CMake template configure task", + "group": "build" + }, + { + "type": "cmake", + "label": "CMake: build", + "command": "build", + "targets": ["all"], + "group": { + "kind": "build", + "isDefault": true + }, + "problemMatcher": [], + "detail": "CMake template build task" + }, + { + "type": "cmake", + "label": "CMake: test", + "command": "test", + "problemMatcher": [], + "detail": "CMake template test task", + "group": "build" + }, + { + "type": "cmake", + "label": "CMake: clean", + "command": "clean", + "problemMatcher": [], + "detail": "CMake template clean task", + "group": "build" + }, + { + "type": "cmake", + "label": "CMake: clean rebuild", + "command": "cleanRebuild", + "targets": ["all"], + "problemMatcher": [], + "detail": "CMake template clean rebuild task", + "group": "build" + } + ], + "version": "2.0.0" +} diff --git a/conda/conda-env.yaml b/conda/conda-env.yaml new file mode 100644 index 0000000000..7e29d7f346 --- /dev/null +++ b/conda/conda-env.yaml @@ -0,0 +1,5 @@ +name: freecad +channels: +- conda-forge +dependencies: +- conda-devenv diff --git a/conda/environment.devenv.yml b/conda/environment.devenv.yml new file mode 100644 index 0000000000..3bc65e1f5b --- /dev/null +++ b/conda/environment.devenv.yml @@ -0,0 +1,58 @@ +name: freecad +channels: +- conda-forge +dependencies: +- libselinux # [linux] +- libspnav # [linux] +- libxau # [linux] +- libxcb # [linux] +- libxdamage # [linux] +- libxext # [linux] +- libxfixes # [linux] +- libxi-devel # [linux] +- libxxf86vm # [linux] +- mesa-dri-drivers # [linux] +- mesa-libegl-devel # [linux] +- mesa-libgl-devel # [linux] +- xorg-x11-server-xvfb # [linux] +- sed # [unix] +- boost +- boost-cpp +- cmake +- coin3d +- compilers +- conda-build +- conda-devenv +- conda-smithy +- debugpy +- doxygen +- eigen +- freetype +- gmsh +- graphviz +- hdf5 +- matplotlib +- ninja +- numpy +- occt==7.6.3 +- openssl==3.0.8 +- pcl +- pip +- pivy +- pkg-config +- ply +- pybind11 +- pyside2 +- python +- pyyaml +- qt +- qt-main +- qt-webengine +- six +- smesh==9.9 +- swig +- vtk +- xerces-c +- zlib +- pip: + - ptvsd