Commit 5a8f39ba authored by Mccaskey, Alex's avatar Mccaskey, Alex

started on a better cmake build system

Signed-off-by: Mccaskey, Alex's avatarAlex McCaskey <mccaskeyaj@ornl.gov>
parent b81f5667
[submodule "tpls/cpr"]
path = tpls/cpr
url = https://github.com/whoshuu/cpr.git
[submodule "tpls/cppmicroservices"]
path = tpls/cppmicroservices
url = https://github.com/cppmicroservices/cppmicroservices
[submodule "tpls/boost-cmake"]
path = tpls/boost-cmake
url = https://github.com/ornl-qci/boost-cmake
......@@ -19,13 +19,22 @@ message(STATUS "C++ version ${CXX_STANDARD} configured.")
option(XACC_BUILD_TESTS "Build test programs" OFF)
# Make sure all build libraries have reference to their dependents
#set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib")
#set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
set(CMAKE_SKIP_INSTALL_RPATH OFF)
set(CMAKE_SKIP_RPATH OFF)
set(CMAKE_INSTALL_RPATH_USE_LINK_PATH ON)
LIST(FIND CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES "${CMAKE_INSTALL_PREFIX}/lib" isSystemDir)
IF("${isSystemDir}" STREQUAL "-1")
SET(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib")
SET(CMAKE_INSTALL_RPATH "@loader_path")
ENDIF("${isSystemDir}" STREQUAL "-1")
if (NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE "Release" CACHE STRING
"Choose the type of build, options are: Debug, Release, RelWithDebInfo, MinSizeRel"
FORCE
)
endif()
include(ExternalProject)
if(NOT WIN32)
......@@ -54,34 +63,9 @@ endif()
message(STATUS "${BoldGreen}Installing XACC to ${CMAKE_INSTALL_PREFIX}. Override with -DCMAKE_INSTALL_PREFIX=...${ColorReset}")
enable_testing()
function(add_tests tests test_include_dirs test_libs)
add_tests_with_flags("${tests}" "${test_include_dirs}" "${test_libs}" "")
endfunction()
function(add_tests_with_flags tests test_include_dirs test_libs test_cflags)
# Include all the required headers and BOOST
include_directories("${CMAKE_INSTALL_PREFIX}/include/boost" "${test_include_dirs}")
# Make executables and link libraries for testers
foreach(test ${tests})
message(STATUS "Adding test ${test}")
get_filename_component(testName ${test} NAME_WE)
# Add the executable to the build and the test list
add_executable(${testName} ${test})
add_test(${testName} ${testName} WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})
# Overwrite the default compile flags if needed.
if (NOT test_cflags STREQUAL "")
target_compile_options(${testName} PUBLIC "${test_cflags}")
endif()
# Only link libraries if they are provided
if (test_libs)
target_link_libraries(${testName} ${test_libs})
endif(test_libs)
# Add a label so the tests can be run on its own by label
set_property(TEST ${testName} PROPERTY LABELS ${PACKAGE_NAME})
endforeach(test ${tests})
endfunction()
if (XACC_BUILD_TESTS)
enable_testing()
endif()
# Setup Doxygen
find_package(Doxygen)
......@@ -95,85 +79,52 @@ endif(DOXYGEN_FOUND)
if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU" AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER "7.0.0")
set (CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS} "-Wimplicit-fallthrough=0")
endif()
ExternalProject_Add(cppmicroservices
GIT_REPOSITORY https://github.com/cppmicroservices/cppmicroservices
GIT_TAG v3.1.0
CMAKE_ARGS -DCMAKE_CXX_FLAGS=${CMAKE_CXX_FLAGS}
-DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}
-DCMAKE_CXX_FLAGS=${CMAKE_CXX_FLAGS}
-DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER}
-DCMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX}
INSTALL_COMMAND ${CMAKE_MAKE_PROGRAM} install
)
# Install Curl For People
set(USE_SYSTEM_CURL ON CACHE BOOL "" FORCE)
set(BUILD_CPR_TESTS OFF CACHE BOOL "" FORCE)
set(CMAKE_POSITION_INDEPENDENT_CODE TRUE)
set(BUILD_SHARED_LIBS TRUE)
add_subdirectory(tpls/cpr)
include_directories(${CPR_INCLUDE_DIRS})
include_directories(${CMAKE_BINARY_DIR}/tpls/cppmicroservices/include)
add_subdirectory(tpls)
include_directories(${CMAKE_INSTALL_PREFIX}/include/cppmicroservices3)
include_directories(${CMAKE_INSTALL_PREFIX}/include)
include_directories(${CPR_INCLUDE_DIRS})
include_directories(${CMAKE_SOURCE_DIR}/tpls/spdlog)
include_directories(${CMAKE_SOURCE_DIR}/tpls/eigen)
ExternalProject_Add(boost
DEPENDS cpr cppmicroservices
URL https://downloads.sourceforge.net/project/boost/boost/1.63.0/boost_1_63_0.tar.gz
UPDATE_COMMAND ./bootstrap.sh --prefix=${CMAKE_INSTALL_PREFIX} --without-libraries=python,mpi,container,context,coroutine,coroutine2,exception,iostreams,locale,log,math,metaparse,serialization,signals,type_erasure,wave,atomic,date_time,random,thread
CONFIGURE_COMMAND ""
BUILD_COMMAND ./b2
INSTALL_COMMAND ./b2 install
LOG_DOWNLOAD 1
LOG_UPDATE 1
LOG_CONFIGURE 1
LOG_BUILD 1
LOG_INSTALL 1
BUILD_IN_SOURCE 1
)
set(BOOST_ROOT ${CMAKE_INSTALL_PREFIX})
link_directories(${CMAKE_INSTALL_PREFIX}/lib)
add_subdirectory(xacc)
ExternalProject_Add(xacc-quantum
DEPENDS xacc
SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/quantum
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX}
-DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}
-DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER}
-DCMAKE_CXX_FLAGS=${CMAKE_CXX_FLAGS}
-DXACC_ROOT=${CMAKE_CURRENT_SOURCE_DIR}
-DXACC_BINARY_DIR=${CMAKE_BINARY_DIR}
-DBOOST_ROOT=${BOOST_ROOT}
CMAKE_CACHE_ARGS -DCMAKE_PREFIX_PATH:PATH=${CMAKE_PREFIX_PATH}
BUILD_ALWAYS 1
INSTALL_COMMAND ${CMAKE_MAKE_PROGRAM} install #DESTDIR=${CMAKE_BINARY_DIR}/stage
TEST_AFTER_INSTALL 1
)
add_subdirectory(quantum)
#ExternalProject_Add(xacc-quantum
# DEPENDS xacc
# SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/quantum
# CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX}
# -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}
# -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER}
# -DCMAKE_CXX_FLAGS=${CMAKE_CXX_FLAGS}
# -DXACC_ROOT=${CMAKE_CURRENT_SOURCE_DIR}
# -DXACC_BINARY_DIR=${CMAKE_BINARY_DIR}
# -DBOOST_ROOT=${BOOST_ROOT}
# CMAKE_CACHE_ARGS -DCMAKE_PREFIX_PATH:PATH=${CMAKE_PREFIX_PATH}
# BUILD_ALWAYS 1
# INSTALL_COMMAND ${CMAKE_MAKE_PROGRAM} install #DESTDIR=${CMAKE_BINARY_DIR}/stage
# TEST_AFTER_INSTALL 1
# )
#find_package(PythonLibs)
if(PYTHON_INCLUDE_DIR) #PYTHONLIBS_FOUND)
ExternalProject_Add(xacc-python
DEPENDS xacc-quantum
SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/python
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX}
-DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}
-DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER}
-DCMAKE_CXX_FLAGS=${CMAKE_CXX_FLAGS}
-DXACC_ROOT=${CMAKE_CURRENT_SOURCE_DIR}
-DPYTHON_EXECUTABLE=${PYTHON_EXECUTABLE}
-DXACC_BINARY_DIR=${CMAKE_BINARY_DIR}
-DFROM_SETUP_PY=${FROM_SETUP_PY}
-DXACC_PYTHON_INCLUDE_DIR=${PYTHON_INCLUDE_DIR}
-DBOOST_ROOT=${BOOST_ROOT}
CMAKE_CACHE_ARGS -DCMAKE_PREFIX_PATH:PATH=${CMAKE_PREFIX_PATH}
BUILD_ALWAYS 1
INSTALL_COMMAND ${CMAKE_MAKE_PROGRAM} install #DESTDIR=${CMAKE_BINARY_DIR}/stage
TEST_AFTER_INSTALL 1
)
add_subdirectory(python)
# ExternalProject_Add(xacc-python
# DEPENDS xacc-quantum
# SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/python
# CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX}
# -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}
# -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER}
# -DCMAKE_CXX_FLAGS=${CMAKE_CXX_FLAGS}
# -DXACC_ROOT=${CMAKE_CURRENT_SOURCE_DIR}
# -DPYTHON_EXECUTABLE=${PYTHON_EXECUTABLE}
# -DXACC_BINARY_DIR=${CMAKE_BINARY_DIR}
# -DFROM_SETUP_PY=${FROM_SETUP_PY}
# -DXACC_PYTHON_INCLUDE_DIR=${PYTHON_INCLUDE_DIR}
# -DBOOST_ROOT=${BOOST_ROOT}
# CMAKE_CACHE_ARGS -DCMAKE_PREFIX_PATH:PATH=${CMAKE_PREFIX_PATH}
# BUILD_ALWAYS 1
# INSTALL_COMMAND ${CMAKE_MAKE_PROGRAM} install #DESTDIR=${CMAKE_BINARY_DIR}/stage
# TEST_AFTER_INSTALL 1
#)
endif()
# Install the config file for external projects to use
......@@ -183,11 +134,11 @@ endif()
configure_file("${CMAKE_SOURCE_DIR}/cmake/xacc-config.cmake.in" "${CMAKE_BINARY_DIR}/xacc-config.cmake" @ONLY)
install(FILES "${CMAKE_BINARY_DIR}/xacc-config.cmake" DESTINATION .)
install(FILES "${CMAKE_SOURCE_DIR}/cmake/Modules/tests.cmake" DESTINATION share/xacc/)
if(APPLE)
install(FILES ${CMAKE_BINARY_DIR}/lib/libcpr.dylib DESTINATION lib)
else()
install(FILES ${CMAKE_BINARY_DIR}/lib/libcpr.so DESTINATION lib)
endif()
#if(APPLE)
#install(FILES ${CMAKE_BINARY_DIR}/lib/libcpr.dylib DESTINATION lib)
#else()
#install(FILES ${CMAKE_BINARY_DIR}/lib/libcpr.so DESTINATION lib)
#endif()
INSTALL( DIRECTORY "${CMAKE_SOURCE_DIR}/tpls/spdlog" DESTINATION include )
INSTALL( DIRECTORY "${CMAKE_SOURCE_DIR}/tpls/exprtk" DESTINATION include )
INSTALL( DIRECTORY "${CMAKE_SOURCE_DIR}/tpls/eigen" DESTINATION include )
......
cmake_minimum_required(VERSION 3.2 FATAL_ERROR)
project(xacc-python LANGUAGES CXX)
#set(BOOST_ROOT ${CMAKE_INSTALL_PREFIX})
#find_package(Boost COMPONENTS system program_options filesystem chrono regex graph REQUIRED)
set(CMAKE_STANDARD_REQUIRED ON)
set(CMAKE_CXX_STANDARD 11)
include_directories(${CMAKE_SOURCE_DIR}/xacc)
include_directories(${CMAKE_SOURCE_DIR}/quantum/gate)
include_directories(${CMAKE_SOURCE_DIR}/quantum/aqc)
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${XACC_ROOT}/cmake/Modules")
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_INSTALL_PREFIX}/share/cppmicroservices3/cmake")
include(CppMicroServicesConfig)
include(tests)
include_directories(${CMAKE_BINARY_DIR})
include_directories(${CMAKE_SOURCE_DIR}/xacc/ir)
include_directories(${CMAKE_SOURCE_DIR}/xacc/compiler)
include_directories(${CMAKE_SOURCE_DIR}/xacc/program)
include_directories(${CMAKE_SOURCE_DIR}/xacc/accelerator)
include_directories(${CMAKE_SOURCE_DIR}/xacc/utils)
include_directories(${CMAKE_SOURCE_DIR}/tpls/rapidjson/include)
include_directories(${CMAKE_SOURCE_DIR}/tpls/exprtk)
include_directories(${CMAKE_SOURCE_DIR}/tpls/spdlog)
include_directories(${CMAKE_SOURCE_DIR}/tpls/eigen)
#find_package(PythonLibs REQUIRED)
include_directories(${CMAKE_SOURCE_DIR}/quantum/gate/ir)
include_directories(${CMAKE_SOURCE_DIR}/quantum/gate/ir/instructions)
include_directories(${CMAKE_SOURCE_DIR}/quantum/gate/utils)
set(BOOST_ROOT ${CMAKE_INSTALL_PREFIX})
find_package(Boost COMPONENTS system program_options filesystem chrono regex graph REQUIRED)
#link_directories(${CMAKE_INSTALL_PREFIX}/lib)
include_directories(${XACC_ROOT}/xacc)
include_directories(${XACC_ROOT}/quantum/gate)
include_directories(${XACC_ROOT}/quantum/aqc)
include_directories(${PYTHON_INCLUDE_DIR})
include_directories(${CMAKE_SOURCE_DIR}/tpls/pybind11/include)
include_directories(${CMAKE_INSTALL_PREFIX}/include)
include_directories(${CMAKE_INSTALL_PREFIX}/include/cppmicroservices3)
include_directories(${XACC_BINARY_DIR})
include_directories(${XACC_ROOT}/xacc/ir)
include_directories(${XACC_ROOT}/xacc/compiler)
include_directories(${XACC_ROOT}/xacc/program)
include_directories(${XACC_ROOT}/xacc/accelerator)
include_directories(${XACC_ROOT}/xacc/utils)
include_directories(${XACC_ROOT}/tpls/rapidjson/include)
include_directories(${XACC_ROOT}/tpls/exprtk)
include_directories(${XACC_ROOT}/tpls/spdlog)
include_directories(${XACC_ROOT}/tpls/eigen)
include_directories(${XACC_ROOT}/quantum/gate/ir)
include_directories(${XACC_ROOT}/quantum/gate/ir/instructions)
include_directories(${XACC_ROOT}/quantum/gate/utils)
link_directories(${CMAKE_INSTALL_PREFIX}/lib)
include_directories(${XACC_PYTHON_INCLUDE_DIR})
include_directories(${XACC_ROOT}/tpls/pybind11/include)
link_directories(${XACC_BINARY_DIR}/xacc)
link_directories(${XACC_BINARY_DIR}/lib)
#link_directories(${XACC_BINARY_DIR}/xacc)
#link_directories(${XACC_BINARY_DIR}/lib)
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-strict-aliasing -O2 -g -pipe -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wformat -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv")
if(APPLE)
......@@ -53,7 +38,7 @@ add_library(_pyxacc SHARED xacc-py.cpp)
set_target_properties(_pyxacc PROPERTIES PREFIX "")
target_link_libraries(_pyxacc CppMicroServices xacc xacc-quantum-gate ${Boost_LIBRARIES} cpr curl)
target_link_libraries(_pyxacc PUBLIC CppMicroServices xacc xacc-quantum-gate)
if(APPLE)
set_target_properties(_pyxacc PROPERTIES INSTALL_RPATH "@loader_path/lib")
......
......@@ -10,36 +10,27 @@
# Contributors:
# Alexander J. McCaskey - initial API and implementation
# *******************************************************************************/
cmake_minimum_required(VERSION 3.2 FATAL_ERROR)
project(xacc-quantum LANGUAGES CXX)
set(CMAKE_STANDARD_REQUIRED ON)
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${XACC_ROOT}/cmake/Modules")
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_INSTALL_PREFIX}/share/cppmicroservices3/cmake")
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_BINARY_DIR}/tpls/cppmicroservices")
#include(${CMAKE_BINARY_DIR}/tpls/cppmicroservices/CppMicroServicesConfig.cmake)
include(CppMicroServicesConfig)
include(tests)
find_package(Boost COMPONENTS system program_options regex filesystem chrono graph REQUIRED)
include_directories(${CMAKE_INSTALL_PREFIX}/include)
include_directories(${CMAKE_INSTALL_PREFIX}/include/cppmicroservices3)
include_directories(${XACC_BINARY_DIR})
include_directories(${XACC_ROOT}/xacc)
include_directories(${XACC_ROOT}/xacc/ir)
include_directories(${XACC_ROOT}/xacc/compiler)
include_directories(${XACC_ROOT}/xacc/program)
include_directories(${XACC_ROOT}/xacc/accelerator)
include_directories(${XACC_ROOT}/xacc/utils)
include_directories(${XACC_ROOT}/tpls/rapidjson/include)
include_directories(${XACC_ROOT}/tpls/exprtk)
include_directories(${XACC_ROOT}/tpls/spdlog)
include_directories(${XACC_ROOT}/tpls/eigen)
include_directories(${CMAKE_BINARY_DIR})
include_directories(${CMAKE_SOURCE_DIR}/xacc)
include_directories(${CMAKE_SOURCE_DIR}/xacc/ir)
include_directories(${CMAKE_SOURCE_DIR}/xacc/compiler)
include_directories(${CMAKE_SOURCE_DIR}/xacc/program)
include_directories(${CMAKE_SOURCE_DIR}/xacc/accelerator)
include_directories(${CMAKE_SOURCE_DIR}/xacc/utils)
include_directories(${CMAKE_SOURCE_DIR}/tpls/rapidjson/include)
include_directories(${CMAKE_SOURCE_DIR}/tpls/exprtk)
include_directories(${CMAKE_SOURCE_DIR}/tpls/spdlog)
include_directories(${CMAKE_SOURCE_DIR}/tpls/eigen)
link_directories(${CMAKE_INSTALL_PREFIX}/lib)
link_directories(${XACC_BINARY_DIR}/xacc)
link_directories(${XACC_BINARY_DIR}/lib)
#link_directories(${CMAKE_INSTALL_PREFIX}/lib)
#link_directories(${XACC_BINARY_DIR}/xacc)
#link_directories(${XACC_BINARY_DIR}/lib)
add_subdirectory(gate)
add_subdirectory(aqc)
......@@ -51,11 +51,10 @@ usFunctionEmbedResources(TARGET ${LIBRARY_NAME}
manifest.json
)
set(BOOST_ROOT ${CMAKE_INSTALL_PREFIX})
find_package(Boost COMPONENTS system program_options filesystem chrono regex graph REQUIRED)
target_link_libraries(${LIBRARY_NAME} CppMicroServices xacc ${Boost_LIBRARIES}) #${CppUsLib}) #${Boost_LIBRARIES} xacc ${CppUsLib} restclient-cpp) #cpprest ${OPENSSL_LIBRARIES})
#set(BOOST_ROOT ${CMAKE_INSTALL_PREFIX})
#find_package(Boost COMPONENTS system program_options filesystem chrono regex graph REQUIRED)
target_link_libraries(${LIBRARY_NAME} PUBLIC CppMicroServices xacc ${Boost_LIBRARIES})
if(APPLE)
set_target_properties(xacc-quantum-aqc PROPERTIES INSTALL_RPATH "@loader_path")
......
......@@ -54,10 +54,10 @@ usFunctionEmbedResources(TARGET ${LIBRARY_NAME}
)
set(BOOST_ROOT ${CMAKE_INSTALL_PREFIX})
find_package(Boost COMPONENTS system program_options filesystem chrono regex graph REQUIRED)
#set(BOOST_ROOT ${CMAKE_INSTALL_PREFIX})
#find_package(Boost COMPONENTS system program_options filesystem chrono regex graph REQUIRED)
target_link_libraries(${LIBRARY_NAME} CppMicroServices xacc ${Boost_LIBRARIES}) #${CppUsLib}) #${Boost_LIBRARIES} xacc ${CppUsLib} restclient-cpp) #cpprest ${OPENSSL_LIBRARIES})
target_link_libraries(${LIBRARY_NAME} PUBLIC CppMicroServices xacc ${Boost_LIBRARIES}) #${CppUsLib}) #${Boost_LIBRARIES} xacc ${CppUsLib} restclient-cpp) #cpprest ${OPENSSL_LIBRARIES})
if(APPLE)
set_target_properties(xacc-quantum-gate PROPERTIES INSTALL_RPATH "@loader_path")
......
set(BUILD_SHARED_LIBS TRUE)
add_subdirectory(cppmicroservices)
set(USE_SYSTEM_CURL ON CACHE BOOL "" FORCE)
set(BUILD_CPR_TESTS OFF CACHE BOOL "" FORCE)
set(CMAKE_POSITION_INDEPENDENT_CODE TRUE)
set(BUILD_SHARED_LIBS FALSE)
add_subdirectory(cpr)
set(BOOST_LIBS_OPTIONAL program_options system filesystem regex graph CACHE STRING "" FORCE)
add_subdirectory(boost-cmake)
INSTALL( DIRECTORY "${CMAKE_SOURCE_DIR}/tpls/boost-cmake/boost/boost_1_64_0/boost" DESTINATION include )
Subproject commit ed498308ba357b3d0ed85aa87f99d0a37d6677f9
Subproject commit 0e0cf324b399a0229e0222731e65bc29f187f9ed
......@@ -10,13 +10,6 @@
# Contributors:
# Alexander J. McCaskey - initial API and implementation
# *******************************************************************************/
# Modify our CMAKE_MODULE_PATH
#set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${XACC_ROOT}/cmake/Modules")
#include(tests)#
# We require Boost without MPI
#find_package(Boost COMPONENTS system program_options regex filesystem chrono graph REQUIRED)
#endif()
# Create a xacc config header file
configure_file("${CMAKE_SOURCE_DIR}/cmake/xacc_config.hpp.in" "${CMAKE_BINARY_DIR}/xacc_config.hpp")
......@@ -50,7 +43,7 @@ file (GLOB SRCS
#link_directories(${CMAKE_INSTALL_PREFIX}/lib)
add_library(xacc SHARED ${SRCS})
add_dependencies(xacc boost cpr)
add_dependencies(xacc Boost::system Boost::filesystem Boost::graph cpr)
if(APPLE)
set_target_properties(xacc PROPERTIES INSTALL_RPATH "@loader_path")
......@@ -63,12 +56,12 @@ endif()
# Get the test files
file(GLOB test_files utils/tests/*Tester.cpp accelerator/tests/*Tester.cpp)
target_link_libraries(xacc CppMicroServices cpr)
target_link_libraries(xacc PUBLIC CppMicroServices Boost::boost Boost::filesystem Boost::graph Boost::program_options Boost::regex PRIVATE cpr)
# Add the tests
if(XACC_BUILD_TESTS)
add_tests("${test_files}" "${CMAKE_CURRENT_SOURCE_DIR}/utils" "${Boost_LIBRARIES};xacc;${CppUsLib};boost_program_options;boost_unit_test_framework;boost_system;cpr;boost_filesystem;boost_graph")
endif()
#3if(XACC_BUILD_TESTS) #add_tests("${test_files}" "${CMAKE_CURRENT_SOURCE_DIR}/utils" "${Boost_LIBRARIES};xacc;${CppUsLib};boost_program_options;boost_unit_test_framework;boost_system;cpr;boost_filesystem;boost_graph")
#add_tests("${test_files}" "${CMAKE_CURRENT_SOURCE_DIR}/utils" "${Boost_LIBRARIES};xacc;${CppUsLib};boost_program_options;boost_unit_test_framework;boost_system;cpr;boost_filesystem;boost_graph")
install(FILES ${HEADERS} DESTINATION include/xacc)
install(TARGETS xacc DESTINATION lib)
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