Skip to content
Snippets Groups Projects
Commit 5a12118a authored by Martin Beseda's avatar Martin Beseda
Browse files

ENH: Added Turtle library for mocking objects.

parent 92265d28
No related branches found
No related tags found
No related merge requests found
......@@ -4,3 +4,6 @@
[submodule "external_dependencies/boost"]
path = external_dependencies/boost
url = https://github.com/boostorg/boost.git
[submodule "external_dependencies/turtle"]
path = external_dependencies/turtle
url = https://github.com/mat007/turtle.git
......@@ -88,6 +88,8 @@ message("lib4neuro LIB DIR: ${LIB4NEURO_DIR}")
find_package(exprtk)
find_package(Turtle)
#------------------------------------------#
# Detect maximum available number of cores #
# and set corresponding build options #
......
......@@ -57,13 +57,8 @@ find_path(
# as Boost headers are supposed to be included like
# #include<boost/...> according to the documentation
set(TMP "")
#if(WIN32)
# string(REPLACE "\\boost\\boost" "\\boost" TMP ${Boost_INCLUDE_DIRS})
# list(APPEND Boost_INCLUDE_DIRS ${TMP})
#else()
string(REPLACE "/boost/boost" "/boost" TMP ${Boost_INCLUDE_DIRS})
list(APPEND Boost_INCLUDE_DIRS ${TMP})
#endif()
string(REPLACE "/boost/boost" "/boost" TMP ${Boost_INCLUDE_DIRS})
list(APPEND Boost_INCLUDE_DIRS ${TMP})
if(NOT Boost_INCLUDE_DIRS)
message(FATAL_ERROR "Boost include directory was not found! Please, set variable BOOST_INCLUDEDIR to the correct path.")
......
# Find headers and libraries
FIND_PATH(
TURTLE_INCLUDE_DIR
NAMES
mock.hpp
HINTS
$ENV{TURTLE_INCLUDE_DIR}
${TURTLE_INCLUDE_DIR}
external_dependencies/turtle
PATHS
/home
/usr/local
/usr
/opt/local
PATH_SUFFIXES
include/turtle
)
# Set TURTLE_FOUND honoring the QUIET and REQUIRED arguments
INCLUDE(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(
turtle
"Turtle was NOT found!"
TURTLE_INCLUDE_DIR)
# Output variables
IF(TURTLE_FOUND)
# Include dirs
SET(TURTLE_INCLUDE_DIRS ${TURTLE_INCLUDE_DIR})
ELSE()
MESSAGE(FATAL_ERROR "Set, please, the environmental variable TURTLE_INCLUDE_DIR to the folder, where 'mock.hpp' is located...")
ENDIF(TURTLE_FOUND)
# Add path only to the 'include' folder
set(TMP "")
string(REPLACE "/include/turtle" "/include" TMP ${TURTLE_INCLUDE_DIR})
list(APPEND TURTLE_INCLUDE_DIR ${TMP})
# Advanced options for not cluttering the cmake UIs:
MARK_AS_ADVANCED(TURTLE_INCLUDE_DIR)
Subproject commit b587bd3bbfb42520838ccd516dabc8684fbdd8a8
Subproject commit 7ff9ae132ba8e8d9ecc329788a55b6e54139068b
Subproject commit e92f52821da312c5e30b447c8046893e576aefca
......@@ -39,7 +39,6 @@ ExprtkWrapper::ExprtkWrapper( std::string expression_string ) {
this->p_impl->parser->compile(this->p_impl->expression_str, *this->p_impl->expression );
}
ExprtkWrapper::~ExprtkWrapper() {
if( this->p_impl->expression ){
......
......@@ -4,55 +4,55 @@
add_executable(linear_neuron_test NeuronLinear_test.cpp)
target_link_libraries(linear_neuron_test lib4neuro boost_unit_test)
target_include_directories(linear_neuron_test PRIVATE ${Boost_INCLUDE_DIRS})
target_include_directories(linear_neuron_test PRIVATE ${Boost_INCLUDE_DIRS} ${TURTLE_INCLUDE_DIR})
add_executable(constant_neuron_test NeuronConstant_test.cpp)
target_link_libraries(constant_neuron_test lib4neuro boost_unit_test)
target_include_directories(constant_neuron_test PRIVATE ${Boost_INCLUDE_DIRS})
target_include_directories(constant_neuron_test PRIVATE ${Boost_INCLUDE_DIRS} ${TURTLE_INCLUDE_DIR})
add_executable(binary_neuron_test NeuronBinary_test.cpp)
target_link_libraries(binary_neuron_test lib4neuro boost_unit_test)
target_include_directories(binary_neuron_test PRIVATE ${Boost_INCLUDE_DIRS})
target_include_directories(binary_neuron_test PRIVATE ${Boost_INCLUDE_DIRS} ${TURTLE_INCLUDE_DIR})
add_executable(logistic_neuron_test NeuronLogistic_test.cpp)
target_link_libraries(logistic_neuron_test lib4neuro boost_unit_test)
target_include_directories(logistic_neuron_test PRIVATE ${Boost_INCLUDE_DIRS})
target_include_directories(logistic_neuron_test PRIVATE ${Boost_INCLUDE_DIRS} ${TURTLE_INCLUDE_DIR})
add_executable(connectionFunctionGeneral_test ConnectionFunctionGeneral_test.cpp)
target_link_libraries(connectionFunctionGeneral_test lib4neuro boost_unit_test)
target_include_directories(connectionFunctionGeneral_test PRIVATE ${Boost_INCLUDE_DIRS})
target_include_directories(connectionFunctionGeneral_test PRIVATE ${Boost_INCLUDE_DIRS} ${TURTLE_INCLUDE_DIR})
add_executable(neural_network_test NeuralNetwork_test.cpp)
target_link_libraries(neural_network_test lib4neuro boost_unit_test)
target_include_directories(neural_network_test PRIVATE ${Boost_INCLUDE_DIRS})
target_include_directories(neural_network_test PRIVATE ${Boost_INCLUDE_DIRS} ${TURTLE_INCLUDE_DIR})
add_executable(connection_Function_identity_test ConnectionFunctionIdentity_test.cpp)
target_link_libraries(connection_Function_identity_test lib4neuro boost_unit_test)
target_include_directories(connection_Function_identity_test PRIVATE ${Boost_INCLUDE_DIRS})
target_include_directories(connection_Function_identity_test PRIVATE ${Boost_INCLUDE_DIRS} ${TURTLE_INCLUDE_DIR})
add_executable(dataset_test DataSet_test.cpp)
target_link_libraries(dataset_test lib4neuro boost_unit_test)
target_include_directories(dataset_test PRIVATE ${Boost_INCLUDE_DIRS})
target_include_directories(dataset_test PRIVATE ${Boost_INCLUDE_DIRS} ${TURTLE_INCLUDE_DIR})
add_executable(errorfunction_test ErrorFunctions_test.cpp)
target_link_libraries(errorfunction_test lib4neuro boost_unit_test)
target_include_directories(errorfunction_test PRIVATE ${Boost_INCLUDE_DIRS})
target_include_directories(errorfunction_test PRIVATE ${Boost_INCLUDE_DIRS} ${TURTLE_INCLUDE_DIR})
add_executable(particle_swarm_test ParticleSwarm_test.cpp)
target_link_libraries(particle_swarm_test lib4neuro boost_unit_test)
target_include_directories(particle_swarm_test PRIVATE ${Boost_INCLUDE_DIRS})
target_include_directories(particle_swarm_test PRIVATE ${Boost_INCLUDE_DIRS} ${TURTLE_INCLUDE_DIR})
add_executable(particle_test Particle_test.cpp)
target_link_libraries(particle_test lib4neuro boost_unit_test)
target_include_directories(particle_test PRIVATE ${Boost_INCLUDE_DIRS})
target_include_directories(particle_test PRIVATE ${Boost_INCLUDE_DIRS} ${TURTLE_INCLUDE_DIR})
add_executable(NeuralNetworkSum_test NeuralNetworkSum_test.cpp)
target_link_libraries(NeuralNetworkSum_test lib4neuro boost_unit_test)
target_include_directories(NeuralNetworkSum_test PRIVATE ${Boost_INCLUDE_DIRS})
target_include_directories(NeuralNetworkSum_test PRIVATE ${Boost_INCLUDE_DIRS} ${TURTLE_INCLUDE_DIR})
add_executable(DESolver_test DESolver_test.cpp)
target_link_libraries(DESolver_test lib4neuro boost_unit_test)
target_include_directories(DESolver_test PRIVATE ${Boost_INCLUDE_DIRS})
target_include_directories(DESolver_test PRIVATE ${Boost_INCLUDE_DIRS} ${TURTLE_INCLUDE_DIR})
set_target_properties(
linear_neuron_test
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment