mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Add FindLibdivecomputer.cmake
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
8b2ba50a62
commit
6f93590705
2 changed files with 36 additions and 14 deletions
|
@ -38,20 +38,7 @@ ELSE()
|
||||||
INCLUDE_DIRECTORIES(${LIBGIT2_INCLUDE_DIRS})
|
INCLUDE_DIRECTORIES(${LIBGIT2_INCLUDE_DIRS})
|
||||||
ENDIF()
|
ENDIF()
|
||||||
|
|
||||||
SET(LIBDCDEVEL "" CACHE STRING "libraries")
|
FIND_PACKAGE(Libdivecomputer REQUIRED)
|
||||||
IF(DEFINED LIBDCDEVEL)
|
|
||||||
cmake_policy(SET CMP0015 OLD)
|
|
||||||
include_directories(${LIBDCDEVEL}/include )
|
|
||||||
link_directories(${LIBDCDEVEL}/src/.libs)
|
|
||||||
if(NOT DEFINED LIBDCSTATIC)
|
|
||||||
set(SUBSURFACE_LINK_LIBRARIES ${SUBSURFACE_LINK_LIBRARIES} -ldivecomputer -lusb-1.0)
|
|
||||||
ELSE()
|
|
||||||
set(SUBSURFACE_LINK_LIBRARIES ${SUBSURFACE_LINK_LIBRARIES} libdivecomputer.a -lusb-1.0)
|
|
||||||
ENDIF()
|
|
||||||
ELSE()
|
|
||||||
set(SUBSURFACE_LINK_LIBRARIES ${SUBSURFACE_LINK_LIBRARIES} -ldivecomputer)
|
|
||||||
ENDIF()
|
|
||||||
|
|
||||||
FIND_PACKAGE(Marble REQUIRED)
|
FIND_PACKAGE(Marble REQUIRED)
|
||||||
include_directories(${MARBLE_INCLUDE_DIR})
|
include_directories(${MARBLE_INCLUDE_DIR})
|
||||||
|
|
||||||
|
|
35
cmake/Modules/FindLibdivecomputer.cmake
Normal file
35
cmake/Modules/FindLibdivecomputer.cmake
Normal file
|
@ -0,0 +1,35 @@
|
||||||
|
# - Try to find the LIBDIVECOMPUTER Library
|
||||||
|
# Once done this will define
|
||||||
|
#
|
||||||
|
# LIBDIVECOMPUTER_FOUND - system has LIBDIVECOMPUTER
|
||||||
|
# LIBDIVECOMPUTER_INCLUDE_DIR - the LIBDIVECOMPUTER include directory
|
||||||
|
# LIBDIVECOMPUTER_LIBRARIES
|
||||||
|
# Redistribution and use is allowed according to the terms of the BSD license.
|
||||||
|
# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
|
||||||
|
#
|
||||||
|
|
||||||
|
# in cache already
|
||||||
|
IF ( LIBDIVECOMPUTER_INCLUDE_DIR AND LIBDIVECOMPUTER_LIBRARIES )
|
||||||
|
SET( LIBDIVECOMPUTER_FIND_QUIETLY TRUE )
|
||||||
|
ENDIF ( LIBDIVECOMPUTER_INCLUDE_DIR AND LIBDIVECOMPUTER_LIBRARIES )
|
||||||
|
|
||||||
|
FIND_PATH( LIBDIVECOMPUTER_INCLUDE_DIR
|
||||||
|
NAMES libdivecomputer/hw.h
|
||||||
|
HINTS
|
||||||
|
${CMAKE_CURRENT_SOURCE_DIR}/../libdivecomputer/include/
|
||||||
|
/usr/local/include
|
||||||
|
/usr/include
|
||||||
|
)
|
||||||
|
|
||||||
|
FIND_LIBRARY( LIBDIVECOMPUTER_LIBRARIES
|
||||||
|
NAMES
|
||||||
|
libdivecomputer.a
|
||||||
|
divecomputer
|
||||||
|
HINTS
|
||||||
|
${CMAKE_CURRENT_SOURCE_DIR}/../libdivecomputer/src/.libs/
|
||||||
|
/usr/local/include
|
||||||
|
/usr/include
|
||||||
|
)
|
||||||
|
|
||||||
|
INCLUDE( FindPackageHandleStandardArgs )
|
||||||
|
FIND_PACKAGE_HANDLE_STANDARD_ARGS( Libdivecomputer DEFAULT_MSG LIBDIVECOMPUTER_INCLUDE_DIR LIBDIVECOMPUTER_LIBRARIES )
|
Loading…
Add table
Add a link
Reference in a new issue