blob: eed741dd718a932278e3f7c5f4d9ea9c920b41eb [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 (
Boost URL
https://dl.bintray.com/boostorg/release/1.69.0/source/boost_1_69_0.tar.gz
URL_MD5 b50944c0c13f81ce2c006802a1186f5a SOURCE_DIR
"${CMAKE_BINARY_DIR}/boost-src" BINARY_DIR
"${CMAKE_BINARY_DIR}/boost-build" STAMP_DIR
"${CMAKE_BINARY_DIR}/boost-stamp" CONFIGURE_COMMAND cd
${CMAKE_BINARY_DIR}/boost-src && ./bootstrap.sh
--prefix=${CMAKE_BINARY_DIR}/prefix --with-toolset=gcc BUILD_COMMAND ""
INSTALL_COMMAND cd ${CMAKE_BINARY_DIR}/boost-src && ./b2 --with-coroutine
--with-context install
)
externalproject_add (sdbusplus-project PREFIX
${CMAKE_BINARY_DIR}/sdbusplus-project DEPENDS Boost
GIT_REPOSITORY https://github.com/openbmc/sdbusplus.git
GIT_TAG f0dd3b5a3c6c54b4f38844b573e3f157f8064088
SOURCE_DIR ${CMAKE_BINARY_DIR}/sdbusplus-src BINARY_DIR
${CMAKE_BINARY_DIR}/sdbusplus-build CONFIGURE_COMMAND cd
${CMAKE_BINARY_DIR}/sdbusplus-src && ./bootstrap.sh clean
&& ./bootstrap.sh && ./configure
--prefix=${CMAKE_BINARY_DIR}/prefix
CPPFLAGS=-I${CMAKE_BINARY_DIR}/prefix/include/
--enable-transaction BUILD_COMMAND cd
${CMAKE_BINARY_DIR}/sdbusplus-src && make -j
INSTALL_COMMAND cd ${CMAKE_BINARY_DIR}/sdbusplus-src &&
make install LOG_DOWNLOAD ON)
externalproject_add (sdeventplus-project PREFIX
${CMAKE_BINARY_DIR}/sdeventplus-project GIT_REPOSITORY
https://github.com/openbmc/sdeventplus.git SOURCE_DIR
${CMAKE_BINARY_DIR}/sdeventplus-src BINARY_DIR
${CMAKE_BINARY_DIR}/sdeventplus-build CONFIGURE_COMMAND cd
${CMAKE_BINARY_DIR}/sdeventplus-src && ./bootstrap.sh
clean && ./bootstrap.sh && ./configure
--prefix=${CMAKE_BINARY_DIR}/prefix
CPPFLAGS=-I${CMAKE_BINARY_DIR}/prefix/include/
BUILD_COMMAND cd ${CMAKE_BINARY_DIR}/sdeventplus-src &&
make -j INSTALL_COMMAND cd
${CMAKE_BINARY_DIR}/sdeventplus-src && make install
LOG_DOWNLOAD ON)
externalproject_add (
dbus-interfaces PREFIX ${CMAKE_BINARY_DIR}/phosphor-dbus-interfaces DEPENDS
sdbusplus-project GIT_REPOSITORY
https://github.com/openbmc/phosphor-dbus-interfaces GIT_TAG
05207d69427cc5f016f08dde801b702d1461cfec SOURCE_DIR
${CMAKE_BINARY_DIR}/phosphor-dbus-interfaces-src BINARY_DIR
${CMAKE_BINARY_DIR}/phosphor-dbus-interfaces-build CONFIGURE_COMMAND cd
${CMAKE_BINARY_DIR}/phosphor-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}/phosphor-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}/phosphor-dbus-interfaces-src && make install
LOG_DOWNLOAD ON
)
externalproject_add (cereal GIT_REPOSITORY https://github.com/USCiLab/cereal
GIT_TAG 51cbda5f30e56c801c07fe3d3aba5d7fb9e6cca4
SOURCE_DIR "${CMAKE_BINARY_DIR}/cereal-src" BINARY_DIR
"${CMAKE_BINARY_DIR}/cereal-build" CONFIGURE_COMMAND ""
BUILD_COMMAND "" INSTALL_COMMAND mkdir -p
"${CMAKE_BINARY_DIR}/prefix/include/cereal" && cp -r
"${CMAKE_BINARY_DIR}/cereal-src/include/cereal"
"${CMAKE_BINARY_DIR}/prefix/include")
externalproject_add (
phosphor-logging PREFIX ${CMAKE_BINARY_DIR}/phosphor-logging DEPENDS cereal
sdbusplus-project dbus-interfaces GIT_REPOSITORY
https://github.com/openbmc/phosphor-logging GIT_TAG
8024d1dc7dfff6360f3e1bdbce145652eb5698be SOURCE_DIR
${CMAKE_BINARY_DIR}/phosphor-logging-src BINARY_DIR
${CMAKE_BINARY_DIR}/phosphor-logging-build CONFIGURE_COMMAND cd
${CMAKE_BINARY_DIR}/phosphor-logging-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/
YAML_DIR=${CMAKE_BINARY_DIR}/prefix/share/phosphor-dbus-yaml/yaml
--enable-metadata-processing BUILD_COMMAND cd
${CMAKE_BINARY_DIR}/phosphor-logging-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}/phosphor-logging-src &&
make install LOG_DOWNLOAD ON
)
externalproject_add (nlohmann-json GIT_REPOSITORY
"https://github.com/nlohmann/json.git" GIT_TAG
d2dd27dc3b8472dbaa7d66f83619b3ebcd9185fe SOURCE_DIR
"${CMAKE_BINARY_DIR}/nlohmann-json-src" BINARY_DIR
"${CMAKE_BINARY_DIR}/nlohmann-json-build"
CONFIGURE_COMMAND "" BUILD_COMMAND "" INSTALL_COMMAND
mkdir -p "${CMAKE_BINARY_DIR}/prefix/include/nlohmann" &&
cp -r
"${CMAKE_BINARY_DIR}/nlohmann-json-src/include/nlohmann"
"${CMAKE_BINARY_DIR}/prefix/include")
externalproject_add (phosphor-objmgr PREFIX ${CMAKE_BINARY_DIR}/phosphor-objmgr
DEPENDS Boost sdbusplus-project phosphor-logging
GIT_REPOSITORY https://github.com/openbmc/phosphor-objmgr
SOURCE_DIR ${CMAKE_BINARY_DIR}/phosphor-objmgr-src
BINARY_DIR ${CMAKE_BINARY_DIR}/phosphor-objmgr-build
CONFIGURE_COMMAND cd
${CMAKE_BINARY_DIR}/phosphor-objmgr-src && 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}/phosphor-objmgr-src
&& export
PKG_CONFIG_PATH=${CMAKE_BINARY_DIR}/prefix/lib/pkgconfig
&& make -j verbose=1 INSTALL_COMMAND cd
${CMAKE_BINARY_DIR}/phosphor-objmgr-src && make install
LOG_DOWNLOAD ON)
externalproject_add (
host-ipmid PREFIX ${CMAKE_BINARY_DIR}/phosphor-host-ipmid DEPENDS
sdeventplus-project sdbusplus-project phosphor-objmgr dbus-interfaces
nlohmann-json Boost 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 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
PKG_CONFIG_PATH=${CMAKE_BINARY_DIR}/prefix/lib/pkgconfig && ./bootstrap.sh
&& ./configure --prefix=${CMAKE_BINARY_DIR}/prefix
CPPFLAGS=-I${CMAKE_BINARY_DIR}/prefix/include/
CXXFLAGS=-Wno-error=unused-result LDFLAGS=-L${CMAKE_BINARY_DIR}/prefix/lib/
BUILD_COMMAND 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
PKG_CONFIG_PATH=${CMAKE_BINARY_DIR}/prefix/lib/pkgconfig && make -j
verbose=1 INSTALL_COMMAND cd ${CMAKE_BINARY_DIR}/phosphor-ipmi-host-src &&
make install && mkdir -p
"${CMAKE_BINARY_DIR}/prefix/include/phosphor-ipmi-host" && cp
sensorhandler.hpp selutility.hpp
"${CMAKE_BINARY_DIR}/prefix/include/phosphor-ipmi-host/" LOG_DOWNLOAD ON
)
externalproject_add (gtest GIT_REPOSITORY
"https://github.com/google/googletest.git" GIT_TAG
dfa853b63d17c787914b663b50c2095a0c5b706e 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)
externalproject_add (tinyxml2 GIT_REPOSITORY
"https://github.com/leethomason/tinyxml2.git" CMAKE_ARGS
-DCMAKE_INSTALL_PREFIX=${CMAKE_BINARY_DIR}/tinyxml2-build
SOURCE_DIR "${CMAKE_BINARY_DIR}/tinyxml2-src" BINARY_DIR
"${CMAKE_BINARY_DIR}/tinyxml2-build" CMAKE_ARGS
-DCMAKE_INSTALL_PREFIX=${CMAKE_BINARY_DIR}/prefix)