Skip to content

Commit

Permalink
fix_third_party: set install libdir and fix spdlog includes
Browse files Browse the repository at this point in the history
With the update of the third-party libraries, qcor's compilation
crashes when try to link to the gtest and spdlog installed by
xacc. This PR fix that and allows for compilation of qcor without
touching qcor's configuration files.
  • Loading branch information
acastanedam committed Mar 8, 2023
1 parent 96943c9 commit 7409455
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ set(CMAKE_SKIP_INSTALL_RPATH OFF)
set(CMAKE_SKIP_RPATH OFF)
set(CMAKE_INSTALL_RPATH_USE_LINK_PATH ON)
set(CMAKE_EXPORT_COMPILE_COMMANDS TRUE)
set(CMAKE_INSTALL_LIBDIR "${CMAKE_INSTALL_PREFIX}/lib")

LIST(FIND CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES "${CMAKE_INSTALL_PREFIX}/lib" isSystemDir)

Expand Down Expand Up @@ -160,7 +161,7 @@ find_package(LAPACK)
# Dependencies:
option(XACC_DEPS_EXTERNAL "Try find external dependencies (system installation) rather than tpls" OFF)

set(SPDLOG_INCLUDE_DIR ${PROJECT_SOURCE_DIR}/tpls/spdlog/include)
set(SPDLOG_INCLUDE_DIR ${PROJECT_SOURCE_DIR}/tpls/spdlog/include/)
if (XACC_DEPS_EXTERNAL)
find_package(spdlog)
if (spdlog_FOUND)
Expand Down Expand Up @@ -248,7 +249,7 @@ install(FILES "${CMAKE_SOURCE_DIR}/tpls/mpark-variant/variant.hpp" DESTINATION i
install(FILES "${CMAKE_SOURCE_DIR}/tpls/taocpp/operators.hpp" DESTINATION include/xacc/)
install(FILES "${NLOHMANN_INCLUDE_DIR}/nlohmann/json.hpp" DESTINATION include/xacc/)

install(DIRECTORY "${SPDLOG_INCLUDE_DIR}" DESTINATION include)
install(DIRECTORY "${SPDLOG_INCLUDE_DIR}" DESTINATION include/spdlog/)
install(DIRECTORY "${CMAKE_SOURCE_DIR}/tpls/exprtk" DESTINATION include)
install(DIRECTORY "${EIGEN_INCLUDE_DIR}" DESTINATION include)
install(DIRECTORY "${CMAKE_SOURCE_DIR}/tpls/rapidjson" DESTINATION include)
Expand Down Expand Up @@ -318,4 +319,4 @@ if(XACC_CPACK_RPM_PLATFORM)
endif()

include(CPack)
endif()
endif()

0 comments on commit 7409455

Please sign in to comment.