summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCzarnowski, Przemyslaw <przemyslaw.hawrylewicz.czarnowski@intel.com>2021-10-21 15:15:59 +0300
committerCzarnowski, Przemyslaw <przemyslaw.hawrylewicz.czarnowski@intel.com>2021-11-19 13:18:25 +0300
commit6165e07cd0ef6da314ed1ef4f58fe47b7d8112db (patch)
treed52992ec92a91a6a4b00042ef9798b29ae070b80
parenteb57aae1f56acff2784887e4f24c74c4141657a6 (diff)
downloadvirtual-media-6165e07cd0ef6da314ed1ef4f58fe47b7d8112db.tar.xz
virtual-media: CMake update
- Fixed standalone builds: - added boost to standalone build, - sdbusplus version bumped up (for dbus signal support) - Fixed warnings when finding udev. Tested: Standalone compilation works in "clean" system, yocto compiles without regression. Change-Id: Iddaa980ec2d299ff836d2e06970ebc5a5b1cf3d9 Signed-off-by: Czarnowski, Przemyslaw <przemyslaw.hawrylewicz.czarnowski@intel.com>
-rw-r--r--CMakeLists.txt50
-rw-r--r--cmake/Findudev.cmake2
2 files changed, 34 insertions, 18 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 6bc3452..e9eb2a4 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -26,10 +26,26 @@ if(NOT ${YOCTO_DEPENDENCIES})
include(ExternalProject)
ExternalProject_Add(
+ Boost
+ URL "https://boostorg.jfrog.io/artifactory/main/release/1.76.0/source/boost_1_76_0.tar.bz2"
+ URL_MD5 "33334dd7f862e8ac9fe1cc7c6584fb6d"
+ SOURCE_DIR ${CMAKE_BINARY_DIR}/src/boost
+ BINARY_DIR ${CMAKE_BINARY_DIR}/libs/boost
+ CONFIGURE_COMMAND cd <SOURCE_DIR> && ./bootstrap.sh
+ BUILD_COMMAND cd <SOURCE_DIR> && ./b2 --exec-prefix=<BINARY_DIR>
+ --prefix=<BINARY_DIR> --with-system --with-coroutine install
+ INSTALL_COMMAND ""
+ UPDATE_COMMAND "")
+
+ set(CMAKE_PREFIX_PATH ${CMAKE_BINARY_DIR}/libs/boost/ ${CMAKE_PREFIX_PATH})
+ include_directories(SYSTEM ${CMAKE_BINARY_DIR}/libs/boost/include)
+ link_directories(SYSTEM ${CMAKE_BINARY_DIR}/libs/boost/lib)
+
+ ExternalProject_Add(
sdbusplus-project
PREFIX ${CMAKE_BINARY_DIR}/sdbusplus-project
GIT_REPOSITORY https://github.com/openbmc/sdbusplus.git
- GIT_TAG c08cf5283b80a071d19506d9a462f6c69e1797f1
+ GIT_TAG afe80cf2e5dc4aefe3b041adeb0230e61929bf12
SOURCE_DIR ${CMAKE_BINARY_DIR}/sdbusplus-src
BINARY_DIR ${CMAKE_BINARY_DIR}/sdbusplus-build
CONFIGURE_COMMAND ""
@@ -39,6 +55,9 @@ if(NOT ${YOCTO_DEPENDENCIES})
LOG_DOWNLOAD ON
UPDATE_COMMAND "")
+ include_directories(${CMAKE_BINARY_DIR}/sdbusplus-src)
+ link_directories(${CMAKE_BINARY_DIR}/sdbusplus-src/.libs)
+
ExternalProject_Add(
nlohmann-json
GIT_REPOSITORY "https://github.com/nlohmann/json.git"
@@ -54,10 +73,20 @@ if(NOT ${YOCTO_DEPENDENCIES})
UPDATE_COMMAND "")
include_directories(${CMAKE_BINARY_DIR}/prefix/include)
- include_directories(${CMAKE_BINARY_DIR}/sdbusplus-src)
-
- link_directories(${CMAKE_BINARY_DIR}/sdbusplus-src/.libs)
+else()
+ # Include Boost library. This allows specify exact version of BOOST to be
+ # used, especially important while using valgrind, to point BOOST that is
+ # compiled with valgrind support
+ if(${BOOST_VERSION})
+ find_package(Boost ${BOOST_VERSION} EXACT)
+ else()
+ find_package(Boost 1.69 REQUIRED COMPONENTS coroutine context)
+ endif()
+ message("++ Using Boost version: " ${Boost_VERSION})
+
+ include_directories(${Boost_INCLUDE_DIRS})
+ link_directories(${Boost_LIBRARY_DIRS})
endif()
# Include UDEV library
@@ -65,19 +94,6 @@ find_package(udev REQUIRED)
include_directories(${UDEV_INCLUDE_DIRS})
link_directories(${UDEV_LIBRARIES})
-# Include Boost library This allows specify exact version of BOOST to be used,
-# especially important while using valgrind, to point BOOST that is compiled
-# with valgrind support
-if(${BOOST_VERSION})
- find_package(Boost ${BOOST_VERSION} EXACT)
-else()
- find_package(Boost 1.69 REQUIRED)
-endif()
-message("++ Using Boost version: " ${Boost_VERSION})
-
-include_directories(${Boost_INCLUDE_DIRS})
-link_directories(${Boost_LIBRARY_DIRS})
-
# Boost related definitions
add_definitions(-DBOOST_COROUTINES_NO_DEPRECATION_WARNING)
add_definitions(-DBOOST_ERROR_CODE_HEADER_ONLY)
diff --git a/cmake/Findudev.cmake b/cmake/Findudev.cmake
index ce454d5..89d5312 100644
--- a/cmake/Findudev.cmake
+++ b/cmake/Findudev.cmake
@@ -60,7 +60,7 @@ find_path(UDEV_INCLUDE_DIR
)
include(FindPackageHandleStandardArgs)
-find_package_handle_standard_args(UDEV
+find_package_handle_standard_args(udev
DEFAULT_MSG
UDEV_LIBRARY
UDEV_INCLUDE_DIR