Fix for 64 bit compatibility.
authorJunfeng Dong <junfeng.dong@intel.com>
Mon, 8 Apr 2013 06:24:44 +0000 (14:24 +0800)
committerJunfeng Dong <junfeng.dong@intel.com>
Mon, 8 Apr 2013 06:24:44 +0000 (14:24 +0800)
- Fix hardcoding path.
- Use %cmake to set default paths.

Change-Id: I75e78c30235fe099d5f7f0a2f5ab0f48a9c1e9df

CMakeLists.txt
packaging/liblivebox.spec

index 66ae402..56ef8f8 100644 (file)
@@ -4,7 +4,7 @@ PROJECT(livebox C)
 SET(PREFIX ${CMAKE_INSTALL_PREFIX})
 SET(EXEC_PREFIX "\${prefix}")
 SET(PROJECT_NAME "${PROJECT_NAME}")
-SET(LIBDIR "\${exec_prefix}/lib")
+SET(LIBDIR ${LIB_INSTALL_DIR})
 SET(INCLUDEDIR "\${prefix}/include/${PROJECT_NAME}")
 SET(VERSION_MAJOR 0)
 SET(VERSION "${VERSION_MAJOR}.0.1")
@@ -50,8 +50,8 @@ TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${pkgs_LDFLAGS} "-lpthread")
 CONFIGURE_FILE(${PROJECT_NAME}.pc.in ${PROJECT_NAME}.pc @ONLY)
 SET_DIRECTORY_PROPERTIES(PROPERTIES ADDITIONAL_MAKE_CLEAN_FILES "${PROJECT_NAME}.pc")
 
-INSTALL(TARGETS ${PROJECT_NAME} DESTINATION lib)
-INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}.pc DESTINATION lib/pkgconfig)
+INSTALL(TARGETS ${PROJECT_NAME} DESTINATION ${LIB_INSTALL_DIR})
+INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}.pc DESTINATION ${LIB_INSTALL_DIR}/pkgconfig)
 INSTALL(FILES ${CMAKE_SOURCE_DIR}/include/livebox.h DESTINATION include/${PROJECT_NAME})
 INSTALL(FILES ${CMAKE_SOURCE_DIR}/include/livebox_PG.h DESTINATION /usr/share/doc/${PROJECT_NAME})
 INSTALL(FILES ${CMAKE_SOURCE_DIR}/LICENSE DESTINATION /usr/share/license RENAME "lib${PROJECT_NAME}")
index a79e08f..3b8ba81 100644 (file)
@@ -26,7 +26,7 @@ Livebox development library (dev)
 %setup -q
 
 %build
-cmake . -DCMAKE_INSTALL_PREFIX=%{_prefix}
+%cmake .
 make %{?jobs:-j%jobs}
 
 %install