Commit 20f7c783 authored by Nguyen, Thien's avatar Nguyen, Thien

Fixed MacOS build

xacc-quantum-py shared lib build config missed the `magic` rpath config.
Signed-off-by: Nguyen, Thien's avatarThien Nguyen <nguyentm@ornl.gov>
parent 0cb51886
set(LIBRARY_NAME xacc-quantum-py)
include_directories(${Python_INCLUDE_DIRS})
include_directories(${CMAKE_SOURCE_DIR}/tpls/pybind11/include)
add_library(xacc-quantum-py SHARED xacc-quantum-py.cpp)
add_library(${LIBRARY_NAME} SHARED xacc-quantum-py.cpp)
target_include_directories(${LIBRARY_NAME} PUBLIC . ${CMAKE_SOURCE_DIR}/quantum/plugins/utils ${CMAKE_SOURCE_DIR}/python)
target_include_directories(xacc-quantum-py PUBLIC . ${CMAKE_SOURCE_DIR}/quantum/plugins/utils ${CMAKE_SOURCE_DIR}/python)
target_link_libraries(${LIBRARY_NAME} PUBLIC xacc xacc-fermion xacc-pauli xacc-quantum-gate)
target_link_libraries(xacc-quantum-py PUBLIC xacc xacc-fermion xacc-pauli xacc-quantum-gate)
if(APPLE)
set_target_properties(${LIBRARY_NAME} PROPERTIES INSTALL_RPATH "@loader_path/lib")
set_target_properties(${LIBRARY_NAME} PROPERTIES LINK_FLAGS "-undefined dynamic_lookup")
else()
set_target_properties(${LIBRARY_NAME} PROPERTIES INSTALL_RPATH "$ORIGIN/lib")
set_target_properties(${LIBRARY_NAME} PROPERTIES LINK_FLAGS "-shared")
endif()
install(TARGETS xacc-quantum-py DESTINATION ${CMAKE_INSTALL_PREFIX})
\ No newline at end of file
install(TARGETS ${LIBRARY_NAME} DESTINATION ${CMAKE_INSTALL_PREFIX})
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment