Unverified Commit 9ca16736 authored by Mccaskey, Alex's avatar Mccaskey, Alex Committed by GitHub

Merge pull request #233 from tnguyen-ornl/tnguyen/fix-apple-build

Fixed MacOS build
parents 587fb62f 20f7c783
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