-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
91 lines (79 loc) · 2.97 KB
/
CMakeLists.txt
File metadata and controls
91 lines (79 loc) · 2.97 KB
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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
cmake_minimum_required(VERSION 3.1.0)
project(MBCoreUtils NONE)
find_package(MBCMakeTools REQUIRED)
find_package(Mustache REQUIRED)
set(templates_dir
"${PROJECT_SOURCE_DIR}/birdwing_codegen/templates")
set(contexts_dir
"${PROJECT_SOURCE_DIR}/birdwing_codegen/contexts")
set(_CONTEXTS
"${contexts_dir}/errors.json"
"${contexts_dir}/tool_metadata.json"
"${contexts_dir}/machine_specific_enums.json")
if(${BIRDWING})
set(static_birdwing_dir
"${PROJECT_SOURCE_DIR}/birdwing_codegen/static")
install(FILES
"${static_birdwing_dir}/machine_config_skeleton.json"
DESTINATION "${USER_EDITABLE_CONFIG_INSTALL_DIR}")
mustache_codegen(
TEMPLATES
"${templates_dir}/python/common_settings.py"
"${templates_dir}/python/machine_definitions.py"
"${templates_dir}/python/machine_errors.py"
"${templates_dir}/python/toolhead_errors.py"
"${templates_dir}/python/tool_mappings.py"
CONTEXTS
"${_CONTEXTS}"
TRANSFORMATIONS_FILE
"${PROJECT_SOURCE_DIR}/birdwing_codegen/transformations.json"
OUTPUT_DIR
"${PROJECT_BINARY_DIR}/python_codegen"
OUTPUT_VARIABLE
codegenned_files_python)
add_custom_target(python_codgen ALL DEPENDS ${codegenned_files_python})
install(
FILES ${codegenned_files_python}
DESTINATION ${PY34_MODULE_DIR}/mbcoreutils)
endif()
mustache_codegen(
TEMPLATES
"${templates_dir}/shared_cpp/all_errors.hh"
"${templates_dir}/shared_cpp/all_errors_node.hh"
"${templates_dir}/shared_cpp/bot_error.hh"
"${templates_dir}/shared_cpp/bot_error_noqt.hh"
"${templates_dir}/shared_cpp/bot_error_translateable.hh"
"${templates_dir}/shared_cpp/common_settings.hh"
"${templates_dir}/shared_cpp/tool_mappings.hh"
"${templates_dir}/machine_cpp/machine_definitions.hh"
"${templates_dir}/machine_cpp/machine_errors.hh"
"${templates_dir}/machine_cpp/toolhead_errors.hh"
"${templates_dir}/machine_cpp/toolhead_toolidentifier.hh"
"${templates_dir}/machine_cpp/extruder_common.hh"
CONTEXTS
"${_CONTEXTS}"
TRANSFORMATIONS_FILE
"${PROJECT_SOURCE_DIR}/birdwing_codegen/transformations.json"
OUTPUT_DIR
"${PROJECT_BINARY_DIR}/bwcoreutils"
OUTPUT_VARIABLE
codegenned_files
)
# Because we don't actually use these files for anything else
add_custom_target(codegen ALL DEPENDS ${codegenned_files})
generate_and_install_config(
NAME MBCoreUtils
ADDITIONAL_PATHS
MBCoreUtils_INCLUDE_DIRS
${HEADER_INSTALL_DIR}
BWCoreUtils_INCLUDE_DIRS
${HEADER_INSTALL_DIR}/bwcoreutils)
install(
FILES ${codegenned_files}
DESTINATION "${HEADER_INSTALL_DIR}/bwcoreutils")
install(
DIRECTORY "${PROJECT_SOURCE_DIR}/include/mbcoreutils"
DESTINATION "${HEADER_INSTALL_DIR}")
install_docs(
FILES "${PROJECT_SOURCE_DIR}/README.md"
PREFIX MBCoreUtils)