diff -r 365b24f20f98 -r a3e494af5c09 CMakeLists.txt --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/CMakeLists.txt Thu Dec 19 18:40:00 2019 +0100 @@ -0,0 +1,58 @@ +cmake_minimum_required(VERSION 3.15) +project(ucx) + +# Autotools Buildsystem +add_custom_command( + OUTPUT ${CMAKE_SOURCE_DIR}/configure + MAIN_DEPENDENCY ${CMAKE_SOURCE_DIR}/configure.ac + COMMAND ${CMAKE_SOURCE_DIR}/autogen.sh + COMMENT "Generating configure script.") + +add_custom_command( + OUTPUT ${CMAKE_SOURCE_DIR}/Makefile + DEPENDS ${CMAKE_SOURCE_DIR}/configure + COMMAND ${CMAKE_SOURCE_DIR}/configure + COMMENT "Configuring project.") + +add_custom_target(libucx-build + DEPENDS ${CMAKE_SOURCE_DIR}/Makefile + COMMAND $(MAKE) -f ${CMAKE_SOURCE_DIR}/Makefile + WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}) + +add_custom_target(libucx-clean + DEPENDS ${CMAKE_SOURCE_DIR}/Makefile + COMMAND $(MAKE) -f ${CMAKE_SOURCE_DIR}/Makefile clean + WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}) + +add_custom_target(libucx-check + DEPENDS ${CMAKE_SOURCE_DIR}/Makefile + COMMAND $(MAKE) ${CMAKE_SOURCE_DIR}/Makefile check + WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}) + +# Web Documentation +add_subdirectory(docs/src) + +# API Documentation +find_package(Doxygen) +option(BUILD_DOCUMENTATION "Create API documentation." ${DOXYGEN_FOUND}) + +if(BUILD_DOCUMENTATION) + if(NOT DOXYGEN_FOUND) + message(FATAL_ERROR "Doxygen is needed to build the documentation.") + endif() + + set(DOXY_INPUT ${CMAKE_SOURCE_DIR}/src) + set(DOXY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/docs) + set(DOXY_PROJECT_LOGO ${CMAKE_SOURCE_DIR}/uaplogo.png) + + configure_file(${CMAKE_SOURCE_DIR}/cmake_infile.doxygen ${CMAKE_BINARY_DIR}/Doxyfile) + + add_custom_target(docs-api + COMMAND ${DOXYGEN_EXECUTABLE} + WORKING_DIRECTORY ${CMAKE_BINARY_DIR} + COMMENT "Generating API documentation with Doxygen") +endif() + +add_custom_target(docs-all DEPENDS docs-html docs-api) + +add_custom_target(build-all DEPENDS docs-all libucx-check)