Skip to content

Commit

Permalink
Support building with biicode.
Browse files Browse the repository at this point in the history
  • Loading branch information
skystrife committed Mar 28, 2015
1 parent 230e52c commit 418fa4f
Show file tree
Hide file tree
Showing 6 changed files with 150 additions and 56 deletions.
6 changes: 5 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ include(FindZLIB)

include_directories(include/)


set(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/deps/findicu)
find_package(Threads REQUIRED)
find_package(ICU COMPONENTS data i18n uc REQUIRED)
Expand Down Expand Up @@ -174,6 +173,11 @@ if(ICU_VERSION VERSION_LESS "4.4")
-DMETA_ICU_NO_TEMP_SUBSTRING)
endif()

if(BIICODE)
include(contrib/biicode/CMakeLists.txt)
return()
ENDIF()

set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR})

link_libraries(cpptoml meta-definitions)
Expand Down
8 changes: 8 additions & 0 deletions contrib/biicode/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
message(STATUS "Setting up biicode block...")
set(UNIT_TEST_EXE skystrife_meta_src_test_tools_unit-test)
include(src/test/unit_tests.cmake)
ADD_BIICODE_TARGETS()
target_link_libraries(${BII_LIB_TARGET} PUBLIC meta-definitions
${ICU_LIBRARIES}
${ZLIB_LIBRARIES}
${CMAKE_THREAD_LIB_INIT})
22 changes: 22 additions & 0 deletions contrib/biicode/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Biicode Integration
MeTA can be built using biicode. To do so, symlink the biicode.conf file to
the project's root directory like so (from the project root):

```bash
ln -s contrib/biicode/biicode.conf .
```

Then, configure and build with the following:

```bash
bii init -L
bii configure
bii build
```

After placing the sample config.toml in the `bin/` directory, you can run
the unit tests:

```bash
bii test
```
58 changes: 58 additions & 0 deletions contrib/biicode/biicode.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
# Biicode configuration file

[requirements]
skystrife/cpptoml: 0

[parent]
# The parent version of this block. Must match folder name. E.g.
# user/block # No version number means not published yet
# You can change it to publish to a different track, and change version, e.g.
# user/block(track): 7

[paths]
# Local directories to look for headers (within block)
# /
include
# should put porter2_stemmer on biicode as well...
deps/porter2_stemmer

[dependencies]
# Manual adjust file implicit dependencies, add (+), remove (-), or overwrite (=)
# hello.h + hello_imp.cpp hello_imp2.cpp
# *.h + *.cpp
include/analyzers/* + src/analyzers/* src/corpus/*
include/classify/* + src/classify/* src/index/*
include/corpus/* + src/corpus/* src/io/*
include/index/* + src/index/* src/analyzers/*
include/io/* + src/io/* src/util/*
include/lm/* + src/lm/* src/corpus/*
include/parser/* + src/parser/* src/io/* src/sequence/* src/util/*
include/sequence/* + src/sequence/* src/io/* src/utf/*
include/topics/* + src/topics/* src/index/*

[mains]
# Manual adjust of files that define an executable
# !main.cpp # Do not build executable from this file
# main2.cpp # Build it (it doesnt have a main() function, but maybe it includes it)
!deps/*

[tests]
# Manual adjust of files that define a CTest test
# test/* pattern to evaluate this test/ folder sources like tests

[hooks]
# These are defined equal to [dependencies],files names matching bii*stage*hook.py
# will be launched as python scripts at stage = {post_process, clean}
# CMakeLists.txt + bii/my_post_process1_hook.py bii_clean_hook.py

[includes]
# Mapping of include patterns to external blocks
# hello*.h: user3/depblock # includes will be processed as user3/depblock/hello*.h
cpptoml.h: skystrife/cpptoml/include

[data]
# Manually define data files dependencies, that will be copied to bin for execution
# By default they are copied to bin/user/block/... which should be taken into account
# when loading from disk such data
# image.cpp + image.jpg # code should write open("user/block/image.jpg")

57 changes: 2 additions & 55 deletions src/test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,58 +17,5 @@ add_library(meta-testing analyzer_test.cpp
parser_test.cpp)
target_link_libraries(meta-testing meta-index meta-classify meta-parser-io)

add_test(analyzers unit-test analyzers)
set_tests_properties(analyzers PROPERTIES TIMEOUT 10 WORKING_DIRECTORY
${CMAKE_RUNTIME_OUTPUT_DIRECTORY})

add_test(stemmers unit-test stemmers)
set_tests_properties(stemmers PROPERTIES TIMEOUT 10 WORKING_DIRECTORY
${CMAKE_RUNTIME_OUTPUT_DIRECTORY})

add_test(parallel unit-test parallel)
set_tests_properties(parallel PROPERTIES TIMEOUT 30 WORKING_DIRECTORY
${CMAKE_RUNTIME_OUTPUT_DIRECTORY})

add_test(inverted-index unit-test inverted-index)
set_tests_properties(inverted-index PROPERTIES TIMEOUT 30 WORKING_DIRECTORY
${CMAKE_RUNTIME_OUTPUT_DIRECTORY})

add_test(forward-index unit-test forward-index)
set_tests_properties(forward-index PROPERTIES TIMEOUT 30 WORKING_DIRECTORY
${CMAKE_RUNTIME_OUTPUT_DIRECTORY})

add_test(string-list unit-test string-list)
set_tests_properties(string-list PROPERTIES TIMEOUT 10 WORKING_DIRECTORY
${CMAKE_RUNTIME_OUTPUT_DIRECTORY})

add_test(vocabulary-map unit-test vocabulary-map)
set_tests_properties(vocabulary-map PROPERTIES TIMEOUT 10 WORKING_DIRECTORY
${CMAKE_RUNTIME_OUTPUT_DIRECTORY})

add_test(libsvm-parser unit-test libsvm-parser)
set_tests_properties(libsvm-parser PROPERTIES TIMEOUT 10 WORKING_DIRECTORY
${CMAKE_RUNTIME_OUTPUT_DIRECTORY})

add_test(classifiers unit-test classifiers)
set_tests_properties(classifiers PROPERTIES TIMEOUT 80 WORKING_DIRECTORY
${CMAKE_RUNTIME_OUTPUT_DIRECTORY})

add_test(rankers unit-test rankers)
set_tests_properties(rankers PROPERTIES TIMEOUT 75 WORKING_DIRECTORY
${CMAKE_RUNTIME_OUTPUT_DIRECTORY})

add_test(ir-eval unit-test ir-eval)
set_tests_properties(ir-eval PROPERTIES TIMEOUT 10 WORKING_DIRECTORY
${CMAKE_RUNTIME_OUTPUT_DIRECTORY})

add_test(compression unit-test compression)
set_tests_properties(compression PROPERTIES TIMEOUT 10 WORKING_DIRECTORY
${CMAKE_RUNTIME_OUTPUT_DIRECTORY})

add_test(graph unit-test graph)
set_tests_properties(graph PROPERTIES TIMEOUT 10 WORKING_DIRECTORY
${CMAKE_RUNTIME_OUTPUT_DIRECTORY})

add_test(parser unit-test parser)
set_tests_properties(parser PROPERTIES TIMEOUT 10 WORKING_DIRECTORY
${CMAKE_RUNTIME_OUTPUT_DIRECTORY})
set(UNIT_TEST_EXE unit-test)
include(unit_tests.cmake)
55 changes: 55 additions & 0 deletions src/test/unit_tests.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
add_test(analyzers ${UNIT_TEST_EXE} analyzers)
set_tests_properties(analyzers PROPERTIES TIMEOUT 10 WORKING_DIRECTORY
${CMAKE_RUNTIME_OUTPUT_DIRECTORY})

add_test(stemmers ${UNIT_TEST_EXE} stemmers)
set_tests_properties(stemmers PROPERTIES TIMEOUT 10 WORKING_DIRECTORY
${CMAKE_RUNTIME_OUTPUT_DIRECTORY})

add_test(parallel ${UNIT_TEST_EXE} parallel)
set_tests_properties(parallel PROPERTIES TIMEOUT 30 WORKING_DIRECTORY
${CMAKE_RUNTIME_OUTPUT_DIRECTORY})

add_test(inverted-index ${UNIT_TEST_EXE} inverted-index)
set_tests_properties(inverted-index PROPERTIES TIMEOUT 30 WORKING_DIRECTORY
${CMAKE_RUNTIME_OUTPUT_DIRECTORY})

add_test(forward-index ${UNIT_TEST_EXE} forward-index)
set_tests_properties(forward-index PROPERTIES TIMEOUT 30 WORKING_DIRECTORY
${CMAKE_RUNTIME_OUTPUT_DIRECTORY})

add_test(string-list ${UNIT_TEST_EXE} string-list)
set_tests_properties(string-list PROPERTIES TIMEOUT 10 WORKING_DIRECTORY
${CMAKE_RUNTIME_OUTPUT_DIRECTORY})

add_test(vocabulary-map ${UNIT_TEST_EXE} vocabulary-map)
set_tests_properties(vocabulary-map PROPERTIES TIMEOUT 10 WORKING_DIRECTORY
${CMAKE_RUNTIME_OUTPUT_DIRECTORY})

add_test(libsvm-parser ${UNIT_TEST_EXE} libsvm-parser)
set_tests_properties(libsvm-parser PROPERTIES TIMEOUT 10 WORKING_DIRECTORY
${CMAKE_RUNTIME_OUTPUT_DIRECTORY})

add_test(classifiers ${UNIT_TEST_EXE} classifiers)
set_tests_properties(classifiers PROPERTIES TIMEOUT 80 WORKING_DIRECTORY
${CMAKE_RUNTIME_OUTPUT_DIRECTORY})

add_test(rankers ${UNIT_TEST_EXE} rankers)
set_tests_properties(rankers PROPERTIES TIMEOUT 75 WORKING_DIRECTORY
${CMAKE_RUNTIME_OUTPUT_DIRECTORY})

add_test(ir-eval ${UNIT_TEST_EXE} ir-eval)
set_tests_properties(ir-eval PROPERTIES TIMEOUT 10 WORKING_DIRECTORY
${CMAKE_RUNTIME_OUTPUT_DIRECTORY})

add_test(compression ${UNIT_TEST_EXE} compression)
set_tests_properties(compression PROPERTIES TIMEOUT 10 WORKING_DIRECTORY
${CMAKE_RUNTIME_OUTPUT_DIRECTORY})

add_test(graph ${UNIT_TEST_EXE} graph)
set_tests_properties(graph PROPERTIES TIMEOUT 10 WORKING_DIRECTORY
${CMAKE_RUNTIME_OUTPUT_DIRECTORY})

add_test(parser ${UNIT_TEST_EXE} parser)
set_tests_properties(parser PROPERTIES TIMEOUT 10 WORKING_DIRECTORY
${CMAKE_RUNTIME_OUTPUT_DIRECTORY})

0 comments on commit 418fa4f

Please sign in to comment.