9238
|
1 |
find_package(GHC REQUIRED)
|
|
2 |
|
7973
|
3 |
set(pas2c_sources
|
7985
|
4 |
Main.hs
|
|
5 |
PascalBasics.hs
|
|
6 |
PascalParser.hs
|
|
7 |
PascalPreprocessor.hs
|
|
8 |
PascalUnitSyntaxTree.hs
|
8044
|
9 |
Pas2C.hs
|
7985
|
10 |
)
|
7973
|
11 |
|
8044
|
12 |
set(pas2c_main ${CMAKE_SOURCE_DIR}/tools/pas2c/Main.hs)
|
7973
|
13 |
|
|
14 |
set(ghc_flags
|
7985
|
15 |
--make ${pas2c_main}
|
8044
|
16 |
-i${CMAKE_SOURCE_DIR}/tools/pas2c/
|
7985
|
17 |
-o ${EXECUTABLE_OUTPUT_PATH}/pas2c${CMAKE_EXECUTABLE_SUFFIX}
|
|
18 |
-odir ${CMAKE_CURRENT_BINARY_DIR}
|
|
19 |
-hidir ${CMAKE_CURRENT_BINARY_DIR}
|
|
20 |
${haskell_flags}
|
|
21 |
)
|
7973
|
22 |
|
|
23 |
add_custom_command(OUTPUT "${EXECUTABLE_OUTPUT_PATH}/pas2c${CMAKE_EXECUTABLE_SUFFIX}"
|
9238
|
24 |
COMMAND "${GHC_EXECUTABLE}"
|
7973
|
25 |
ARGS ${ghc_flags}
|
13863
|
26 |
MAIN_DEPENDENCY ${pas2c_main}
|
|
27 |
DEPENDS ${pas2c_sources}
|
7973
|
28 |
)
|
|
29 |
|
|
30 |
add_custom_target(pas2c ALL DEPENDS "${EXECUTABLE_OUTPUT_PATH}/pas2c${CMAKE_EXECUTABLE_SUFFIX}")
|
|
31 |
|