blob: aa7ca2a93907e7744cb548e3bdb49da92b7fa685 [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
12 GIT_REPOSITORY
Yong Li0669d192019-05-06 14:01:46 +080013 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 Mauery53870d72019-06-04 14:21:10 -070027 verbose=1 INSTALL_COMMAND cd ${CMAKE_BINARY_DIR}/intel-dbus-interfaces-src
28 && make install LOG_DOWNLOAD ON
Yong Li0669d192019-05-06 14:01:46 +080029)
30
Jia, Chunhuia835eaa2018-09-05 09:00:41 +080031externalproject_add (
Vernon Mauery53870d72019-06-04 14:21:10 -070032 host-ipmid PREFIX ${CMAKE_BINARY_DIR}/phosphor-host-ipmid
33 GIT_REPOSITORY
Vernon Mauery8b69fae2019-03-20 13:43:11 -070034 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 Feist7c00db72019-04-03 10:50:56 -070047 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 Mauery8b69fae2019-03-20 13:43:11 -070052 "${CMAKE_BINARY_DIR}/prefix/include/phosphor-ipmi-host/" LOG_DOWNLOAD ON
Jason M. Bills3f7c5e42018-10-03 14:00:41 -070053)
James Feistb9683922019-01-02 15:04:45 -080054
Vernon Mauery53870d72019-06-04 14:21:10 -070055externalproject_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 Mauery8b69fae2019-03-20 13:43:11 -070063