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 ( |
James Feist | 13b0039 | 2019-08-19 16:16:08 -0700 | [diff] [blame] | 11 | host-ipmid PREFIX ${CMAKE_BINARY_DIR}/phosphor-host-ipmid GIT_REPOSITORY |
Vernon Mauery | 6207207 | 2022-06-15 11:42:33 -0700 | [diff] [blame] | 12 | https://github.com/openbmc/phosphor-host-ipmid SOURCE_DIR |
Vernon Mauery | 8b69fae | 2019-03-20 13:43:11 -0700 | [diff] [blame] | 13 | ${CMAKE_BINARY_DIR}/phosphor-ipmi-host-src BINARY_DIR |
Hao Jiang | d859395 | 2021-02-12 11:27:47 -0800 | [diff] [blame] | 14 | ${CMAKE_BINARY_DIR}/phosphor-ipmi-host-build CONFIGURE_COMMAND /usr/bin/bash -c |
| 15 | "cd ${CMAKE_BINARY_DIR}/phosphor-ipmi-host-src && export \ |
| 16 | PYTHONPATH=${CMAKE_BINARY_DIR}/prefix/lib/python2.7/site-packages:$ENV{PYTHONPATH} \ |
Vernon Mauery | 6207207 | 2022-06-15 11:42:33 -0700 | [diff] [blame] | 17 | && export PATH=${CMAKE_BINARY_DIR}/prefix/bin:$ENV{PATH} && \ |
| 18 | export CPPFLAGS=\'-I${CMAKE_BINARY_DIR}/prefix/include/ \' && \ |
| 19 | export LDFLAGS=\'-L${CMAKE_BINARY_DIR}/prefix/lib/ \' && \ |
| 20 | meson --prefix=${CMAKE_BINARY_DIR}/prefix build-ext" |
Hao Jiang | d859395 | 2021-02-12 11:27:47 -0800 | [diff] [blame] | 21 | BUILD_COMMAND /usr/bin/bash -c "cd ${CMAKE_BINARY_DIR}/phosphor-ipmi-host-src && export \ |
| 22 | PYTHONPATH=${CMAKE_BINARY_DIR}/prefix/lib/python2.7/site-packages:$ENV{PYTHONPATH} \ |
Vernon Mauery | 6207207 | 2022-06-15 11:42:33 -0700 | [diff] [blame] | 23 | && export PATH=${CMAKE_BINARY_DIR}/prefix/bin:$ENV{PATH} && \ |
| 24 | ninja --verbose -C build-ext" |
Hao Jiang | d859395 | 2021-02-12 11:27:47 -0800 | [diff] [blame] | 25 | INSTALL_COMMAND cd ${CMAKE_BINARY_DIR}/phosphor-ipmi-host-src && |
Vernon Mauery | 6207207 | 2022-06-15 11:42:33 -0700 | [diff] [blame] | 26 | ninja --verbose -C build-ext install && mkdir -p |
James Feist | 7c00db7 | 2019-04-03 10:50:56 -0700 | [diff] [blame] | 27 | "${CMAKE_BINARY_DIR}/prefix/include/phosphor-ipmi-host" && cp |
| 28 | sensorhandler.hpp selutility.hpp |
Hao Jiang | d859395 | 2021-02-12 11:27:47 -0800 | [diff] [blame] | 29 | "${CMAKE_BINARY_DIR}/prefix/include/phosphor-ipmi-host/" && echo "ipmid config finish" |
| 30 | LOG_BUILD ON LOG_CONFIGURE ON LOG_DOWNLOAD ON |
Jason M. Bills | 3f7c5e4 | 2018-10-03 14:00:41 -0700 | [diff] [blame] | 31 | ) |
James Feist | b968392 | 2019-01-02 15:04:45 -0800 | [diff] [blame] | 32 | |
James Feist | 13b0039 | 2019-08-19 16:16:08 -0700 | [diff] [blame] | 33 | externalproject_add (gtest GIT_REPOSITORY |
| 34 | "https://github.com/google/googletest.git" GIT_TAG |
Jason M. Bills | 24df90f | 2021-06-15 12:46:13 -0700 | [diff] [blame] | 35 | 7153098229e88295f9655ff1d3b0e2fa9eada5f8 CMAKE_ARGS |
James Feist | 13b0039 | 2019-08-19 16:16:08 -0700 | [diff] [blame] | 36 | -DCMAKE_INSTALL_PREFIX=${CMAKE_BINARY_DIR}/googletest-build |
| 37 | SOURCE_DIR "${CMAKE_BINARY_DIR}/googletest-src" BINARY_DIR |
| 38 | "${CMAKE_BINARY_DIR}/googletest-build" CMAKE_ARGS |
| 39 | -DCMAKE_INSTALL_PREFIX=${CMAKE_BINARY_DIR}/prefix) |
Vernon Mauery | 8b69fae | 2019-03-20 13:43:11 -0700 | [diff] [blame] | 40 | |