aboutsummaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt40
1 files changed, 40 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 5c6330162..392b04dea 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -62,9 +62,24 @@ endif()
message(STATUS "BOOST_IGNORE_SYSTEM_PATHS defaults to ${BOOST_IGNORE_SYSTEM_PATHS_DEFAULT}")
option(BOOST_IGNORE_SYSTEM_PATHS "Ignore boost system paths for local boost installation" ${BOOST_IGNORE_SYSTEM_PATHS_DEFAULT})
+
+if (NOT DEFINED ENV{DEVELOPER_LIBUNBOUND_OLD})
+ message(STATUS "Could not find DEVELOPER_LIBUNBOUND_OLD in env (not required)")
+elseif ("$ENV{DEVELOPER_LIBUNBOUND_OLD}" EQUAL 1)
+ message(STATUS "Found: env DEVELOPER_LIBUNBOUND_OLD = 1, will use the work around")
+ add_definitions(-DDEVELOPER_LIBUNBOUND_OLD)
+elseif ("$ENV{DEVELOPER_LIBUNBOUND_OLD}" EQUAL 0)
+ message(STATUS "Found: env DEVELOPER_LIBUNBOUND_OLD = 0")
+else()
+ message(STATUS "Found: env DEVELOPER_LIBUNBOUND_OLD with bad value. Will NOT use the work around")
+endif()
+
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
enable_testing()
+option(BUILD_DOCUMENTATION "Build the Doxygen documentation." ON)
+
+
# Check if we're on FreeBSD so we can exclude the local miniupnpc (it should be installed from ports instead)
# CMAKE_SYSTEM_NAME checks are commonly known, but specifically taken from libsdl's CMakeLists
if(CMAKE_SYSTEM_NAME MATCHES "kFreeBSD.*")
@@ -276,3 +291,28 @@ add_subdirectory(src)
if(BUILD_TESTS)
add_subdirectory(tests)
endif()
+
+
+
+if(BUILD_DOCUMENTATION)
+ set(DOC_GRAPHS "YES" CACHE STRING "Create dependency graphs (needs graphviz)")
+ set(DOC_FULLGRAPHS "NO" CACHE STRING "Create call/callee graphs (large)")
+
+ find_program(DOT_PATH dot)
+
+ if (DOT_PATH STREQUAL "DOT_PATH-NOTFOUND")
+ message("Doxygen: graphviz not found - graphs disabled")
+ set(DOC_GRAPHS "NO")
+ endif()
+
+ find_package(Doxygen)
+ if(DOXYGEN_FOUND)
+ configure_file("cmake/Doxyfile.in" "Doxyfile" @ONLY)
+ configure_file("cmake/Doxygen.extra.css.in" "Doxygen.extra.css" @ONLY)
+ add_custom_target(doc
+ ${DOXYGEN_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile
+ WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
+ COMMENT "Generating API documentation with Doxygen.." VERBATIM)
+ endif()
+endif()
+