37 lines
872 B
CMake
37 lines
872 B
CMake
# Minimum required CMake version
|
|
cmake_minimum_required(VERSION 3.10)
|
|
|
|
# Project name and version
|
|
project(Graph VERSION 1.0)
|
|
|
|
# Specify the C standard
|
|
set(CMAKE_C_STANDARD 90)
|
|
set(CMAKE_C_STANDARD_REQUIRED True)
|
|
|
|
# Add the executable target
|
|
add_executable(Graph
|
|
"main.c"
|
|
"lex.c"
|
|
"parser.c"
|
|
"tree.c"
|
|
"ps_graph.c"
|
|
"errors.c"
|
|
"math_functions.c"
|
|
)
|
|
|
|
# Optionally, you can set compiler warnings
|
|
if (MSVC)
|
|
target_compile_options(Graph PRIVATE /W4)
|
|
else()
|
|
target_compile_options(Graph PRIVATE -Wall -Wextra -pedantic)
|
|
target_link_libraries(Graph PRIVATE m)
|
|
endif()
|
|
|
|
target_compile_definitions(Graph PRIVATE ENABLE_GRAPHVIZ_EXPORT)
|
|
|
|
# link math
|
|
|
|
# Optionally, set the output directory for the executable
|
|
# set_target_properties(Graph PROPERTIES
|
|
# RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin"
|
|
# ) |