if ("${BUILD_TESTS}" STREQUAL "yes")
	add_subdirectory(tests unit-tests)
endif ()

if ("${BUILD_EXAMPLES}" STREQUAL "yes")
	add_subdirectory(examples examples)
endif ()

if ("${BUILD_LIB}" STREQUAL "yes")
	add_library(lib4neuro SHARED
		Neuron/Neuron.cpp        
		Neuron/NeuronBinary.cpp        
		Neuron/NeuronConstant.cpp        
		Neuron/NeuronLinear.cpp        
		Neuron/NeuronLogistic.cpp        
		Network/NeuralNetwork.cpp        
		Network/NeuralNetworkSum.cpp        
		NetConnection/ConnectionFunctionGeneral.cpp        
		NetConnection/ConnectionFunctionIdentity.cpp        
		LearningMethods/ParticleSwarm.cpp        
		DataSet/DataSet.cpp        
		ErrorFunction/ErrorFunctions.cpp        
		Solvers/DESolver.cpp
		General/ExprtkWrapper.cpp
	)

    target_link_libraries(
        lib4neuro

        PRIVATE
            ${Boost_LIBRARIES}
    )

	target_include_directories(
        lib4neuro

        #TODO Boost_INCLUDE_DIRS should be PRIVATE - rewrite code accordingly!
        PUBLIC
          ${Boost_INCLUDE_DIRS}
          ${ROOT_DIR}/include
          ${EXPRTK_INCLUDE_DIR}

        PRIVATE
            ${SRC_DIR}

#            ${Boost_INCLUDE_DIRS}
    )

    set_target_properties(
        lib4neuro

        PROPERTIES
            ARCHIVE_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/lib"
            LIBRARY_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/lib"
            RUNTIME_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/bin"
    )

    set(PREFIX "")
#    if(WIN32)
#        set(PREFIX "lib")
#    endif()
	if(WIN32 AND "${DEPENDENCIES_LINK_TYPE}" STREQUAL "shared")
		add_library(${PREFIX}boost_unit_test STATIC boost_test_lib_dummy.cpp)
	elseif("${DEPENDENCIES_LINK_TYPE}" STREQUAL "static")
		add_library(${PREFIX}boost_unit_test STATIC boost_test_lib_dummy.cpp)
    elseif("${DEPENDENCIES_LINK_TYPE}" STREQUAL "shared")
        add_library(${PREFIX}boost_unit_test SHARED boost_test_lib_dummy.cpp)
	endif()

    target_include_directories(
        ${PREFIX}boost_unit_test

        PRIVATE
            ${EXPRTK_INCLUDE_DIR}
            ${Boost_INCLUDE_DIRS}
    )

endif ()