picrin/src/CMakeLists.txt

21 lines
738 B
CMake
Raw Normal View History

2014-03-02 04:50:35 -05:00
# flex
2014-03-01 11:52:41 -05:00
find_package(FLEX REQUIRED)
2014-03-01 23:24:12 -05:00
flex_target(scan src/scan.l ${PROJECT_SOURCE_DIR}/src/lex.yy.c COMPILE_FLAGS --header-file="src/lex.yy.h")
2014-03-02 05:03:01 -05:00
set_directory_properties(PROPERTIES ADDITIONAL_MAKE_CLEAN_FILES ${PROJECT_SOURCE_DIR}/src/lex.yy.h)
2014-03-01 11:52:41 -05:00
# xfile
set(XFILE_SOURCES extlib/xfile/xfile.c)
2014-04-05 13:47:40 -04:00
# piclib
set(PICLIB_SOURCES ${PROJECT_SOURCE_DIR}/src/load_piclib.c)
add_custom_command(
OUTPUT ${PICLIB_SOURCES}
2014-04-05 13:47:40 -04:00
COMMAND python etc/libemb.py
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
)
2014-03-02 04:50:35 -05:00
# build!
2014-03-31 07:43:36 -04:00
file(GLOB PICRIN_SOURCES ${PROJECT_SOURCE_DIR}/src/*.c)
add_library(picrin SHARED ${PICRIN_SOURCES} ${PICLIB_SOURCES} ${FLEX_scan_OUTPUTS} ${XFILE_SOURCES} ${PICRIN_CONTRIB_SOURCES})
2014-03-31 07:43:36 -04:00
target_link_libraries(picrin m ${PICRIN_CONTRIB_LIBRARIES})