mirror of
https://github.com/m1ngsama/TUT.git
synced 2025-12-25 02:57:08 +00:00
Update CMake and add Makefile for the new project: - Rename project from NBTCA_TUI to TUT - Update executable name from nbtca_tui to tut - Add all new source files to build - Include Makefile for environments without CMake - Update .gitignore for build artifacts Both CMake and Make build systems are now supported for maximum compatibility.
30 lines
681 B
CMake
30 lines
681 B
CMake
cmake_minimum_required(VERSION 3.15)
|
|
project(TUT LANGUAGES CXX)
|
|
|
|
set(CMAKE_CXX_STANDARD 17)
|
|
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
|
|
|
# 优先使用带宽字符支持的 ncursesw
|
|
set(CURSES_NEED_WIDE TRUE)
|
|
|
|
# macOS: Homebrew ncurses 路径
|
|
if(APPLE)
|
|
set(CMAKE_PREFIX_PATH "/opt/homebrew/opt/ncurses" ${CMAKE_PREFIX_PATH})
|
|
endif()
|
|
|
|
find_package(Curses REQUIRED)
|
|
find_package(CURL REQUIRED)
|
|
|
|
add_executable(tut
|
|
src/main.cpp
|
|
src/http_client.cpp
|
|
src/html_parser.cpp
|
|
src/text_renderer.cpp
|
|
src/input_handler.cpp
|
|
src/browser.cpp
|
|
)
|
|
|
|
target_include_directories(tut PRIVATE ${CURSES_INCLUDE_DIR})
|
|
target_link_libraries(tut PRIVATE ${CURSES_LIBRARIES} CURL::libcurl)
|
|
|
|
|