roflcat/CMakeLists.txt
2020-04-09 15:20:39 -07:00

26 lines
810 B
CMake

project(roflcat)
cmake_minimum_required(VERSION 3.1)
include(CMakeDependentOption)
include(GNUInstallDirs)
#c++17 without compiler extensions
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
find_package(Curses REQUIRED)
find_library(TINFO_LIBRARY tinfo)
if(NOT TINFO_LIBRARY)
set(TINFO_LIBRARY "")
endif()
set(INCLUDE_PATH ${CMAKE_SOURCE_DIR}/include)
add_executable (roflcat src/roflcat.cpp src/cmd.cpp)
target_include_directories(roflcat PUBLIC ${INCLUDE_PATH})
target_include_directories(roflcat PUBLIC ${CURSES_INCLUDE_DIRS} ${TINFO_INCLUDE_DIRS})
target_link_libraries(roflcat PRIVATE ${CURSES_LIBRARIES} ${TINFO_LIBRARY})
install(TARGETS roflcat RUNTIME DESTINATION bin)
#uninstall target
add_custom_target(uninstall cat install_manifest.txt | xargs rm)