make contribs independant of the directory structure of picrin

This commit is contained in:
Sunrim KIM (keen) 2014-07-20 17:54:08 +09:00
parent c836c2fbe7
commit cdee9d9134
7 changed files with 20 additions and 5 deletions

View File

@ -1,2 +1,2 @@
file(GLOB PARTCONT_FILES ${PROJECT_SOURCE_DIR}/contrib/10.partcont/piclib/*.scm)
file(GLOB PARTCONT_FILES ${PICRIN_CONTRIB_DIR}/10.partcont/piclib/*.scm)
list(APPEND PICLIB_CONTRIB_LIBS ${PARTCONT_FILES})

View File

@ -1 +1 @@
list(APPEND PICLIB_CONTRIB_LIBS ${PROJECT_SOURCE_DIR}/contrib/10.pretty-print/pretty-print.scm)
list(APPEND PICLIB_CONTRIB_LIBS ${PICRIN_CONTRIB_DIR}/10.pretty-print/pretty-print.scm)

View File

@ -1,11 +1,14 @@
# regex
set(PICRIN_REGEX_DIR ${PICRIN_CONTRIB_DIR}/10.regexp)
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${PICRIN_REGEX_DIR}/cmake/")
find_package(REGEX)
if (REGEX_FOUND)
add_definitions(${REGEX_DEFINITIONS})
include_directories(${REGEX_INCLUDE_DIR})
file(GLOB PICRIN_REGEX_SOURCES ${PROJECT_SOURCE_DIR}/contrib/10.regexp/src/*.c)
file(GLOB PICRIN_REGEX_SOURCES ${PICRIN_REGEX_DIR}/src/*.c)
list(APPEND PICRIN_CONTRIB_INITS regexp)
list(APPEND PICRIN_CONTRIB_LIBRARIES ${REGEX_LIBRARIES})

View File

@ -0,0 +1,11 @@
(import (scheme base)
(picrin test)
(picrin regexp))
(test #t (regexp? (regexp "simple")))
(test #f (regexp? "it\\s[s]e+ms\\s(reg)?exp"))
(test-values '(("abcd") ("b")) (regexp-match (regexp "a(b)cd") "abdacabcd"))
(test '("a" "b" "c" "d") (regexp-split (regexp ",") "a,b,c,d"))
(test '("a" "b" "c" "d") (regexp-split (regexp "\.+") "a.b....c.....d"))
(test "newline tab spase " (regexp-replace (regexp "\\s") " " "newline
tab space "))

View File

@ -1,2 +1,2 @@
file(GLOB FOR_FILES ${PROJECT_SOURCE_DIR}/contrib/20.for/piclib/*.scm)
file(GLOB FOR_FILES ${PICRIN_CONTRIB_DIR}/20.for/piclib/*.scm)
list(APPEND PICLIB_CONTRIB_LIBS ${FOR_FILES})

View File

@ -1,4 +1,5 @@
file(GLOB CONTRIBS ${PROJECT_SOURCE_DIR}/contrib/*/CMakeLists.txt)
set(PICRIN_CONTRIB_DIR ${PROJECT_SOURCE_DIR}/contrib)
file(GLOB CONTRIBS ${PICRIN_CONTRIB_DIR}/*/CMakeLists.txt)
list(SORT CONTRIBS)
foreach(contrib ${CONTRIBS})
include(${contrib})