Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

[f87edd]: src / parser / CMakeLists.txt Maximize Restore History

Download this file

CMakeLists.txt    35 lines (25 with data), 1.3 kB

 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
#this is just a basic CMakeLists.txt, for more information see the cmake manpage
# parser stuff
#BISON_TARGET(mparser parser.y ${PROJECT_BINARY_DIR}/parser.cpp)
#FLEX_TARGET(mscanner scanner.l ${PROJECT_BINARY_DIR}/scanner.cpp)
#ADD_FLEX_BISON_DEPENDENCY(scanner parser)
ADD_CUSTOM_COMMAND(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/parser.c ${CMAKE_CURRENT_BINARY_DIR}/parser.h
COMMAND ${BISON_EXECUTABLE} -d -oparser.c ${CMAKE_CURRENT_SOURCE_DIR}/parser.y
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/parser.y )
ADD_CUSTOM_COMMAND(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/scanner.c
COMMAND ${FLEX_EXECUTABLE} -oscanner.c ${CMAKE_CURRENT_SOURCE_DIR}/scanner.l
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/scanner.l )
# set include path to include the generated parser.h file
include_directories( ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR} )
#build a shared library
ADD_LIBRARY(panoparser SHARED tparser.c
${CMAKE_CURRENT_BINARY_DIR}/parser.c
${CMAKE_CURRENT_BINARY_DIR}/scanner.c )
#for testing the shared library you probably need some test app too
ADD_EXECUTABLE(testparser testparser.c)
#link to the library
TARGET_LINK_LIBRARIES(testparser panoparser)
#add an install target here
#INSTALL_FILES(...)
#INSTALL_PROGRAMS(...)
#INSTALL_TARGET(...)