SET(LIBRARIES ChronoEngine)
INCLUDE_DIRECTORIES( ${CH_INCLUDES} )

SET(TESTS
    utest_CH_ChVector
    utest_CH_coords
    utest_CH_math
    utest_CH_AVX
    #utest_CH_stream
)

MESSAGE(STATUS "Unit test programs for CORE module...")

FOREACH(PROGRAM ${TESTS})
    MESSAGE(STATUS "...add ${PROGRAM}")

    ADD_EXECUTABLE(${PROGRAM}  "${PROGRAM}.cpp")
    SOURCE_GROUP(""  FILES "${PROGRAM}.cpp")

    SET_TARGET_PROPERTIES(${PROGRAM} PROPERTIES
        FOLDER demos
        COMPILE_FLAGS "${CH_CXX_FLAGS}"
        LINK_FLAGS "${CH_LINKERFLAG_EXE}"
    )

    TARGET_LINK_LIBRARIES(${PROGRAM} ${LIBRARIES})
    ADD_DEPENDENCIES(${PROGRAM} ${LIBRARIES})

    INSTALL(TARGETS ${PROGRAM} DESTINATION bin)
    ADD_TEST(${PROGRAM} ${PROJECT_BINARY_DIR}/bin/${PROGRAM})
ENDFOREACH(PROGRAM)
SET(LIBRARIES ChronoEngine)
INCLUDE_DIRECTORIES( ${CH_INCLUDES} )

SET(TESTS
    utest_CH_ChVector
    utest_CH_coords
    utest_CH_math
    #utest_CH_stream
)

if(AVX_FOUND)
   set(TESTS ${TESTS} 
       utest_CH_AVX
   )
endif()

MESSAGE(STATUS "Unit test programs for CORE module...")

FOREACH(PROGRAM ${TESTS})
    MESSAGE(STATUS "...add ${PROGRAM}")

    ADD_EXECUTABLE(${PROGRAM}  "${PROGRAM}.cpp")
    SOURCE_GROUP(""  FILES "${PROGRAM}.cpp")

    SET_TARGET_PROPERTIES(${PROGRAM} PROPERTIES
        FOLDER demos
        COMPILE_FLAGS "${CH_CXX_FLAGS}"
        LINK_FLAGS "${CH_LINKERFLAG_EXE}"
    )

    TARGET_LINK_LIBRARIES(${PROGRAM} ${LIBRARIES})
    ADD_DEPENDENCIES(${PROGRAM} ${LIBRARIES})

    INSTALL(TARGETS ${PROGRAM} DESTINATION bin)
    ADD_TEST(${PROGRAM} ${PROJECT_BINARY_DIR}/bin/${PROGRAM})
ENDFOREACH(PROGRAM)
Build the AVX unit test only if AVX is supported/enabled
Build the AVX unit test only if AVX is supported/enabled
