diff --git a/cmake_modules/FindProtobuf.cmake b/cmake_modules/FindProtobuf.cmake index 6be08638..4b91a1d3 100644 --- a/cmake_modules/FindProtobuf.cmake +++ b/cmake_modules/FindProtobuf.cmake @@ -1,7 +1,7 @@ # Distributed under the OSI-approved BSD 3-Clause License. See accompanying # file Copyright.txt or https://cmake.org/licensing for details. -set(LIBRARY_ROOT "${LIBRARY_REPOSITORY_ROOT}/protobuf") +set(LIBRARY_ROOT "${CXX_COMMON_REPOSITORY_ROOT}/protobuf") set(Protobuf_FOUND TRUE) set(Protobuf_INCLUDE_DIR "${LIBRARY_ROOT}/include") diff --git a/cmake_modules/FindXED.cmake b/cmake_modules/FindXED.cmake index 4f336b73..b9650291 100644 --- a/cmake_modules/FindXED.cmake +++ b/cmake_modules/FindXED.cmake @@ -1,4 +1,4 @@ -set(LIBRARY_ROOT "${LIBRARY_REPOSITORY_ROOT}/xed") +set(LIBRARY_ROOT "${CXX_COMMON_REPOSITORY_ROOT}/xed") set(XED_FOUND TRUE) set(XED_INCLUDE_DIRS "${LIBRARY_ROOT}/include") diff --git a/cmake_modules/Findcapstone.cmake b/cmake_modules/Findcapstone.cmake index 622e3308..4c4b9b3c 100644 --- a/cmake_modules/Findcapstone.cmake +++ b/cmake_modules/Findcapstone.cmake @@ -1,4 +1,4 @@ -set(LIBRARY_ROOT "${LIBRARY_REPOSITORY_ROOT}/capstone") +set(LIBRARY_ROOT "${CXX_COMMON_REPOSITORY_ROOT}/capstone") set(CAPSTONE_FOUND TRUE) set(CAPSTONE_INCLUDE_DIRS "${LIBRARY_ROOT}/include") diff --git a/cmake_modules/Finddrdecode.cmake b/cmake_modules/Finddrdecode.cmake index a12eb198..78da0540 100644 --- a/cmake_modules/Finddrdecode.cmake +++ b/cmake_modules/Finddrdecode.cmake @@ -1,4 +1,4 @@ -set(LIBRARY_ROOT "${LIBRARY_REPOSITORY_ROOT}/drdecode") +set(LIBRARY_ROOT "${CXX_COMMON_REPOSITORY_ROOT}/drdecode") set(DRDECODE_FOUND TRUE) set(DRDECODE_INCLUDE_DIRS "${LIBRARY_ROOT}/include") diff --git a/cmake_modules/Findgtest.cmake b/cmake_modules/Findgtest.cmake index c882d9ad..d0f6f71d 100644 --- a/cmake_modules/Findgtest.cmake +++ b/cmake_modules/Findgtest.cmake @@ -1,4 +1,4 @@ -set(LIBRARY_ROOT "${LIBRARY_REPOSITORY_ROOT}/googletest") +set(LIBRARY_ROOT "${CXX_COMMON_REPOSITORY_ROOT}/googletest") set(gtest_FOUND TRUE) set(gtest_INCLUDE_DIRS "${LIBRARY_ROOT}/include") diff --git a/cmake_modules/repository.cmake b/cmake_modules/repository.cmake index 131e2cf2..be9e4648 100644 --- a/cmake_modules/repository.cmake +++ b/cmake_modules/repository.cmake @@ -1,15 +1,19 @@ -set(LIBRARY_REPOSITORY_ROOT $ENV{TRAILOFBITS_LIBRARIES}) +if(DEFINED ENV{TRAILOFBITS_LIBRARIES}) + set(CXX_COMMON_REPOSITORY_ROOT $ENV{TRAILOFBITS_LIBRARIES} CACHE PATH "Location of cxx-common libraries") +endif() -if ("${LIBRARY_REPOSITORY_ROOT}" STREQUAL "") +if("x${CXX_COMMON_REPOSITORY_ROOT}x" STREQUAL "xx") message(ERROR "The TRAILOFBITS_LIBRARIES environment variable is not defined!") -endif () +endif() -list(APPEND CMAKE_MODULE_PATH "${LIBRARY_REPOSITORY_ROOT}/cmake_modules") +list(APPEND CMAKE_MODULE_PATH "${CXX_COMMON_REPOSITORY_ROOT}/cmake_modules") -list(APPEND CMAKE_PREFIX_PATH "${LIBRARY_REPOSITORY_ROOT}/gflags") -list(APPEND CMAKE_PREFIX_PATH "${LIBRARY_REPOSITORY_ROOT}/llvm") -list(APPEND CMAKE_PREFIX_PATH "${LIBRARY_REPOSITORY_ROOT}/glog") -list(APPEND CMAKE_PREFIX_PATH "${LIBRARY_REPOSITORY_ROOT}/protobuf/lib/cmake/protobuf") -list(APPEND CMAKE_PREFIX_PATH "${LIBRARY_REPOSITORY_ROOT}/capnproto/lib/cmake/CapnProto") -set(BOOST_ROOT "${LIBRARY_REPOSITORY_ROOT}/boost") +list(APPEND CMAKE_PREFIX_PATH "${CXX_COMMON_REPOSITORY_ROOT}/gflags") +list(APPEND CMAKE_PREFIX_PATH "${CXX_COMMON_REPOSITORY_ROOT}/llvm") +list(APPEND CMAKE_PREFIX_PATH "${CXX_COMMON_REPOSITORY_ROOT}/glog") +list(APPEND CMAKE_PREFIX_PATH "${CXX_COMMON_REPOSITORY_ROOT}/protobuf/lib/cmake/protobuf") +list(APPEND CMAKE_PREFIX_PATH "${CXX_COMMON_REPOSITORY_ROOT}/capnproto/lib/cmake/CapnProto") +if(EXISTS "${CXX_COMMON_REPOSITORY_ROOT}/boost") + set(BOOST_ROOT "${CXX_COMMON_REPOSITORY_ROOT}/boost") +endif()