picrin/src/CMakeLists.txt

27 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 12:34:32 -04:00
set(PICLIB_SOURCE ${PROJECT_SOURCE_DIR}/src/load_piclib.c)
add_custom_command(
2014-05-20 12:34:32 -04:00
OUTPUT ${PICLIB_SOURCE}
COMMAND ${PERL_EXECUTABLE} etc/mkloader.pl ${PICLIB_SCHEME_LIBS} ${PICLIB_CONTRIB_LIBS} > ${PICLIB_SOURCE}
DEPENDS ${PICLIB_SCHEME_LIBS} ${PICLIB_CONTRIB_LIBS}
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)
2014-05-20 12:34:32 -04:00
add_library(picrin SHARED ${PICRIN_SOURCES} ${PICLIB_SOURCE} ${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")