Jia, Chunhui | a835eaa | 2018-09-05 09:00:41 +0800 | [diff] [blame] | 1 | cmake_minimum_required (VERSION 3.5) |
| 2 | |
| 3 | include (ExternalProject) |
| 4 | |
| 5 | file (MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/prefix) |
| 6 | file (MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/prefix/include) |
| 7 | |
| 8 | # requires apt install autoconf-archive and autoconf |
| 9 | externalproject_add ( |
| 10 | sdbusplus-project PREFIX ${CMAKE_BINARY_DIR}/sdbusplus-project |
Jason M. Bills | 3f7c5e4 | 2018-10-03 14:00:41 -0700 | [diff] [blame] | 11 | GIT_REPOSITORY https://github.com/openbmc/sdbusplus.git GIT_TAG |
Jia, Chunhui | e0c7073 | 2018-11-20 11:29:12 +0800 | [diff] [blame] | 12 | 6b4fb2969cd0c853ff6aa7f9bdd3ddaa0081c204 SOURCE_DIR |
Jason M. Bills | 3f7c5e4 | 2018-10-03 14:00:41 -0700 | [diff] [blame] | 13 | ${CMAKE_BINARY_DIR}/sdbusplus-src BINARY_DIR |
| 14 | ${CMAKE_BINARY_DIR}/sdbusplus-build CONFIGURE_COMMAND "" BUILD_COMMAND cd |
| 15 | ${CMAKE_BINARY_DIR}/sdbusplus-src && ./bootstrap.sh clean && ./bootstrap.sh |
| 16 | && ./configure --prefix=${CMAKE_BINARY_DIR}/prefix |
| 17 | CPPFLAGS=-I${CMAKE_BINARY_DIR}/prefix/include/ --enable-transaction && make |
| 18 | && make install INSTALL_COMMAND "" LOG_DOWNLOAD ON |
Jia, Chunhui | a835eaa | 2018-09-05 09:00:41 +0800 | [diff] [blame] | 19 | ) |
| 20 | |
| 21 | externalproject_add ( |
Jason M. Bills | 3f7c5e4 | 2018-10-03 14:00:41 -0700 | [diff] [blame] | 22 | dbus-interfaces PREFIX ${CMAKE_BINARY_DIR}/phosphor-dbus-interfaces DEPENDS |
| 23 | sdbusplus-project GIT_REPOSITORY |
| 24 | https://github.com/openbmc/phosphor-dbus-interfaces GIT_TAG |
| 25 | 4132f4b6b1de57a993af9bd2bcd039957786a227 SOURCE_DIR |
| 26 | ${CMAKE_BINARY_DIR}/phosphor-dbus-interfaces-src BINARY_DIR |
| 27 | ${CMAKE_BINARY_DIR}/phosphor-dbus-interfaces-build CONFIGURE_COMMAND "" |
| 28 | BUILD_COMMAND cd ${CMAKE_BINARY_DIR}/phosphor-dbus-interfaces-src && echo |
| 29 | "#!/bin/bash" > build.sh && echo |
| 30 | "export PYTHONPATH=${CMAKE_BINARY_DIR}/prefix/lib/python2.7/site-packages:$ENV{PYTHONPATH}" |
| 31 | >> build.sh && echo "export PATH=${CMAKE_BINARY_DIR}/prefix/bin:$ENV{PATH}" |
| 32 | >> build.sh && echo |
| 33 | "export PKG_CONFIG_PATH=${CMAKE_BINARY_DIR}/prefix/lib/pkgconfig" >> |
| 34 | build.sh && echo "./bootstrap.sh " >> build.sh && echo |
| 35 | "./configure --prefix=${CMAKE_BINARY_DIR}/prefix CPPFLAGS=-I${CMAKE_BINARY_DIR}/prefix/include/ " |
| 36 | >> build.sh && echo "make verbose=1" >> build.sh && echo "make install " >> |
| 37 | build.sh && chmod 777 build.sh && ./build.sh INSTALL_COMMAND "" LOG_DOWNLOAD |
| 38 | ON |
Jia, Chunhui | a835eaa | 2018-09-05 09:00:41 +0800 | [diff] [blame] | 39 | ) |
| 40 | |
| 41 | externalproject_add ( |
Jason M. Bills | 3f7c5e4 | 2018-10-03 14:00:41 -0700 | [diff] [blame] | 42 | cereal GIT_REPOSITORY https://github.com/USCiLab/cereal GIT_TAG |
| 43 | 51cbda5f30e56c801c07fe3d3aba5d7fb9e6cca4 SOURCE_DIR |
| 44 | "${CMAKE_BINARY_DIR}/cereal-src" BINARY_DIR |
| 45 | "${CMAKE_BINARY_DIR}/cereal-build" CONFIGURE_COMMAND "" BUILD_COMMAND "" |
| 46 | INSTALL_COMMAND mkdir -p "${CMAKE_BINARY_DIR}/prefix/include/cereal" && cp |
| 47 | -r "${CMAKE_BINARY_DIR}/cereal-src/include/cereal" |
| 48 | "${CMAKE_BINARY_DIR}/prefix/include" |
Jia, Chunhui | a835eaa | 2018-09-05 09:00:41 +0800 | [diff] [blame] | 49 | ) |
| 50 | |
| 51 | externalproject_add ( |
Jason M. Bills | 3f7c5e4 | 2018-10-03 14:00:41 -0700 | [diff] [blame] | 52 | phosphor-logging PREFIX ${CMAKE_BINARY_DIR}/phosphor-logging DEPENDS cereal |
| 53 | sdbusplus-project dbus-interfaces GIT_REPOSITORY |
| 54 | https://github.com/openbmc/phosphor-logging GIT_TAG |
| 55 | 477b731ad0fd8c116ffcaa8265a508c9fb112479 SOURCE_DIR |
| 56 | ${CMAKE_BINARY_DIR}/phosphor-logging-src BINARY_DIR |
| 57 | ${CMAKE_BINARY_DIR}/phosphor-logging-build CONFIGURE_COMMAND "" |
| 58 | BUILD_COMMAND cd ${CMAKE_BINARY_DIR}/phosphor-logging-src && echo |
| 59 | "#!/bin/bash" > build.sh && echo |
| 60 | "export PYTHONPATH=${CMAKE_BINARY_DIR}/prefix/lib/python2.7/site-packages:$ENV{PYTHONPATH}" |
| 61 | >> build.sh && echo "export PATH=${CMAKE_BINARY_DIR}/prefix/bin:$ENV{PATH}" |
| 62 | >> build.sh && echo |
| 63 | "export PKG_CONFIG_PATH=${CMAKE_BINARY_DIR}/prefix/lib/pkgconfig:$ENV{PKG_CONFIG_PATH}" |
| 64 | >> build.sh && echo "./bootstrap.sh clean" >> build.sh && echo |
| 65 | "./bootstrap.sh" >> build.sh && echo |
| 66 | "./configure --prefix=${CMAKE_BINARY_DIR}/prefix CPPFLAGS=-I${CMAKE_BINARY_DIR}/prefix/include/ \ |
| 67 | YAML_DIR=${CMAKE_BINARY_DIR}/prefix/share/phosphor-dbus-yaml/yaml --enable-metadata-processing" |
| 68 | >> build.sh && echo "make verbose=1" >> build.sh && echo "make install " >> |
| 69 | build.sh && chmod 777 build.sh && ./build.sh INSTALL_COMMAND "" LOG_DOWNLOAD |
| 70 | ON |
Jia, Chunhui | a835eaa | 2018-09-05 09:00:41 +0800 | [diff] [blame] | 71 | ) |
| 72 | |
| 73 | externalproject_add ( |
Jason M. Bills | 3f7c5e4 | 2018-10-03 14:00:41 -0700 | [diff] [blame] | 74 | nlohmann-json GIT_REPOSITORY "https://github.com/nlohmann/json.git" GIT_TAG |
| 75 | d2dd27dc3b8472dbaa7d66f83619b3ebcd9185fe SOURCE_DIR |
| 76 | "${CMAKE_BINARY_DIR}/nlohmann-json-src" BINARY_DIR |
| 77 | "${CMAKE_BINARY_DIR}/nlohmann-json-build" CONFIGURE_COMMAND "" BUILD_COMMAND |
| 78 | "" INSTALL_COMMAND mkdir -p "${CMAKE_BINARY_DIR}/prefix/include/nlohmann" && |
| 79 | cp -r "${CMAKE_BINARY_DIR}/nlohmann-json-src/include/nlohmann" |
| 80 | "${CMAKE_BINARY_DIR}/prefix/include" |
Jia, Chunhui | a835eaa | 2018-09-05 09:00:41 +0800 | [diff] [blame] | 81 | ) |
| 82 | |
Jason M. Bills | 3f7c5e4 | 2018-10-03 14:00:41 -0700 | [diff] [blame] | 83 | externalproject_add ( |
| 84 | host-ipmid PREFIX ${CMAKE_BINARY_DIR}/phosphor-host-ipmid DEPENDS |
| 85 | sdbusplus-project dbus-interfaces nlohmann-json GIT_REPOSITORY |
| 86 | https://github.com/openbmc/phosphor-host-ipmid SOURCE_DIR |
| 87 | ${CMAKE_BINARY_DIR}/phosphor-ipmi-host BINARY_DIR |
| 88 | ${CMAKE_BINARY_DIR}/phosphor-host-ipmid-build CONFIGURE_COMMAND "" |
| 89 | BUILD_COMMAND "" INSTALL_COMMAND mkdir -p |
| 90 | "${CMAKE_BINARY_DIR}/prefix/include/host-ipmid" && cp |
| 91 | ${CMAKE_BINARY_DIR}/phosphor-ipmi-host/host-ipmid/ipmid-api.h |
| 92 | ${CMAKE_BINARY_DIR}/prefix/include/host-ipmid && cp |
| 93 | ${CMAKE_BINARY_DIR}/phosphor-ipmi-host/elog-errors.hpp |
| 94 | ${CMAKE_BINARY_DIR}/prefix/include/host-ipmid && cp |
| 95 | ${CMAKE_BINARY_DIR}/phosphor-ipmi-host/utils.hpp |
| 96 | ${CMAKE_BINARY_DIR}/prefix/include/host-ipmid && cp |
| 97 | ${CMAKE_BINARY_DIR}/phosphor-ipmi-host/types.hpp |
| 98 | ${CMAKE_BINARY_DIR}/prefix/include/host-ipmid LOG_DOWNLOAD ON |
| 99 | ) |
Jia, Chunhui | a835eaa | 2018-09-05 09:00:41 +0800 | [diff] [blame] | 100 | |
Jason M. Bills | 3f7c5e4 | 2018-10-03 14:00:41 -0700 | [diff] [blame] | 101 | externalproject_add ( |
| 102 | Boost URL |
| 103 | https://dl.bintray.com/boostorg/release/1.66.0/source/boost_1_66_0.tar.gz |
| 104 | URL_MD5 d275cd85b00022313c171f602db59fc5 SOURCE_DIR |
| 105 | "${CMAKE_BINARY_DIR}/boost-src" BINARY_DIR "${CMAKE_BINARY_DIR}/boost-build" |
| 106 | CONFIGURE_COMMAND "" BUILD_COMMAND "" INSTALL_COMMAND mkdir -p |
| 107 | "${CMAKE_BINARY_DIR}/prefix/include/" && cp -R |
| 108 | ${CMAKE_BINARY_DIR}/boost-src/boost ${CMAKE_BINARY_DIR}/prefix/include |
| 109 | ) |
James Feist | b968392 | 2019-01-02 15:04:45 -0800 | [diff] [blame] | 110 | |
| 111 | externalproject_add ( |
| 112 | gtest GIT_REPOSITORY "https://github.com/google/googletest.git" GIT_TAG |
| 113 | dfa853b63d17c787914b663b50c2095a0c5b706e CMAKE_ARGS |
| 114 | -DCMAKE_INSTALL_PREFIX=${CMAKE_BINARY_DIR}/googletest-build SOURCE_DIR |
| 115 | "${CMAKE_BINARY_DIR}/googletest-src" BINARY_DIR |
| 116 | "${CMAKE_BINARY_DIR}/googletest-build" CMAKE_ARGS |
| 117 | -DCMAKE_INSTALL_PREFIX=${CMAKE_BINARY_DIR}/prefix |
| 118 | ) |