cmake_minimum_required(VERSION 3.0) # 项目名称和版本信息 project(Emacs VERSION 28.0.50) # 源文件目录 set(SOURCE_DIR src) # 头文件目录 include_directories(${CMAKE_CURRENT_SOURCE_DIR}/include) # 链接库 find_package(ncurses REQUIRED) find_package(gtk2 REQUIRED) find_package(GSL REQUIRED) find_package(GDBM REQUIRED) find_package(Libotf REQUIRED) find_package(HARFBUZZ REQUIRED) find_package(LIBXML2 REQUIRED) find_package(ZLIB REQUIRED) find_package(PNG REQUIRED) find_package(JPEG REQUIRED) find_package(TIFF REQUIRED) find_package(GIFLIB REQUIRED) find_package(RSVG REQUIRED) find_package(CAIRO REQUIRED) find_package(PANGO REQUIRED) find_package(PIXMAN REQUIRED) find_package(GDB REQUIRED) # 添加源文件 file(GLOB SOURCES ${SOURCE_DIR}/*.c) add_executable(emacs ${SOURCES}) # 链接库 target_link_libraries(emacs NCURSES GTK2 GSL GDBM LIBOTF HARFBUZZ LIBXML2 ZLIB PNG JPEG TIFF GIFLIB RSVG CAIRO PANGO PIXMAN GDB) # 安装目标 install(TARGETS emacs DESTINATION bin)