Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use CMake Python Functions #188

Merged
merged 6 commits into from
Jun 14, 2024
Merged
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
9 changes: 8 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
cmake_minimum_required(VERSION 3.14)

project(everest-framework
VERSION 0.15.0
VERSION 0.15.1
DESCRIPTION "The open operating system for e-mobility charging stations"
LANGUAGES CXX C
)
Expand All @@ -20,6 +20,13 @@ option(EVEREST_ENABLE_PY_SUPPORT "Enable everestpy for Python modules" ON)
option(EVEREST_ENABLE_RS_SUPPORT "Enable everestrs for Rust modules" OFF)
option(EVEREST_ENABLE_ADMIN_PANEL_BACKEND "Enable everest admin panel backend" ON)
option(EVEREST_INSTALL_ADMIN_PANEL "Download and install everest admin panel" ON)
ev_setup_cmake_variables_python_wheel()
option(${PROJECT_NAME}_USE_PYTHON_VENV "Use python venv for pip install targets" OFF)
set(${PROJECT_NAME}_PYTHON_VENV_PATH "${CMAKE_BINARY_DIR}/venv" CACHE PATH "Path to python venv")
ev_setup_python_executable(
USE_PYTHON_VENV ${${PROJECT_NAME}_USE_PYTHON_VENV}
PYTHON_VENV_PATH ${${PROJECT_NAME}_PYTHON_VENV_PATH}
)

# make own cmake modules available
list(INSERT CMAKE_MODULE_PATH 0 "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
Expand Down
36 changes: 12 additions & 24 deletions everestpy/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,29 +1,17 @@
add_subdirectory(src/everest)

add_custom_target(everestpy_pip_install_dist
# remove build dir from pip
COMMAND
cmake -E remove_directory build
COMMAND
${PYTHON_EXECUTABLE} -m pip install --force-reinstall .
WORKING_DIRECTORY
${CMAKE_CURRENT_SOURCE_DIR}
DEPENDS
ev_create_pip_install_targets(
PACKAGE_NAME
everestpy
DIST_DEPENDS
everestpy_ln_dist
COMMENT
"Installing everestpy from distribution"
LOCAL_DEPENDS
everestpy_ln_local
)

add_custom_target(everestpy_pip_install_local
# remove build dir from pip
COMMAND
cmake -E remove_directory build
COMMAND
${PYTHON_EXECUTABLE} -m pip install --force-reinstall -e .
WORKING_DIRECTORY
${CMAKE_CURRENT_SOURCE_DIR}
ev_create_python_wheel_targets(
PACKAGE_NAME
everestpy
DEPENDS
everestpy_ln_local
COMMENT
"Installing everestpy via user-mode from build"
everestpy_ln_dist
)

add_subdirectory(src/everest)
6 changes: 0 additions & 6 deletions everestpy/src/everest/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,9 +1,3 @@
find_program(
PYTHON_EXECUTABLE
python3
REQUIRED
)

if (DISABLE_EDM)
find_package(pybind11 REQUIRED)
find_package(pybind11_json REQUIRED)
Expand Down
Loading