Change name of python library if IqsMPI=ON

When IqsMPI=OFF, the name is: intelqs_py
When IqsMPI=ON , the name is: intelqs_py_mpi
This commit is contained in:
giangiac 2021-03-09 10:25:36 -08:00
parent 3698396102
commit 0c79114899
1 changed files with 10 additions and 3 deletions

View File

@ -2,13 +2,20 @@
# Build the Python library for the IQS wrapper.
find_package(pybind11 REQUIRED)
pybind11_add_module(intelqs_py SHARED
if (NOT IqsMPI)
set(NAME_PY_LIB intelqs_py)
else()
set(NAME_PY_LIB intelqs_py_mpi)
endif()
pybind11_add_module(${NAME_PY_LIB} SHARED
intelqs_py.cpp
../src/qaoa_features.cpp)
target_link_libraries(intelqs_py PRIVATE iqs)
target_link_libraries(${NAME_PY_LIB} PRIVATE iqs)
set_target_properties( intelqs_py
set_target_properties(${NAME_PY_LIB}
PROPERTIES
LIBRARY_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/lib"
)