Fix for 64 bit compatibility.
authorJunfeng Dong <junfeng.dong@intel.com>
Mon, 25 Mar 2013 11:43:12 +0000 (19:43 +0800)
committerlifang <fangx.li@intel.com>
Thu, 28 Mar 2013 21:20:58 +0000 (05:20 +0800)
- Use %cmake macro to set default path
- Fix hard-coded library path
- Fix the wrong cast between int and pointer.

Change-Id: I4c0636e5e2e30f07f72aea9063de06d588bef901

CMakeLists.txt
packaging/sensor.spec
sensor.pc.in
src/client.cpp

index f7b1b63..37baba3 100644 (file)
@@ -3,7 +3,6 @@ project(sensor CXX)
 
 SET(PREFIX ${CMAKE_INSTALL_PREFIX})
 SET(EXEC_PREFIX "\${prefix}")
-SET(LIBDIR "\${prefix}/lib")
 SET(INCLUDEDIR "\${prefix}/include")
 SET(VERSION_MAJOR 1)
 SET(VERSION "${VERSION_MAJOR}.1.0")
@@ -45,7 +44,7 @@ SET_TARGET_PROPERTIES(${PROJECT_NAME} PROPERTIES VERSION ${VERSION})
 configure_file(${PROJECT_NAME}.pc.in ${CMAKE_CURRENT_SOURCE_DIR}/${PROJECT_NAME}.pc @ONLY)
 
 #install(DIRECTORY include/ DESTINATION include/ FILES_MATCHING PATTERN "*.h")
-install(TARGETS ${PROJECT_NAME} DESTINATION lib COMPONENT RuntimeLibraries)
+install(TARGETS ${PROJECT_NAME} DESTINATION ${LIB_INSTALL_DIR} COMPONENT RuntimeLibraries)
 
 install(FILES include/sensor.h DESTINATION include/sensor/)
 install(FILES include/sensor_accel.h DESTINATION include/sensor/)
@@ -57,4 +56,4 @@ install(FILES include/sensor_gyro.h DESTINATION include/sensor/)
 install(FILES include/sensor_barometer.h DESTINATION include/sensor/)
 install(FILES include/sensor_fusion.h DESTINATION include/sensor/)
 
-install(FILES ${PROJECT_NAME}.pc DESTINATION lib/pkgconfig)
+install(FILES ${PROJECT_NAME}.pc DESTINATION ${LIB_INSTALL_DIR}/pkgconfig)
index b2d8916..d5aa129 100644 (file)
@@ -33,7 +33,7 @@ Sensor framework client library (devel)
 
 
 %build
-cmake . -DCMAKE_INSTALL_PREFIX=%{_prefix}
+%cmake .
 
 
 make %{?jobs:-j%jobs}
index abac8eb..33168d0 100644 (file)
@@ -2,7 +2,7 @@
 
 prefix=@PREFIX@
 exec_prefix=@EXEC_PREFIX@
-libdir=@LIBDIR@
+libdir=@LIB_INSTALL_DIR@
 includedir=@INCLUDEDIR@/sensor
 
 Name: libsensor
index f3fc816..004890b 100755 (executable)
@@ -556,7 +556,7 @@ void lcd_off_set_wake_up(keynode_t *node, void *data)
 
 static void sensor_changed_cb(keynode_t *node, void *data)
 {
-       int event_number = (int)(data);
+       signed long event_number = (signed long)(data);
        unsigned int i = 0;
        int val;
        int cb_number = 0;