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 |
| 12 | GIT_REPOSITORY |
Yong Li | 0669d19 | 2019-05-06 14:01:46 +0800 | [diff] [blame] | 13 | https://github.com/openbmc/intel-dbus-interfaces GIT_TAG |
| 14 | 2b8f89f5876c5a97a34cdf922729d4283d5f2627 SOURCE_DIR |
| 15 | ${CMAKE_BINARY_DIR}/intel-dbus-interfaces-src BINARY_DIR |
| 16 | ${CMAKE_BINARY_DIR}/intel-dbus-interfaces-build CONFIGURE_COMMAND cd |
| 17 | ${CMAKE_BINARY_DIR}/intel-dbus-interfaces-src && export |
| 18 | PYTHONPATH=${CMAKE_BINARY_DIR}/prefix/lib/python2.7/site-packages:$ENV{PYTHONPATH} |
| 19 | && export PATH=${CMAKE_BINARY_DIR}/prefix/bin:$ENV{PATH} && export |
| 20 | PKG_CONFIG_PATH=${CMAKE_BINARY_DIR}/prefix/lib/pkgconfig && ./bootstrap.sh |
| 21 | && ./configure --prefix=${CMAKE_BINARY_DIR}/prefix |
| 22 | CPPFLAGS=-I${CMAKE_BINARY_DIR}/prefix/include/ BUILD_COMMAND cd |
| 23 | ${CMAKE_BINARY_DIR}/intel-dbus-interfaces-src && export |
| 24 | PYTHONPATH=${CMAKE_BINARY_DIR}/prefix/lib/python2.7/site-packages:$ENV{PYTHONPATH} |
| 25 | && export PATH=${CMAKE_BINARY_DIR}/prefix/bin:$ENV{PATH} && export |
| 26 | PKG_CONFIG_PATH=${CMAKE_BINARY_DIR}/prefix/lib/pkgconfig && make -j |
Vernon Mauery | 53870d7 | 2019-06-04 14:21:10 -0700 | [diff] [blame] | 27 | verbose=1 INSTALL_COMMAND cd ${CMAKE_BINARY_DIR}/intel-dbus-interfaces-src |
| 28 | && make install LOG_DOWNLOAD ON |
Yong Li | 0669d19 | 2019-05-06 14:01:46 +0800 | [diff] [blame] | 29 | ) |
| 30 | |
Jia, Chunhui | a835eaa | 2018-09-05 09:00:41 +0800 | [diff] [blame] | 31 | externalproject_add ( |
Vernon Mauery | 53870d7 | 2019-06-04 14:21:10 -0700 | [diff] [blame] | 32 | host-ipmid PREFIX ${CMAKE_BINARY_DIR}/phosphor-host-ipmid |
| 33 | GIT_REPOSITORY |
Vernon Mauery | 8b69fae | 2019-03-20 13:43:11 -0700 | [diff] [blame] | 34 | https://github.com/openbmc/phosphor-host-ipmid SOURCE_DIR |
| 35 | ${CMAKE_BINARY_DIR}/phosphor-ipmi-host-src BINARY_DIR |
| 36 | ${CMAKE_BINARY_DIR}/phosphor-ipmi-host-build CONFIGURE_COMMAND cd |
| 37 | ${CMAKE_BINARY_DIR}/phosphor-ipmi-host-src && export |
| 38 | PYTHONPATH=${CMAKE_BINARY_DIR}/prefix/lib/python2.7/site-packages:$ENV{PYTHONPATH} |
| 39 | && export PATH=${CMAKE_BINARY_DIR}/prefix/bin:$ENV{PATH} && export |
| 40 | PKG_CONFIG_PATH=${CMAKE_BINARY_DIR}/prefix/lib/pkgconfig && ./bootstrap.sh |
| 41 | && ./configure --prefix=${CMAKE_BINARY_DIR}/prefix |
| 42 | CPPFLAGS=-I${CMAKE_BINARY_DIR}/prefix/include/ |
| 43 | CXXFLAGS=-Wno-error=unused-result LDFLAGS=-L${CMAKE_BINARY_DIR}/prefix/lib/ |
| 44 | BUILD_COMMAND cd ${CMAKE_BINARY_DIR}/phosphor-ipmi-host-src && export |
| 45 | PYTHONPATH=${CMAKE_BINARY_DIR}/prefix/lib/python2.7/site-packages:$ENV{PYTHONPATH} |
| 46 | && export PATH=${CMAKE_BINARY_DIR}/prefix/bin:$ENV{PATH} && export |
James Feist | 7c00db7 | 2019-04-03 10:50:56 -0700 | [diff] [blame] | 47 | PKG_CONFIG_PATH=${CMAKE_BINARY_DIR}/prefix/lib/pkgconfig && make -j |
| 48 | verbose=1 INSTALL_COMMAND cd ${CMAKE_BINARY_DIR}/phosphor-ipmi-host-src && |
| 49 | make install && mkdir -p |
| 50 | "${CMAKE_BINARY_DIR}/prefix/include/phosphor-ipmi-host" && cp |
| 51 | sensorhandler.hpp selutility.hpp |
Vernon Mauery | 8b69fae | 2019-03-20 13:43:11 -0700 | [diff] [blame] | 52 | "${CMAKE_BINARY_DIR}/prefix/include/phosphor-ipmi-host/" LOG_DOWNLOAD ON |
Jason M. Bills | 3f7c5e4 | 2018-10-03 14:00:41 -0700 | [diff] [blame] | 53 | ) |
James Feist | b968392 | 2019-01-02 15:04:45 -0800 | [diff] [blame] | 54 | |
Vernon Mauery | 53870d7 | 2019-06-04 14:21:10 -0700 | [diff] [blame] | 55 | externalproject_add ( |
| 56 | gtest GIT_REPOSITORY "https://github.com/google/googletest.git" GIT_TAG |
| 57 | dfa853b63d17c787914b663b50c2095a0c5b706e CMAKE_ARGS |
| 58 | -DCMAKE_INSTALL_PREFIX=${CMAKE_BINARY_DIR}/googletest-build SOURCE_DIR |
| 59 | "${CMAKE_BINARY_DIR}/googletest-src" BINARY_DIR |
| 60 | "${CMAKE_BINARY_DIR}/googletest-build" CMAKE_ARGS |
| 61 | -DCMAKE_INSTALL_PREFIX=${CMAKE_BINARY_DIR}/prefix |
| 62 | ) |
Vernon Mauery | 8b69fae | 2019-03-20 13:43:11 -0700 | [diff] [blame] | 63 | |