Fix compiling error

The cmake installs the binary file to the /lib directory but yocto
install from the /usr. This caused the error didn't find the services
file. Change from /lib to /usr to fix the issue.

Change-Id: Ica64a229d31629b65aded125b607d21d29486699
Signed-off-by: Hieu Huynh <hieuh@os.amperecomputing.com>
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 50be81c..8cffa03 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -56,10 +56,14 @@
     target_compile_definitions (smbiosmdrv2app PRIVATE DIMM_DBUS)
 endif ()
 
+if (NOT DEFINED SYSTEMD_SYSTEM_UNIT_DIR)
+    pkg_get_variable(SYSTEMD_SYSTEM_UNIT_DIR systemd systemdsystemunitdir)
+endif()
+
 install (TARGETS smbiosmdrv2app DESTINATION bin)
 
 install (FILES  ${PROJECT_SOURCE_DIR}/service_files/smbios-mdrv2.service
-    DESTINATION /lib/systemd/system/)
+    DESTINATION "${SYSTEMD_SYSTEM_UNIT_DIR}")
 
 option (DIMM_ONLY_LOCATOR "Only use the DIMM number, and not the bank" OFF)
 
@@ -106,7 +110,7 @@
 
     install (FILES
         ${PROJECT_SOURCE_DIR}/service_files/xyz.openbmc_project.cpuinfo.service
-        DESTINATION /lib/systemd/system/)
+        DESTINATION "${SYSTEMD_SYSTEM_UNIT_DIR}")
 endif()
 
 option (IPMI_BLOB "Add IPMI Blobs" ON)