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