1 | # - Try to find NOVA
|
---|
2 | # Once done this will define
|
---|
3 | #
|
---|
4 | # NOVA_FOUND - system has NOVA
|
---|
5 | # NOVA_INCLUDE_DIR - the NOVA include directory
|
---|
6 | # NOVA_LIBRARIES - Link these to use NOVA
|
---|
7 |
|
---|
8 | # Copyright (c) 2006, Jasem Mutlaq <mutlaqja@ikarustech.com>
|
---|
9 | # Based on FindLibfacile by Carsten Niehaus, <cniehaus@gmx.de>
|
---|
10 | #
|
---|
11 | # Redistribution and use is allowed according to the terms of the BSD license.
|
---|
12 | # For details see the accompanying COPYING-CMAKE-SCRIPTS file.
|
---|
13 |
|
---|
14 | if (NOVA_INCLUDE_DIR AND NOVA_LIBRARIES AND NOVA_FUNCTION_COMPILE)
|
---|
15 |
|
---|
16 | # in cache already
|
---|
17 | set(NOVA_FOUND TRUE)
|
---|
18 | message(STATUS "Found libnova: ${NOVA_LIBRARIES}")
|
---|
19 |
|
---|
20 | else (NOVA_INCLUDE_DIR AND NOVA_LIBRARIES)
|
---|
21 |
|
---|
22 | find_path(NOVA_INCLUDE_DIR libnova.h
|
---|
23 | PATH_SUFFIXES libnova
|
---|
24 | ${_obIncDir}
|
---|
25 | ${GNUWIN32_DIR}/include
|
---|
26 | )
|
---|
27 |
|
---|
28 | find_library(NOVA_LIBRARIES NAMES nova
|
---|
29 | PATHS
|
---|
30 | ${_obLinkDir}
|
---|
31 | ${GNUWIN32_DIR}/lib
|
---|
32 | )
|
---|
33 |
|
---|
34 | set(CMAKE_REQUIRED_INCLUDES ${NOVA_INCLUDE_DIR})
|
---|
35 | set(CMAKE_REQUIRED_LIBRARIES ${NOVA_LIBRARIES})
|
---|
36 | check_cxx_source_compiles("#include <libnova.h>
|
---|
37 | int main() { ln_get_date_from_tm(NULL, NULL); return 0; }" NOVA_FUNCTION_COMPILE)
|
---|
38 |
|
---|
39 | if(NOVA_INCLUDE_DIR AND NOVA_LIBRARIES AND NOVA_FUNCTION_COMPILE)
|
---|
40 | set(NOVA_FOUND TRUE)
|
---|
41 | else (NOVA_INCLUDE_DIR AND NOVA_LIBRARIES AND NOVA_FUNCTION_COMPILE)
|
---|
42 | set(NOVA_FOUND FALSE)
|
---|
43 | endif(NOVA_INCLUDE_DIR AND NOVA_LIBRARIES AND NOVA_FUNCTION_COMPILE)
|
---|
44 |
|
---|
45 | if (NOVA_FOUND)
|
---|
46 | if (NOT Nova_FIND_QUIETLY)
|
---|
47 | message(STATUS "Found NOVA: ${NOVA_LIBRARIES}")
|
---|
48 | endif (NOT Nova_FIND_QUIETLY)
|
---|
49 | else (NOVA_FOUND)
|
---|
50 | if (Nova_FIND_REQUIRED)
|
---|
51 | message(FATAL_ERROR "libnova not found. Please install libnova0-devel. http://indi.sf.net")
|
---|
52 | endif (Nova_FIND_REQUIRED)
|
---|
53 | endif (NOVA_FOUND)
|
---|
54 |
|
---|
55 | mark_as_advanced(NOVA_INCLUDE_DIR NOVA_LIBRARIES)
|
---|
56 |
|
---|
57 | endif (NOVA_INCLUDE_DIR AND NOVA_LIBRARIES AND NOVA_FUNCTION_COMPILE)
|
---|