Loading CMakeLists.txt +1 −28 Original line number Diff line number Diff line Loading @@ -10,45 +10,18 @@ set(CMAKE_DISABLE_SOURCE_CHANGES ON) set(CMAKE_POSITION_INDEPENDENT_CODE TRUE) set(CMAKE_EXPORT_COMPILE_COMMANDS TRUE) set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_SOURCE_DIR}/cmake/Modules) set(CLANG_COMPILER /usr/bin/clang++-9) message(STATUS "${CMAKE_MODULE_PATH}") project(qcor LANGUAGES CXX) option(QCOR_BUILD_TESTS "Build qcor tests" OFF) include(CTest) find_package(Clang 9.0.0 REQUIRED) find_package(XACC REQUIRED) set(CLANG_COMPILER /usr/bin/clang++-9) if (CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT) set (CMAKE_INSTALL_PREFIX "${XACC_ROOT}" CACHE PATH "default install path" FORCE ) endif() set(CppMicroServicesConfig_DIR "${XACC_ROOT}/share/cppmicroservices4/cmake") set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${XACC_ROOT}/share/xacc") set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CppMicroServicesConfig_DIR}") include(CppMicroServicesConfig) include_directories(${XACC_INCLUDE_DIRS}) link_directories(${XACC_LIBRARY_DIR}) configure_file(${CMAKE_SOURCE_DIR}/scripts/qcor.in ${CMAKE_BINARY_DIR}/qcor) 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() add_subdirectory(runtime) add_subdirectory(compiler) add_subdirectory(ir) Loading compiler/CMakeLists.txt +2 −2 Original line number Diff line number Diff line Loading @@ -16,7 +16,7 @@ target_include_directories(${LIBRARY_NAME} ${LLVM_INCLUDE_DIRS} ) target_link_libraries(${LIBRARY_NAME} PUBLIC xacc qcor-ast-plugin ${CLANG_LIBS} ${LLVM_LIBS}) target_link_libraries(${LIBRARY_NAME} PUBLIC xacc::xacc qcor-ast-plugin ${CLANG_LIBS} ${LLVM_LIBS}) set(_bundle_name qcor_compiler) set_target_properties(${LIBRARY_NAME} Loading @@ -32,7 +32,7 @@ usfunctionembedresources(TARGET FILES manifest.json) qcor_enable_rpath(${LIBRARY_NAME}) xacc_configure_plugin_rpath(${LIBRARY_NAME}) if(QCOR_BUILD_TESTS) #add_subdirectory(tests) Loading compiler/clang/CMakeLists.txt +7 −14 Original line number Diff line number Diff line Loading @@ -6,21 +6,14 @@ add_library(${LIBRARY_NAME} QCORASTConsumer.cpp) target_include_directories(${LIBRARY_NAME} PUBLIC . ${CMAKE_SOURCE_DIR}/runtime ${CLANG_INCLUDE_DIRS} ${LLVM_INCLUDE_DIRS} ${XACC_INCLUDE_ROOT} ${XACC_INCLUDE_ROOT}/xacc ${XACC_INCLUDE_ROOT}/cppmicroservices4) ${LLVM_INCLUDE_DIRS}) target_link_libraries(${LIBRARY_NAME} PUBLIC ${CLANG_LIBS} ${LLVM_LIBS} ${XACC_LIBRARIES} qcor) 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() PUBLIC ${CLANG_LIBS} ${LLVM_LIBS} qcor) xacc_configure_library_rpath(${LIBRARY_NAME}) install(TARGETS ${LIBRARY_NAME} DESTINATION lib) if(QCOR_BUILD_TESTS) Loading @@ -30,6 +23,6 @@ endif() configure_file(qcor-driver.in.cpp ${CMAKE_BINARY_DIR}/compiler/clang/qcor-driver.cpp) add_executable(qcor-driver ${CMAKE_BINARY_DIR}/compiler/clang/qcor-driver.cpp) target_link_libraries(qcor-driver PRIVATE qcor-ast-plugin qcor xacc) target_link_libraries(qcor-driver PRIVATE qcor-ast-plugin qcor) install(PROGRAMS ${CMAKE_BINARY_DIR}/compiler/clang/qcor-driver DESTINATION bin) install (FILES QCORPragmaHandler.hpp DESTINATION include/qcor) No newline at end of file compiler/clang/tests/CMakeLists.txt +1 −1 Original line number Diff line number Diff line Loading @@ -3,4 +3,4 @@ configure_file(LambdaVisitorTester.in.cpp include_directories(${CMAKE_SOURCE_DIR}/compiler/clang) add_xacc_test(LambdaVisitor) target_link_libraries(LambdaVisitorTester qcor qcor-ast-plugin ${CLANG_LIBS}) No newline at end of file target_link_libraries(LambdaVisitorTester qcor qcor-ast-plugin xacc::quantum_gate ${CLANG_LIBS}) No newline at end of file ir/digital/CMakeLists.txt +2 −2 Original line number Diff line number Diff line Loading @@ -11,7 +11,7 @@ target_include_directories( ${LIBRARY_NAME} PUBLIC . generators/hwe generators/exp) target_link_libraries(${LIBRARY_NAME} PUBLIC xacc CppMicroServices PRIVATE xacc-pauli xacc-fermion) target_link_libraries(${LIBRARY_NAME} PUBLIC xacc::xacc PRIVATE xacc::pauli xacc::fermion) set(_bundle_name qcor_digital) set_target_properties(${LIBRARY_NAME} Loading @@ -27,7 +27,7 @@ usfunctionembedresources(TARGET FILES manifest.json) qcor_enable_rpath(${LIBRARY_NAME}) xacc_configure_plugin_rpath(${LIBRARY_NAME}) if(QCOR_BUILD_TESTS) add_subdirectory(generators/hwe/tests) Loading Loading
CMakeLists.txt +1 −28 Original line number Diff line number Diff line Loading @@ -10,45 +10,18 @@ set(CMAKE_DISABLE_SOURCE_CHANGES ON) set(CMAKE_POSITION_INDEPENDENT_CODE TRUE) set(CMAKE_EXPORT_COMPILE_COMMANDS TRUE) set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_SOURCE_DIR}/cmake/Modules) set(CLANG_COMPILER /usr/bin/clang++-9) message(STATUS "${CMAKE_MODULE_PATH}") project(qcor LANGUAGES CXX) option(QCOR_BUILD_TESTS "Build qcor tests" OFF) include(CTest) find_package(Clang 9.0.0 REQUIRED) find_package(XACC REQUIRED) set(CLANG_COMPILER /usr/bin/clang++-9) if (CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT) set (CMAKE_INSTALL_PREFIX "${XACC_ROOT}" CACHE PATH "default install path" FORCE ) endif() set(CppMicroServicesConfig_DIR "${XACC_ROOT}/share/cppmicroservices4/cmake") set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${XACC_ROOT}/share/xacc") set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CppMicroServicesConfig_DIR}") include(CppMicroServicesConfig) include_directories(${XACC_INCLUDE_DIRS}) link_directories(${XACC_LIBRARY_DIR}) configure_file(${CMAKE_SOURCE_DIR}/scripts/qcor.in ${CMAKE_BINARY_DIR}/qcor) 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() add_subdirectory(runtime) add_subdirectory(compiler) add_subdirectory(ir) Loading
compiler/CMakeLists.txt +2 −2 Original line number Diff line number Diff line Loading @@ -16,7 +16,7 @@ target_include_directories(${LIBRARY_NAME} ${LLVM_INCLUDE_DIRS} ) target_link_libraries(${LIBRARY_NAME} PUBLIC xacc qcor-ast-plugin ${CLANG_LIBS} ${LLVM_LIBS}) target_link_libraries(${LIBRARY_NAME} PUBLIC xacc::xacc qcor-ast-plugin ${CLANG_LIBS} ${LLVM_LIBS}) set(_bundle_name qcor_compiler) set_target_properties(${LIBRARY_NAME} Loading @@ -32,7 +32,7 @@ usfunctionembedresources(TARGET FILES manifest.json) qcor_enable_rpath(${LIBRARY_NAME}) xacc_configure_plugin_rpath(${LIBRARY_NAME}) if(QCOR_BUILD_TESTS) #add_subdirectory(tests) Loading
compiler/clang/CMakeLists.txt +7 −14 Original line number Diff line number Diff line Loading @@ -6,21 +6,14 @@ add_library(${LIBRARY_NAME} QCORASTConsumer.cpp) target_include_directories(${LIBRARY_NAME} PUBLIC . ${CMAKE_SOURCE_DIR}/runtime ${CLANG_INCLUDE_DIRS} ${LLVM_INCLUDE_DIRS} ${XACC_INCLUDE_ROOT} ${XACC_INCLUDE_ROOT}/xacc ${XACC_INCLUDE_ROOT}/cppmicroservices4) ${LLVM_INCLUDE_DIRS}) target_link_libraries(${LIBRARY_NAME} PUBLIC ${CLANG_LIBS} ${LLVM_LIBS} ${XACC_LIBRARIES} qcor) 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() PUBLIC ${CLANG_LIBS} ${LLVM_LIBS} qcor) xacc_configure_library_rpath(${LIBRARY_NAME}) install(TARGETS ${LIBRARY_NAME} DESTINATION lib) if(QCOR_BUILD_TESTS) Loading @@ -30,6 +23,6 @@ endif() configure_file(qcor-driver.in.cpp ${CMAKE_BINARY_DIR}/compiler/clang/qcor-driver.cpp) add_executable(qcor-driver ${CMAKE_BINARY_DIR}/compiler/clang/qcor-driver.cpp) target_link_libraries(qcor-driver PRIVATE qcor-ast-plugin qcor xacc) target_link_libraries(qcor-driver PRIVATE qcor-ast-plugin qcor) install(PROGRAMS ${CMAKE_BINARY_DIR}/compiler/clang/qcor-driver DESTINATION bin) install (FILES QCORPragmaHandler.hpp DESTINATION include/qcor) No newline at end of file
compiler/clang/tests/CMakeLists.txt +1 −1 Original line number Diff line number Diff line Loading @@ -3,4 +3,4 @@ configure_file(LambdaVisitorTester.in.cpp include_directories(${CMAKE_SOURCE_DIR}/compiler/clang) add_xacc_test(LambdaVisitor) target_link_libraries(LambdaVisitorTester qcor qcor-ast-plugin ${CLANG_LIBS}) No newline at end of file target_link_libraries(LambdaVisitorTester qcor qcor-ast-plugin xacc::quantum_gate ${CLANG_LIBS}) No newline at end of file
ir/digital/CMakeLists.txt +2 −2 Original line number Diff line number Diff line Loading @@ -11,7 +11,7 @@ target_include_directories( ${LIBRARY_NAME} PUBLIC . generators/hwe generators/exp) target_link_libraries(${LIBRARY_NAME} PUBLIC xacc CppMicroServices PRIVATE xacc-pauli xacc-fermion) target_link_libraries(${LIBRARY_NAME} PUBLIC xacc::xacc PRIVATE xacc::pauli xacc::fermion) set(_bundle_name qcor_digital) set_target_properties(${LIBRARY_NAME} Loading @@ -27,7 +27,7 @@ usfunctionembedresources(TARGET FILES manifest.json) qcor_enable_rpath(${LIBRARY_NAME}) xacc_configure_plugin_rpath(${LIBRARY_NAME}) if(QCOR_BUILD_TESTS) add_subdirectory(generators/hwe/tests) Loading