blob: b805efc2e6cccf456a8cd3187027b29a94f18d05 [file] [log] [blame]
Jia, Chunhuia835eaa2018-09-05 09:00:41 +08001cmake_minimum_required (VERSION 3.5)
2
3include (ExternalProject)
4
5file (MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/prefix)
6file (MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/prefix/include)
7
8# requires apt install autoconf-archive and autoconf
Vernon Mauery8b69fae2019-03-20 13:43:11 -07009
Jia, Chunhuia835eaa2018-09-05 09:00:41 +080010externalproject_add (
Vernon Mauery8b69fae2019-03-20 13:43:11 -070011 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 Feist7c00db72019-04-03 10:50:56 -070014 "${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 Mauery8b69fae2019-03-20 13:43:11 -070018 --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 Feist7c00db72019-04-03 10:50:56 -070023externalproject_add (sdbusplus-project PREFIX
24 ${CMAKE_BINARY_DIR}/sdbusplus-project DEPENDS Boost
25 GIT_REPOSITORY https://github.com/openbmc/sdbusplus.git
James Feist7c00db72019-04-03 10:50:56 -070026 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 Mauery8b69fae2019-03-20 13:43:11 -070036
James Feist7c00db72019-04-03 10:50:56 -070037externalproject_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, Chunhuia835eaa2018-09-05 09:00:41 +080050
51externalproject_add (
Jason M. Bills3f7c5e42018-10-03 14:00:41 -070052 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 Feist91244a62019-02-19 15:04:54 -080055 05207d69427cc5f016f08dde801b702d1461cfec SOURCE_DIR
Jason M. Bills3f7c5e42018-10-03 14:00:41 -070056 ${CMAKE_BINARY_DIR}/phosphor-dbus-interfaces-src BINARY_DIR
Vernon Mauery8b69fae2019-03-20 13:43:11 -070057 ${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 Feist7c00db72019-04-03 10:50:56 -070067 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, Chunhuia835eaa2018-09-05 09:00:41 +080071)
72
Yong Li0669d192019-05-06 14:01:46 +080073externalproject_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 Feist7c00db72019-04-03 10:50:56 -070095externalproject_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, Chunhuia835eaa2018-09-05 09:00:41 +0800103
104externalproject_add (
Jason M. Bills3f7c5e42018-10-03 14:00:41 -0700105 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 Feist91244a62019-02-19 15:04:54 -0800108 8024d1dc7dfff6360f3e1bdbce145652eb5698be SOURCE_DIR
Jason M. Bills3f7c5e42018-10-03 14:00:41 -0700109 ${CMAKE_BINARY_DIR}/phosphor-logging-src BINARY_DIR
Vernon Mauery8b69fae2019-03-20 13:43:11 -0700110 ${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 Feist7c00db72019-04-03 10:50:56 -0700122 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, Chunhuia835eaa2018-09-05 09:00:41 +0800125)
126
James Feist7c00db72019-04-03 10:50:56 -0700127externalproject_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, Chunhuia835eaa2018-09-05 09:00:41 +0800137
James Feist7c00db72019-04-03 10:50:56 -0700138externalproject_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, Chunhuia835eaa2018-09-05 09:00:41 +0800155
Jason M. Bills3f7c5e42018-10-03 14:00:41 -0700156externalproject_add (
Vernon Mauery8b69fae2019-03-20 13:43:11 -0700157 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 Feist7c00db72019-04-03 10:50:56 -0700173 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 Mauery8b69fae2019-03-20 13:43:11 -0700178 "${CMAKE_BINARY_DIR}/prefix/include/phosphor-ipmi-host/" LOG_DOWNLOAD ON
Jason M. Bills3f7c5e42018-10-03 14:00:41 -0700179)
James Feistb9683922019-01-02 15:04:45 -0800180
James Feist7c00db72019-04-03 10:50:56 -0700181externalproject_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 Mauery8b69fae2019-03-20 13:43:11 -0700188
James Feist7c00db72019-04-03 10:50:56 -0700189externalproject_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)