# Copyright (c) 2010-2015, Panasonic Corporation.
#
# Permission to use, copy, modify, and/or distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
# copyright notice and this permission notice appear in all copies.
#
# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.

add_executable( DOFValue_unit DOFValue_unit.c )
add_executable( DOFValueStructure_unit DOFValueStructure_unit.c )
add_executable( DOFValueList_unit DOFValueList_unit.c )
add_executable( DOFValueArray_unit DOFValueArray_unit.c )
add_executable( testBLOB_unit testBLOB_unit.c )
add_executable( testBoolean_unit testBoolean_unit.c )
add_executable( testBooleanArray_unit testBooleanArray_unit.c )
add_executable( testDateTime_unit testDateTime_unit.c )
add_executable( testDateTimeArray_unit testDateTimeArray_unit.c )
add_executable( testFloat32_unit testFloat32_unit.c )
add_executable( testFloat32Array_unit testFloat32Array_unit.c )
add_executable( testFloat64_unit testFloat64_unit.c )
add_executable( testFloat64Array_unit testFloat64Array_unit.c )
add_executable( testGUID_unit testGUID_unit.c )
add_executable( testGUIDArray_unit testGUIDArray_unit.c )
add_executable( testInt16_unit testInt16_unit.c )
add_executable( testInt16Array_unit testInt16Array_unit.c )
add_executable( testInt32_unit testInt32_unit.c )
add_executable( testInt32Array_unit testInt32Array_unit.c )
add_executable( testInt64_unit testInt64_unit.c )
add_executable( testInt64Array_unit testInt64Array_unit.c )
add_executable( testInt8_unit testInt8_unit.c )
add_executable( testInt8Array_unit testInt8Array_unit.c )
add_executable( testInterfaceID_unit testInterfaceID_unit.c )
add_executable( testInterfaceIDArray_unit testInterfaceIDArray_unit.c )
add_executable( testObjectID_unit testObjectID_unit.c )
add_executable( testObjectIDArray_unit testObjectIDArray_unit.c )
add_executable( testString_unit testString_unit.c )
add_executable( testStringArray_unit testStringArray_unit.c )
add_executable( testStringBuffer_unit testStringBuffer_unit.c )
add_executable( testUInt16_unit testUInt16_unit.c )
add_executable( testUInt16Array_unit testUInt16Array_unit.c )
add_executable( testUInt32_unit testUInt32_unit.c )
add_executable( testUInt32Array_unit testUInt32Array_unit.c )
add_executable( testUInt64_unit testUInt64_unit.c )
add_executable( testUInt64Array_unit testUInt64Array_unit.c )
add_executable( testUInt8_unit testUInt8_unit.c )
add_executable( testUInt8Array_unit testUInt8Array_unit.c )

include_directories( ${DOF_PCR_DEV_INCLUDE_DIRS} ${DOF_PCR_INCLUDE_DIRS} ${DOF_OAL_INCLUDE_DIRS} include ${CMAKE_CURRENT_BINARY_DIR}/include )
target_link_libraries( DOFValue_unit ${PACKAGE_LIBRARY_TARGET_NAME} ${DOF_PCR_LIBRARIES} pthread )
target_link_libraries( DOFValueStructure_unit ${PACKAGE_LIBRARY_TARGET_NAME} ${DOF_PCR_LIBRARIES} pthread )
target_link_libraries( DOFValueList_unit ${PACKAGE_LIBRARY_TARGET_NAME} ${DOF_PCR_LIBRARIES} pthread )
target_link_libraries( DOFValueArray_unit ${PACKAGE_LIBRARY_TARGET_NAME} ${DOF_PCR_LIBRARIES} pthread )
target_link_libraries( testBLOB_unit ${PACKAGE_LIBRARY_TARGET_NAME} ${DOF_PCR_LIBRARIES} pthread )
target_link_libraries( testBoolean_unit ${PACKAGE_LIBRARY_TARGET_NAME} ${DOF_PCR_LIBRARIES} pthread )
target_link_libraries( testBooleanArray_unit ${PACKAGE_LIBRARY_TARGET_NAME} ${DOF_PCR_LIBRARIES} pthread )
target_link_libraries( testDateTime_unit ${PACKAGE_LIBRARY_TARGET_NAME} ${DOF_PCR_LIBRARIES} pthread )
target_link_libraries( testDateTimeArray_unit ${PACKAGE_LIBRARY_TARGET_NAME} ${DOF_PCR_LIBRARIES} pthread )
target_link_libraries( testFloat32_unit ${PACKAGE_LIBRARY_TARGET_NAME} ${DOF_PCR_LIBRARIES} pthread )
target_link_libraries( testFloat32Array_unit ${PACKAGE_LIBRARY_TARGET_NAME} ${DOF_PCR_LIBRARIES} pthread )
target_link_libraries( testFloat64_unit ${PACKAGE_LIBRARY_TARGET_NAME} ${DOF_PCR_LIBRARIES} pthread )
target_link_libraries( testFloat64Array_unit ${PACKAGE_LIBRARY_TARGET_NAME} ${DOF_PCR_LIBRARIES} pthread )
target_link_libraries( testGUID_unit ${PACKAGE_LIBRARY_TARGET_NAME} ${DOF_PCR_LIBRARIES} pthread )
target_link_libraries( testGUIDArray_unit ${PACKAGE_LIBRARY_TARGET_NAME} ${DOF_PCR_LIBRARIES} pthread )
target_link_libraries( testInt16_unit ${PACKAGE_LIBRARY_TARGET_NAME} ${DOF_PCR_LIBRARIES} pthread )
target_link_libraries( testInt16Array_unit ${PACKAGE_LIBRARY_TARGET_NAME} ${DOF_PCR_LIBRARIES} pthread )
target_link_libraries( testInt32_unit ${PACKAGE_LIBRARY_TARGET_NAME} ${DOF_PCR_LIBRARIES} pthread )
target_link_libraries( testInt32Array_unit ${PACKAGE_LIBRARY_TARGET_NAME} ${DOF_PCR_LIBRARIES} pthread )
target_link_libraries( testInt64_unit ${PACKAGE_LIBRARY_TARGET_NAME} ${DOF_PCR_LIBRARIES} pthread )
target_link_libraries( testInt64Array_unit ${PACKAGE_LIBRARY_TARGET_NAME} ${DOF_PCR_LIBRARIES} pthread )
target_link_libraries( testInt8_unit ${PACKAGE_LIBRARY_TARGET_NAME} ${DOF_PCR_LIBRARIES} pthread )
target_link_libraries( testInt8Array_unit ${PACKAGE_LIBRARY_TARGET_NAME} ${DOF_PCR_LIBRARIES} pthread )
target_link_libraries( testInterfaceID_unit ${PACKAGE_LIBRARY_TARGET_NAME} ${DOF_PCR_LIBRARIES} pthread )
target_link_libraries( testInterfaceIDArray_unit ${PACKAGE_LIBRARY_TARGET_NAME} ${DOF_PCR_LIBRARIES} pthread )
target_link_libraries( testObjectID_unit ${PACKAGE_LIBRARY_TARGET_NAME} ${DOF_PCR_LIBRARIES} pthread )
target_link_libraries( testObjectIDArray_unit ${PACKAGE_LIBRARY_TARGET_NAME} ${DOF_PCR_LIBRARIES} pthread )
target_link_libraries( testString_unit ${PACKAGE_LIBRARY_TARGET_NAME} ${DOF_PCR_LIBRARIES} pthread )
target_link_libraries( testStringArray_unit ${PACKAGE_LIBRARY_TARGET_NAME} ${DOF_PCR_LIBRARIES} pthread )
target_link_libraries( testStringBuffer_unit ${PACKAGE_LIBRARY_TARGET_NAME} ${DOF_PCR_LIBRARIES} pthread )
target_link_libraries( testUInt16_unit ${PACKAGE_LIBRARY_TARGET_NAME} ${DOF_PCR_LIBRARIES} pthread )
target_link_libraries( testUInt16Array_unit ${PACKAGE_LIBRARY_TARGET_NAME} ${DOF_PCR_LIBRARIES} pthread )
target_link_libraries( testUInt32_unit ${PACKAGE_LIBRARY_TARGET_NAME} ${DOF_PCR_LIBRARIES} pthread )
target_link_libraries( testUInt32Array_unit ${PACKAGE_LIBRARY_TARGET_NAME} ${DOF_PCR_LIBRARIES} pthread )
target_link_libraries( testUInt64_unit ${PACKAGE_LIBRARY_TARGET_NAME} ${DOF_PCR_LIBRARIES} pthread )
target_link_libraries( testUInt64Array_unit ${PACKAGE_LIBRARY_TARGET_NAME} ${DOF_PCR_LIBRARIES} pthread )
target_link_libraries( testUInt8_unit ${PACKAGE_LIBRARY_TARGET_NAME} ${DOF_PCR_LIBRARIES} pthread )
target_link_libraries( testUInt8Array_unit ${PACKAGE_LIBRARY_TARGET_NAME} ${DOF_PCR_LIBRARIES} pthread )

add_dependencies( check DOFValue_unit DOFValueStructure_unit DOFValueList_unit DOFValueArray_unit testBLOB_unit testBoolean_unit 
    testBooleanArray_unit testDateTime_unit testDateTimeArray_unit testFloat32_unit testFloat32Array_unit testFloat64_unit 
    testFloat64Array_unit testGUID_unit testGUIDArray_unit testInt16_unit testInt16Array_unit testInt32_unit testInt32Array_unit 
    testInt64_unit testInt64Array_unit testInt8_unit testInt8Array_unit testInterfaceID_unit testInterfaceIDArray_unit testObjectID_unit 
    testObjectIDArray_unit testString_unit testStringArray_unit testStringBuffer_unit testUInt16_unit testUInt16Array_unit testUInt32_unit 
    testUInt32Array_unit testUInt64_unit testUInt64Array_unit testUInt8_unit testUInt8Array_unit)

add_test( DOFValue_unit DOFValue_unit)
add_test( DOFValueStructure_unit DOFValueStructure_unit)
add_test( DOFValueList_unit DOFValueList_unit)
add_test( DOFValueArray_unit DOFValueArray_unit)
add_test( testBLOB_unit testBLOB_unit)
add_test( testBoolean_unit testBoolean_unit)
add_test( testBooleanArray_unit testBooleanArray_unit)
add_test( testDateTime_unit testDateTime_unit)
add_test( testDateTimeArray_unit testDateTimeArray_unit)
add_test( testFloat32_unit testFloat32_unit)
add_test( testFloat32Array_unit testFloat32Array_unit)
add_test( testFloat64_unit testFloat64_unit)
add_test( testFloat64Array_unit testFloat64Array_unit)
add_test( testGUID_unit testGUID_unit)
add_test( testGUIDArray_unit testGUIDArray_unit)
add_test( testInt16_unit testInt16_unit)
add_test( testInt16Array_unit testInt16Array_unit)
add_test( testInt32_unit testInt32_unit)
add_test( testInt32Array_unit testInt32Array_unit)
add_test( testInt64_unit testInt64_unit)
add_test( testInt64Array_unit testInt64Array_unit)
add_test( testInt8_unit testInt8_unit)
add_test( testInt8Array_unit testInt8Array_unit)
add_test( testInterfaceID_unit testInterfaceID_unit)
add_test( testInterfaceIDArray_unit testInterfaceIDArray_unit)
add_test( testObjectID_unit testObjectID_unit)
add_test( testObjectIDArray_unit testObjectIDArray_unit)
add_test( testString_unit testString_unit)
add_test( testStringArray_unit testStringArray_unit)
add_test( testStringBuffer_unit testStringBuffer_unit)
add_test( testUInt16_unit testUInt16_unit)
add_test( testUInt16Array_unit testUInt16Array_unit)
add_test( testUInt32_unit testUInt32_unit)
add_test( testUInt32Array_unit testUInt32Array_unit)
add_test( testUInt64_unit testUInt64_unit)
add_test( testUInt64Array_unit testUInt64Array_unit)
add_test( testUInt8_unit testUInt8_unit)
add_test( testUInt8Array_unit testUInt8Array_unit)
