Skip to content

Commit

Permalink
Setup output directories
Browse files Browse the repository at this point in the history
Indention fixing

  Signed-off-by: Kyle Machulis <[email protected]>
  • Loading branch information
qdot committed Nov 23, 2010
1 parent 1420155 commit 1b9bd9f
Showing 1 changed file with 32 additions and 28 deletions.
60 changes: 32 additions & 28 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,9 @@ set (PROJECT_VER_MAJOR 0)
set (PROJECT_VER_MINOR 0)
set (PROJECT_VER_PATCH 1)
set (PROJECT_VER
"${PROJECT_VER_MAJOR}.${PROJECT_VER_MINOR}.${PROJECT_VER_PATCH}")
"${PROJECT_VER_MAJOR}.${PROJECT_VER_MINOR}.${PROJECT_VER_PATCH}")
set (PROJECT_APIVER
"${PROJECT_VER_MAJOR}.${PROJECT_VER_MINOR}")
"${PROJECT_VER_MAJOR}.${PROJECT_VER_MINOR}")

######################################################################################
# CMake Modules
Expand All @@ -63,6 +63,10 @@ include (SetupDirectories)
# CMake
######################################################################################

SET(EXECUTABLE_OUTPUT_PATH ${CMAKE_BINARY_DIR}/bin)
SET(LIBRARY_OUTPUT_PATH ${CMAKE_BINARY_DIR}/lib)
SET(DOC_OUTPUT_PATH ${CMAKE_BINARY_DIR}/doc)

# Pretty much everyone is going to need the main includes
include_directories (${CMAKE_CURRENT_SOURCE_DIR}/include)

Expand All @@ -78,39 +82,39 @@ add_subdirectory (examples)

# Create an uninstall target
configure_file(
"${CMAKE_CURRENT_SOURCE_DIR}/cmake_modules/UninstallTarget.cmake.in"
"${CMAKE_CURRENT_BINARY_DIR}/UninstallTarget.cmake"
IMMEDIATE @ONLY)
"${CMAKE_CURRENT_SOURCE_DIR}/cmake_modules/UninstallTarget.cmake.in"
"${CMAKE_CURRENT_BINARY_DIR}/UninstallTarget.cmake"
IMMEDIATE @ONLY)

add_custom_target(uninstall
COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_BINARY_DIR}/UninstallTarget.cmake)
COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_BINARY_DIR}/UninstallTarget.cmake)

# Create Debian/RPM Packages
# after make, use "fakeroot cpack" in the build Dir to complete

IF ("${CMAKE_SYSTEM_NAME}" MATCHES "Linux")
set(CPACK_PACKAGE_DESCRIPTION "libfreenect for kinect")
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "libfreenect library for using kinect")
set(CPACK_PACKAGE_NAME "libfreenect-dev")
set(CPACK_DEBIAN_PACKAGE_DEPENDS "libusb-1.0.0-dev")

set(CPACK_PACKAGE_CONTACT "OpenKinect <[email protected]>")
#set(CPACK_PACKAGE_VENDOR "")
set(CPACK_PACKAGE_VERSION_MAJOR PROJECT_VER_MAJOR)
set(CPACK_PACKAGE_VERSION_MINOR PROJECT_VER_MINOR)
set(CPACK_PACKAGE_VERSION_PATCH PROJECT_VER_PATCH)
set(VERSION "${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}")

set(CPACK_GENERATOR "DEB;RPM;")
set(CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME}-${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}-${CMAKE_SYSTEM_PROCESSOR}")

include(CPack)

INSTALL(FILES "${CMAKE_BINARY_DIR}/lib/libfreenect.a" DESTINATION lib)
INSTALL(FILES "include/libfreenect.h" DESTINATION include)
INSTALL(FILES "../APACHE20" DESTINATION "share/doc/${CPACK_PACKAGE_NAME}")
INSTALL(FILES "../GPL2" DESTINATION "share/doc/${CPACK_PACKAGE_NAME}")
INSTALL(FILES "../README.asciidoc" DESTINATION "share/doc/${CPACK_PACKAGE_NAME}")
set(CPACK_PACKAGE_DESCRIPTION "libfreenect for kinect")
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "libfreenect library for using kinect")
set(CPACK_PACKAGE_NAME "libfreenect-dev")
set(CPACK_DEBIAN_PACKAGE_DEPENDS "libusb-1.0.0-dev")

set(CPACK_PACKAGE_CONTACT "OpenKinect <[email protected]>")
#set(CPACK_PACKAGE_VENDOR "")
set(CPACK_PACKAGE_VERSION_MAJOR PROJECT_VER_MAJOR)
set(CPACK_PACKAGE_VERSION_MINOR PROJECT_VER_MINOR)
set(CPACK_PACKAGE_VERSION_PATCH PROJECT_VER_PATCH)
set(VERSION "${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}")

set(CPACK_GENERATOR "DEB;RPM;")
set(CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME}-${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}-${CMAKE_SYSTEM_PROCESSOR}")

include(CPack)

INSTALL(FILES "${CMAKE_BINARY_DIR}/lib/libfreenect.a" DESTINATION lib)
INSTALL(FILES "include/libfreenect.h" DESTINATION include)
INSTALL(FILES "../APACHE20" DESTINATION "share/doc/${CPACK_PACKAGE_NAME}")
INSTALL(FILES "../GPL2" DESTINATION "share/doc/${CPACK_PACKAGE_NAME}")
INSTALL(FILES "../README.asciidoc" DESTINATION "share/doc/${CPACK_PACKAGE_NAME}")

ENDIF ("${CMAKE_SYSTEM_NAME}" MATCHES "Linux")

0 comments on commit 1b9bd9f

Please sign in to comment.