blob: eed741dd718a932278e3f7c5f4d9ea9c920b41eb [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
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 Mauery8b69fae2019-03-20 13:43:11 -070037
James Feist7c00db72019-04-03 10:50:56 -070038externalproject_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, Chunhuia835eaa2018-09-05 09:00:41 +080051
52externalproject_add (
Jason M. Bills3f7c5e42018-10-03 14:00:41 -070053 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 Feist91244a62019-02-19 15:04:54 -080056 05207d69427cc5f016f08dde801b702d1461cfec SOURCE_DIR
Jason M. Bills3f7c5e42018-10-03 14:00:41 -070057 ${CMAKE_BINARY_DIR}/phosphor-dbus-interfaces-src BINARY_DIR
Vernon Mauery8b69fae2019-03-20 13:43:11 -070058 ${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 Feist7c00db72019-04-03 10:50:56 -070068 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, Chunhuia835eaa2018-09-05 09:00:41 +080072)
73
James Feist7c00db72019-04-03 10:50:56 -070074externalproject_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, Chunhuia835eaa2018-09-05 09:00:41 +080082
83externalproject_add (
Jason M. Bills3f7c5e42018-10-03 14:00:41 -070084 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 Feist91244a62019-02-19 15:04:54 -080087 8024d1dc7dfff6360f3e1bdbce145652eb5698be SOURCE_DIR
Jason M. Bills3f7c5e42018-10-03 14:00:41 -070088 ${CMAKE_BINARY_DIR}/phosphor-logging-src BINARY_DIR
Vernon Mauery8b69fae2019-03-20 13:43:11 -070089 ${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 Feist7c00db72019-04-03 10:50:56 -0700101 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, Chunhuia835eaa2018-09-05 09:00:41 +0800104)
105
James Feist7c00db72019-04-03 10:50:56 -0700106externalproject_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, Chunhuia835eaa2018-09-05 09:00:41 +0800116
James Feist7c00db72019-04-03 10:50:56 -0700117externalproject_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, Chunhuia835eaa2018-09-05 09:00:41 +0800134
Jason M. Bills3f7c5e42018-10-03 14:00:41 -0700135externalproject_add (
Vernon Mauery8b69fae2019-03-20 13:43:11 -0700136 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 Feist7c00db72019-04-03 10:50:56 -0700152 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 Mauery8b69fae2019-03-20 13:43:11 -0700157 "${CMAKE_BINARY_DIR}/prefix/include/phosphor-ipmi-host/" LOG_DOWNLOAD ON
Jason M. Bills3f7c5e42018-10-03 14:00:41 -0700158)
James Feistb9683922019-01-02 15:04:45 -0800159
James Feist7c00db72019-04-03 10:50:56 -0700160externalproject_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 Mauery8b69fae2019-03-20 13:43:11 -0700167
James Feist7c00db72019-04-03 10:50:56 -0700168externalproject_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)