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 |
Vernon Mauery | 8b69fae | 2019-03-20 13:43:11 -0700 | [diff] [blame] | 9 | |
Jia, Chunhui | a835eaa | 2018-09-05 09:00:41 +0800 | [diff] [blame] | 10 | externalproject_add ( |
Vernon Mauery | 8b69fae | 2019-03-20 13:43:11 -0700 | [diff] [blame] | 11 | Boost URL |
| 12 | https://dl.bintray.com/boostorg/release/1.69.0/source/boost_1_69_0.tar.gz |
| 13 | URL_MD5 b50944c0c13f81ce2c006802a1186f5a SOURCE_DIR |
James Feist | 7c00db7 | 2019-04-03 10:50:56 -0700 | [diff] [blame^] | 14 | "${CMAKE_BINARY_DIR}/boost-src" BINARY_DIR |
| 15 | "${CMAKE_BINARY_DIR}/boost-build" STAMP_DIR |
| 16 | "${CMAKE_BINARY_DIR}/boost-stamp" CONFIGURE_COMMAND cd |
| 17 | ${CMAKE_BINARY_DIR}/boost-src && ./bootstrap.sh |
Vernon Mauery | 8b69fae | 2019-03-20 13:43:11 -0700 | [diff] [blame] | 18 | --prefix=${CMAKE_BINARY_DIR}/prefix --with-toolset=gcc BUILD_COMMAND "" |
| 19 | INSTALL_COMMAND cd ${CMAKE_BINARY_DIR}/boost-src && ./b2 --with-coroutine |
| 20 | --with-context install |
| 21 | ) |
| 22 | |
James Feist | 7c00db7 | 2019-04-03 10:50:56 -0700 | [diff] [blame^] | 23 | externalproject_add (sdbusplus-project PREFIX |
| 24 | ${CMAKE_BINARY_DIR}/sdbusplus-project DEPENDS Boost |
| 25 | GIT_REPOSITORY https://github.com/openbmc/sdbusplus.git |
| 26 | GIT_TAG f0dd3b5a3c6c54b4f38844b573e3f157f8064088 |
| 27 | SOURCE_DIR ${CMAKE_BINARY_DIR}/sdbusplus-src BINARY_DIR |
| 28 | ${CMAKE_BINARY_DIR}/sdbusplus-build CONFIGURE_COMMAND cd |
| 29 | ${CMAKE_BINARY_DIR}/sdbusplus-src && ./bootstrap.sh clean |
| 30 | && ./bootstrap.sh && ./configure |
| 31 | --prefix=${CMAKE_BINARY_DIR}/prefix |
| 32 | CPPFLAGS=-I${CMAKE_BINARY_DIR}/prefix/include/ |
| 33 | --enable-transaction BUILD_COMMAND cd |
| 34 | ${CMAKE_BINARY_DIR}/sdbusplus-src && make -j |
| 35 | INSTALL_COMMAND cd ${CMAKE_BINARY_DIR}/sdbusplus-src && |
| 36 | make install LOG_DOWNLOAD ON) |
Vernon Mauery | 8b69fae | 2019-03-20 13:43:11 -0700 | [diff] [blame] | 37 | |
James Feist | 7c00db7 | 2019-04-03 10:50:56 -0700 | [diff] [blame^] | 38 | externalproject_add (sdeventplus-project PREFIX |
| 39 | ${CMAKE_BINARY_DIR}/sdeventplus-project GIT_REPOSITORY |
| 40 | https://github.com/openbmc/sdeventplus.git SOURCE_DIR |
| 41 | ${CMAKE_BINARY_DIR}/sdeventplus-src BINARY_DIR |
| 42 | ${CMAKE_BINARY_DIR}/sdeventplus-build CONFIGURE_COMMAND cd |
| 43 | ${CMAKE_BINARY_DIR}/sdeventplus-src && ./bootstrap.sh |
| 44 | clean && ./bootstrap.sh && ./configure |
| 45 | --prefix=${CMAKE_BINARY_DIR}/prefix |
| 46 | CPPFLAGS=-I${CMAKE_BINARY_DIR}/prefix/include/ |
| 47 | BUILD_COMMAND cd ${CMAKE_BINARY_DIR}/sdeventplus-src && |
| 48 | make -j INSTALL_COMMAND cd |
| 49 | ${CMAKE_BINARY_DIR}/sdeventplus-src && make install |
| 50 | LOG_DOWNLOAD ON) |
Jia, Chunhui | a835eaa | 2018-09-05 09:00:41 +0800 | [diff] [blame] | 51 | |
| 52 | externalproject_add ( |
Jason M. Bills | 3f7c5e4 | 2018-10-03 14:00:41 -0700 | [diff] [blame] | 53 | dbus-interfaces PREFIX ${CMAKE_BINARY_DIR}/phosphor-dbus-interfaces DEPENDS |
| 54 | sdbusplus-project GIT_REPOSITORY |
| 55 | https://github.com/openbmc/phosphor-dbus-interfaces GIT_TAG |
James Feist | 91244a6 | 2019-02-19 15:04:54 -0800 | [diff] [blame] | 56 | 05207d69427cc5f016f08dde801b702d1461cfec SOURCE_DIR |
Jason M. Bills | 3f7c5e4 | 2018-10-03 14:00:41 -0700 | [diff] [blame] | 57 | ${CMAKE_BINARY_DIR}/phosphor-dbus-interfaces-src BINARY_DIR |
Vernon Mauery | 8b69fae | 2019-03-20 13:43:11 -0700 | [diff] [blame] | 58 | ${CMAKE_BINARY_DIR}/phosphor-dbus-interfaces-build CONFIGURE_COMMAND cd |
| 59 | ${CMAKE_BINARY_DIR}/phosphor-dbus-interfaces-src && export |
| 60 | PYTHONPATH=${CMAKE_BINARY_DIR}/prefix/lib/python2.7/site-packages:$ENV{PYTHONPATH} |
| 61 | && export PATH=${CMAKE_BINARY_DIR}/prefix/bin:$ENV{PATH} && export |
| 62 | PKG_CONFIG_PATH=${CMAKE_BINARY_DIR}/prefix/lib/pkgconfig && ./bootstrap.sh |
| 63 | && ./configure --prefix=${CMAKE_BINARY_DIR}/prefix |
| 64 | CPPFLAGS=-I${CMAKE_BINARY_DIR}/prefix/include/ BUILD_COMMAND cd |
| 65 | ${CMAKE_BINARY_DIR}/phosphor-dbus-interfaces-src && export |
| 66 | PYTHONPATH=${CMAKE_BINARY_DIR}/prefix/lib/python2.7/site-packages:$ENV{PYTHONPATH} |
| 67 | && export PATH=${CMAKE_BINARY_DIR}/prefix/bin:$ENV{PATH} && export |
James Feist | 7c00db7 | 2019-04-03 10:50:56 -0700 | [diff] [blame^] | 68 | PKG_CONFIG_PATH=${CMAKE_BINARY_DIR}/prefix/lib/pkgconfig && make -j |
| 69 | verbose=1 INSTALL_COMMAND cd |
| 70 | ${CMAKE_BINARY_DIR}/phosphor-dbus-interfaces-src && make install |
| 71 | LOG_DOWNLOAD ON |
Jia, Chunhui | a835eaa | 2018-09-05 09:00:41 +0800 | [diff] [blame] | 72 | ) |
| 73 | |
James Feist | 7c00db7 | 2019-04-03 10:50:56 -0700 | [diff] [blame^] | 74 | externalproject_add (cereal GIT_REPOSITORY https://github.com/USCiLab/cereal |
| 75 | GIT_TAG 51cbda5f30e56c801c07fe3d3aba5d7fb9e6cca4 |
| 76 | SOURCE_DIR "${CMAKE_BINARY_DIR}/cereal-src" BINARY_DIR |
| 77 | "${CMAKE_BINARY_DIR}/cereal-build" CONFIGURE_COMMAND "" |
| 78 | BUILD_COMMAND "" INSTALL_COMMAND mkdir -p |
| 79 | "${CMAKE_BINARY_DIR}/prefix/include/cereal" && cp -r |
| 80 | "${CMAKE_BINARY_DIR}/cereal-src/include/cereal" |
| 81 | "${CMAKE_BINARY_DIR}/prefix/include") |
Jia, Chunhui | a835eaa | 2018-09-05 09:00:41 +0800 | [diff] [blame] | 82 | |
| 83 | externalproject_add ( |
Jason M. Bills | 3f7c5e4 | 2018-10-03 14:00:41 -0700 | [diff] [blame] | 84 | phosphor-logging PREFIX ${CMAKE_BINARY_DIR}/phosphor-logging DEPENDS cereal |
| 85 | sdbusplus-project dbus-interfaces GIT_REPOSITORY |
| 86 | https://github.com/openbmc/phosphor-logging GIT_TAG |
James Feist | 91244a6 | 2019-02-19 15:04:54 -0800 | [diff] [blame] | 87 | 8024d1dc7dfff6360f3e1bdbce145652eb5698be SOURCE_DIR |
Jason M. Bills | 3f7c5e4 | 2018-10-03 14:00:41 -0700 | [diff] [blame] | 88 | ${CMAKE_BINARY_DIR}/phosphor-logging-src BINARY_DIR |
Vernon Mauery | 8b69fae | 2019-03-20 13:43:11 -0700 | [diff] [blame] | 89 | ${CMAKE_BINARY_DIR}/phosphor-logging-build CONFIGURE_COMMAND cd |
| 90 | ${CMAKE_BINARY_DIR}/phosphor-logging-src && export |
| 91 | PYTHONPATH=${CMAKE_BINARY_DIR}/prefix/lib/python2.7/site-packages:$ENV{PYTHONPATH} |
| 92 | && export PATH=${CMAKE_BINARY_DIR}/prefix/bin:$ENV{PATH} && export |
| 93 | PKG_CONFIG_PATH=${CMAKE_BINARY_DIR}/prefix/lib/pkgconfig && ./bootstrap.sh |
| 94 | && ./configure --prefix=${CMAKE_BINARY_DIR}/prefix |
| 95 | CPPFLAGS=-I${CMAKE_BINARY_DIR}/prefix/include/ |
| 96 | YAML_DIR=${CMAKE_BINARY_DIR}/prefix/share/phosphor-dbus-yaml/yaml |
| 97 | --enable-metadata-processing BUILD_COMMAND cd |
| 98 | ${CMAKE_BINARY_DIR}/phosphor-logging-src && export |
| 99 | PYTHONPATH=${CMAKE_BINARY_DIR}/prefix/lib/python2.7/site-packages:$ENV{PYTHONPATH} |
| 100 | && export PATH=${CMAKE_BINARY_DIR}/prefix/bin:$ENV{PATH} && export |
James Feist | 7c00db7 | 2019-04-03 10:50:56 -0700 | [diff] [blame^] | 101 | PKG_CONFIG_PATH=${CMAKE_BINARY_DIR}/prefix/lib/pkgconfig && make -j |
| 102 | verbose=1 INSTALL_COMMAND cd ${CMAKE_BINARY_DIR}/phosphor-logging-src && |
| 103 | make install LOG_DOWNLOAD ON |
Jia, Chunhui | a835eaa | 2018-09-05 09:00:41 +0800 | [diff] [blame] | 104 | ) |
| 105 | |
James Feist | 7c00db7 | 2019-04-03 10:50:56 -0700 | [diff] [blame^] | 106 | externalproject_add (nlohmann-json GIT_REPOSITORY |
| 107 | "https://github.com/nlohmann/json.git" GIT_TAG |
| 108 | d2dd27dc3b8472dbaa7d66f83619b3ebcd9185fe SOURCE_DIR |
| 109 | "${CMAKE_BINARY_DIR}/nlohmann-json-src" BINARY_DIR |
| 110 | "${CMAKE_BINARY_DIR}/nlohmann-json-build" |
| 111 | CONFIGURE_COMMAND "" BUILD_COMMAND "" INSTALL_COMMAND |
| 112 | mkdir -p "${CMAKE_BINARY_DIR}/prefix/include/nlohmann" && |
| 113 | cp -r |
| 114 | "${CMAKE_BINARY_DIR}/nlohmann-json-src/include/nlohmann" |
| 115 | "${CMAKE_BINARY_DIR}/prefix/include") |
Jia, Chunhui | a835eaa | 2018-09-05 09:00:41 +0800 | [diff] [blame] | 116 | |
James Feist | 7c00db7 | 2019-04-03 10:50:56 -0700 | [diff] [blame^] | 117 | externalproject_add (phosphor-objmgr PREFIX ${CMAKE_BINARY_DIR}/phosphor-objmgr |
| 118 | DEPENDS Boost sdbusplus-project phosphor-logging |
| 119 | GIT_REPOSITORY https://github.com/openbmc/phosphor-objmgr |
| 120 | SOURCE_DIR ${CMAKE_BINARY_DIR}/phosphor-objmgr-src |
| 121 | BINARY_DIR ${CMAKE_BINARY_DIR}/phosphor-objmgr-build |
| 122 | CONFIGURE_COMMAND cd |
| 123 | ${CMAKE_BINARY_DIR}/phosphor-objmgr-src && export |
| 124 | PKG_CONFIG_PATH=${CMAKE_BINARY_DIR}/prefix/lib/pkgconfig |
| 125 | && ./bootstrap.sh && ./configure |
| 126 | --prefix=${CMAKE_BINARY_DIR}/prefix |
| 127 | CPPFLAGS=-I${CMAKE_BINARY_DIR}/prefix/include/ |
| 128 | BUILD_COMMAND cd ${CMAKE_BINARY_DIR}/phosphor-objmgr-src |
| 129 | && export |
| 130 | PKG_CONFIG_PATH=${CMAKE_BINARY_DIR}/prefix/lib/pkgconfig |
| 131 | && make -j verbose=1 INSTALL_COMMAND cd |
| 132 | ${CMAKE_BINARY_DIR}/phosphor-objmgr-src && make install |
| 133 | LOG_DOWNLOAD ON) |
Jia, Chunhui | a835eaa | 2018-09-05 09:00:41 +0800 | [diff] [blame] | 134 | |
Jason M. Bills | 3f7c5e4 | 2018-10-03 14:00:41 -0700 | [diff] [blame] | 135 | externalproject_add ( |
Vernon Mauery | 8b69fae | 2019-03-20 13:43:11 -0700 | [diff] [blame] | 136 | host-ipmid PREFIX ${CMAKE_BINARY_DIR}/phosphor-host-ipmid DEPENDS |
| 137 | sdeventplus-project sdbusplus-project phosphor-objmgr dbus-interfaces |
| 138 | nlohmann-json Boost GIT_REPOSITORY |
| 139 | https://github.com/openbmc/phosphor-host-ipmid SOURCE_DIR |
| 140 | ${CMAKE_BINARY_DIR}/phosphor-ipmi-host-src BINARY_DIR |
| 141 | ${CMAKE_BINARY_DIR}/phosphor-ipmi-host-build CONFIGURE_COMMAND cd |
| 142 | ${CMAKE_BINARY_DIR}/phosphor-ipmi-host-src && export |
| 143 | PYTHONPATH=${CMAKE_BINARY_DIR}/prefix/lib/python2.7/site-packages:$ENV{PYTHONPATH} |
| 144 | && export PATH=${CMAKE_BINARY_DIR}/prefix/bin:$ENV{PATH} && export |
| 145 | PKG_CONFIG_PATH=${CMAKE_BINARY_DIR}/prefix/lib/pkgconfig && ./bootstrap.sh |
| 146 | && ./configure --prefix=${CMAKE_BINARY_DIR}/prefix |
| 147 | CPPFLAGS=-I${CMAKE_BINARY_DIR}/prefix/include/ |
| 148 | CXXFLAGS=-Wno-error=unused-result LDFLAGS=-L${CMAKE_BINARY_DIR}/prefix/lib/ |
| 149 | BUILD_COMMAND cd ${CMAKE_BINARY_DIR}/phosphor-ipmi-host-src && export |
| 150 | PYTHONPATH=${CMAKE_BINARY_DIR}/prefix/lib/python2.7/site-packages:$ENV{PYTHONPATH} |
| 151 | && export PATH=${CMAKE_BINARY_DIR}/prefix/bin:$ENV{PATH} && export |
James Feist | 7c00db7 | 2019-04-03 10:50:56 -0700 | [diff] [blame^] | 152 | PKG_CONFIG_PATH=${CMAKE_BINARY_DIR}/prefix/lib/pkgconfig && make -j |
| 153 | verbose=1 INSTALL_COMMAND cd ${CMAKE_BINARY_DIR}/phosphor-ipmi-host-src && |
| 154 | make install && mkdir -p |
| 155 | "${CMAKE_BINARY_DIR}/prefix/include/phosphor-ipmi-host" && cp |
| 156 | sensorhandler.hpp selutility.hpp |
Vernon Mauery | 8b69fae | 2019-03-20 13:43:11 -0700 | [diff] [blame] | 157 | "${CMAKE_BINARY_DIR}/prefix/include/phosphor-ipmi-host/" LOG_DOWNLOAD ON |
Jason M. Bills | 3f7c5e4 | 2018-10-03 14:00:41 -0700 | [diff] [blame] | 158 | ) |
James Feist | b968392 | 2019-01-02 15:04:45 -0800 | [diff] [blame] | 159 | |
James Feist | 7c00db7 | 2019-04-03 10:50:56 -0700 | [diff] [blame^] | 160 | externalproject_add (gtest GIT_REPOSITORY |
| 161 | "https://github.com/google/googletest.git" GIT_TAG |
| 162 | dfa853b63d17c787914b663b50c2095a0c5b706e CMAKE_ARGS |
| 163 | -DCMAKE_INSTALL_PREFIX=${CMAKE_BINARY_DIR}/googletest-build |
| 164 | SOURCE_DIR "${CMAKE_BINARY_DIR}/googletest-src" BINARY_DIR |
| 165 | "${CMAKE_BINARY_DIR}/googletest-build" CMAKE_ARGS |
| 166 | -DCMAKE_INSTALL_PREFIX=${CMAKE_BINARY_DIR}/prefix) |
Vernon Mauery | 8b69fae | 2019-03-20 13:43:11 -0700 | [diff] [blame] | 167 | |
James Feist | 7c00db7 | 2019-04-03 10:50:56 -0700 | [diff] [blame^] | 168 | externalproject_add (tinyxml2 GIT_REPOSITORY |
| 169 | "https://github.com/leethomason/tinyxml2.git" CMAKE_ARGS |
| 170 | -DCMAKE_INSTALL_PREFIX=${CMAKE_BINARY_DIR}/tinyxml2-build |
| 171 | SOURCE_DIR "${CMAKE_BINARY_DIR}/tinyxml2-src" BINARY_DIR |
| 172 | "${CMAKE_BINARY_DIR}/tinyxml2-build" CMAKE_ARGS |
| 173 | -DCMAKE_INSTALL_PREFIX=${CMAKE_BINARY_DIR}/prefix) |