blob: 37a605cdce5c65cd81721004feb8010c700647b4 [file] [log] [blame]
cmake_minimum_required (VERSION 3.5)
include (ExternalProject)
file (MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/prefix)
file (MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/prefix/include)
# requires apt install autoconf-archive and autoconf
externalproject_add (
host-ipmid PREFIX ${CMAKE_BINARY_DIR}/phosphor-host-ipmid GIT_REPOSITORY
https://github.com/openbmc/phosphor-host-ipmid SOURCE_DIR
${CMAKE_BINARY_DIR}/phosphor-ipmi-host-src BINARY_DIR
${CMAKE_BINARY_DIR}/phosphor-ipmi-host-build CONFIGURE_COMMAND /usr/bin/bash -c
"cd ${CMAKE_BINARY_DIR}/phosphor-ipmi-host-src && export \
PYTHONPATH=${CMAKE_BINARY_DIR}/prefix/lib/python2.7/site-packages:$ENV{PYTHONPATH} \
&& export PATH=${CMAKE_BINARY_DIR}/prefix/bin:$ENV{PATH} && \
export CPPFLAGS=\'-I${CMAKE_BINARY_DIR}/prefix/include/ \' && \
export LDFLAGS=\'-L${CMAKE_BINARY_DIR}/prefix/lib/ \' && \
meson --prefix=${CMAKE_BINARY_DIR}/prefix build-ext"
BUILD_COMMAND /usr/bin/bash -c "cd ${CMAKE_BINARY_DIR}/phosphor-ipmi-host-src && export \
PYTHONPATH=${CMAKE_BINARY_DIR}/prefix/lib/python2.7/site-packages:$ENV{PYTHONPATH} \
&& export PATH=${CMAKE_BINARY_DIR}/prefix/bin:$ENV{PATH} && \
ninja --verbose -C build-ext"
INSTALL_COMMAND cd ${CMAKE_BINARY_DIR}/phosphor-ipmi-host-src &&
ninja --verbose -C build-ext install && mkdir -p
"${CMAKE_BINARY_DIR}/prefix/include/phosphor-ipmi-host" && cp
sensorhandler.hpp selutility.hpp
"${CMAKE_BINARY_DIR}/prefix/include/phosphor-ipmi-host/" && echo "ipmid config finish"
LOG_BUILD ON LOG_CONFIGURE ON LOG_DOWNLOAD ON
)
externalproject_add (gtest GIT_REPOSITORY
"https://github.com/google/googletest.git" GIT_TAG
7153098229e88295f9655ff1d3b0e2fa9eada5f8 CMAKE_ARGS
-DCMAKE_INSTALL_PREFIX=${CMAKE_BINARY_DIR}/googletest-build
SOURCE_DIR "${CMAKE_BINARY_DIR}/googletest-src" BINARY_DIR
"${CMAKE_BINARY_DIR}/googletest-build" CMAKE_ARGS
-DCMAKE_INSTALL_PREFIX=${CMAKE_BINARY_DIR}/prefix)