-
Notifications
You must be signed in to change notification settings - Fork 1
/
CMakeLists.txt
74 lines (63 loc) · 2.58 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
cmake_minimum_required(VERSION 3.4.3)
project(japc)
include(CTest) # For testing
option(BUILD_DOC "Build documentation" OFF)
option(BUILD_USER_DOC "Build user documentation" PFF)
include(GNUInstallDirs)
set(CMAKE_C_STANDARD 11)
set(CMAKE_EXPORT_COMPILE_COMMANDS OFF)
find_package(LLVM 12.0 REQUIRED CONFIG)
message(STATUS "Found LLVM ${LLVM_PACKAGE_VERSION}")
message(STATUS "Using LLVMConfig.cmake in: ${LLVM_DIR}")
include_directories(${LLVM_INCLUDE_DIRS})
separate_arguments(LLVM_DEFINITIONS_LIST NATIVE_COMMAND ${LLVM_DEFINITIONS})
add_definitions(${LLVM_DEFINITIONS_LIST})
llvm_map_components_to_libnames(llvm_libs support core irreader)
include_directories(${PROJECT_SOURCE_DIR}/include)
include_directories( ${PROJECT_SOURCE_DIR}/tools)
include_directories( ${PROJECT_SOURCE_DIR}/utils)
include_directories(${PROJECT_SOURCE_DIR}/lib)
include_directories(${PROJECT_SOURCE_DIR}/test)
add_subdirectory(tools)
add_subdirectory(utils)
add_subdirectory(lib)
add_subdirectory(test)
find_package(Doxygen)
if(BUILD_DOC)
if(DOXYGEN_FOUND)
message("BUILDING DOCUMENTATION")
set(DOXYGEN_IN docs/Doxyfile.in)
set(DOXYGEN_OUT ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile)
configure_file(${DOXYGEN_IN} ${DOXYGEN_OUT} @ONLY)
message("Doxygen build started")
add_custom_target(internal-docs ALL
COMMAND ${DOXYGEN_EXECUTABLE} ${DOXYGEN_OUT}
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
COMMENT "Generating documentation with Doxygen"
VERBATIM )
else(DOXYGEN_FOUND)
message("Doxygen is not found!")
endif(DOXYGEN_FOUND)
else(BUILD_DOC)
message("Omitting doxygen doc!")
endif(BUILD_DOC)
if(BUILD_USER_DOC)
find_program(MAKEINFO_EXECUTABLE makeinfo)
set(info_in_es ${CMAKE_CURRENT_SOURCE_DIR}/man/japc_es.texi)
set(info_out_es ${CMAKE_CURRENT_BINARY_DIR}/japc_es.info)
set(info_in_en ${CMAKE_CURRENT_SOURCE_DIR}/man/japc_en.texi)
set(info_out_en ${CMAKE_CURRENT_BINARY_DIR}/japc_en.info)
add_custom_command(OUTPUT ${info_out_es}
COMMAND ${MAKEINFO_EXECUTABLE} -o ${info_out_es} ${info_in_es}
DEPENDS ${info_in_es}
COMMENT "Creating Info file ${info_out_es}"
VERBATIM)
add_custom_command(OUTPUT ${info_out_en}
COMMAND ${MAKEINFO_EXECUTABLE} -o ${info_out_en} ${info_in_en}
DEPENDS ${info_in_en}
COMMENT "Creating Info file ${info_out_en}"
VERBATIM)
add_custom_target(info ALL DEPENDS ${info_out_es} ${info_out_en})
else(BUILD_USER_DOC)
message("Omitting user doc!")
endif(BUILD_USER_DOC)