2014-07-19 20:36:18 -04:00
|
|
|
find_package(Perl REQUIRED)
|
|
|
|
|
2014-03-05 09:00:24 -05:00
|
|
|
# xfile
|
|
|
|
set(XFILE_SOURCES extlib/xfile/xfile.c)
|
|
|
|
|
2014-04-05 13:47:40 -04:00
|
|
|
# piclib
|
2014-05-20 12:34:32 -04:00
|
|
|
set(PICLIB_SOURCE ${PROJECT_SOURCE_DIR}/src/load_piclib.c)
|
2014-04-05 21:05:15 -04:00
|
|
|
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-07-19 20:36:18 -04:00
|
|
|
# contrib
|
|
|
|
set(CONTRIB_INIT ${PROJECT_SOURCE_DIR}/src/init_contrib.c)
|
|
|
|
add_custom_command(
|
|
|
|
OUTPUT ${CONTRIB_INIT}
|
|
|
|
COMMAND ${PERL_EXECUTABLE} etc/mkinit.pl ${PICRIN_CONTRIB_INITS} > ${CONTRIB_INIT}
|
|
|
|
DEPENDS ${PICRIN_CONTRIB_SOURCES}
|
|
|
|
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-07-19 20:36:18 -04:00
|
|
|
add_library(picrin SHARED ${PICRIN_SOURCES} ${PICLIB_SOURCE} ${XFILE_SOURCES} ${PICRIN_CONTRIB_SOURCES} ${CONTRIB_INIT})
|
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
|
2014-05-21 02:38:12 -04:00
|
|
|
set(CMAKE_INSTALL_RPATH ${CMAKE_INSTALL_PREFIX}/lib)
|
2014-05-18 03:21:54 -04:00
|
|
|
install(TARGETS picrin DESTINATION lib)
|
2014-04-05 23:36:08 -04:00
|
|
|
install(DIRECTORY include/ DESTINATION include FILES_MATCHING PATTERN "*.h")
|