CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
-PROJECT(device-manager-tw3 C)
+PROJECT(device-manager-plugin-tw3 C)
SET(PREFIX ${CMAKE_INSTALL_PREFIX})
ADD_DEFINITIONS("-DFEATURE_DLOG")
ENDIF()
+INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/LICENSE.Apache-2.0 DESTINATION ${HAL_LICENSE_DIR}/${PROJECT_NAME})
+
ADD_SUBDIRECTORY(hw/battery)
ADD_SUBDIRECTORY(hw/display)
ADD_SUBDIRECTORY(hw/external_connection)
ADD_LIBRARY(${PROJECT_NAME} MODULE battery.c ../udev.c)
TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${hal-backend-device-battery_pkgs_LDFLAGS})
-INSTALL(TARGETS ${PROJECT_NAME} DESTINATION /hal/lib COMPONENT RuntimeLibraries)
+INSTALL(TARGETS ${PROJECT_NAME} DESTINATION ${HAL_LIB_DIR} COMPONENT RuntimeLibraries)
ADD_LIBRARY(${PROJECT_NAME} MODULE bezel.c)
TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${hal-backend-device-bezel_pkgs_LDFLAGS})
-INSTALL(TARGETS ${PROJECT_NAME} DESTINATION /hal/lib COMPONENT RuntimeLibraries)
+INSTALL(TARGETS ${PROJECT_NAME} DESTINATION ${HAL_LIB_DIR} COMPONENT RuntimeLibraries)
ADD_LIBRARY(${PROJECT_NAME} MODULE display.c)
TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${hal-backend-device-display_pkgs_LDFLAGS})
-INSTALL(TARGETS ${PROJECT_NAME} DESTINATION /hal/lib COMPONENT RuntimeLibraries)
+INSTALL(TARGETS ${PROJECT_NAME} DESTINATION ${HAL_LIB_DIR} COMPONENT RuntimeLibraries)
ADD_LIBRARY(${PROJECT_NAME} MODULE external_connection.c ../udev.c)
TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${hal-backend-device-external-connection_pkgs_LDFLAGS})
-INSTALL(TARGETS ${PROJECT_NAME} DESTINATION /hal/lib COMPONENT RuntimeLibraries)
+INSTALL(TARGETS ${PROJECT_NAME} DESTINATION ${HAL_LIB_DIR} COMPONENT RuntimeLibraries)
ADD_LIBRARY(${PROJECT_NAME} MODULE standard.c)
TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${haptic_pkgs_LDFLAGS})
-INSTALL(TARGETS ${PROJECT_NAME} DESTINATION /hal/lib COMPONENT RuntimeLibraries)
+INSTALL(TARGETS ${PROJECT_NAME} DESTINATION ${HAL_LIB_DIR} COMPONENT RuntimeLibraries)
ADD_LIBRARY(${PROJECT_NAME} MODULE thermal.c ../udev.c)
TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${hal-backend-device-thermal_pkgs_LDFLAGS})
-INSTALL(TARGETS ${PROJECT_NAME} DESTINATION /hal/lib COMPONENT RuntimeLibraries)
+INSTALL(TARGETS ${PROJECT_NAME} DESTINATION ${HAL_LIB_DIR} COMPONENT RuntimeLibraries)
ADD_LIBRARY(${PROJECT_NAME} MODULE touchscreen.c)
TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${hal-backend-device-touchscreen_pkgs_LDFLAGS})
-INSTALL(TARGETS ${PROJECT_NAME} DESTINATION /hal/lib COMPONENT RuntimeLibraries)
+INSTALL(TARGETS ${PROJECT_NAME} DESTINATION ${HAL_LIB_DIR} COMPONENT RuntimeLibraries)
ADD_LIBRARY(${PROJECT_NAME} MODULE usb_gadget.c)
TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${hal-backend-device-usb-gadget_pkgs_LDFLAGS})
-INSTALL(TARGETS ${PROJECT_NAME} DESTINATION /hal/lib COMPONENT RuntimeLibraries)
+INSTALL(TARGETS ${PROJECT_NAME} DESTINATION ${HAL_LIB_DIR} COMPONENT RuntimeLibraries)
%build
%cmake . -DENABLE_DLOG=on \
+ -DHAL_LIB_DIR=%{_hal_libdir} \
+ -DHAL_LICENSE_DIR=%{_hal_licensedir}
make %{?jobs:-j%jobs}
%files
%manifest %{name}.manifest
-%license LICENSE.Apache-2.0
-/hal/lib/*.so*
+%{_hal_licensedir}/%{name}/LICENSE.Apache-2.0
+%{_hal_libdir}/*.so*