Skip to content

Commit

Permalink
CMakeLists.txt: Remove NONE from project name, which invalidates cmak…
Browse files Browse the repository at this point in the history
…e ability to check arch

CMakeLists.txt: Proper use LIB_SUFFIX and LIB_INSTALL_DIR enable some 64 bit Linux distros find pkgconfig file
CmakeLists.txt: Install python on default site_packages instead of pyshared. Most Linux distros already made the transition,
        for referennce Debian statement https://wiki.debian.org/Python/TransitionToDHPython2?action=show&redirect=Python%2FPyCentral2DhPython2
pc.in: Use correct package version and add proper description.

Signed-off-by: Helio Chissini de Castro <[email protected]>
  • Loading branch information
heliocastro authored and Andrew Tridgell committed Dec 3, 2014
1 parent 7e248d6 commit 3a089c6
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 5 deletions.
16 changes: 13 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
project (mavlink NONE)
project (mavlink)

# settings
cmake_minimum_required (VERSION 2.8.2)
Expand Down Expand Up @@ -35,6 +35,12 @@ include(CheckLibraryExists)
#include(CheckCSourceCompiles)
include(ExternalProjectWithFilename)

if (UNIX)
include(GNUInstallDirs)
set(LIB_INSTALL_DIR "lib${LIB_SUFFIX}" CACHE PATH "Installation path for libraries")
endif ()


# spawn new cmake to build deps
if (WITH_BUILD_DEPS AND ROOT_THREAD)
execute_process(COMMAND ${CMAKE_COMMAND} "${CMAKE_SOURCE_DIR}"
Expand Down Expand Up @@ -165,12 +171,16 @@ endif()
install(DIRECTORY ${CMAKE_BINARY_DIR}/include/ DESTINATION include/${PROJECT_NAME} COMPONENT Dev FILES_MATCHING PATTERN "*.h*")
install(DIRECTORY ${CMAKE_BINARY_DIR}/src/ DESTINATION share/${PROJECT_NAME} COMPONENT Dev FILES_MATCHING PATTERN "*.c*")
install(DIRECTORY ${CMAKE_SOURCE_DIR}/share/${PROJECT_NAME} DESTINATION share COMPONENT Dev FILES_MATCHING PATTERN "*.c*")
install(DIRECTORY ${CMAKE_SOURCE_DIR}/pymavlink DESTINATION "share/pyshared" COMPONENT Dev)
if (UNIX)
install(DIRECTORY ${CMAKE_SOURCE_DIR}/pymavlink DESTINATION ${CMAKE_INSTALL_LIBDIR}/python${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}/site-packages COMPONENT Dev)
else ()
install(DIRECTORY ${CMAKE_SOURCE_DIR}/pymavlink DESTINATION "share/pyshared" COMPONENT Dev)
endif ()

configure_file(pc.in ${PROJECT_NAME}.pc)
install(FILES
${PROJECT_BINARY_DIR}/${PROJECT_NAME}.pc
DESTINATION "lib/pkgconfig" COMPONENT Dev
DESTINATION lib${LIB_SUFFIX}/pkgconfig COMPONENT Dev
)

### packaging
Expand Down
4 changes: 2 additions & 2 deletions pc.in
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ prefix=@CMAKE_INSTALL_PREFIX@
exec_prefix=@CMAKE_INSTALL_PREFIX@

Name: @PROJECT_NAME@
Description: @CPACK_PACKAGE_DESCRIPTION_SUMMARY@
Version: @APPLICATION_VERSION@
Description: MAVLink micro air vehicle marshalling / communication library
Version: @PROJECT_VERSION@
Cflags: -I@CMAKE_INSTALL_PREFIX@/include/@PROJECT_NAME@

0 comments on commit 3a089c6

Please sign in to comment.