Commit e689f0e9 authored by Benoît Barbot's avatar Benoît Barbot

fix cmake

parent 6fa4b3fa
Pipeline #984 passed with stages
in 25 minutes and 41 seconds
......@@ -33,54 +33,64 @@ add_library(grml src/libgrml/expatmodelparser.cc
src/libgrml/modelwriter.cc)
add_custom_command(OUTPUT ${CMAKE_CURRENT_SOURCE_DIR}/src/ModelGenerator/Eval/Eval-parser.cc ${CMAKE_CURRENT_SOURCE_DIR}/src/ModelGenerator/Eval/Eval-scanner.cc
COMMAND ${FLEX_EXECUTABLE} -o Eval-scanner.cc --prefix=eval Eval-scanner.ll
COMMAND ${BISON_EXECUTABLE} -o Eval-parser.cc -y -p eval Eval-parser.yy
WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/src/ModelGenerator/Eval")
add_custom_command( OUTPUT ${CMAKE_CURRENT_SOURCE_DIR}/src/ModelGenerator/GspnParser/Gspn-scanner.cc ${CMAKE_CURRENT_SOURCE_DIR}/src/ModelGenerator/GspnParser/Gspn-parser.cc
COMMAND ${FLEX_EXECUTABLE} -o Gspn-scanner.cc --prefix=gspn Gspn-scanner.ll
COMMAND ${BISON_EXECUTABLE} -o Gspn-parser.cc -y -p gspn Gspn-parser.yy
WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/src/ModelGenerator/GspnParser")
add_custom_command(OUTPUT ${CMAKE_CURRENT_SOURCE_DIR}/src/ModelGenerator/LhaParser/Lha-scanner.cc ${CMAKE_CURRENT_SOURCE_DIR}/src/ModelGenerator/LhaParser/Lha-parser.cc
COMMAND ${FLEX_EXECUTABLE} -o Lha-scanner.cc --prefix=lha Lha-scanner.ll
COMMAND ${BISON_EXECUTABLE} -o Lha-parser.cc -y -p lha Lha-parser.yy
WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/src/ModelGenerator/LhaParser")
file(GLOB_RECURSE Cosmos_SOURCES "src/ModelGenerator/*.cpp" "src/ModelGenerator/*.cc" "src/libgrml/*.cc" "src/Simulator/BatchR.cpp" )
SET_SOURCE_FILES_PROPERTIES("src/ModelGenerator/GspnParser/Gspn-Reader.cpp" PROPERTIES OBJECT_DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/src/ModelGenerator/GspnParser/Gspn-parser.cc)
SET_SOURCE_FILES_PROPERTIES("src/ModelGenerator/Eval/Eval.cpp" PROPERTIES OBJECT_DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/src/ModelGenerator/Eval/Eval-parser.cc)
SET_SOURCE_FILES_PROPERTIES("src/ModelGenerator/LhaParser/Lha-Reader.cpp" PROPERTIES OBJECT_DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/src/ModelGenerator/LhaParser/Lha-parser.cc)
file(MAKE_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/src/ModelGenerator/Eval/")
BISON_TARGET(EvalParser src/ModelGenerator/Eval/Eval-parser.yy
${CMAKE_CURRENT_BINARY_DIR}/src/ModelGenerator/Eval/Eval-parser.cc COMPILE_FLAGS -peval)
FLEX_TARGET(EvalScanner src/ModelGenerator/Eval/Eval-scanner.ll
${CMAKE_CURRENT_BINARY_DIR}/src/ModelGenerator/Eval/Eval-scanner.cc COMPILE_FLAGS --prefix=eval)
ADD_FLEX_BISON_DEPENDENCY(EvalScanner EvalParser)
add_library(libeval
${BISON_EvalParser_OUTPUTS}
${FLEX_EvalScanner_OUTPUTS}
src/ModelGenerator/Eval/Eval.cpp)
target_include_directories(libeval PRIVATE "src/ModelGenerator/Eval")
target_include_directories(libeval PUBLIC ${CMAKE_CURRENT_BINARY_DIR}/src/ModelGenerator/Eval)
file(MAKE_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/src/ModelGenerator/GspnParser/")
BISON_TARGET(GrmlParser src/ModelGenerator/GspnParser/Gspn-parser.yy
${CMAKE_CURRENT_BINARY_DIR}/src/ModelGenerator/GspnParser/Gspn-parser.cc COMPILE_FLAGS -pgspn)
FLEX_TARGET(GrmlScanner src/ModelGenerator/GspnParser/Gspn-scanner.ll
${CMAKE_CURRENT_BINARY_DIR}/src/ModelGenerator/GspnParser/Gspn-scanner.cc COMPILE_FLAGS --prefix=gspn)
ADD_FLEX_BISON_DEPENDENCY(GrmlScanner GrmlParser)
add_library(libgspn
${BISON_GrmlParser_OUTPUTS}
${FLEX_GrmlScanner_OUTPUTS}
src/ModelGenerator/GspnParser/Gspn-Grml-Output.cpp
src/ModelGenerator/GspnParser/Gspn-Writer-Color.cpp
src/ModelGenerator/GspnParser/Gspn-model.cpp
src/ModelGenerator/GspnParser/unfolder.cpp
src/ModelGenerator/GspnParser/Gspn-Reader.cpp
src/ModelGenerator/GspnParser/Gspn-Writer.cpp
src/ModelGenerator/GspnParser/Gspn_gmlparser.cpp
)
target_link_libraries (libgspn libeval)
target_include_directories(libgspn PUBLIC "src/libgrml")
target_include_directories(libgspn PRIVATE "src/ModelGenerator/GspnParser")
target_include_directories(libgspn PUBLIC ${CMAKE_CURRENT_BINARY_DIR}/src/ModelGenerator/GspnParser)
file(MAKE_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/src/ModelGenerator/LhaParser/")
BISON_TARGET(LHAParser src/ModelGenerator/LhaParser/Lha-parser.yy
${CMAKE_CURRENT_BINARY_DIR}/src/ModelGenerator/LhaParser/Lha-parser.cc COMPILE_FLAGS -plha)
FLEX_TARGET(LHAScanner src/ModelGenerator/LhaParser/Lha-scanner.ll
${CMAKE_CURRENT_BINARY_DIR}/src/ModelGenerator/LhaParser/Lha-scanner.cc COMPILE_FLAGS --prefix=lha)
ADD_FLEX_BISON_DEPENDENCY(LHAScanner LHAParser)
add_library(liblha
${BISON_LHAParser_OUTPUTS}
${FLEX_LHAScanner_OUTPUTS}
src/ModelGenerator/LhaParser/Lha-Reader.cpp
src/ModelGenerator/LhaParser/Lha_gmlparser.cpp
)
target_include_directories(liblha PRIVATE "src/ModelGenerator/LhaParser")
target_include_directories(liblha PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/src/ModelGenerator/LhaParser)
target_link_libraries(liblha libeval libgspn)
include_directories ("src/libgrml" ${EXPAT_INCLUDE_DIR} "src/ModelGenerator" ${Boost_INCLUDE_DIR})
add_executable(Cosmos
src/Simulator/BatchR.cpp
src/ModelGenerator/Eval/Eval-parser.cc
src/ModelGenerator/GspnParser/Gspn-parser.cc
src/ModelGenerator/LhaParser/Lha-parser.cc
src/ModelGenerator/Eval/Eval-scanner.cc
src/ModelGenerator/GspnParser/Gspn-scanner.cc
src/ModelGenerator/LhaParser/Lha-scanner.cc
src/ModelGenerator/Eval/Eval.cpp
src/ModelGenerator/GspnParser/Gspn-Grml-Output.cpp
src/ModelGenerator/GspnParser/Gspn-Writer-Color.cpp
src/ModelGenerator/GspnParser/Gspn-model.cpp
src/ModelGenerator/GspnParser/unfolder.cpp
src/ModelGenerator/GspnParser/Gspn-Reader.cpp
src/ModelGenerator/GspnParser/Gspn-Writer.cpp
src/ModelGenerator/GspnParser/Gspn_gmlparser.cpp
src/ModelGenerator/LhaParser/Lha-Reader.cpp
src/ModelGenerator/LhaParser/Lha_gmlparser.cpp
src/ModelGenerator/Cosmos.cpp
src/ModelGenerator/HaslFormula.cpp
src/ModelGenerator/expressionStruct.cpp
src/ModelGenerator/expressionStruct.cpp
src/ModelGenerator/result.cpp
src/ModelGenerator/Generator.cpp
src/ModelGenerator/casesWriter.cpp
......@@ -88,11 +98,13 @@ add_executable(Cosmos
src/ModelGenerator/SimpleSerializer.cpp
src/ModelGenerator/server.cpp)
target_link_libraries (Cosmos grml ${EXPAT_LIBRARY} ${Boost_LIBRARIES})
target_include_directories(Cosmos PRIVATE "src/ModelGenerator/GspnParser")
target_include_directories(Cosmos PRIVATE "src/ModelGenerator/LhaParser")
target_include_directories(Cosmos PRIVATE "${CMAKE_CURRENT_BINARY_DIR}/src/ModelGenerator/LhaParser")
target_link_libraries (Cosmos grml liblha ${EXPAT_LIBRARY} ${Boost_LIBRARIES})
install(TARGETS Cosmos DESTINATION bin)
add_library(ClientSimBase
src/ModelGenerator/parameters.cpp
src/ModelGenerator/SimpleSerializer.cpp
......@@ -104,11 +116,14 @@ add_library(ClientSimBase
src/Simulator/clientsim.cpp
src/Simulator/Simulator.cpp
)
target_include_directories(ClientSimBase PRIVATE "src/ModelGenerator")
install(TARGETS ClientSimBase DESTINATION lib)
add_library(ClientSimMain
src/Simulator/timeGenBis.cpp
src/Simulator/main.cpp
)
target_include_directories(ClientSimMain PRIVATE "src/ModelGenerator")
install(TARGETS ClientSimMain DESTINATION lib)
add_library(ClientSim
......@@ -127,6 +142,7 @@ add_library(ClientSim
src/Simulator/Simulink/SKTime.cpp
src/Simulator/InstanceSPNSim.cpp
)
target_include_directories(ClientSim PRIVATE "src/ModelGenerator")
install(TARGETS ClientSim DESTINATION lib)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment