Skip to content

Commit

Permalink
w
Browse files Browse the repository at this point in the history
  • Loading branch information
jslee02 committed Mar 15, 2024
1 parent fa76fc1 commit 0662b42
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 4 deletions.
23 changes: 22 additions & 1 deletion cmake/dart_v7_defs.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,21 @@ function(dart_library)
set(multiValueArgs
HEADERS
SOURCES
PUBLIC_LINK_LIBRARIES
PRIVATE_LINK_LIBRARIES
)
cmake_parse_arguments(
"${prefix}" "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN}
)

add_library(${_ARG_NAME} ${_ARG_HEADERS} ${_ARG_SOURCES})
# Get the current directory relative to the root of the project
# assuming that dart/* is the root of the source tree
string(REPLACE "${CMAKE_SOURCE_DIR}/" "" relative_path ${CMAKE_CURRENT_SOURCE_DIR})

add_library(${_ARG_NAME}
${_ARG_HEADERS}
${_ARG_SOURCES}
)

target_include_directories(${_ARG_NAME} PUBLIC
$<BUILD_INTERFACE:${CMAKE_SOURCE_DIR}>
Expand All @@ -52,12 +61,24 @@ function(dart_library)

target_compile_features(${_ARG_NAME} PUBLIC cxx_std_17)

target_link_libraries(${_ARG_NAME}
PUBLIC
${_ARG_PUBLIC_LINK_LIBRARIES}
PRIVATE
${_ARG_PRIVATE_LINK_LIBRARIES}
)

set_target_properties(${_ARG_NAME} PROPERTIES
OUTPUT_NAME dart-${_ARG_NAME}
)

include(GNUInstallDirs)

install(
FILES ${_ARG_HEADERS}
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/${relative_path}/
)

install(
TARGETS ${_ARG_NAME}
EXPORT ${_ARG_NAME}Targets
Expand Down
1 change: 1 addition & 0 deletions dart/v7/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,6 @@ include(dart_v7_defs)

dart_library(
NAME v7
HEADERS empty.hpp
SOURCES empty.cpp
)
2 changes: 2 additions & 0 deletions pixi.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ platforms = ["linux-64", "osx-64", "osx-arm64", "win-64"]
[tasks]
clean = "rm -rf build"
build-v7 = { cmd= "cmake --build build --target v7 --parallel", depends_on = ["configure"] }
configure_local = { cmd= "cmake -G Ninja -S . -B build -DDART_VERBOSE=ON -DDART_BUILD_V7=ON -DCMAKE_INSTALL_PREFIX=$CONDA_PREFIX" }
install_local = { cmd= "cmake --install build --prefix $CONDA_PREFIX", depends_on = ["configure_local", "build"] }

[dependencies]
assimp = ">=5.3.1,<5.4"
Expand Down
9 changes: 6 additions & 3 deletions python/dartpy/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -91,10 +91,13 @@ if(BUILD_SHARED_LIBS)
"Install the shared libraries to be able to import ${pybind_module}."
)
endif()

# Install the pybind module to site-packages directory
install(TARGETS ${pybind_module}
LIBRARY DESTINATION "${PYTHON_SITE_PACKAGES}"
)
if(TARGET ${pybind_module})
install(TARGETS ${pybind_module}
LIBRARY DESTINATION "${PYTHON_SITE_PACKAGES}"
)
endif()

list(REMOVE_ITEM dartpy_headers
${CMAKE_CURRENT_LIST_DIR}/eigen_geometry_pybind.h
Expand Down

0 comments on commit 0662b42

Please sign in to comment.