Move service files into repo and clean up OVERLAYS
Upstream request is to have service files in repo now.
Also limit scope of OVERLAYS flag to allow exports to
still work.
Change-Id: I61c8621a648556d277d4faf3dfe38a61343053ce
Signed-off-by: James Feist <james.feist@linux.intel.com>
diff --git a/CMakeLists.txt b/CMakeLists.txt
index c8cce5b..20bd146 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -115,7 +115,16 @@
add_dependencies (fru-device sdbusplus-project)
endif ()
-install (TARGETS fru-device entity-manager DESTINATION bin)
-install (DIRECTORY configurations DESTINATION share)
-install (DIRECTORY overlay_templates DESTINATION share)
-install (DIRECTORY schemas DESTINATION share/configurations)
+set (
+ SERVICE_FILES
+ ${PROJECT_SOURCE_DIR}/service_files/xyz.openbmc_project.EntityManager.service
+ ${PROJECT_SOURCE_DIR}/service_files/xyz.openbmc_project.FruDevice.service
+)
+
+set (PACKAGE_DIR /usr/share/entity-manager/)
+target_compile_definitions (entity-manager PRIVATE PACKAGE_DIR="${PACKAGE_DIR}")
+install (TARGETS fru-device entity-manager DESTINATION sbin)
+install (DIRECTORY configurations DESTINATION ${PACKAGE_DIR})
+install (DIRECTORY overlay_templates DESTINATION ${PACKAGE_DIR})
+install (DIRECTORY schemas DESTINATION ${PACKAGE_DIR}/configurations)
+install (FILES ${SERVICE_FILES} DESTINATION /lib/systemd/system/)