blob: f7161acd34b85d944ae4fb89e1e0e107ce7b4667 [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 (
sdbusplus-project PREFIX ${CMAKE_BINARY_DIR}/sdbusplus-project
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 "" BUILD_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 && make
&& make install INSTALL_COMMAND "" 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 ""
BUILD_COMMAND cd ${CMAKE_BINARY_DIR}/phosphor-dbus-interfaces-src && echo
"#!/bin/bash" > build.sh && echo
"export PYTHONPATH=${CMAKE_BINARY_DIR}/prefix/lib/python2.7/site-packages:$ENV{PYTHONPATH}"
>> build.sh && echo "export PATH=${CMAKE_BINARY_DIR}/prefix/bin:$ENV{PATH}"
>> build.sh && echo
"export PKG_CONFIG_PATH=${CMAKE_BINARY_DIR}/prefix/lib/pkgconfig" >>
build.sh && echo "./bootstrap.sh " >> build.sh && echo
"./configure --prefix=${CMAKE_BINARY_DIR}/prefix CPPFLAGS=-I${CMAKE_BINARY_DIR}/prefix/include/ "
>> build.sh && echo "make verbose=1" >> build.sh && echo "make install " >>
build.sh && chmod 777 build.sh && ./build.sh INSTALL_COMMAND "" 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 ""
BUILD_COMMAND cd ${CMAKE_BINARY_DIR}/phosphor-logging-src && echo
"#!/bin/bash" > build.sh && echo
"export PYTHONPATH=${CMAKE_BINARY_DIR}/prefix/lib/python2.7/site-packages:$ENV{PYTHONPATH}"
>> build.sh && echo "export PATH=${CMAKE_BINARY_DIR}/prefix/bin:$ENV{PATH}"
>> build.sh && echo
"export PKG_CONFIG_PATH=${CMAKE_BINARY_DIR}/prefix/lib/pkgconfig:$ENV{PKG_CONFIG_PATH}"
>> build.sh && echo "./bootstrap.sh clean" >> build.sh && echo
"./bootstrap.sh" >> build.sh && echo
"./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.sh && echo "make verbose=1" >> build.sh && echo "make install " >>
build.sh && chmod 777 build.sh && ./build.sh INSTALL_COMMAND "" 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 (
host-ipmid PREFIX ${CMAKE_BINARY_DIR}/phosphor-host-ipmid DEPENDS
sdbusplus-project dbus-interfaces nlohmann-json GIT_REPOSITORY
https://github.com/openbmc/phosphor-host-ipmid SOURCE_DIR
${CMAKE_BINARY_DIR}/phosphor-ipmi-host BINARY_DIR
${CMAKE_BINARY_DIR}/phosphor-host-ipmid-build CONFIGURE_COMMAND ""
BUILD_COMMAND "" INSTALL_COMMAND mkdir -p
"${CMAKE_BINARY_DIR}/prefix/include/ipmid" && cp
${CMAKE_BINARY_DIR}/phosphor-ipmi-host/include/ipmid/api.h
${CMAKE_BINARY_DIR}/prefix/include/ipmid LOG_DOWNLOAD ON
)
externalproject_add (
Boost URL
https://dl.bintray.com/boostorg/release/1.66.0/source/boost_1_66_0.tar.gz
URL_MD5 d275cd85b00022313c171f602db59fc5 SOURCE_DIR
"${CMAKE_BINARY_DIR}/boost-src" BINARY_DIR "${CMAKE_BINARY_DIR}/boost-build"
CONFIGURE_COMMAND "" BUILD_COMMAND "" INSTALL_COMMAND mkdir -p
"${CMAKE_BINARY_DIR}/prefix/include/" && cp -R
${CMAKE_BINARY_DIR}/boost-src/boost ${CMAKE_BINARY_DIR}/prefix/include
)
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
)