CMakeLists.txt

Sun, 13 Nov 2022 13:29:15 +0100

author
Mike Becker <universe@uap-core.de>
date
Sun, 13 Nov 2022 13:29:15 +0100
changeset 609
6ae8146d9f62
parent 463
92721c8f9db3
child 641
d402fead3386
permissions
-rw-r--r--

more custom data for array re-allocator

390
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents: 377
diff changeset
1 cmake_minimum_required(VERSION 3.14)
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents: 377
diff changeset
2 project(ucx VERSION 3.0 DESCRIPTION "UAP Common Extensions")
372
a3e494af5c09 adds very simple cmake wrapper
Mike Becker <universe@uap-core.de>
parents:
diff changeset
3
375
460c0258bb5b adds proper cmake build targets
Mike Becker <universe@uap-core.de>
parents: 372
diff changeset
4 # Configuration
460c0258bb5b adds proper cmake build targets
Mike Becker <universe@uap-core.de>
parents: 372
diff changeset
5 set(CMAKE_C_STANDARD 11)
460c0258bb5b adds proper cmake build targets
Mike Becker <universe@uap-core.de>
parents: 372
diff changeset
6 set(CMAKE_C_STANDARD_REQUIRED 99)
372
a3e494af5c09 adds very simple cmake wrapper
Mike Becker <universe@uap-core.de>
parents:
diff changeset
7
433
f1e4c6dabfb4 add option to enable more warnings
Mike Becker <universe@uap-core.de>
parents: 420
diff changeset
8 option(GCC_MORE_WARNINGS "Enable -Wall -Wextra -pedantic when using gcc." OFF)
f1e4c6dabfb4 add option to enable more warnings
Mike Becker <universe@uap-core.de>
parents: 420
diff changeset
9 if (GCC_MORE_WARNINGS AND CMAKE_COMPILER_IS_GNUCC)
f1e4c6dabfb4 add option to enable more warnings
Mike Becker <universe@uap-core.de>
parents: 420
diff changeset
10 add_compile_options(-Wall -Wextra -pedantic)
f1e4c6dabfb4 add option to enable more warnings
Mike Becker <universe@uap-core.de>
parents: 420
diff changeset
11 endif()
f1e4c6dabfb4 add option to enable more warnings
Mike Becker <universe@uap-core.de>
parents: 420
diff changeset
12
375
460c0258bb5b adds proper cmake build targets
Mike Becker <universe@uap-core.de>
parents: 372
diff changeset
13 # Library
460c0258bb5b adds proper cmake build targets
Mike Becker <universe@uap-core.de>
parents: 372
diff changeset
14 add_subdirectory(src)
372
a3e494af5c09 adds very simple cmake wrapper
Mike Becker <universe@uap-core.de>
parents:
diff changeset
15
375
460c0258bb5b adds proper cmake build targets
Mike Becker <universe@uap-core.de>
parents: 372
diff changeset
16 # Tests
460c0258bb5b adds proper cmake build targets
Mike Becker <universe@uap-core.de>
parents: 372
diff changeset
17 enable_testing()
460c0258bb5b adds proper cmake build targets
Mike Becker <universe@uap-core.de>
parents: 372
diff changeset
18 add_subdirectory(test)
372
a3e494af5c09 adds very simple cmake wrapper
Mike Becker <universe@uap-core.de>
parents:
diff changeset
19
a3e494af5c09 adds very simple cmake wrapper
Mike Becker <universe@uap-core.de>
parents:
diff changeset
20 # Web Documentation
a3e494af5c09 adds very simple cmake wrapper
Mike Becker <universe@uap-core.de>
parents:
diff changeset
21 add_subdirectory(docs/src)
a3e494af5c09 adds very simple cmake wrapper
Mike Becker <universe@uap-core.de>
parents:
diff changeset
22
a3e494af5c09 adds very simple cmake wrapper
Mike Becker <universe@uap-core.de>
parents:
diff changeset
23 # API Documentation
420
8eb6faa2edba change detection of Doxygen
Mike Becker <universe@uap-core.de>
parents: 390
diff changeset
24 message(CHECK_START "Seaching for Doxygen")
372
a3e494af5c09 adds very simple cmake wrapper
Mike Becker <universe@uap-core.de>
parents:
diff changeset
25 find_package(Doxygen)
420
8eb6faa2edba change detection of Doxygen
Mike Becker <universe@uap-core.de>
parents: 390
diff changeset
26 if(DOXYGEN_FOUND)
8eb6faa2edba change detection of Doxygen
Mike Becker <universe@uap-core.de>
parents: 390
diff changeset
27 message(CHECK_PASS "found.")
8eb6faa2edba change detection of Doxygen
Mike Becker <universe@uap-core.de>
parents: 390
diff changeset
28 else()
8eb6faa2edba change detection of Doxygen
Mike Becker <universe@uap-core.de>
parents: 390
diff changeset
29 message(CHECK_FAIL "not found - documentation will not be generated.")
8eb6faa2edba change detection of Doxygen
Mike Becker <universe@uap-core.de>
parents: 390
diff changeset
30 endif()
8eb6faa2edba change detection of Doxygen
Mike Becker <universe@uap-core.de>
parents: 390
diff changeset
31 option(BUILD_API_DOC "Create API documentation." ON)
372
a3e494af5c09 adds very simple cmake wrapper
Mike Becker <universe@uap-core.de>
parents:
diff changeset
32
420
8eb6faa2edba change detection of Doxygen
Mike Becker <universe@uap-core.de>
parents: 390
diff changeset
33 if(BUILD_API_DOC AND DOXYGEN_FOUND)
463
92721c8f9db3 change src dir of Doxygen to only include header files
Mike Becker <universe@uap-core.de>
parents: 433
diff changeset
34 set(DOXY_INPUT ${CMAKE_SOURCE_DIR}/src/cx)
372
a3e494af5c09 adds very simple cmake wrapper
Mike Becker <universe@uap-core.de>
parents:
diff changeset
35 set(DOXY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/docs)
a3e494af5c09 adds very simple cmake wrapper
Mike Becker <universe@uap-core.de>
parents:
diff changeset
36 set(DOXY_PROJECT_LOGO ${CMAKE_SOURCE_DIR}/uaplogo.png)
a3e494af5c09 adds very simple cmake wrapper
Mike Becker <universe@uap-core.de>
parents:
diff changeset
37
a3e494af5c09 adds very simple cmake wrapper
Mike Becker <universe@uap-core.de>
parents:
diff changeset
38 configure_file(${CMAKE_SOURCE_DIR}/cmake_infile.doxygen ${CMAKE_BINARY_DIR}/Doxyfile)
a3e494af5c09 adds very simple cmake wrapper
Mike Becker <universe@uap-core.de>
parents:
diff changeset
39
390
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents: 377
diff changeset
40 add_custom_target(docs-api-21
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents: 377
diff changeset
41 COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_SOURCE_DIR}/docs/api-2.1 ${CMAKE_BINARY_DIR}/docs/web/api-2.1
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents: 377
diff changeset
42 WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents: 377
diff changeset
43 COMMENT "Copying UCX 2.1 API documentation.")
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents: 377
diff changeset
44
372
a3e494af5c09 adds very simple cmake wrapper
Mike Becker <universe@uap-core.de>
parents:
diff changeset
45 add_custom_target(docs-api
a3e494af5c09 adds very simple cmake wrapper
Mike Becker <universe@uap-core.de>
parents:
diff changeset
46 COMMAND ${DOXYGEN_EXECUTABLE}
a3e494af5c09 adds very simple cmake wrapper
Mike Becker <universe@uap-core.de>
parents:
diff changeset
47 WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
390
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents: 377
diff changeset
48 COMMENT "Generating API documentation with Doxygen.")
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents: 377
diff changeset
49
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents: 377
diff changeset
50 add_custom_target(docs-all DEPENDS docs-html docs-api docs-api-21)
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents: 377
diff changeset
51 else()
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents: 377
diff changeset
52 add_custom_target(docs-all DEPENDS docs-html)
372
a3e494af5c09 adds very simple cmake wrapper
Mike Becker <universe@uap-core.de>
parents:
diff changeset
53 endif()
a3e494af5c09 adds very simple cmake wrapper
Mike Becker <universe@uap-core.de>
parents:
diff changeset
54

mercurial