blob: 9181ae5104ee966bab2fe9c1d94d5b1c38dd3d69 [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
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 Feist7c00db72019-04-03 10:50:56 -070045 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 Mauery8b69fae2019-03-20 13:43:11 -070050 "${CMAKE_BINARY_DIR}/prefix/include/phosphor-ipmi-host/" LOG_DOWNLOAD ON
Jason M. Bills3f7c5e42018-10-03 14:00:41 -070051)
James Feistb9683922019-01-02 15:04:45 -080052
James Feist13b00392019-08-19 16:16:08 -070053externalproject_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 Mauery8b69fae2019-03-20 13:43:11 -070060