Make out of tree builds work again

Build sdbusplus and link correctly out of tree.

Closes openbmc/bmcweb#2
Closes openbmc/bmcweb#3

Tested: cmake built out of tree
Change-Id: I7eecb19209a7dace857ffa5eb9498441dfb570e9
Signed-off-by: James Feist <james.feist@linux.intel.com>
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 9a1ecd9..6b8a4ce 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -109,20 +109,8 @@
 
 # sdbusplus
 if (NOT ${YOCTO_DEPENDENCIES})
-    include_directories (
-        ${CMAKE_BINARY_DIR}/sdbusplus-src ${CMAKE_BINARY_DIR}/prefix/include
-    )
-
-    set (WANT_TRANSACTION 0)
-
-    configure_file (
-        ${CMAKE_BINARY_DIR}/sdbusplus-src/sdbusplus/server.hpp.in
-        ${CMAKE_BINARY_DIR}/prefix/include/sdbusplus/server.hpp @ONLY
-    )
-    configure_file (
-        ${CMAKE_BINARY_DIR}/sdbusplus-src/sdbusplus/bus.hpp.in
-        ${CMAKE_BINARY_DIR}/prefix/include/sdbusplus/bus.hpp @ONLY
-    )
+    include_directories (${CMAKE_BINARY_DIR}/sdbusplus-src)
+    link_directories (${CMAKE_BINARY_DIR}/sdbusplus-src/.libs)
 endif ()
 
 # Openssl
diff --git a/CMakeLists.txt.in b/CMakeLists.txt.in
index 4399482..62fd89b 100644
--- a/CMakeLists.txt.in
+++ b/CMakeLists.txt.in
@@ -5,17 +5,16 @@
 file (MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/prefix)
 file (MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/prefix/include)
 
-externalproject_add (
-    sdbusplus GIT_REPOSITORY
-    ssh://git-amr-2.devtools.intel.com:29418/openbmc-sdbusplus GIT_TAG
-    ce4a3cbfe89d1a30e982899bc336029f730f394e SOURCE_DIR
-    "${CMAKE_BINARY_DIR}/sdbusplus-src" BINARY_DIR
-    "${CMAKE_BINARY_DIR}/sdbusplus-build" CMAKE_ARGS
-    -DCMAKE_INSTALL_PREFIX=${CMAKE_BINARY_DIR}/prefix CONFIGURE_COMMAND ""
-    BUILD_COMMAND "" INSTALL_COMMAND cp -r
-    "${CMAKE_BINARY_DIR}/sdbusplus-src/sdbusplus"
-    "${CMAKE_BINARY_DIR}/prefix/include"
-)
+# requires apt install autoconf-archive and autoconf
+externalproject_add (sdbusplus-project PREFIX
+                     ${CMAKE_BINARY_DIR}/sdbusplus-project GIT_REPOSITORY
+                     https://github.com/openbmc/sdbusplus.git GIT_TAG
+                     fac43a650e59e873688d5fc6e06b5bdc88ba0546 SOURCE_DIR
+                     ${CMAKE_BINARY_DIR}/sdbusplus-src BINARY_DIR
+                     ${CMAKE_BINARY_DIR}/sdbusplus-build CONFIGURE_COMMAND ""
+                     BUILD_COMMAND cd ${CMAKE_BINARY_DIR}/sdbusplus-src &&
+                     ./bootstrap.sh && ./configure --enable-transaction && make
+                     -j libsdbusplus.la INSTALL_COMMAND "" LOG_DOWNLOAD ON)
 
 externalproject_add (
     tinyxml2 GIT_REPOSITORY https://github.com/leethomason/tinyxml2.git GIT_TAG