Thu, 19 Dec 2019 18:40:00 +0100
adds very simple cmake wrapper
universe@372 | 1 | cmake_minimum_required(VERSION 3.15) |
universe@372 | 2 | project(ucx) |
universe@372 | 3 | |
universe@372 | 4 | # Autotools Buildsystem |
universe@372 | 5 | add_custom_command( |
universe@372 | 6 | OUTPUT ${CMAKE_SOURCE_DIR}/configure |
universe@372 | 7 | MAIN_DEPENDENCY ${CMAKE_SOURCE_DIR}/configure.ac |
universe@372 | 8 | COMMAND ${CMAKE_SOURCE_DIR}/autogen.sh |
universe@372 | 9 | COMMENT "Generating configure script.") |
universe@372 | 10 | |
universe@372 | 11 | add_custom_command( |
universe@372 | 12 | OUTPUT ${CMAKE_SOURCE_DIR}/Makefile |
universe@372 | 13 | DEPENDS ${CMAKE_SOURCE_DIR}/configure |
universe@372 | 14 | COMMAND ${CMAKE_SOURCE_DIR}/configure |
universe@372 | 15 | COMMENT "Configuring project.") |
universe@372 | 16 | |
universe@372 | 17 | add_custom_target(libucx-build |
universe@372 | 18 | DEPENDS ${CMAKE_SOURCE_DIR}/Makefile |
universe@372 | 19 | COMMAND $(MAKE) -f ${CMAKE_SOURCE_DIR}/Makefile |
universe@372 | 20 | WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}) |
universe@372 | 21 | |
universe@372 | 22 | add_custom_target(libucx-clean |
universe@372 | 23 | DEPENDS ${CMAKE_SOURCE_DIR}/Makefile |
universe@372 | 24 | COMMAND $(MAKE) -f ${CMAKE_SOURCE_DIR}/Makefile clean |
universe@372 | 25 | WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}) |
universe@372 | 26 | |
universe@372 | 27 | add_custom_target(libucx-check |
universe@372 | 28 | DEPENDS ${CMAKE_SOURCE_DIR}/Makefile |
universe@372 | 29 | COMMAND $(MAKE) ${CMAKE_SOURCE_DIR}/Makefile check |
universe@372 | 30 | WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}) |
universe@372 | 31 | |
universe@372 | 32 | # Web Documentation |
universe@372 | 33 | add_subdirectory(docs/src) |
universe@372 | 34 | |
universe@372 | 35 | # API Documentation |
universe@372 | 36 | find_package(Doxygen) |
universe@372 | 37 | option(BUILD_DOCUMENTATION "Create API documentation." ${DOXYGEN_FOUND}) |
universe@372 | 38 | |
universe@372 | 39 | if(BUILD_DOCUMENTATION) |
universe@372 | 40 | if(NOT DOXYGEN_FOUND) |
universe@372 | 41 | message(FATAL_ERROR "Doxygen is needed to build the documentation.") |
universe@372 | 42 | endif() |
universe@372 | 43 | |
universe@372 | 44 | set(DOXY_INPUT ${CMAKE_SOURCE_DIR}/src) |
universe@372 | 45 | set(DOXY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/docs) |
universe@372 | 46 | set(DOXY_PROJECT_LOGO ${CMAKE_SOURCE_DIR}/uaplogo.png) |
universe@372 | 47 | |
universe@372 | 48 | configure_file(${CMAKE_SOURCE_DIR}/cmake_infile.doxygen ${CMAKE_BINARY_DIR}/Doxyfile) |
universe@372 | 49 | |
universe@372 | 50 | add_custom_target(docs-api |
universe@372 | 51 | COMMAND ${DOXYGEN_EXECUTABLE} |
universe@372 | 52 | WORKING_DIRECTORY ${CMAKE_BINARY_DIR} |
universe@372 | 53 | COMMENT "Generating API documentation with Doxygen") |
universe@372 | 54 | endif() |
universe@372 | 55 | |
universe@372 | 56 | add_custom_target(docs-all DEPENDS docs-html docs-api) |
universe@372 | 57 | |
universe@372 | 58 | add_custom_target(build-all DEPENDS docs-all libucx-check) |