File: Findlibshp.cmake

package info (click to toggle)
tilemaker 3.1.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 78,952 kB
  • sloc: cpp: 29,461; ansic: 12,510; makefile: 229; ruby: 77; sh: 43
file content (23 lines) | stat: -rw-r--r-- 920 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# LIBSHP_FOUND - system has the LIBSHP library
# LIBSHP_INCLUDE_DIR - the LIBSHP include directory
# LIBSHP_LIBRARIES - The libraries needed to use LIBSHP

if(LIBSHP_INCLUDE_DIR AND LIBSHP_LIBRARIES)
  set(LIBSHP_FOUND TRUE)
else(LIBSHP_INCLUDE_DIR AND LIBSHP_LIBRARIES)

  find_path(LIBSHP_INCLUDE_DIR NAMES shapefil.h PATH_SUFFIXES libshp)
  find_library(LIBSHP_LIBRARIES NAMES shp shapelib)

  include(FindPackageHandleStandardArgs)
  find_package_handle_standard_args(libshp DEFAULT_MSG LIBSHP_INCLUDE_DIR LIBSHP_LIBRARIES)

  mark_as_advanced(LIBSHP_INCLUDE_DIR LIBSHP_LIBRARIES)
endif(LIBSHP_INCLUDE_DIR AND LIBSHP_LIBRARIES)
if (LIBSHP_FOUND)
  add_library(shapelib::shp UNKNOWN IMPORTED)
  set_target_properties(shapelib::shp PROPERTIES
          INTERFACE_INCLUDE_DIRECTORIES  ${LIBSHP_INCLUDE_DIR})
  set_property(TARGET shapelib::shp APPEND PROPERTY
          IMPORTED_LOCATION "${LIBSHP_LIBRARIES}")
endif()