kNCurses/cmake/libvterm.cmake
Christian Burger f1d0c012b7 fixing debug facility in when NDEBUG is set
- changed libvterm.cmake so it is easier to integrate in other projects
2022-04-14 09:31:19 +02:00

26 lines
929 B
CMake

# @author Christian Burger <christian@krikkel.de>
# @brief searches for libvterm and builds it if not found
#
# provides LIBVTERM_LIBRARY and include path
# dependency must be added like this:
# if(EXISTS libvtermProject)
# add_dependencies(<targetDependingOn> libvtermProject)
# endif()
find_library(LIBVTERM_LIBRARY NAMES libvterm.so.0.0.2 vterm)
if(LIBVTERM_LIBRARY STREQUAL "LIBVTERM_LIBRARY-NOTFOUND")
message(STATUS "libvterm not found — building it")
ExternalProject_Add(
libvtermProject
DOWNLOAD_COMMAND URL "https://launchpad.net/ubuntu/+archive/primary/+sourcefiles/libvterm/0.1.2-2/libvterm_0.1.2.orig.tar.gz"
CONFIGURE_COMMAND ""
BUILD_IN_SOURCE true
INSTALL_COMMAND ""
)
ExternalProject_Get_property(libvtermProject SOURCE_DIR)
set(LIBVTERM_LIBRARY "${SOURCE_DIR}/.libs/libvterm.a")
include_directories(SYSTEM "${SOURCE_DIR}/include")
endif()