-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
49 lines (42 loc) · 1.28 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
# SPDX-License-Identifier: GPL-2.0
# Copyright (C) 2023 JiauZhang <https://github.com/JiauZhang/menuconfig>
cmake_minimum_required(VERSION 3.10)
project(menuconfig)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -s")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -s")
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_INSTALL_LIBDIR /usr/lib)
set(CMAKE_INSTALL_BINDIR /usr/bin)
find_package(BISON REQUIRED)
find_package(FLEX REQUIRED)
find_package(Curses REQUIRED)
BISON_TARGET(
PARSER parser.y
${CMAKE_CURRENT_BINARY_DIR}/parser.tab.c
DEFINES_FILE ${CMAKE_CURRENT_BINARY_DIR}/parser.tab.h
)
FLEX_TARGET(LEXER lexer.l ${CMAKE_CURRENT_BINARY_DIR}/lexer.c)
include_directories(
${CMAKE_CURRENT_BINARY_DIR}
${CMAKE_CURRENT_SOURCE_DIR}
${CMAKE_CURRENT_SOURCE_DIR}/lxdialog
)
add_definitions(-DYYDEBUG=1)
add_library(
mconf
SHARED
confdata.c expr.c api.c mnconf-common.c
menu.c preprocess.c symbol.c util.c
lxdialog/checklist.c lxdialog/inputbox.c
lxdialog/menubox.c lxdialog/textbox.c
lxdialog/util.c lxdialog/yesno.c
${BISON_PARSER_OUTPUTS}
${FLEX_LEXER_OUTPUTS}
)
add_executable(menuconfig main.cpp)
target_link_libraries(
menuconfig mconf
${FLEX_LIBRARIES} ${BISON_LIBRARIES} ${CURSES_LIBRARY}
)
install(TARGETS menuconfig mconf)