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 |
| 34 | ${CMAKE_BINARY_DIR}/phosphor-ipmi-host-build CONFIGURE_COMMAND cd |
| 35 | ${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 LDFLAGS=-L${CMAKE_BINARY_DIR}/prefix/lib/ |
| 42 | BUILD_COMMAND cd ${CMAKE_BINARY_DIR}/phosphor-ipmi-host-src && export |
| 43 | PYTHONPATH=${CMAKE_BINARY_DIR}/prefix/lib/python2.7/site-packages:$ENV{PYTHONPATH} |
| 44 | && export PATH=${CMAKE_BINARY_DIR}/prefix/bin:$ENV{PATH} && export |
James Feist | 7c00db7 | 2019-04-03 10:50:56 -0700 | [diff] [blame] | 45 | PKG_CONFIG_PATH=${CMAKE_BINARY_DIR}/prefix/lib/pkgconfig && make -j |
| 46 | verbose=1 INSTALL_COMMAND cd ${CMAKE_BINARY_DIR}/phosphor-ipmi-host-src && |
| 47 | make install && mkdir -p |
| 48 | "${CMAKE_BINARY_DIR}/prefix/include/phosphor-ipmi-host" && cp |
| 49 | sensorhandler.hpp selutility.hpp |
Vernon Mauery | 8b69fae | 2019-03-20 13:43:11 -0700 | [diff] [blame] | 50 | "${CMAKE_BINARY_DIR}/prefix/include/phosphor-ipmi-host/" LOG_DOWNLOAD ON |
Jason M. Bills | 3f7c5e4 | 2018-10-03 14:00:41 -0700 | [diff] [blame] | 51 | ) |
James Feist | b968392 | 2019-01-02 15:04:45 -0800 | [diff] [blame] | 52 | |
James Feist | 13b0039 | 2019-08-19 16:16:08 -0700 | [diff] [blame^] | 53 | externalproject_add (gtest GIT_REPOSITORY |
| 54 | "https://github.com/google/googletest.git" GIT_TAG |
| 55 | dfa853b63d17c787914b663b50c2095a0c5b706e CMAKE_ARGS |
| 56 | -DCMAKE_INSTALL_PREFIX=${CMAKE_BINARY_DIR}/googletest-build |
| 57 | SOURCE_DIR "${CMAKE_BINARY_DIR}/googletest-src" BINARY_DIR |
| 58 | "${CMAKE_BINARY_DIR}/googletest-build" CMAKE_ARGS |
| 59 | -DCMAKE_INSTALL_PREFIX=${CMAKE_BINARY_DIR}/prefix) |
Vernon Mauery | 8b69fae | 2019-03-20 13:43:11 -0700 | [diff] [blame] | 60 | |