blob: 21a1041b37b4d50f548432b910449b153c3b2006 [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 Mauery53870d72019-06-04 14:21:10 -070011 intel-dbus-interfaces PREFIX ${CMAKE_BINARY_DIR}/intel-dbus-interfaces
James Feist13b00392019-08-19 16:16:08 -070012 GIT_REPOSITORY https://github.com/openbmc/intel-dbus-interfaces GIT_TAG
Chen Yugang39736d52019-07-12 16:24:33 +080013 b5f2dd444c5d3808d005452417e4ae2ea28624ff SOURCE_DIR
Yong Li0669d192019-05-06 14:01:46 +080014 ${CMAKE_BINARY_DIR}/intel-dbus-interfaces-src BINARY_DIR
15 ${CMAKE_BINARY_DIR}/intel-dbus-interfaces-build CONFIGURE_COMMAND cd
16 ${CMAKE_BINARY_DIR}/intel-dbus-interfaces-src && export
17 PYTHONPATH=${CMAKE_BINARY_DIR}/prefix/lib/python2.7/site-packages:$ENV{PYTHONPATH}
18 && export PATH=${CMAKE_BINARY_DIR}/prefix/bin:$ENV{PATH} && export
19 PKG_CONFIG_PATH=${CMAKE_BINARY_DIR}/prefix/lib/pkgconfig && ./bootstrap.sh
20 && ./configure --prefix=${CMAKE_BINARY_DIR}/prefix
21 CPPFLAGS=-I${CMAKE_BINARY_DIR}/prefix/include/ BUILD_COMMAND cd
22 ${CMAKE_BINARY_DIR}/intel-dbus-interfaces-src && export
23 PYTHONPATH=${CMAKE_BINARY_DIR}/prefix/lib/python2.7/site-packages:$ENV{PYTHONPATH}
24 && export PATH=${CMAKE_BINARY_DIR}/prefix/bin:$ENV{PATH} && export
25 PKG_CONFIG_PATH=${CMAKE_BINARY_DIR}/prefix/lib/pkgconfig && make -j
Vernon Mauery53870d72019-06-04 14:21:10 -070026 verbose=1 INSTALL_COMMAND cd ${CMAKE_BINARY_DIR}/intel-dbus-interfaces-src
27 && make install LOG_DOWNLOAD ON
Yong Li0669d192019-05-06 14:01:46 +080028)
29
Jia, Chunhuia835eaa2018-09-05 09:00:41 +080030externalproject_add (
James Feist13b00392019-08-19 16:16:08 -070031 host-ipmid PREFIX ${CMAKE_BINARY_DIR}/phosphor-host-ipmid GIT_REPOSITORY
Vernon Mauery8b69fae2019-03-20 13:43:11 -070032 https://github.com/openbmc/phosphor-host-ipmid SOURCE_DIR
33 ${CMAKE_BINARY_DIR}/phosphor-ipmi-host-src BINARY_DIR
Hao Jiangd8593952021-02-12 11:27:47 -080034 ${CMAKE_BINARY_DIR}/phosphor-ipmi-host-build CONFIGURE_COMMAND /usr/bin/bash -c
35 "cd ${CMAKE_BINARY_DIR}/phosphor-ipmi-host-src && export \
36 PYTHONPATH=${CMAKE_BINARY_DIR}/prefix/lib/python2.7/site-packages:$ENV{PYTHONPATH} \
37 && export PATH=${CMAKE_BINARY_DIR}/prefix/bin:$ENV{PATH} && export \
38 PKG_CONFIG_PATH=${CMAKE_BINARY_DIR}/prefix/lib/pkgconfig && ./bootstrap.sh \
39 && ./configure --prefix=${CMAKE_BINARY_DIR}/prefix \
40 CPPFLAGS=\'-I${CMAKE_BINARY_DIR}/prefix/include/ \' \
41 CXXFLAGS=\'-Wno-error=unused-result \' \
42 LDFLAGS=\'-L${CMAKE_BINARY_DIR}/prefix/lib/ \'"
43 BUILD_COMMAND /usr/bin/bash -c "cd ${CMAKE_BINARY_DIR}/phosphor-ipmi-host-src && export \
44 PYTHONPATH=${CMAKE_BINARY_DIR}/prefix/lib/python2.7/site-packages:$ENV{PYTHONPATH} \
45 && export PATH=${CMAKE_BINARY_DIR}/prefix/bin:$ENV{PATH} && export \
46 PKG_CONFIG_PATH=${CMAKE_BINARY_DIR}/prefix/lib/pkgconfig && make -j \
47 verbose=1"
48 INSTALL_COMMAND cd ${CMAKE_BINARY_DIR}/phosphor-ipmi-host-src &&
James Feist7c00db72019-04-03 10:50:56 -070049 make install && mkdir -p
50 "${CMAKE_BINARY_DIR}/prefix/include/phosphor-ipmi-host" && cp
51 sensorhandler.hpp selutility.hpp
Hao Jiangd8593952021-02-12 11:27:47 -080052 "${CMAKE_BINARY_DIR}/prefix/include/phosphor-ipmi-host/" && echo "ipmid config finish"
53 LOG_BUILD ON LOG_CONFIGURE ON LOG_DOWNLOAD ON
Jason M. Bills3f7c5e42018-10-03 14:00:41 -070054)
James Feistb9683922019-01-02 15:04:45 -080055
James Feist13b00392019-08-19 16:16:08 -070056externalproject_add (gtest GIT_REPOSITORY
57 "https://github.com/google/googletest.git" GIT_TAG
Jason M. Bills24df90f2021-06-15 12:46:13 -070058 7153098229e88295f9655ff1d3b0e2fa9eada5f8 CMAKE_ARGS
James Feist13b00392019-08-19 16:16:08 -070059 -DCMAKE_INSTALL_PREFIX=${CMAKE_BINARY_DIR}/googletest-build
60 SOURCE_DIR "${CMAKE_BINARY_DIR}/googletest-src" BINARY_DIR
61 "${CMAKE_BINARY_DIR}/googletest-build" CMAKE_ARGS
62 -DCMAKE_INSTALL_PREFIX=${CMAKE_BINARY_DIR}/prefix)
Vernon Mauery8b69fae2019-03-20 13:43:11 -070063