CMakeLists.txt 1.27 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
macro(qcor_enable_rpath LIBNAME)
  if(APPLE)
    set_target_properties(${LIBNAME} PROPERTIES INSTALL_RPATH "@loader_path/../lib")
    set_target_properties(${LIBNAME}
                          PROPERTIES LINK_FLAGS "-undefined dynamic_lookup")
  else()
    set_target_properties(${LIBNAME} PROPERTIES INSTALL_RPATH "$ORIGIN/../lib")
    set_target_properties(${LIBNAME} PROPERTIES LINK_FLAGS "-shared")
  endif()
endmacro()

Mccaskey, Alex's avatar
Mccaskey, Alex committed
12
13
14
15
16
17
set(LIBRARY_NAME qcor)

file(GLOB SRC *.cpp)

add_library(${LIBRARY_NAME} SHARED ${SRC})

18
target_include_directories(${LIBRARY_NAME} PUBLIC . algorithm ${XACC_INCLUDE_DIRS})
Mccaskey, Alex's avatar
Mccaskey, Alex committed
19

20
target_link_libraries(${LIBRARY_NAME} PUBLIC xacc PRIVATE xacc-pauli xacc-fermion)
Mccaskey, Alex's avatar
Mccaskey, Alex committed
21
22

if(QCOR_BUILD_TESTS)
23
  # add_subdirectory(tests)
Mccaskey, Alex's avatar
Mccaskey, Alex committed
24
25
endif()

26
27
28
29
30
31
32
33
if(APPLE)
   set_target_properties(${LIBRARY_NAME} PROPERTIES INSTALL_RPATH "@loader_path")
   set_target_properties(${LIBRARY_NAME} PROPERTIES LINK_FLAGS "-undefined dynamic_lookup")
else()
   set_target_properties(${LIBRARY_NAME} PROPERTIES INSTALL_RPATH "$ORIGIN")
   set_target_properties(${LIBRARY_NAME} PROPERTIES LINK_FLAGS "-shared")
endif()

34
file(GLOB HEADERS qcor.hpp qpu_handler.hpp)
35
36
install(FILES ${HEADERS} DESTINATION include/qcor)
install(TARGETS ${LIBRARY_NAME} DESTINATION lib)
Mccaskey, Alex's avatar
Mccaskey, Alex committed
37

38
39
#add_subdirectory(algorithms)
#add_subdirectory(nlopt-optimizers)