Add targets to build documentation with instructions.
[apps/low-level-can-service.git] / CMakeLists.txt
1 ###########################################################################
2 # Copyright 2016 IoT.bzh
3 #
4 # author: José Bollo <jose.bollo@iot.bzh>
5 # author: Stéphane Desneux <stephane.desneux@iot.bzh>
6 #
7 # Licensed under the Apache License, Version 2.0 (the "License");
8 # you may not use this file except in compliance with the License.
9 # You may obtain a copy of the License at
10 #
11 #     http://www.apache.org/licenses/LICENSE-2.0
12 #
13 # Unless required by applicable law or agreed to in writing, software
14 # distributed under the License is distributed on an "AS IS" BASIS,
15 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 # See the License for the specific language governing permissions and
17 # limitations under the License.
18 ###########################################################################
19
20 cmake_minimum_required(VERSION 3.3)
21 project(low-can-binding)
22 add_subdirectory(src)
23
24 add_custom_command(
25         OUTPUT ${PROJECT_NAME}.pdf
26         WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
27         COMMAND gitbook install
28         COMMAND gitbook pdf docs ${PROJECT_NAME}.pdf
29 )
30 add_custom_target(pdf
31         DEPENDS ${PROJECT_NAME}.pdf)
32
33 add_custom_command(
34         OUTPUT _book
35         WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
36         COMMAND gitbook install
37         COMMAND gitbook serve
38 )
39 add_custom_target(serve
40         DEPENDS _book)
41
42 add_custom_command(
43         OUTPUT docs_doxygen
44         WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
45         COMMAND doxygen CAN_signaling.doxygen
46 )
47 add_custom_target(doxygen
48         DEPENDS docs_doxygen)