# fmo-test

add_executable(fmo-test
    ../catch/catch.hpp
    test-explorer.cpp
    test-image.cpp
    test-main.cpp)

set_property(TARGET fmo-test PROPERTY CXX_EXTENSIONS OFF)
set_property(TARGET fmo-test PROPERTY CXX_STANDARD 14)

target_link_libraries(fmo-test fmo)
install(TARGETS fmo-test DESTINATION bin)

# fmo-test assets
set(ASSETS_SRC "${CMAKE_CURRENT_SOURCE_DIR}/assets")
install(DIRECTORY "${ASSETS_SRC}" DESTINATION bin)

if(MSVC)
    # copy assets to the MSVC default launch directory
    set(ASSETS_DST "${CMAKE_CURRENT_BINARY_DIR}/assets")
else()
    # copy assets next to the test executable in the build tree
    set(ASSETS_DST "$<TARGET_FILE_DIR:fmo-test>/assets")
endif()

add_custom_command(TARGET fmo-test POST_BUILD
    COMMAND "${CMAKE_COMMAND}" -E copy_directory
    "${ASSETS_SRC}" "${ASSETS_DST}")

# fmo-benchmark

add_executable(fmo-benchmark
	benchmark-main.cpp)

set_property(TARGET fmo-benchmark PROPERTY CXX_EXTENSIONS OFF)
set_property(TARGET fmo-benchmark PROPERTY CXX_STANDARD 14)

target_link_libraries(fmo-benchmark fmo)
install(TARGETS fmo-benchmark DESTINATION bin)

# fmo-test

add_executable(fmo-test
    ../catch/catch.hpp
    test-explorer.cpp
    test-image.cpp
    test-main.cpp)

set_property(TARGET fmo-test PROPERTY CXX_EXTENSIONS OFF)
set_property(TARGET fmo-test PROPERTY CXX_STANDARD 14)

target_compile_definitions(fmo-test PRIVATE CATCH_CONFIG_FAST_COMPILE)
target_link_libraries(fmo-test fmo)
install(TARGETS fmo-test DESTINATION bin)

# fmo-test assets
set(ASSETS_SRC "${CMAKE_CURRENT_SOURCE_DIR}/assets")
install(DIRECTORY "${ASSETS_SRC}" DESTINATION bin)

if(MSVC)
    # copy assets to the MSVC default launch directory
    set(ASSETS_DST "${CMAKE_CURRENT_BINARY_DIR}/assets")
else()
    # copy assets next to the test executable in the build tree
    set(ASSETS_DST "$<TARGET_FILE_DIR:fmo-test>/assets")
endif()

add_custom_command(TARGET fmo-test POST_BUILD
    COMMAND "${CMAKE_COMMAND}" -E copy_directory
    "${ASSETS_SRC}" "${ASSETS_DST}")

# fmo-benchmark

add_executable(fmo-benchmark
	benchmark-main.cpp)

set_property(TARGET fmo-benchmark PROPERTY CXX_EXTENSIONS OFF)
set_property(TARGET fmo-benchmark PROPERTY CXX_STANDARD 14)

target_link_libraries(fmo-benchmark fmo)
install(TARGETS fmo-benchmark DESTINATION bin)

Enable fast compilation of Catch tests
Enable fast compilation of Catch tests
