tools/pas2c/CMakeLists.txt
author koda
Tue, 04 Jun 2013 23:48:44 +0200
branchwebgl
changeset 9133 a269fe7090a0
parent 8044 796f2653f21d
child 9238 84e591af6c29
permissions -rw-r--r--
actually everything is CLANG'd

set(pas2c_sources
        Main.hs
        PascalBasics.hs
        PascalParser.hs
        PascalPreprocessor.hs
        PascalUnitSyntaxTree.hs
        Pas2C.hs
    )

set(pas2c_main ${CMAKE_SOURCE_DIR}/tools/pas2c/Main.hs)

set(ghc_flags
        --make ${pas2c_main}
        -i${CMAKE_SOURCE_DIR}/tools/pas2c/
        -o ${EXECUTABLE_OUTPUT_PATH}/pas2c${CMAKE_EXECUTABLE_SUFFIX}
        -odir ${CMAKE_CURRENT_BINARY_DIR}
        -hidir ${CMAKE_CURRENT_BINARY_DIR}
        ${haskell_flags}
    )

add_custom_command(OUTPUT "${EXECUTABLE_OUTPUT_PATH}/pas2c${CMAKE_EXECUTABLE_SUFFIX}"
        COMMAND "${ghc_executable}"
        ARGS ${ghc_flags}
        MAIN_DEPENDENCY ${hwserv_main}
        DEPENDS ${hwserver_sources}
        )

add_custom_target(pas2c ALL DEPENDS "${EXECUTABLE_OUTPUT_PATH}/pas2c${CMAKE_EXECUTABLE_SUFFIX}")