ADD_SUBDIRECTORY( Communicators )
ADD_SUBDIRECTORY( Containers )
ADD_SUBDIRECTORY( Functions )
ADD_SUBDIRECTORY( Matrices )
ADD_SUBDIRECTORY( Meshes )
ADD_SUBDIRECTORY( Pointers )

ADD_EXECUTABLE( AssertTest AssertTest.cpp )
TARGET_COMPILE_OPTIONS( AssertTest PRIVATE ${CXX_TESTS_FLAGS} )
TARGET_LINK_LIBRARIES( AssertTest ${GTEST_BOTH_LIBRARIES} )

if( BUILD_CUDA )
   CUDA_ADD_EXECUTABLE( AssertCudaTest AssertCudaTest.cu OPTIONS ${CXX_TESTS_FLAGS} )
   TARGET_LINK_LIBRARIES( AssertCudaTest ${GTEST_BOTH_LIBRARIES} )
endif()

if( BUILD_CUDA )
   CUDA_ADD_EXECUTABLE( AllocatorsTest AllocatorsTest.cu OPTIONS ${CXX_TESTS_FLAGS} )
   TARGET_LINK_LIBRARIES( AllocatorsTest ${GTEST_BOTH_LIBRARIES} )
else()
   ADD_EXECUTABLE( AllocatorsTest AllocatorsTest.cpp )
   TARGET_COMPILE_OPTIONS( AllocatorsTest PRIVATE ${CXX_TESTS_FLAGS} )
   TARGET_LINK_LIBRARIES( AllocatorsTest ${GTEST_BOTH_LIBRARIES} )
endif()

if( BUILD_CUDA )
   CUDA_ADD_EXECUTABLE( FileTest FileTest.cu OPTIONS ${CXX_TESTS_FLAGS} )
   TARGET_LINK_LIBRARIES( FileTest ${GTEST_BOTH_LIBRARIES} )
else()
   ADD_EXECUTABLE( FileTest FileTest.cpp )
   TARGET_COMPILE_OPTIONS( FileTest PRIVATE ${CXX_TESTS_FLAGS} )
   TARGET_LINK_LIBRARIES( FileTest ${GTEST_BOTH_LIBRARIES} )
endif()

ADD_EXECUTABLE( FileNameTest FileNameTest.cpp )
TARGET_COMPILE_OPTIONS( FileNameTest PRIVATE ${CXX_TESTS_FLAGS} )
TARGET_LINK_LIBRARIES( FileNameTest ${GTEST_BOTH_LIBRARIES} )

ADD_EXECUTABLE( StringTest StringTest.cpp )
TARGET_COMPILE_OPTIONS( StringTest PRIVATE ${CXX_TESTS_FLAGS} )
TARGET_LINK_LIBRARIES( StringTest ${GTEST_BOTH_LIBRARIES} )

ADD_EXECUTABLE( ObjectTest ObjectTest.cpp )
TARGET_COMPILE_OPTIONS( ObjectTest PRIVATE ${CXX_TESTS_FLAGS} )
TARGET_LINK_LIBRARIES( ObjectTest ${GTEST_BOTH_LIBRARIES} )

ADD_EXECUTABLE( TimerTest TimerTest.cpp )
TARGET_COMPILE_OPTIONS( TimerTest PRIVATE ${CXX_TESTS_FLAGS} )
TARGET_LINK_LIBRARIES( TimerTest ${GTEST_BOTH_LIBRARIES} )

ADD_EXECUTABLE( TypeInfoTest TypeInfoTest.cpp )
TARGET_COMPILE_OPTIONS( TypeInfoTest PRIVATE ${CXX_TESTS_FLAGS} )
TARGET_LINK_LIBRARIES( TypeInfoTest ${GTEST_BOTH_LIBRARIES} )

ADD_TEST( AssertTest ${EXECUTABLE_OUTPUT_PATH}/AssertTest${CMAKE_EXECUTABLE_SUFFIX} )
if( BUILD_CUDA )
   ADD_TEST( AssertCudaTest ${EXECUTABLE_OUTPUT_PATH}/AssertCudaTest${CMAKE_EXECUTABLE_SUFFIX} )
endif()
ADD_TEST( AllocatorsTest ${EXECUTABLE_OUTPUT_PATH}/AllocatorsTest${CMAKE_EXECUTABLE_SUFFIX} )
ADD_TEST( FileTest ${EXECUTABLE_OUTPUT_PATH}/FileTest${CMAKE_EXECUTABLE_SUFFIX} )
ADD_TEST( StringTest ${EXECUTABLE_OUTPUT_PATH}/StringTest${CMAKE_EXECUTABLE_SUFFIX} )
ADD_TEST( ObjectTest ${EXECUTABLE_OUTPUT_PATH}/ObjectTest${CMAKE_EXECUTABLE_SUFFIX} )
ADD_TEST( TimerTest ${EXECUTABLE_OUTPUT_PATH}/TimerTest${CMAKE_EXECUTABLE_SUFFIX} )
ADD_TEST( TypeInfoTest ${EXECUTABLE_OUTPUT_PATH}/TypeInfoTest${CMAKE_EXECUTABLE_SUFFIX} )
