CMakeLists.txt 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345
  1. cmake_minimum_required(VERSION 2.8.8)
  2. # set(CMAKE_VERBOSE_MAKEFILE ON)
  3. project(open62541 C)
  4. FIND_PACKAGE(PythonInterp REQUIRED)
  5. # Find Python-lxml
  6. execute_process ( COMMAND ${PYTHON_EXECUTABLE} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())" OUTPUT_VARIABLE PYTHON_SITE_PACKAGES OUTPUT_STRIP_TRAILING_WHITESPACE)
  7. if(NOT EXISTS "${PYTHON_SITE_PACKAGES}/lxml")
  8. execute_process ( COMMAND ${PYTHON_EXECUTABLE} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(True))" OUTPUT_VARIABLE PYTHON_SITE_PACKAGES OUTPUT_STRIP_TRAILING_WHITESPACE)
  9. if(NOT EXISTS "${PYTHON_SITE_PACKAGES}/lxml")
  10. message( FATAL_ERROR "Python-lxml is not installed.")
  11. endif()
  12. endif()
  13. find_package(Git)
  14. if(GIT_FOUND)
  15. execute_process(COMMAND ${GIT_EXECUTABLE} describe --abbrev=7 --dirty --always --tags RESULT_VARIABLE res_var OUTPUT_VARIABLE GIT_COM_ID )
  16. if( NOT ${res_var} EQUAL 0 )
  17. set( GIT_COMMIT_ID "git commit id unknown")
  18. message( WARNING "Git failed (not a repo, or no tags). Build will not contain git revision info." )
  19. else()
  20. string( REPLACE "\n" "" GIT_COMMIT_ID ${GIT_COM_ID} )
  21. endif()
  22. else()
  23. set( GIT_COMMIT_ID "unknown (git not found!)")
  24. message( WARNING "Git not found. Build will not contain git revision info." )
  25. endif()
  26. add_definitions("-DVERSION=${GIT_COMMIT_ID}")
  27. MESSAGE (STATUS "Git version: " ${GIT_COMMIT_ID})
  28. set(CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake")
  29. # Set default build type.
  30. if(NOT CMAKE_BUILD_TYPE)
  31. message(STATUS "CMAKE_BUILD_TYPE not given; setting to 'RelWithDebInfo'.")
  32. set(CMAKE_BUILD_TYPE "RelWithDebInfo" CACHE STRING "Choose the type of build." FORCE)
  33. endif()
  34. # compiler flags
  35. if(CMAKE_COMPILER_IS_GNUCC OR "x${CMAKE_C_COMPILER_ID}" STREQUAL "xClang")
  36. add_definitions(-std=c99 -pipe -Wall -Wextra -Werror -Wformat -Wno-unused-parameter
  37. -Wno-unused-function -Wno-unused-label -Wpointer-arith -Wreturn-type -Wsign-compare -Wmultichar
  38. -Wcast-qual -Wmissing-prototypes -Wstrict-prototypes # -Wshadow -Wconversion
  39. -Winit-self -Wuninitialized -Wformat-security -Wformat-nonliteral)
  40. # binary size reduction settings
  41. add_definitions(-ffunction-sections -fdata-sections -fno-stack-protector -fno-unwind-tables
  42. -fno-asynchronous-unwind-tables -fno-math-errno -fmerge-all-constants -fno-ident)
  43. set(CMAKE_C_LINK_FLAGS "${CMAKE_C_LINK_FLAGS} -Wl,--gc-sections")
  44. set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--gc-sections")
  45. set(CMAKE_SHARED_LIBRARY_LINK_C_FLAGS "") # cmake sets -rdynamic by default
  46. if(NOT WIN32)
  47. add_definitions(-fvisibility=hidden -fPIC)
  48. set(CMAKE_C_LINK_FLAGS "${CMAKE_C_LINK_FLAGS} -Wl,-z,norelro -Wl,--hash-style=gnu -Wl,--build-id=none")
  49. endif()
  50. if(CMAKE_BUILD_TYPE STREQUAL "MinSizeRel" OR CMAKE_BUILD_TYPE STREQUAL "Release")
  51. # add_definitions(-flto)
  52. set(CMAKE_C_LINK_FLAGS "${CMAKE_C_LINK_FLAGS} -s")
  53. set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -s")
  54. endif()
  55. endif()
  56. # build the main library
  57. set(exported_headers ${PROJECT_BINARY_DIR}/src_generated/ua_config.h
  58. ${PROJECT_SOURCE_DIR}/include/ua_statuscodes.h
  59. ${PROJECT_SOURCE_DIR}/include/ua_types.h
  60. ${PROJECT_BINARY_DIR}/src_generated/ua_nodeids.h
  61. ${PROJECT_BINARY_DIR}/src_generated/ua_types_generated.h
  62. ${PROJECT_SOURCE_DIR}/include/ua_connection.h
  63. ${PROJECT_SOURCE_DIR}/include/ua_log.h
  64. ${PROJECT_SOURCE_DIR}/include/ua_server.h
  65. ${PROJECT_SOURCE_DIR}/include/ua_client.h
  66. ${PROJECT_SOURCE_DIR}/examples/networklayer_tcp.h
  67. ${PROJECT_SOURCE_DIR}/examples/logger_stdout.h)
  68. set(internal_headers ${PROJECT_SOURCE_DIR}/src/ua_util.h
  69. ${PROJECT_SOURCE_DIR}/deps/queue.h
  70. ${PROJECT_BINARY_DIR}/src_generated/ua_transport_generated.h
  71. ${PROJECT_SOURCE_DIR}/src/ua_types_encoding_binary.h
  72. ${PROJECT_SOURCE_DIR}/src/ua_securechannel.h
  73. ${PROJECT_SOURCE_DIR}/src/ua_session.h
  74. ${PROJECT_SOURCE_DIR}/src/server/ua_nodes.h
  75. ${PROJECT_SOURCE_DIR}/src/server/ua_nodestore.h
  76. ${PROJECT_SOURCE_DIR}/src/server/ua_session_manager.h
  77. ${PROJECT_SOURCE_DIR}/src/server/ua_securechannel_manager.h
  78. ${PROJECT_SOURCE_DIR}/src/server/ua_server_internal.h
  79. ${PROJECT_SOURCE_DIR}/src/server/ua_services.h)
  80. set(lib_sources ${PROJECT_SOURCE_DIR}/src/ua_types.c
  81. ${PROJECT_SOURCE_DIR}/src/ua_types_encoding_binary.c
  82. ${PROJECT_BINARY_DIR}/src_generated/ua_types_generated.c
  83. ${PROJECT_BINARY_DIR}/src_generated/ua_transport_generated.c
  84. ${PROJECT_SOURCE_DIR}/src/ua_connection.c
  85. ${PROJECT_SOURCE_DIR}/src/ua_securechannel.c
  86. ${PROJECT_SOURCE_DIR}/src/ua_session.c
  87. ${PROJECT_SOURCE_DIR}/src/server/ua_server.c
  88. ${PROJECT_SOURCE_DIR}/src/server/ua_server_addressspace.c
  89. ${PROJECT_SOURCE_DIR}/src/server/ua_server_binary.c
  90. ${PROJECT_SOURCE_DIR}/src/server/ua_nodes.c
  91. ${PROJECT_SOURCE_DIR}/src/server/ua_server_worker.c
  92. ${PROJECT_SOURCE_DIR}/src/server/ua_securechannel_manager.c
  93. ${PROJECT_SOURCE_DIR}/src/server/ua_session_manager.c
  94. ${PROJECT_SOURCE_DIR}/src/server/ua_services_discovery.c
  95. ${PROJECT_SOURCE_DIR}/src/server/ua_services_securechannel.c
  96. ${PROJECT_SOURCE_DIR}/src/server/ua_services_session.c
  97. ${PROJECT_SOURCE_DIR}/src/server/ua_services_attribute.c
  98. ${PROJECT_SOURCE_DIR}/src/server/ua_services_nodemanagement.c
  99. ${PROJECT_SOURCE_DIR}/src/server/ua_services_view.c
  100. ${PROJECT_SOURCE_DIR}/src/client/ua_client.c
  101. ${PROJECT_SOURCE_DIR}/examples/networklayer_tcp.c
  102. ${PROJECT_SOURCE_DIR}/examples/logger_stdout.c)
  103. ##TODO: make client stuff optional
  104. ## generate code from xml definitions
  105. file(MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/src_generated")
  106. add_custom_command(OUTPUT ${PROJECT_BINARY_DIR}/src_generated/ua_types_generated.c
  107. ${PROJECT_BINARY_DIR}/src_generated/ua_types_generated.h
  108. PRE_BUILD
  109. COMMAND ${PYTHON_EXECUTABLE} ${PROJECT_SOURCE_DIR}/tools/generate_datatypes.py --typedescriptions ${PROJECT_SOURCE_DIR}/tools/schema/NodeIds.csv 0 ${PROJECT_SOURCE_DIR}/tools/schema/Opc.Ua.Types.bsd ${PROJECT_BINARY_DIR}/src_generated/ua_types
  110. DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/tools/generate_datatypes.py
  111. ${CMAKE_CURRENT_SOURCE_DIR}/tools/schema/Opc.Ua.Types.bsd
  112. ${CMAKE_CURRENT_SOURCE_DIR}/tools/schema/NodeIds.csv)
  113. add_custom_command(OUTPUT ${PROJECT_BINARY_DIR}/src_generated/ua_transport_generated.c
  114. ${PROJECT_BINARY_DIR}/src_generated/ua_transport_generated.h
  115. PRE_BUILD
  116. COMMAND ${PYTHON_EXECUTABLE} ${PROJECT_SOURCE_DIR}/tools/generate_datatypes.py --ns0-types-xml ${PROJECT_SOURCE_DIR}/tools/schema/Opc.Ua.Types.bsd 1 ${PROJECT_SOURCE_DIR}/tools/schema/Custom.Opc.Ua.Transport.bsd ${PROJECT_BINARY_DIR}/src_generated/ua_transport
  117. DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/tools/generate_datatypes.py
  118. ${CMAKE_CURRENT_SOURCE_DIR}/tools/schema/Custom.Opc.Ua.Transport.bsd)
  119. add_custom_command(OUTPUT ${PROJECT_BINARY_DIR}/src_generated/ua_nodeids.h
  120. PRE_BUILD
  121. COMMAND ${PYTHON_EXECUTABLE} ${PROJECT_SOURCE_DIR}/tools/generate_nodeids.py ${PROJECT_SOURCE_DIR}/tools/schema/NodeIds.csv ${PROJECT_BINARY_DIR}/src_generated/ua_nodeids
  122. DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/tools/generate_nodeids.py
  123. ${CMAKE_CURRENT_SOURCE_DIR}/tools/schema/NodeIds.csv)
  124. option(ENABLE_GENERATE_NAMESPACE0 "Generate and load UA XML Namespace 0 definition" OFF)
  125. if(ENABLE_GENERATE_NAMESPACE0)
  126. add_definitions(-DENABLE_GENERATE_NAMESPACE0)
  127. set(GENERATE_NAMESPACE0_FILE "Opc.Ua.NodeSet2.xml" CACHE STRING "Namespace definition XML file")
  128. set_property(CACHE GENERATE_NAMESPACE0_FILE PROPERTY STRINGS Opc.Ua.NodeSet2.xml Opc.Ua.NodeSet2.Minimal.xml)
  129. add_custom_command(OUTPUT ${PROJECT_BINARY_DIR}/src_generated/ua_namespaceinit_generated.c
  130. ${PROJECT_BINARY_DIR}/src_generated/ua_namespaceinit_generated.h
  131. PRE_BUILD
  132. COMMAND ${PYTHON_EXECUTABLE} ${PROJECT_SOURCE_DIR}/tools/pyUANamespace/generate_open62541CCode.py -i ${PROJECT_SOURCE_DIR}/tools/pyUANamespace/NodeID_AssumeExternal.txt -s description -b ${PROJECT_SOURCE_DIR}/tools/pyUANamespace/NodeID_Blacklist.txt ${PROJECT_SOURCE_DIR}/tools/schema/namespace0/${GENERATE_NAMESPACE0_FILE} ${PROJECT_BINARY_DIR}/src_generated/ua_namespaceinit_generated
  133. DEPENDS ${PROJECT_SOURCE_DIR}/tools/schema/namespace0/${GENERATE_NAMESPACE0_FILE}
  134. ${PROJECT_SOURCE_DIR}/tools/pyUANamespace/generate_open62541CCode.py
  135. ${PROJECT_SOURCE_DIR}/tools/pyUANamespace/logger.py
  136. ${PROJECT_SOURCE_DIR}/tools/pyUANamespace/open62541_MacroHelper.py
  137. ${PROJECT_SOURCE_DIR}/tools/pyUANamespace/ua_builtin_types.py
  138. ${PROJECT_SOURCE_DIR}/tools/pyUANamespace/ua_constants.py
  139. ${PROJECT_SOURCE_DIR}/tools/pyUANamespace/ua_namespace.py
  140. ${PROJECT_SOURCE_DIR}/tools/pyUANamespace/ua_node_types.py)
  141. list(APPEND internal_headers ${PROJECT_BINARY_DIR}/src_generated/ua_namespaceinit_generated.h)
  142. list(APPEND lib_sources ${PROJECT_BINARY_DIR}/src_generated/ua_namespaceinit_generated.c)
  143. endif()
  144. ## logging
  145. set(UA_LOGLEVEL 300 CACHE STRING "Level at which logs shall be reported")
  146. ## multithreading
  147. option(ENABLE_MULTITHREADING "Enable multithreading (experimental)" OFF)
  148. if(ENABLE_MULTITHREADING)
  149. add_definitions(-DUA_MULTITHREADING)
  150. find_package(Threads REQUIRED)
  151. list(APPEND lib_sources ${PROJECT_SOURCE_DIR}/src/server/ua_nodestore_concurrent.c)
  152. else()
  153. list(APPEND lib_sources ${PROJECT_SOURCE_DIR}/src/server/ua_nodestore.c)
  154. endif()
  155. option(ENABLE_EXTERNAL_NAMESPACES "Enable namespace handling by an external component (experimental)" OFF)
  156. if(ENABLE_EXTERNAL_NAMESPACES)
  157. add_definitions(-DUA_EXTERNAL_NAMESPACES)
  158. endif()
  159. ## enable dynamic nodeset
  160. option(ENABLE_ADDNODES "Enable dynamic addition of nodes" ON)
  161. if(ENABLE_ADDNODES)
  162. add_definitions(-DENABLE_ADDNODES )
  163. endif()
  164. ## set the precompiler flags
  165. configure_file("include/ua_config.h.in" "${PROJECT_BINARY_DIR}/src_generated/ua_config.h")
  166. ## extensions
  167. option(EXTENSION_UDP "Enable udp extension" OFF)
  168. if(EXTENSION_UDP)
  169. add_definitions(-DEXTENSION_STATELESS)
  170. message(STATUS "Extensions: enabling udp")
  171. add_definitions(-DEXTENSION_UDP)
  172. add_executable(exampleServerUDP $<TARGET_OBJECTS:open62541-object> examples/networklayer_udp.c examples/server_udp.c)
  173. target_link_libraries(exampleServerUDP rt)
  174. endif()
  175. option(EXTENSION_STATELESS "Enable stateless extension" OFF)
  176. if(EXTENSION_STATELESS)
  177. message(STATUS "Extensions: enabling stateless")
  178. add_definitions(-DEXTENSION_STATELESS)
  179. endif()
  180. option(ENABLE_AMALGAMATION "Concatenate the library to a single file open62541.h/.c" OFF)
  181. add_custom_command(OUTPUT ${PROJECT_BINARY_DIR}/open62541.h
  182. PRE_BUILD
  183. COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/tools/amalgamate.py ${GIT_COMMIT_ID} ${CMAKE_CURRENT_BINARY_DIR}/open62541.h ${exported_headers}
  184. DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/tools/amalgamate.py ${exported_headers} ${internal_headers})
  185. add_custom_command(OUTPUT ${PROJECT_BINARY_DIR}/open62541.c
  186. PRE_BUILD
  187. COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/tools/amalgamate.py ${GIT_COMMIT_ID} ${CMAKE_CURRENT_BINARY_DIR}/open62541.c
  188. ${internal_headers} ${PROJECT_SOURCE_DIR}/src/server/ua_nodestore_hash.inc ${lib_sources}
  189. DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/tools/amalgamate.py ${internal_headers} ${PROJECT_SOURCE_DIR}/src/server/ua_nodestore_hash.inc ${lib_sources})
  190. if(ENABLE_AMALGAMATION)
  191. add_definitions(-DUA_AMALGAMATE)
  192. add_custom_target(amalgamation ALL DEPENDS ${PROJECT_BINARY_DIR}/open62541.h ${PROJECT_BINARY_DIR}/open62541.c)
  193. add_library(open62541-object OBJECT ${PROJECT_BINARY_DIR}/open62541.c ${PROJECT_BINARY_DIR}/open62541.h)
  194. include_directories(${PROJECT_BINARY_DIR})
  195. else()
  196. add_library(open62541-object OBJECT ${lib_sources} ${internal_headers} ${exported_headers})
  197. include_directories(${PROJECT_SOURCE_DIR}/include)
  198. include_directories(${PROJECT_SOURCE_DIR}/deps)
  199. include_directories(${PROJECT_SOURCE_DIR}/src)
  200. include_directories(${PROJECT_BINARY_DIR}/src_generated)
  201. endif()
  202. target_compile_definitions(open62541-object PRIVATE -DUA_DYNAMIC_LINKING)
  203. add_library(open62541 SHARED $<TARGET_OBJECTS:open62541-object>)
  204. target_compile_definitions(open62541 PRIVATE -DUA_DYNAMIC_LINKING)
  205. if(WIN32)
  206. target_link_libraries(open62541 ws2_32) #since networklayer_tcp is linked into the amalgate
  207. endif()
  208. # build language bindings for the library
  209. option(ENABLE_BINDING_LUA "Build Lua bindings" OFF)
  210. option(ENABLE_BINDING_PYTHON "Build Python bindings" OFF)
  211. if(ENABLE_BINDING_LUA OR ENABLE_BINDING_PYTHON)
  212. add_subdirectory(bindings)
  213. endif()
  214. # coverage
  215. option(ENABLE_COVERAGE "Enable gcov coverage" OFF)
  216. if(ENABLE_COVERAGE)
  217. message(STATUS "Enabling gcov support")
  218. set(CMAKE_BUILD_TYPE DEBUG)
  219. set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fprofile-arcs -ftest-coverage")
  220. set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fprofile-arcs -ftest-coverage")
  221. set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -fprofile-arcs -ftest-coverage")
  222. endif()
  223. # build example server
  224. option(BUILD_EXAMPLESERVER "Build the example server" OFF)
  225. if(BUILD_EXAMPLESERVER)
  226. set(server_source $<TARGET_OBJECTS:open62541-object>)
  227. add_executable(server_static examples/server.c ${server_source})
  228. add_executable(server_simple examples/server_simple.c ${server_source})
  229. add_executable(server examples/server.c)
  230. if(ENABLE_AMALGAMATION)
  231. ADD_DEPENDENCIES(server amalgamation)
  232. endif()
  233. target_link_libraries(server open62541)
  234. if(WIN32)
  235. target_link_libraries(server_static ws2_32)
  236. target_link_libraries(server_simple ws2_32)
  237. target_link_libraries(server ws2_32)
  238. else()
  239. target_link_libraries(server_static rt)
  240. target_link_libraries(server_simple rt)
  241. target_link_libraries(server rt)
  242. endif()
  243. if(ENABLE_MULTITHREADING)
  244. target_link_libraries(server_static urcu-cds urcu urcu-common pthread)
  245. target_link_libraries(server_simple urcu-cds urcu urcu-common pthread)
  246. target_link_libraries(server urcu-cds urcu urcu-common pthread)
  247. endif()
  248. endif()
  249. ## self-signed certificates
  250. option(GENERATE_SELFSIGNED "Generate self-signed certificates" OFF)
  251. if(GENERATE_SELFSIGNED)
  252. message(STATUS "Enabling self-signed certificates")
  253. find_package(OpenSSL REQUIRED)
  254. add_custom_command(OUTPUT ${PROJECT_BINARY_DIR}/server_cert.der
  255. ${PROJECT_BINARY_DIR}/ca.crt
  256. COMMAND ${PYTHON_EXECUTABLE} ${PROJECT_SOURCE_DIR}/tools/certs/create_self-signed.py ${PROJECT_BINARY_DIR}
  257. DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/tools/certs/create_self-signed.py
  258. ${CMAKE_CURRENT_SOURCE_DIR}/tools/certs/localhost.cnf)
  259. add_custom_target(selfsigned ALL DEPENDS ${PROJECT_BINARY_DIR}/server_cert.der ${PROJECT_BINARY_DIR}/ca.crt)
  260. endif()
  261. # build example client
  262. option(BUILD_EXAMPLECLIENT "Build a test client" OFF)
  263. if(BUILD_EXAMPLECLIENT)
  264. add_definitions(-DBENCHMARK)
  265. set(client_source $<TARGET_OBJECTS:open62541-object>)
  266. add_executable(client_static examples/client.c ${client_source})
  267. add_executable(client examples/client.c)
  268. if(ENABLE_AMALGAMATION)
  269. ADD_DEPENDENCIES(client amalgamation)
  270. endif()
  271. target_link_libraries(client open62541)
  272. if(WIN32)
  273. target_link_libraries(client_static ws2_32)
  274. target_link_libraries(client ws2_32)
  275. else()
  276. target_link_libraries(client_static rt)
  277. target_link_libraries(client rt)
  278. endif()
  279. if(ENABLE_MULTITHREADING)
  280. target_link_libraries(client_static urcu-cds urcu urcu-common pthread)
  281. target_link_libraries(client urcu-cds urcu urcu-common pthread)
  282. endif()
  283. if(EXTENSION_STATELESS)
  284. add_executable(client_stateless examples/client_stateless.c ${client_source})
  285. if(ENABLE_MULTITHREADING)
  286. target_link_libraries(client_stateless urcu-cds urcu urcu-common pthread)
  287. endif()
  288. endif()
  289. endif()
  290. # build unit tests
  291. option(BUILD_UNIT_TESTS "Run unit tests after building" OFF)
  292. if(BUILD_UNIT_TESTS)
  293. add_definitions(-DBUILD_UNIT_TESTS)
  294. enable_testing()
  295. add_subdirectory(tests)
  296. endif()
  297. # build documentation
  298. option(BUILD_DOCUMENTATION "Generate doxygen documentation" OFF)
  299. if(BUILD_DOCUMENTATION)
  300. find_package(Doxygen)
  301. if(NOT DOXYGEN_FOUND)
  302. message(FATAL_ERROR "Doxygen is not installed or not properly configured")
  303. endif(NOT DOXYGEN_FOUND)
  304. configure_file(${CMAKE_CURRENT_SOURCE_DIR}/doc/Doxyfile.in ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile @ONLY)
  305. add_custom_target(doc
  306. ${DOXYGEN_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile
  307. WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
  308. COMMENT "Generating API documentation with Doxygen")
  309. endif()