Skip to content

Commit

Permalink
Merge pull request libfann#27 from lasote/master
Browse files Browse the repository at this point in the history
Biicode Dependency Manager support
  • Loading branch information
steffennissen committed Mar 22, 2015
2 parents 2938adc + 7e85330 commit a0358b0
Show file tree
Hide file tree
Showing 3 changed files with 90 additions and 0 deletions.
41 changes: 41 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,43 @@
IF(BIICODE)
# Initializes block variables
INIT_BIICODE_BLOCK()

# Output folder for binaries
SET(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_SOURCE_DIR}/../bin/fann/examples)
SET(CMAKE_RUNTIME_OUTPUT_DIRECTORY_DEBUG ${CMAKE_SOURCE_DIR}/../bin/fann/examples)

# Copy datasets for examples if exists
if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/datasets)
file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/datasets DESTINATION ${CMAKE_SOURCE_DIR}/../bin/)
ENDIF()

# Include recipes block for CPP11 activation
INCLUDE(biicode/cmake/tools)

# Are examples present?
LIST(FIND BII_BLOCK_EXES examples_parallel_train examples_present)
SET(examples_present (NOT ${examples_present} EQUAL "-1")) # Depending on examples
IF(${examples_present} AND NOT WIN32 AND NOT APPLE) # Linux doesn't have GetTickCount
LIST(REMOVE_ITEM BII_BLOCK_EXES examples_parallel_train)
ENDIF()

ADD_BIICODE_TARGETS()

IF(${examples_present})
# This example needs CPP11
ACTIVATE_CPP11(lasote_fann_examples_xor_sample)
ENDIF()

TARGET_COMPILE_OPTIONS(${BII_BLOCK_TARGET} INTERFACE -DGTEST_ENABLE_CATCH_EXCEPTIONS_=1)

IF(MSVC)
TARGET_COMPILE_OPTIONS(${BII_LIB_TARGET} PUBLIC -DFANN_DLL_EXPORTS)
ELSE()
IF(${examples_present})
TARGET_LINK_LIBRARIES(${BII_BLOCK_TARGET} INTERFACE gomp)
ENDIF()
ENDIF()
ELSE()
PROJECT (FANN)
#SET(CMAKE_VERBOSE_MAKEFILE ON)
cmake_minimum_required(VERSION 2.8)
Expand Down Expand Up @@ -54,3 +94,4 @@ ELSE(WIN32 AND NOT UNIX)
ENDIF(WIN32 AND NOT UNIX)
#SET(CPACK_PACKAGE_EXECUTABLES "MyExecutable" "My Executable")
INCLUDE(CPack)
ENDIF()
45 changes: 45 additions & 0 deletions biicode.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# Biicode configuration file

[requirements]
biicode/cmake: 3
google/gtest: 10

[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
lasote/fann: 0

[paths]
# Local directories to look for headers (within block)
# /
# include
src
src/include


[dependencies]
# Manual adjust file implicit dependencies, add (+), remove (-), or overwrite (=)
# hello.h + hello_imp.cpp hello_imp2.cpp
# *.h + *.cpp

[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)

[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]
gtest/gtest.h: google/gtest/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")

4 changes: 4 additions & 0 deletions ignore.bii
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
bin/*
VS2010/*
lib/*
cmake/*

0 comments on commit a0358b0

Please sign in to comment.