blob: 366f144abe725091f01a150f7b4894ae1d5bb62a [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 (
intel-dbus-interfaces PREFIX ${CMAKE_BINARY_DIR}/intel-dbus-interfaces
GIT_REPOSITORY https://github.com/openbmc/intel-dbus-interfaces GIT_TAG
b5f2dd444c5d3808d005452417e4ae2ea28624ff SOURCE_DIR
${CMAKE_BINARY_DIR}/intel-dbus-interfaces-src BINARY_DIR
${CMAKE_BINARY_DIR}/intel-dbus-interfaces-build CONFIGURE_COMMAND cd
${CMAKE_BINARY_DIR}/intel-dbus-interfaces-src && export
PYTHONPATH=${CMAKE_BINARY_DIR}/prefix/lib/python2.7/site-packages:$ENV{PYTHONPATH}
&& export PATH=${CMAKE_BINARY_DIR}/prefix/bin:$ENV{PATH} && export
PKG_CONFIG_PATH=${CMAKE_BINARY_DIR}/prefix/lib/pkgconfig && ./bootstrap.sh
&& ./configure --prefix=${CMAKE_BINARY_DIR}/prefix
CPPFLAGS=-I${CMAKE_BINARY_DIR}/prefix/include/ BUILD_COMMAND cd
${CMAKE_BINARY_DIR}/intel-dbus-interfaces-src && export
PYTHONPATH=${CMAKE_BINARY_DIR}/prefix/lib/python2.7/site-packages:$ENV{PYTHONPATH}
&& export PATH=${CMAKE_BINARY_DIR}/prefix/bin:$ENV{PATH} && export
PKG_CONFIG_PATH=${CMAKE_BINARY_DIR}/prefix/lib/pkgconfig && make -j
verbose=1 INSTALL_COMMAND cd ${CMAKE_BINARY_DIR}/intel-dbus-interfaces-src
&& make install LOG_DOWNLOAD ON
)
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)