Use variable for service install location

After enabling 'usrmerge', the install location for systemd service
files changed. This uses a variable to get the installation location
instead of hardcoding it.

Tested:
Confirmed that with 'usrmerge' enabled, the service file is correctly
installed.

Signed-off-by: Jason M. Bills <jason.m.bills@intel.com>
Change-Id: I293ec79d8e31199993f777a4dbfa805e1d07dcce
diff --git a/CMakeLists.txt b/CMakeLists.txt
index c05e5c4..fa153bc 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -67,8 +67,11 @@
 set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-rtti")
 set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fno-rtti")
 
+find_package (PkgConfig REQUIRED)
+pkg_get_variable(SYSTEMD_SYSTEM_UNIT_DIR systemd systemdsystemunitdir)
+
 set (
     SERVICE_FILES
     ${PROJECT_SOURCE_DIR}/service_files/xyz.openbmc_project.HostErrorMonitor.service
 )
-install (FILES ${SERVICE_FILES} DESTINATION /lib/systemd/system/)
+install (FILES ${SERVICE_FILES} DESTINATION "${SYSTEMD_SYSTEM_UNIT_DIR}")