aboutsummaryrefslogtreecommitdiff
path: root/external/CMakeLists.txt
blob: 3b2edd4d4c5efdbff30fba2be2367778d9e7e14d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
if (${SESSION_RECORDING})
    # Build libtty from the termrec project
    if(NOT EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/termrec/)
        message("Unable to find termrec, running git submodule update --init")
        execute_process(COMMAND git submodule update --init -- termrec WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
    endif()
    if(NOT EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/termrec/configure)
        message("Unable to find configure file for termrec, running autogen.sh")
        execute_process(COMMAND ./autogen.sh WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/termrec)
    endif()
    if(NOT EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/termrec/config.h)
        message("Unable to find config.h file for termrec, running configure script")
        execute_process(COMMAND ./configure WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/termrec)
    endif()
    file(GLOB_RECURSE LIBTTY_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/termrec/libtty/*.c)
    include_directories("${CMAKE_CURRENT_SOURCE_DIR}/termrec/")
    include_directories("${CMAKE_CURRENT_SOURCE_DIR}/termrec/libtty")
    include_directories("${CMAKE_CURRENT_SOURCE_DIR}/termrec/sys")
    ADD_LIBRARY(libtty STATIC ${LIBTTY_SOURCES})
    SET_TARGET_PROPERTIES(libtty PROPERTIES COMPILE_FLAGS "-Wno-all -Wno-error -Wno-extra -Wno-pedantic")
endif()