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