Skip to content
Open
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
15 changes: 8 additions & 7 deletions unidock/unidock_engine/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -89,20 +89,21 @@ add_subdirectory("lib")

add_subdirectory("src")

# python binding
if (BUILD_TEST) # Compile libs on the fly
enable_testing() # add before BUILD_API, since ctest may be used in API
add_subdirectory("include")
add_subdirectory("test")
endif ()

if (BUILD_API)
add_subdirectory("api")
add_subdirectory("api") # pytest-cov, pybind11
endif ()

if (BUILD_BIN)
add_subdirectory("bin")
endif ()

if (BUILD_TEST) # Compile libs on the fly
add_subdirectory("include")
enable_testing()
add_subdirectory("test")
endif ()


if (BUILD_DOC)
add_subdirectory("doc")
Expand Down
22 changes: 14 additions & 8 deletions unidock/unidock_engine/api/python/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@ set(PYBIND11_FINDPYTHON ON)
find_package(pybind11 REQUIRED)

set(CMAKE_INTERPROCEDURAL_OPTIMIZATION OFF) # avoid the symbol: fatbinData
pybind11_add_module(${PYBIND_NAME} pipeline.cpp
${CMAKE_SOURCE_DIR}/src/format/pybind_parser.cpp)
pybind11_add_module(${PYBIND_NAME} pipeline.cpp)
install(TARGETS ${PYBIND_NAME} LIBRARY DESTINATION .)

target_link_libraries(${PYBIND_NAME} PRIVATE ${LIB_NAME})
Expand All @@ -17,11 +16,18 @@ target_include_directories(${PYBIND_NAME}
${CMAKE_SOURCE_DIR}/src
)

# install not specified here; managed by conda

# lib rpath: suppose conda_env/lib/pythonX.Y/site-packages/my_package/unidock_engine.AABB.so
#set_target_properties(${PYBIND_NAME} PROPERTIES
# INSTALL_RPATH "$ORIGIN/../../../../"
#)
# ============ CTest Integration (pytest) ============
# Run: ctest -R pytest_pipeline -V
# Or in CLion: View -> Tool Windows -> CTest -> right-click pytest_pipeline -> Run
if(BUILD_TEST)
message(" Building pytest_pipeline test ...")
add_test(NAME pytest_pipeline
COMMAND ${Python_EXECUTABLE} -m pytest ${CMAKE_CURRENT_SOURCE_DIR} -v --tb=short
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
)
set_tests_properties(pytest_pipeline PROPERTIES
ENVIRONMENT "PYTHONPATH=${CMAKE_CURRENT_BINARY_DIR}"
)
endif()

message(" [Sub-Section Done] PYTHON BINDING !")
11 changes: 0 additions & 11 deletions unidock/unidock_engine/api/python/example.cpp

This file was deleted.

Loading
Loading