annotate maintainers_add_rathaxes_cmake_library.patch @ 0:973e7bc6d13c

Add some patches to use and test rathaxes with CMake
author Louis Opter <louis@lse.epitech.net>
date Sun, 01 Jan 2012 15:31:17 +0100
parents
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
973e7bc6d13c Add some patches to use and test rathaxes with CMake
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
1 # HG changeset patch
973e7bc6d13c Add some patches to use and test rathaxes with CMake
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
2 # Parent 237e60d20f4fd8063a48ff47cf37a8072f55478c
973e7bc6d13c Add some patches to use and test rathaxes with CMake
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
3 maintainers: add a new CMake "library" UseRathaxes.cmake to add a minimal Rathaxes support into CMake
973e7bc6d13c Add some patches to use and test rathaxes with CMake
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
4
973e7bc6d13c Add some patches to use and test rathaxes with CMake
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
5 - Add the new ADD_RATHAXES_EXECUTABLE function to build a .rtx target;
973e7bc6d13c Add some patches to use and test rathaxes with CMake
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
6 - No more generated files in the source directory;
973e7bc6d13c Add some patches to use and test rathaxes with CMake
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
7 - No more tedious generate shell script to write;
973e7bc6d13c Add some patches to use and test rathaxes with CMake
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
8 - ADD_RATHAXES_TEST is renamed to ADD_RATHAXES_CWS_TEST.
973e7bc6d13c Add some patches to use and test rathaxes with CMake
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
9
973e7bc6d13c Add some patches to use and test rathaxes with CMake
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
10
973e7bc6d13c Add some patches to use and test rathaxes with CMake
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
11 diff --git a/CMakeLists.txt b/CMakeLists.txt
973e7bc6d13c Add some patches to use and test rathaxes with CMake
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
12 --- a/CMakeLists.txt
973e7bc6d13c Add some patches to use and test rathaxes with CMake
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
13 +++ b/CMakeLists.txt
973e7bc6d13c Add some patches to use and test rathaxes with CMake
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
14 @@ -33,7 +33,7 @@
973e7bc6d13c Add some patches to use and test rathaxes with CMake
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
15 INCLUDE(AddFileDependencies)
973e7bc6d13c Add some patches to use and test rathaxes with CMake
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
16 INCLUDE(FileCopy)
973e7bc6d13c Add some patches to use and test rathaxes with CMake
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
17 INCLUDE(RathaxesCopyLatexClasses)
973e7bc6d13c Add some patches to use and test rathaxes with CMake
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
18 -INCLUDE(AddRathaxesTest)
973e7bc6d13c Add some patches to use and test rathaxes with CMake
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
19 +INCLUDE(UseRathaxes)
973e7bc6d13c Add some patches to use and test rathaxes with CMake
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
20
973e7bc6d13c Add some patches to use and test rathaxes with CMake
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
21 # Global definitions ###########################################################
973e7bc6d13c Add some patches to use and test rathaxes with CMake
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
22
973e7bc6d13c Add some patches to use and test rathaxes with CMake
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
23 diff --git a/maintainers/CMakeScripts/AddRathaxesTest.cmake b/maintainers/CMakeScripts/AddRathaxesTest.cmake
973e7bc6d13c Add some patches to use and test rathaxes with CMake
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
24 deleted file mode 100644
973e7bc6d13c Add some patches to use and test rathaxes with CMake
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
25 --- a/maintainers/CMakeScripts/AddRathaxesTest.cmake
973e7bc6d13c Add some patches to use and test rathaxes with CMake
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
26 +++ /dev/null
973e7bc6d13c Add some patches to use and test rathaxes with CMake
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
27 @@ -1,8 +0,0 @@
973e7bc6d13c Add some patches to use and test rathaxes with CMake
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
28 -# This function call codeworker + cnorm with the given codeworker script.
973e7bc6d13c Add some patches to use and test rathaxes with CMake
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
29 -#
973e7bc6d13c Add some patches to use and test rathaxes with CMake
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
30 -# The codeworker script must return 0 on success.
973e7bc6d13c Add some patches to use and test rathaxes with CMake
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
31 -
973e7bc6d13c Add some patches to use and test rathaxes with CMake
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
32 -FUNCTION(ADD_RATHAXES_TEST CW_SCRIPT)
973e7bc6d13c Add some patches to use and test rathaxes with CMake
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
33 - STRING(REGEX MATCH "(.*)\\.cws$" TEST_NAME "${CW_SCRIPT}")
973e7bc6d13c Add some patches to use and test rathaxes with CMake
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
34 - ADD_TEST("Rathaxes_${TEST_NAME}" ${CODEWORKER_BINARY_PATH} "-I" "${RATHAXES_SOURCE_DIR}/maintainers/cnorm/src" "-I" "${RATHAXES_SOURCE_DIR}/rathaxes/compiler/" "-script" "${CMAKE_CURRENT_SOURCE_DIR}/${CW_SCRIPT}" "-args" "${RATHAXES_SOURCE_DIR}/rathaxes")
973e7bc6d13c Add some patches to use and test rathaxes with CMake
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
35 -ENDFUNCTION(ADD_RATHAXES_TEST CW_SCRIPT)
973e7bc6d13c Add some patches to use and test rathaxes with CMake
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
36 diff --git a/maintainers/CMakeScripts/UseRathaxes.cmake b/maintainers/CMakeScripts/UseRathaxes.cmake
973e7bc6d13c Add some patches to use and test rathaxes with CMake
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
37 new file mode 100644
973e7bc6d13c Add some patches to use and test rathaxes with CMake
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
38 --- /dev/null
973e7bc6d13c Add some patches to use and test rathaxes with CMake
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
39 +++ b/maintainers/CMakeScripts/UseRathaxes.cmake
973e7bc6d13c Add some patches to use and test rathaxes with CMake
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
40 @@ -0,0 +1,119 @@
973e7bc6d13c Add some patches to use and test rathaxes with CMake
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
41 +FUNCTION(_RTX_PARSE_OPTIONS ARGS RTI_OUT BLT_OUT SYSTEM_OUT)
973e7bc6d13c Add some patches to use and test rathaxes with CMake
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
42 + SET(OPTIONS "RTI" "BLT" "SYSTEM")
973e7bc6d13c Add some patches to use and test rathaxes with CMake
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
43 + SET(FILE_LISTS ${RTI_OUT} ${BLT_OUT} ${SYSTEM_OUT})
973e7bc6d13c Add some patches to use and test rathaxes with CMake
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
44 +
973e7bc6d13c Add some patches to use and test rathaxes with CMake
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
45 + FOREACH(I ${ARGS})
973e7bc6d13c Add some patches to use and test rathaxes with CMake
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
46 + LIST(FIND OPTIONS "${I}" OPTION_IDX)
973e7bc6d13c Add some patches to use and test rathaxes with CMake
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
47 + IF (NOT ${OPTION_IDX} EQUAL -1)
973e7bc6d13c Add some patches to use and test rathaxes with CMake
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
48 + LIST(GET FILE_LISTS ${OPTION_IDX} CURRENT_FILE_LIST)
973e7bc6d13c Add some patches to use and test rathaxes with CMake
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
49 + ELSE (NOT ${OPTION_IDX} EQUAL -1)
973e7bc6d13c Add some patches to use and test rathaxes with CMake
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
50 + IF (DEFINED CURRENT_FILE_LIST)
973e7bc6d13c Add some patches to use and test rathaxes with CMake
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
51 + LIST(APPEND ${CURRENT_FILE_LIST} "${I}")
973e7bc6d13c Add some patches to use and test rathaxes with CMake
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
52 + ELSE (DEFINED CURRENT_FILE_LIST)
973e7bc6d13c Add some patches to use and test rathaxes with CMake
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
53 + MESSAGE(SEND_ERROR "Unexpected argument: ${I}")
973e7bc6d13c Add some patches to use and test rathaxes with CMake
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
54 + ENDIF (DEFINED CURRENT_FILE_LIST)
973e7bc6d13c Add some patches to use and test rathaxes with CMake
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
55 + ENDIF (NOT ${OPTION_IDX} EQUAL -1)
973e7bc6d13c Add some patches to use and test rathaxes with CMake
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
56 + ENDFOREACH(I ${ARGS})
973e7bc6d13c Add some patches to use and test rathaxes with CMake
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
57 +
973e7bc6d13c Add some patches to use and test rathaxes with CMake
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
58 + IF (NOT DEFINED ${SYSTEM_OUT})
973e7bc6d13c Add some patches to use and test rathaxes with CMake
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
59 + SET(${SYSTEM_OUT} ${CMAKE_SYSTEM_NAME})
973e7bc6d13c Add some patches to use and test rathaxes with CMake
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
60 + ENDIF (NOT DEFINED ${SYSTEM_OUT})
973e7bc6d13c Add some patches to use and test rathaxes with CMake
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
61 +
973e7bc6d13c Add some patches to use and test rathaxes with CMake
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
62 + # It's a "return value" variable so we have to "export" it with
973e7bc6d13c Add some patches to use and test rathaxes with CMake
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
63 + # PARENT_SCOPE, otherwise it will stay local to the function.
973e7bc6d13c Add some patches to use and test rathaxes with CMake
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
64 + #
973e7bc6d13c Add some patches to use and test rathaxes with CMake
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
65 + # {RTI,BLT,SYSTEM}_OUT point to a variable name hence the double
973e7bc6d13c Add some patches to use and test rathaxes with CMake
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
66 + # expand to get the value.
973e7bc6d13c Add some patches to use and test rathaxes with CMake
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
67 + SET(${RTI_OUT} ${${RTI_OUT}} PARENT_SCOPE)
973e7bc6d13c Add some patches to use and test rathaxes with CMake
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
68 + SET(${BLT_OUT} ${${BLT_OUT}} PARENT_SCOPE)
973e7bc6d13c Add some patches to use and test rathaxes with CMake
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
69 + SET(${SYSTEM_OUT} ${${SYSTEM_OUT}} PARENT_SCOPE)
973e7bc6d13c Add some patches to use and test rathaxes with CMake
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
70 +ENDFUNCTION(_RTX_PARSE_OPTIONS ARGS RTI_OUT BLT_OUT)
973e7bc6d13c Add some patches to use and test rathaxes with CMake
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
71 +
973e7bc6d13c Add some patches to use and test rathaxes with CMake
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
72 +FUNCTION(_RTX_GENERATE_BUILD_COMMANDS REGISTER_COMMANDS_OUT RTI_FILES BLT_FILES GENERATE_COMMANDS_OUT SYSTEMS)
973e7bc6d13c Add some patches to use and test rathaxes with CMake
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
73 + FOREACH(RTI ${RTI_FILES})
973e7bc6d13c Add some patches to use and test rathaxes with CMake
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
74 + LIST(APPEND ${REGISTER_COMMANDS_OUT}
973e7bc6d13c Add some patches to use and test rathaxes with CMake
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
75 + "COMMAND" ${_RTX_CODEWORKER_COMMAND}
973e7bc6d13c Add some patches to use and test rathaxes with CMake
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
76 + "rti-register" "${CMAKE_CURRENT_SOURCE_DIR}/${RTI}")
973e7bc6d13c Add some patches to use and test rathaxes with CMake
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
77 + ENDFOREACH(RTI ${RTI_FILES})
973e7bc6d13c Add some patches to use and test rathaxes with CMake
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
78 +
973e7bc6d13c Add some patches to use and test rathaxes with CMake
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
79 + FOREACH(BLT ${BLT_FILES})
973e7bc6d13c Add some patches to use and test rathaxes with CMake
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
80 + LIST(APPEND ${REGISTER_COMMANDS_OUT}
973e7bc6d13c Add some patches to use and test rathaxes with CMake
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
81 + "COMMAND" ${_RTX_CODEWORKER_COMMAND}
973e7bc6d13c Add some patches to use and test rathaxes with CMake
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
82 + "blt-register" "${CMAKE_CURRENT_SOURCE_DIR}/${BLT}")
973e7bc6d13c Add some patches to use and test rathaxes with CMake
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
83 + ENDFOREACH(BLT ${BLT_FILES})
973e7bc6d13c Add some patches to use and test rathaxes with CMake
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
84 +
973e7bc6d13c Add some patches to use and test rathaxes with CMake
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
85 + FOREACH(OS ${SYSTEMS})
973e7bc6d13c Add some patches to use and test rathaxes with CMake
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
86 + LIST(APPEND ${GENERATE_COMMANDS_OUT}
973e7bc6d13c Add some patches to use and test rathaxes with CMake
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
87 + COMMAND ${_RTX_CODEWORKER_COMMAND}
973e7bc6d13c Add some patches to use and test rathaxes with CMake
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
88 + "generate" "${OS}"
973e7bc6d13c Add some patches to use and test rathaxes with CMake
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
89 + "${CMAKE_CURRENT_SOURCE_DIR}/${RTX_FILE}")
973e7bc6d13c Add some patches to use and test rathaxes with CMake
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
90 + ENDFOREACH(OS ${SYSTEMS})
973e7bc6d13c Add some patches to use and test rathaxes with CMake
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
91 +
973e7bc6d13c Add some patches to use and test rathaxes with CMake
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
92 + SET(${REGISTER_COMMANDS_OUT} ${${REGISTER_COMMANDS_OUT}} PARENT_SCOPE)
973e7bc6d13c Add some patches to use and test rathaxes with CMake
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
93 + SET(${GENERATE_COMMANDS_OUT} ${${GENERATE_COMMANDS_OUT}} PARENT_SCOPE)
973e7bc6d13c Add some patches to use and test rathaxes with CMake
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
94 +ENDFUNCTION(_RTX_GENERATE_BUILD_COMMANDS REGISTER_COMMANDS_OUT RTI_FILES BLT_FILES GENERATE_COMMANDS_OUT SYSTEMS)
973e7bc6d13c Add some patches to use and test rathaxes with CMake
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
95 +
973e7bc6d13c Add some patches to use and test rathaxes with CMake
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
96 +# This function will build a Rathaxes target. Usage:
973e7bc6d13c Add some patches to use and test rathaxes with CMake
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
97 +#
973e7bc6d13c Add some patches to use and test rathaxes with CMake
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
98 +# ADD_RATHAXES_EXECUTABLE(hello.rtx
973e7bc6d13c Add some patches to use and test rathaxes with CMake
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
99 +# [RTI hello.rti [file.rti]]
973e7bc6d13c Add some patches to use and test rathaxes with CMake
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
100 +# [BLT hello.blt [file.blt]]
973e7bc6d13c Add some patches to use and test rathaxes with CMake
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
101 +# [SYSTEM windows [linux]])
973e7bc6d13c Add some patches to use and test rathaxes with CMake
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
102 +#
973e7bc6d13c Add some patches to use and test rathaxes with CMake
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
103 +# Files are built in the same order as they are listed, except for the rtx file
973e7bc6d13c Add some patches to use and test rathaxes with CMake
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
104 +# which is built last.
973e7bc6d13c Add some patches to use and test rathaxes with CMake
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
105 +#
973e7bc6d13c Add some patches to use and test rathaxes with CMake
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
106 +# If no system are specified with SYSTEM then the source will be generated for
973e7bc6d13c Add some patches to use and test rathaxes with CMake
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
107 +# the current system (as in CMAKE_SYSTEM_NAME).
973e7bc6d13c Add some patches to use and test rathaxes with CMake
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
108 +#
973e7bc6d13c Add some patches to use and test rathaxes with CMake
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
109 +# At some point we will certainly have our own language definition for CMake
973e7bc6d13c Add some patches to use and test rathaxes with CMake
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
110 +# but let's start with simpler things.
973e7bc6d13c Add some patches to use and test rathaxes with CMake
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
111 +FUNCTION(ADD_RATHAXES_EXECUTABLE OUT_NAME RTX_FILE)
973e7bc6d13c Add some patches to use and test rathaxes with CMake
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
112 + SET(_RTX_CODEWORKER_COMMAND
973e7bc6d13c Add some patches to use and test rathaxes with CMake
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
113 + ${CODEWORKER_BINARY_PATH} "-nologo"
973e7bc6d13c Add some patches to use and test rathaxes with CMake
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
114 + "-I" "${RATHAXES_SOURCE_DIR}/maintainers/cnorm/src"
973e7bc6d13c Add some patches to use and test rathaxes with CMake
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
115 + "-I" "${RATHAXES_SOURCE_DIR}/rathaxes/compiler/"
973e7bc6d13c Add some patches to use and test rathaxes with CMake
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
116 + "-script" "${CMAKE_SOURCE_DIR}/rathaxes/compiler/rathaxes.cws"
973e7bc6d13c Add some patches to use and test rathaxes with CMake
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
117 + "-args" "${CMAKE_SOURCE_DIR}/rathaxes/" "${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/RathaxesCache/")
973e7bc6d13c Add some patches to use and test rathaxes with CMake
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
118 +
973e7bc6d13c Add some patches to use and test rathaxes with CMake
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
119 + LIST(REMOVE_ITEM ARGV ${OUT_NAME} ${RTX_FILE})
973e7bc6d13c Add some patches to use and test rathaxes with CMake
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
120 +
973e7bc6d13c Add some patches to use and test rathaxes with CMake
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
121 + # We have to expand ARGV inside quotes, so it expand as a single LIST
973e7bc6d13c Add some patches to use and test rathaxes with CMake
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
122 + # argument (otherwise it would expand as different arguments).
973e7bc6d13c Add some patches to use and test rathaxes with CMake
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
123 + _RTX_PARSE_OPTIONS("${ARGV}" RTI_FILES BLT_FILES SYSTEMS)
973e7bc6d13c Add some patches to use and test rathaxes with CMake
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
124 +
973e7bc6d13c Add some patches to use and test rathaxes with CMake
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
125 + _RTX_GENERATE_BUILD_COMMANDS(REGISTER_COMMANDS
973e7bc6d13c Add some patches to use and test rathaxes with CMake
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
126 + "${RTI_FILES}"
973e7bc6d13c Add some patches to use and test rathaxes with CMake
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
127 + "${BLT_FILES}"
973e7bc6d13c Add some patches to use and test rathaxes with CMake
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
128 + GENERATE_COMMANDS
973e7bc6d13c Add some patches to use and test rathaxes with CMake
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
129 + "${SYSTEMS}")
973e7bc6d13c Add some patches to use and test rathaxes with CMake
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
130 +
973e7bc6d13c Add some patches to use and test rathaxes with CMake
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
131 + # As soon as we start to write the generation result to files this should
973e7bc6d13c Add some patches to use and test rathaxes with CMake
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
132 + # be translated to an ADD_CUSTOM_COMMAND:
973e7bc6d13c Add some patches to use and test rathaxes with CMake
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
133 + ADD_CUSTOM_TARGET(${OUT_NAME}
973e7bc6d13c Add some patches to use and test rathaxes with CMake
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
134 + ${_RTX_CODEWORKER_COMMAND} "cache" "clear"
973e7bc6d13c Add some patches to use and test rathaxes with CMake
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
135 + ${REGISTER_COMMANDS}
973e7bc6d13c Add some patches to use and test rathaxes with CMake
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
136 + COMMENT "Registering .rti and .blt for the Rathaxes target ${OUT_NAME}"
973e7bc6d13c Add some patches to use and test rathaxes with CMake
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
137 + VERBATIM
973e7bc6d13c Add some patches to use and test rathaxes with CMake
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
138 + SOURCES ${RTX_FILE} ${RTI_FILES} ${BLT_FILES})
973e7bc6d13c Add some patches to use and test rathaxes with CMake
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
139 +
973e7bc6d13c Add some patches to use and test rathaxes with CMake
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
140 + STRING(REPLACE ";" ", " SYSTEMS "${SYSTEMS}")
973e7bc6d13c Add some patches to use and test rathaxes with CMake
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
141 + ADD_CUSTOM_COMMAND(TARGET ${OUT_NAME} POST_BUILD
973e7bc6d13c Add some patches to use and test rathaxes with CMake
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
142 + ${GENERATE_COMMANDS}
973e7bc6d13c Add some patches to use and test rathaxes with CMake
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
143 + COMMENT "Building Rathaxes target ${OUT_NAME} for ${SYSTEMS}"
973e7bc6d13c Add some patches to use and test rathaxes with CMake
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
144 + VERBATIM)
973e7bc6d13c Add some patches to use and test rathaxes with CMake
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
145 +ENDFUNCTION(ADD_RATHAXES_EXECUTABLE OUT_NAME RTX_FILE)
973e7bc6d13c Add some patches to use and test rathaxes with CMake
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
146 +
973e7bc6d13c Add some patches to use and test rathaxes with CMake
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
147 +# This function call codeworker + cnorm with the given codeworker script. The
973e7bc6d13c Add some patches to use and test rathaxes with CMake
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
148 +# path to the rathaxes source directory is given as the first argument (arg[0]).
973e7bc6d13c Add some patches to use and test rathaxes with CMake
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
149 +#
973e7bc6d13c Add some patches to use and test rathaxes with CMake
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
150 +# The codeworker script must return 0 on success.
973e7bc6d13c Add some patches to use and test rathaxes with CMake
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
151 +FUNCTION(ADD_RATHAXES_CWS_TEST CW_SCRIPT)
973e7bc6d13c Add some patches to use and test rathaxes with CMake
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
152 + STRING(REGEX MATCH "(.*)\\.cws$" TEST_NAME "${CW_SCRIPT}")
973e7bc6d13c Add some patches to use and test rathaxes with CMake
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
153 + ADD_TEST("Rathaxes_${TEST_NAME}"
973e7bc6d13c Add some patches to use and test rathaxes with CMake
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
154 + ${CODEWORKER_BINARY_PATH}
973e7bc6d13c Add some patches to use and test rathaxes with CMake
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
155 + "-I" "${RATHAXES_SOURCE_DIR}/maintainers/cnorm/src"
973e7bc6d13c Add some patches to use and test rathaxes with CMake
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
156 + "-I" "${RATHAXES_SOURCE_DIR}/rathaxes/compiler/"
973e7bc6d13c Add some patches to use and test rathaxes with CMake
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
157 + "-script" "${CMAKE_CURRENT_SOURCE_DIR}/${CW_SCRIPT}"
973e7bc6d13c Add some patches to use and test rathaxes with CMake
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
158 + "-args" "${RATHAXES_SOURCE_DIR}/rathaxes")
973e7bc6d13c Add some patches to use and test rathaxes with CMake
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
159 +ENDFUNCTION(ADD_RATHAXES_CWS_TEST CW_SCRIPT)
973e7bc6d13c Add some patches to use and test rathaxes with CMake
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
160 diff --git a/rathaxes/compiler/tests/CMakeLists.txt b/rathaxes/compiler/tests/CMakeLists.txt
973e7bc6d13c Add some patches to use and test rathaxes with CMake
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
161 --- a/rathaxes/compiler/tests/CMakeLists.txt
973e7bc6d13c Add some patches to use and test rathaxes with CMake
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
162 +++ b/rathaxes/compiler/tests/CMakeLists.txt
973e7bc6d13c Add some patches to use and test rathaxes with CMake
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
163 @@ -1,39 +1,39 @@
973e7bc6d13c Add some patches to use and test rathaxes with CMake
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
164 # Pure backend compilation and resolution tests
973e7bc6d13c Add some patches to use and test rathaxes with CMake
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
165 -ADD_RATHAXES_TEST(01_A_test_back_parse.cws)
973e7bc6d13c Add some patches to use and test rathaxes with CMake
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
166 -ADD_RATHAXES_TEST(01_B_test_back_compile.cws)
973e7bc6d13c Add some patches to use and test rathaxes with CMake
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
167 -ADD_RATHAXES_TEST(01_C_test_back_meta.cws)
973e7bc6d13c Add some patches to use and test rathaxes with CMake
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
168 -ADD_RATHAXES_TEST(01_D_test_back_type_hash.cws)
973e7bc6d13c Add some patches to use and test rathaxes with CMake
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
169 -ADD_RATHAXES_TEST(01_E_test_back_introspect.cws)
973e7bc6d13c Add some patches to use and test rathaxes with CMake
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
170 -ADD_RATHAXES_TEST(01_F_test_back_gen.cws)
973e7bc6d13c Add some patches to use and test rathaxes with CMake
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
171 -ADD_RATHAXES_TEST(01_G_test_back_registerToCache.cws)
973e7bc6d13c Add some patches to use and test rathaxes with CMake
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
172 -ADD_RATHAXES_TEST(01_H_test_back_loadFromCache.cws)
973e7bc6d13c Add some patches to use and test rathaxes with CMake
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
173 -ADD_RATHAXES_TEST(01_I_test_back_resolveCall.cws)
973e7bc6d13c Add some patches to use and test rathaxes with CMake
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
174 -ADD_RATHAXES_TEST(01_J_test_back_resolvePointcut.cws)
973e7bc6d13c Add some patches to use and test rathaxes with CMake
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
175 -ADD_RATHAXES_TEST(01_K_test_back_resolvePointcutDefault.cws)
973e7bc6d13c Add some patches to use and test rathaxes with CMake
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
176 -ADD_RATHAXES_TEST(01_L_test_back_resolveTypeMapping.cws)
973e7bc6d13c Add some patches to use and test rathaxes with CMake
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
177 -ADD_RATHAXES_TEST(01_M_test_back_resolveTypeChunkCall.cws)
973e7bc6d13c Add some patches to use and test rathaxes with CMake
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
178 -ADD_RATHAXES_TEST(01_N_test_back_resolveSequenceCall.cws)
973e7bc6d13c Add some patches to use and test rathaxes with CMake
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
179 +ADD_RATHAXES_CWS_TEST(01_A_test_back_parse.cws)
973e7bc6d13c Add some patches to use and test rathaxes with CMake
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
180 +ADD_RATHAXES_CWS_TEST(01_B_test_back_compile.cws)
973e7bc6d13c Add some patches to use and test rathaxes with CMake
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
181 +ADD_RATHAXES_CWS_TEST(01_C_test_back_meta.cws)
973e7bc6d13c Add some patches to use and test rathaxes with CMake
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
182 +ADD_RATHAXES_CWS_TEST(01_D_test_back_type_hash.cws)
973e7bc6d13c Add some patches to use and test rathaxes with CMake
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
183 +ADD_RATHAXES_CWS_TEST(01_E_test_back_introspect.cws)
973e7bc6d13c Add some patches to use and test rathaxes with CMake
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
184 +ADD_RATHAXES_CWS_TEST(01_F_test_back_gen.cws)
973e7bc6d13c Add some patches to use and test rathaxes with CMake
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
185 +ADD_RATHAXES_CWS_TEST(01_G_test_back_registerToCache.cws)
973e7bc6d13c Add some patches to use and test rathaxes with CMake
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
186 +ADD_RATHAXES_CWS_TEST(01_H_test_back_loadFromCache.cws)
973e7bc6d13c Add some patches to use and test rathaxes with CMake
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
187 +ADD_RATHAXES_CWS_TEST(01_I_test_back_resolveCall.cws)
973e7bc6d13c Add some patches to use and test rathaxes with CMake
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
188 +ADD_RATHAXES_CWS_TEST(01_J_test_back_resolvePointcut.cws)
973e7bc6d13c Add some patches to use and test rathaxes with CMake
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
189 +ADD_RATHAXES_CWS_TEST(01_K_test_back_resolvePointcutDefault.cws)
973e7bc6d13c Add some patches to use and test rathaxes with CMake
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
190 +ADD_RATHAXES_CWS_TEST(01_L_test_back_resolveTypeMapping.cws)
973e7bc6d13c Add some patches to use and test rathaxes with CMake
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
191 +ADD_RATHAXES_CWS_TEST(01_M_test_back_resolveTypeChunkCall.cws)
973e7bc6d13c Add some patches to use and test rathaxes with CMake
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
192 +ADD_RATHAXES_CWS_TEST(01_N_test_back_resolveSequenceCall.cws)
973e7bc6d13c Add some patches to use and test rathaxes with CMake
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
193
973e7bc6d13c Add some patches to use and test rathaxes with CMake
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
194 # Pure middle-end validation tests
973e7bc6d13c Add some patches to use and test rathaxes with CMake
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
195 -ADD_RATHAXES_TEST(02_A_test_middle_parse.cws)
973e7bc6d13c Add some patches to use and test rathaxes with CMake
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
196 -ADD_RATHAXES_TEST(02_B_test_middle_parse_rti_file.cws)
973e7bc6d13c Add some patches to use and test rathaxes with CMake
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
197 -ADD_RATHAXES_TEST(02_C_test_middle_check_inheritance.cws)
973e7bc6d13c Add some patches to use and test rathaxes with CMake
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
198 -ADD_RATHAXES_TEST(02_D_test_middle_check_types_declaration.cws)
973e7bc6d13c Add some patches to use and test rathaxes with CMake
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
199 +ADD_RATHAXES_CWS_TEST(02_A_test_middle_parse.cws)
973e7bc6d13c Add some patches to use and test rathaxes with CMake
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
200 +ADD_RATHAXES_CWS_TEST(02_B_test_middle_parse_rti_file.cws)
973e7bc6d13c Add some patches to use and test rathaxes with CMake
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
201 +ADD_RATHAXES_CWS_TEST(02_C_test_middle_check_inheritance.cws)
973e7bc6d13c Add some patches to use and test rathaxes with CMake
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
202 +ADD_RATHAXES_CWS_TEST(02_D_test_middle_check_types_declaration.cws)
973e7bc6d13c Add some patches to use and test rathaxes with CMake
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
203
973e7bc6d13c Add some patches to use and test rathaxes with CMake
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
204 # Required for test 2_B
973e7bc6d13c Add some patches to use and test rathaxes with CMake
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
205 FILE_COPY(full_lkm/simplified_lkm.rti full_lkm/simplified_lkm.rti)
973e7bc6d13c Add some patches to use and test rathaxes with CMake
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
206
973e7bc6d13c Add some patches to use and test rathaxes with CMake
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
207 # Tests for configuration matching (against with blocks)
973e7bc6d13c Add some patches to use and test rathaxes with CMake
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
208 -ADD_RATHAXES_TEST(03_A_test_config_match_lesser.cws)
973e7bc6d13c Add some patches to use and test rathaxes with CMake
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
209 -ADD_RATHAXES_TEST(03_B_test_config_match_lesser_or_equal.cws)
973e7bc6d13c Add some patches to use and test rathaxes with CMake
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
210 -ADD_RATHAXES_TEST(03_C_test_config_match_equal.cws)
973e7bc6d13c Add some patches to use and test rathaxes with CMake
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
211 -ADD_RATHAXES_TEST(03_D_test_config_match_greater_or_equal.cws)
973e7bc6d13c Add some patches to use and test rathaxes with CMake
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
212 -ADD_RATHAXES_TEST(03_E_test_config_match_greater.cws)
973e7bc6d13c Add some patches to use and test rathaxes with CMake
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
213 -ADD_RATHAXES_TEST(03_F_test_config_match.cws)
973e7bc6d13c Add some patches to use and test rathaxes with CMake
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
214 +ADD_RATHAXES_CWS_TEST(03_A_test_config_match_lesser.cws)
973e7bc6d13c Add some patches to use and test rathaxes with CMake
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
215 +ADD_RATHAXES_CWS_TEST(03_B_test_config_match_lesser_or_equal.cws)
973e7bc6d13c Add some patches to use and test rathaxes with CMake
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
216 +ADD_RATHAXES_CWS_TEST(03_C_test_config_match_equal.cws)
973e7bc6d13c Add some patches to use and test rathaxes with CMake
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
217 +ADD_RATHAXES_CWS_TEST(03_D_test_config_match_greater_or_equal.cws)
973e7bc6d13c Add some patches to use and test rathaxes with CMake
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
218 +ADD_RATHAXES_CWS_TEST(03_E_test_config_match_greater.cws)
973e7bc6d13c Add some patches to use and test rathaxes with CMake
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
219 +ADD_RATHAXES_CWS_TEST(03_F_test_config_match.cws)
973e7bc6d13c Add some patches to use and test rathaxes with CMake
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
220
973e7bc6d13c Add some patches to use and test rathaxes with CMake
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
221 # Tests for the Front-end
973e7bc6d13c Add some patches to use and test rathaxes with CMake
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
222 -ADD_RATHAXES_TEST(04_A_test_front_parse.cws)
973e7bc6d13c Add some patches to use and test rathaxes with CMake
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
223 +ADD_RATHAXES_CWS_TEST(04_A_test_front_parse.cws)
973e7bc6d13c Add some patches to use and test rathaxes with CMake
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
224
973e7bc6d13c Add some patches to use and test rathaxes with CMake
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
225 # Tests for Link module
973e7bc6d13c Add some patches to use and test rathaxes with CMake
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
226 -ADD_RATHAXES_TEST(05_A_test_link_merge.cws)
973e7bc6d13c Add some patches to use and test rathaxes with CMake
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
227 -ADD_RATHAXES_TEST(05_B_test_link_merge_conflict.cws)
973e7bc6d13c Add some patches to use and test rathaxes with CMake
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
228 +ADD_RATHAXES_CWS_TEST(05_A_test_link_merge.cws)
973e7bc6d13c Add some patches to use and test rathaxes with CMake
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
229 +ADD_RATHAXES_CWS_TEST(05_B_test_link_merge_conflict.cws)