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 | 53870d7 | 2019-06-04 14:21:10 -0700 | [diff] [blame] | 11 | intel-dbus-interfaces PREFIX ${CMAKE_BINARY_DIR}/intel-dbus-interfaces |
James Feist | 13b0039 | 2019-08-19 16:16:08 -0700 | [diff] [blame] | 12 | GIT_REPOSITORY https://github.com/openbmc/intel-dbus-interfaces GIT_TAG |
Chen Yugang | 39736d5 | 2019-07-12 16:24:33 +0800 | [diff] [blame] | 13 | b5f2dd444c5d3808d005452417e4ae2ea28624ff SOURCE_DIR |
Yong Li | 0669d19 | 2019-05-06 14:01:46 +0800 | [diff] [blame] | 14 | ${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 Mauery | 53870d7 | 2019-06-04 14:21:10 -0700 | [diff] [blame] | 26 | verbose=1 INSTALL_COMMAND cd ${CMAKE_BINARY_DIR}/intel-dbus-interfaces-src |
| 27 | && make install LOG_DOWNLOAD ON |
Yong Li | 0669d19 | 2019-05-06 14:01:46 +0800 | [diff] [blame] | 28 | ) |
| 29 | |
Jia, Chunhui | a835eaa | 2018-09-05 09:00:41 +0800 | [diff] [blame] | 30 | externalproject_add ( |
James Feist | 13b0039 | 2019-08-19 16:16:08 -0700 | [diff] [blame] | 31 | host-ipmid PREFIX ${CMAKE_BINARY_DIR}/phosphor-host-ipmid GIT_REPOSITORY |
Vernon Mauery | 8b69fae | 2019-03-20 13:43:11 -0700 | [diff] [blame] | 32 | https://github.com/openbmc/phosphor-host-ipmid SOURCE_DIR |
| 33 | ${CMAKE_BINARY_DIR}/phosphor-ipmi-host-src BINARY_DIR |
Hao Jiang | d859395 | 2021-02-12 11:27:47 -0800 | [diff] [blame] | 34 | ${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 Feist | 7c00db7 | 2019-04-03 10:50:56 -0700 | [diff] [blame] | 49 | make install && mkdir -p |
| 50 | "${CMAKE_BINARY_DIR}/prefix/include/phosphor-ipmi-host" && cp |
| 51 | sensorhandler.hpp selutility.hpp |
Hao Jiang | d859395 | 2021-02-12 11:27:47 -0800 | [diff] [blame] | 52 | "${CMAKE_BINARY_DIR}/prefix/include/phosphor-ipmi-host/" && echo "ipmid config finish" |
| 53 | LOG_BUILD ON LOG_CONFIGURE ON LOG_DOWNLOAD ON |
Jason M. Bills | 3f7c5e4 | 2018-10-03 14:00:41 -0700 | [diff] [blame] | 54 | ) |
James Feist | b968392 | 2019-01-02 15:04:45 -0800 | [diff] [blame] | 55 | |
James Feist | 13b0039 | 2019-08-19 16:16:08 -0700 | [diff] [blame] | 56 | externalproject_add (gtest GIT_REPOSITORY |
| 57 | "https://github.com/google/googletest.git" GIT_TAG |
Jason M. Bills | 24df90f | 2021-06-15 12:46:13 -0700 | [diff] [blame] | 58 | 7153098229e88295f9655ff1d3b0e2fa9eada5f8 CMAKE_ARGS |
James Feist | 13b0039 | 2019-08-19 16:16:08 -0700 | [diff] [blame] | 59 | -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 Mauery | 8b69fae | 2019-03-20 13:43:11 -0700 | [diff] [blame] | 63 | |