CMakeLists.txt 714 Bytes
Newer Older
Jaime Arias's avatar
Jaime Arias committed
1
2
3
# set minimum cmake version
cmake_minimum_required(VERSION 3.5 FATAL_ERROR)

4
# compilator flags
Jaime Arias's avatar
Jaime Arias committed
5
project(pn-parser-src LANGUAGES CXX)
6
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O3 -Wall")
Jaime Arias's avatar
Jaime Arias committed
7
8
9
10
11

# dependencies
find_package(BISON REQUIRED)
find_package(FLEX REQUIRED)

12
13
14
15
16
17
18
19
20
21
22
23
# execute bison
BISON_TARGET(
  RdPMonteurParser
  RdPMonteur.y ${CMAKE_CURRENT_BINARY_DIR}/RdPMonteur.tab.cpp
)

# execute flex
FLEX_TARGET(
  RdPMonteurLexer
  RdPMonteur.l ${CMAKE_CURRENT_BINARY_DIR}/RdPMonteur.lex.cpp
)
ADD_FLEX_BISON_DEPENDENCY(RdPMonteurLexer RdPMonteurParser)
Jaime Arias's avatar
Jaime Arias committed
24
25

# generate a the library from sources
26
27
28
29
30
31
add_library(RdP STATIC
  ${BISON_RdPMonteurParser_OUTPUTS}
  ${FLEX_RdPMonteurLexer_OUTPUTS}
  Net.hpp
  Net.cpp
  RdPMonteur.hpp
Jaime Arias's avatar
Jaime Arias committed
32
)