This commit is contained in:
LiuYuanchi 2024-05-10 22:23:25 +08:00
parent 2b373378cb
commit aa7f674b96
7 changed files with 6 additions and 15 deletions

View File

@ -2,19 +2,14 @@ cmake_minimum_required(VERSION 3.10)
project(nfa) project(nfa)
# 收集所有的cpp源文件 # 收集所有的cpp源文件
file(GLOB SOURCES dfa.cpp nfa.cpp tool.cpp test_main.cpp) file(GLOB SOURCES "src/*.cpp")
# 设置输出目录为 bin
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR})
# 创建静态链接库 # 创建静态链接库
add_library(nfa STATIC ${SOURCES}) add_library(nfa STATIC ${SOURCES})
# Test:添加可执行文件并链接目标库
add_executable(test_nfa test/test_main.cpp)
target_link_libraries(test_nfa nfa)
# 添加头文件目录 # 添加头文件目录
target_include_directories(nfa PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}) target_include_directories(nfa PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/include)
# 添加可执行文件
add_executable(test_nfa test_main.cpp nfa)
# 链接目标库
target_link_libraries(test_nfa nfa)

BIN
nfa/archive/nfa.zip Normal file

Binary file not shown.

View File

@ -1,8 +1,4 @@
// 将正则表达式转换为非确定性有限自动机 // 将正则表达式转换为非确定性有限自动机
#include "nfa.h" #include "nfa.h"