Skip to content

Commit

Permalink
pypi installation
Browse files Browse the repository at this point in the history
  • Loading branch information
K20shores committed Apr 9, 2024
1 parent b866c95 commit ba33fa0
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 10 deletions.
9 changes: 8 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,14 @@ build-backend = "scikit_build_core.build"

[project]
name = "musica"
readme = "README.md"
version = "0.6.1"
description = "MUSICA is a Python library for performing computational simulations in atmospheric chemistry."
long_description = "MUSICA (Multiscale Interface for Chemistry and Aerosols) is a powerful tool for modeling atmospheric chemistry processes. It provides a flexible interface for running simulations and analyzing results."
long_description_content_type = "text/plain"

[tool.scikit-build]
cmake.args = ["-DMUSICA_ENABLE_PYTHON_LIBRARY=ON"]
cmake.args = ["-DMUSICA_ENABLE_PYTHON_LIBRARY=ON"]

[project.urls]
homepage = "https://wiki.ucar.edu/display/MUSICA/MUSICA+Home"
22 changes: 14 additions & 8 deletions python/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
pybind11_add_module(musica_python wrapper.cpp)
pybind11_add_module(musica_python
wrapper.cpp
${PROJECT_SOURCE_DIR}/src/micm/micm.cpp
${PROJECT_SOURCE_DIR}/src/component_versions.c
${CMAKE_BINARY_DIR}/version.c
)

target_link_libraries(musica_python PRIVATE nlohmann_json::nlohmann_json)

set_target_properties(musica_python PROPERTIES OUTPUT_NAME musica)

Expand All @@ -8,15 +15,14 @@ target_include_directories(musica_python
$<INSTALL_INTERFACE:${MUSICA_INSTALL_INCLUDE_DIR}>
)

target_link_libraries(musica_python PUBLIC musica::musica)

install(TARGETS musica_python
LIBRARY DESTINATION .
target_include_directories(musica_python
PUBLIC
$<BUILD_INTERFACE:${CMAKE_SOURCE_DIR}/include>
$<INSTALL_INTERFACE:${MUSICA_INSTALL_INCLUDE_DIR}>
)

set_target_properties(musica
PROPERTIES
INSTALL_RPATH "$ORIGIN"
install(TARGETS musica_python
LIBRARY DESTINATION .
)

if(WIN32)
Expand Down
2 changes: 1 addition & 1 deletion src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,6 @@ endif()

################################################################################
# Packaging
if(MUSICA_ENABLE_INSTALL)
if(MUSICA_ENABLE_INSTALL AND NOT MUSICA_ENABLE_PYTHON_LIBRARY)
add_subdirectory(packaging)
endif()

0 comments on commit ba33fa0

Please sign in to comment.