File: CMakeLists.txt

package info (click to toggle)
libxpertmass 1.7.1-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 5,148 kB
  • sloc: cpp: 52,453; xml: 2,193; python: 417; ansic: 70; sh: 54; makefile: 33
file content (98 lines) | stat: -rw-r--r-- 3,743 bytes parent folder | download | duplicates (2)
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
92
93
94
95
96
97
98
message("\n${BoldGreen}Now configuring src/doc/javascript for ${PROJECT_NAME}${ColourReset}\n")

################ JavaScript reference text handling #################
################ JavaScript reference text handling #################

find_package(Python3 REQUIRED)

############ List all the files that contain the class JS reference tag
# that is like so:
# /* BEGIN CLASS JS REFERENCE
# * namespace: pappso
# * class name: MzIntegrationParams
# */
# The jsExtract.py program lists the files to stdout and that output
# is redirected to OUTPUT_FILE.

set(TOP_JS_REF_DIR ${CMAKE_CURRENT_SOURCE_DIR}/js_reference)
set(SCRIPTS_DIR ${CMAKE_CURRENT_SOURCE_DIR}/scripts)

set(CORE_SRC_DIR ${CMAKE_SOURCE_DIR}/source/XpertMassCore)
set(GUI_SRC_DIR ${CMAKE_SOURCE_DIR}/source/XpertMassGui)

set(CORE_OUTPUT_DIR ${TOP_JS_REF_DIR}/Core)
set(GUI_OUTPUT_DIR ${TOP_JS_REF_DIR}/Gui)

set(CORE_CLASS_JS_REF_FILE_LIST ${CORE_OUTPUT_DIR}/class_js_reference_file_list.txt)
set(CORE_CLASS_JS_REF_TEXT ${CORE_OUTPUT_DIR}/class_js_reference_text.txt)

set(GUI_CLASS_JS_REF_FILE_LIST ${GUI_OUTPUT_DIR}/class_js_reference_file_list.txt)
set(GUI_CLASS_JS_REF_TEXT ${GUI_OUTPUT_DIR}/class_js_reference_text.txt)

# When run (see add_custom_target(list_class_js_ref_files below)
# this command will list all the header files in the Core lib that have
# a class JS reference text in them.
add_custom_command(
    OUTPUT ${CORE_CLASS_JS_REF_FILE_LIST}
    COMMAND ${Python3_EXECUTABLE} ${SCRIPTS_DIR}/jsExtract.py
        --list-files class
        -d ${CORE_SRC_DIR}
        -t "  " > ${CORE_CLASS_JS_REF_FILE_LIST}
    COMMENT "List Core files containing class JS reference text"
    VERBATIM
)

# When run (see add_custom_target(list_class_js_ref_files below)
# this command will list all the header files in the Widget lib that have
# a class JS reference text in them.
add_custom_command(
    OUTPUT ${GUI_CLASS_JS_REF_FILE_LIST}
    COMMAND ${Python3_EXECUTABLE} ${SCRIPTS_DIR}/jsExtract.py
        --list-files class
        -d ${GUI_SRC_DIR}
        -t "  " > ${GUI_CLASS_JS_REF_FILE_LIST}
    COMMENT "List Widget files containing class JS reference text"
    VERBATIM
)

# Runs the commands above that create the files listed here as DEPENDS
add_custom_target(list_class_js_ref_files
    DEPENDS ${CORE_CLASS_JS_REF_FILE_LIST} ${GUI_CLASS_JS_REF_FILE_LIST}
    COMMENT "Listing Core and Widget files containing class JS reference text"
)

# When run (see add_custom_target(extract_class_js_ref_text below)
# this command will extract from the files listed in the lists generated above
# all the class JS reference text.
#
# Core
add_custom_command(
    OUTPUT ${CORE_CLASS_JS_REF_TEXT}
    DEPENDS ${CORE_CLASS_JS_REF_FILE_LIST}
    COMMAND ${Python3_EXECUTABLE} ${SCRIPTS_DIR}/jsExtract.py
      --tab "  "
      --extract class
      --listfile ${CORE_CLASS_JS_REF_FILE_LIST} > ${CORE_CLASS_JS_REF_TEXT}
    COMMENT "Extract class JS reference text from Core header files"
    VERBATIM
)
#
# Widget
add_custom_command(
    OUTPUT ${GUI_CLASS_JS_REF_TEXT}
    DEPENDS ${GUI_CLASS_JS_REF_FILE_LIST}
    COMMAND ${Python3_EXECUTABLE} ${SCRIPTS_DIR}/jsExtract.py
      --tab "  "
      --extract class
      --listfile ${GUI_CLASS_JS_REF_FILE_LIST} > ${GUI_CLASS_JS_REF_TEXT}
    COMMENT "Extract class JS reference text from Widget header files"
    VERBATIM
)

# Runs the commands above that create the files listed here as DEPENDS
add_custom_target(extract_class_js_ref_text
    DEPENDS ${CORE_CLASS_JS_REF_TEXT} ${GUI_CLASS_JS_REF_TEXT}
    COMMENT "Extracting class JavaScript reference text into ${CORE_CLASS_JS_REF_TEXT} and ${GUI_CLASS_JS_REF_TEXT}"
)

message("\n${BoldGreen}Done configuring src/doc/javascript for ${PROJECT_NAME}${ColourReset}\n")