forked from libgeos/geos
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
57 lines (48 loc) · 1.88 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
################################################################################
# Part of CMake configuration for GEOS
#
# Copyright (C) 2018 Mateusz Loskot <[email protected]>
# Copyright (C) 2019 Daniel Baston <[email protected]>
#
# This is free software; you can redistribute and/or modify it under
# the terms of the GNU Lesser General Public Licence as published
# by the Free Software Foundation.
# See the COPYING file for more information.
################################################################################
add_executable(example example.cpp)
target_link_libraries(example PRIVATE geos)
if(BUILD_TESTING)
target_include_directories(test_geos_unit
PRIVATE
$<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}>)
endif()
option(BUILD_DOCUMENTATION "Build Doxygen documentation" OFF)
if(BUILD_DOCUMENTATION)
find_package(Doxygen)
if(NOT DOXYGEN_FOUND)
message(FATAL_ERROR "Doxygen was not found.")
endif()
set(srcdir ${CMAKE_CURRENT_SOURCE_DIR})
set(VERSION ${GEOS_VERSION_FULL})
set(DOXYGEN_LOGFILE ${CMAKE_CURRENT_BINARY_DIR}/doxygen.log)
set(CHECK_ERROR_SCRIPT "check_doxygen_errors.cmake")
configure_file(
"${CMAKE_CURRENT_SOURCE_DIR}/${CHECK_ERROR_SCRIPT}"
"${CMAKE_CURRENT_BINARY_DIR}/${CHECK_ERROR_SCRIPT}"
COPYONLY)
configure_file(
${CMAKE_CURRENT_SOURCE_DIR}/Doxyfile.in
${CMAKE_CURRENT_BINARY_DIR}/Doxyfile
@ONLY)
unset(srcdir)
unset(VERSION)
add_custom_target(docs
COMMAND ${DOXYGEN_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile
BYPRODUCTS ${DOXYGEN_LOGFILE} ${CMAKE_CURRENT_BINARY_DIR}/doxygen_docs)
add_test(NAME test_docs
COMMAND ${CMAKE_COMMAND}
-D DOXYGEN_LOGFILE="${DOXYGEN_LOGFILE}"
-P "${CMAKE_CURRENT_BINARY_DIR}/${CHECK_ERROR_SCRIPT}")
unset(DOXYGEN_LOGFILE)
unset(CHECK_ERROR_SCRIPT)
endif()