picrin/src/CMakeLists.txt

29 lines
1.0 KiB
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
2014-05-18 19:40:22 -04:00
find_package(Perl REQUIRED)
2014-05-20 11:48:56 -04:00
set(PICLIB_SOURCES ${PROJECT_SOURCE_DIR}/src/load_piclib.c)
2014-05-19 01:38:32 -04:00
list(APPEND PICLIBS ${PICLIB_SCHEME_LIBS})
list(APPEND PICLIBS ${PICLIB_CONTRIB_LIBS})
add_custom_command(
OUTPUT ${PICLIB_SOURCES}
2014-05-19 00:39:28 -04:00
COMMAND ${PERL_EXECUTABLE} etc/mkloader.pl ${PICLIBS} > ${PROJECT_SOURCE_DIR}/src/load_piclib.c
2014-05-20 11:29:33 -04:00
DEPENDS ${PICLIBS}
2014-04-05 13:47:40 -04:00
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})
2014-04-05 23:36:08 -04:00
# install
install(TARGETS picrin DESTINATION lib)
2014-04-05 23:36:08 -04:00
install(DIRECTORY include/ DESTINATION include FILES_MATCHING PATTERN "*.h")