Make builds work in Yocto
Some paths were not the same as defined in openbmc.
Change-Id: Ib0766be22e9c6b55164bcb772e6ac2b88f8c08c2
Signed-off-by: James Feist <james.feist@linux.intel.com>
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 638854f..17a51a7 100755
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -81,21 +81,23 @@
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/include)
add_executable(fru-device src/FruDevice.cpp src/Utils.cpp)
-add_dependencies(fru-device boost-dbus)
-#add_dependencies(entity-manager nlohmann-json)
target_link_libraries(fru-device ${DBUS_LIBRARIES})
target_link_libraries(fru-device pthread)
target_link_libraries(fru-device stdc++fs)
target_link_libraries(fru-device ${Boost_LIBRARIES})
add_executable(entity-manager src/EntityManager.cpp src/Utils.cpp)
-add_dependencies(entity-manager boost-dbus)
-add_dependencies(entity-manager nlohmann-json)
target_link_libraries(entity-manager ${DBUS_LIBRARIES})
target_link_libraries(entity-manager pthread)
target_link_libraries(entity-manager stdc++fs)
target_link_libraries(entity-manager ${Boost_LIBRARIES})
+if(NOT YOCTO)
+ add_dependencies(entity-manager nlohmann-json)
+ add_dependencies(entity-manager boost-dbus)
+ add_dependencies(fru-device boost-dbus)
+endif()
+
install (TARGETS fru-device entity-manager DESTINATION bin)
diff --git a/CMakeLists.txt.orig b/CMakeLists.txt.orig
deleted file mode 100755
index bd10a73..0000000
--- a/CMakeLists.txt.orig
+++ /dev/null
@@ -1,105 +0,0 @@
-cmake_minimum_required(VERSION 3.1 FATAL_ERROR)
-SET(BUILD_SHARED_LIBRARIES OFF)
-include(ExternalProject)
-set(CMAKE_CXX_STANDARD 14)
-set(CMAKE_CXX_STANDARD_REQUIRED ON)
-set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -lstdc++fs")
-set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake ${CMAKE_MODULE_PATH})
-
-option(HUNTER_ENABLED "Enable hunter package pulling" OFF)
-include("cmake/HunterGate.cmake")
-
-HunterGate(
- URL "https://github.com/ruslo/hunter/archive/v0.18.64.tar.gz"
- SHA1 "baf9c8cc4f65306f0e442b5419967b4c4c04589a"
-)
-
-project(enitity-manager)
-
-hunter_add_package(Boost)
-find_package(Boost REQUIRED)
-include_directories(${Boost_INCLUDE_DIRS})
-
-add_definitions(-DBOOST_ERROR_CODE_HEADER_ONLY)
-add_definitions(-DBOOST_SYSTEM_NO_DEPRECATED)
-add_definitions(-DBOOST_ALL_NO_LIB)
-add_definitions(-DBOOST_NO_RTTI)
-add_definitions(-DBOOST_NO_TYPEID)
-
-hunter_add_package(dbus)
-find_package(dbus REQUIRED) # Include functions provided by PkgConfig module.
-include_directories(${DBUS_INCLUDE_DIRS})
-
-find_package(Threads REQUIRED)
-
-option(YOCTO "Enable Building in Yocto" OFF)
-
-if(NOT YOCTO)
- ExternalProject_Add(boost-dbus
- PREFIX ${CMAKE_CURRENT_BINARY_DIR}/boost-dbus
- GIT_REPOSITORY ssh://git-amr-2.devtools.intel.com:29418/openbmc-boost-dbus
- GIT_TAG fee38731bccba22b4157cc47afbf6434fec1eb6d
- CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${EXTERNAL_INSTALL_LOCATION} -DBOOST_ROOT=${BOOST_ROOT}
- CONFIGURE_COMMAND ""
- BUILD_COMMAND ""
- INSTALL_COMMAND ""
- LOG_DOWNLOAD ON
- )
- ExternalProject_Get_Property(boost-dbus install_dir)
- include_directories(${install_dir}/src/boost-dbus/include)
-
- include_directories(${CMAKE_CURRENT_SOURCE_DIR}/include/non-yocto)
-
- ExternalProject_Add(nlohmann-json
- PREFIX ${CMAKE_CURRENT_BINARY_DIR}/nlohmann-json
- GIT_REPOSITORY https://github.com/nlohmann/json.git
- GIT_TAG afebb6a3bbc8751e834a5472e5c53cb2b5bbd750
- CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${EXTERNAL_INSTALL_LOCATION}
- CONFIGURE_COMMAND ""
- BUILD_COMMAND mkdir -p
- ${CMAKE_CURRENT_BINARY_DIR}/nlohmann-json/src/nlohmann-json/src/nlohmann &&
- cp ${CMAKE_CURRENT_BINARY_DIR}/nlohmann-json/src/nlohmann-json/src/json.hpp
- ${CMAKE_CURRENT_BINARY_DIR}/nlohmann-json/src/nlohmann-json/src/nlohmann/json.hpp
- INSTALL_COMMAND ""
- LOG_DOWNLOAD ON
- )
-
- ExternalProject_Get_Property(nlohmann-json install_dir)
- include_directories(${install_dir}/src/nlohmann-json/src)
-
- option(ENABLE_TEST "Enable Google Test" OFF)
- if(ENABLE_TEST)
- hunter_add_package(GTest)
- find_package(GTest CONFIG REQUIRED)
-<<<<<<< HEAD
-=======
-
->>>>>>> da00f8f... Add CPP EntityManager Stage 1
- enable_testing()
- endif()
-endif()
-include_directories(${CMAKE_CURRENT_SOURCE_DIR}/include)
-
-link_directories(${EXTERNAL_INSTALL_LOCATION}/lib)
-
-include_directories(${CMAKE_CURRENT_SOURCE_DIR}/include)
-
-add_executable(fru-device src/FruDevice.cpp src/Utils.cpp)
-add_dependencies(fru-device boost-dbus)
-
-#add_dependencies(entity-manager nlohmann-json)
-target_link_libraries(fru-device ${DBUS_LIBRARIES})
-target_link_libraries(fru-device pthread)
-target_link_libraries(fru-device stdc++fs)
-target_link_libraries(fru-device ${Boost_LIBRARIES})
-
-add_executable(entity-manager src/EntityManager.cpp src/Utils.cpp)
-add_dependencies(entity-manager boost-dbus)
-
-add_dependencies(entity-manager nlohmann-json)
-target_link_libraries(entity-manager ${DBUS_LIBRARIES})
-target_link_libraries(entity-manager pthread)
-target_link_libraries(entity-manager stdc++fs)
-target_link_libraries(entity-manager ${Boost_LIBRARIES})
-
-install (TARGETS fru-device entity-manager DESTINATION bin)
diff --git a/include/non-yocto/i2c-dev-user.h b/include/non-yocto/linux/i2c-dev-user.h
similarity index 100%
rename from include/non-yocto/i2c-dev-user.h
rename to include/non-yocto/linux/i2c-dev-user.h
diff --git a/src/FruDevice.cpp b/src/FruDevice.cpp
index b431f81..1c01f95 100644
--- a/src/FruDevice.cpp
+++ b/src/FruDevice.cpp
@@ -24,7 +24,7 @@
#include <fcntl.h>
#include <fstream>
#include <future>
-#include <i2c-dev-user.h>
+#include <linux/i2c-dev-user.h>
#include <iostream>
#include <sys/ioctl.h>