2026-04-05 14:30:43 +10:00
|
|
|
project(FireNSmokeDetection_Tests LANGUAGES CXX)
|
|
|
|
|
|
2026-04-06 07:11:04 +10:00
|
|
|
# ============================================================================
|
|
|
|
|
# Common settings shared by both targets
|
|
|
|
|
# ============================================================================
|
|
|
|
|
set(COMMON_INCLUDES
|
|
|
|
|
${TEST_COMMON_DIR}
|
|
|
|
|
${ANSLIB_INCLUDE_DIR}
|
|
|
|
|
${OPENCV_INCLUDE_DIR}
|
|
|
|
|
${CMAKE_SOURCE_DIR}/ANSCustomFireNSmokeDetection
|
2026-04-05 14:30:43 +10:00
|
|
|
)
|
|
|
|
|
|
2026-04-06 07:11:04 +10:00
|
|
|
set(COMMON_DEFS
|
2026-04-05 14:30:43 +10:00
|
|
|
WIN32_LEAN_AND_MEAN
|
|
|
|
|
NOMINMAX
|
|
|
|
|
$<$<CONFIG:Debug>:_DEBUG>
|
|
|
|
|
$<$<CONFIG:Release>:NDEBUG>
|
|
|
|
|
)
|
|
|
|
|
|
2026-04-06 07:11:04 +10:00
|
|
|
# All runtime DLLs (ANSLIB, ANSODEngine, ANSLicensingSystem, ANSMOT, OpenCV, etc.)
|
|
|
|
|
# live in C:\ProgramData\ANSCENTER\Shared — same directory as the .lib files.
|
|
|
|
|
# Windows resolves them via the standard DLL search order.
|
|
|
|
|
|
|
|
|
|
# ============================================================================
|
|
|
|
|
# 1. Google Test unit/integration test executable
|
|
|
|
|
# ============================================================================
|
|
|
|
|
add_executable(${PROJECT_NAME}
|
|
|
|
|
FireNSmokeDetectionTest.cpp
|
2026-04-05 14:30:43 +10:00
|
|
|
)
|
|
|
|
|
|
2026-04-06 07:11:04 +10:00
|
|
|
target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17)
|
|
|
|
|
target_compile_definitions(${PROJECT_NAME} PRIVATE ${COMMON_DEFS})
|
|
|
|
|
target_include_directories(${PROJECT_NAME} PRIVATE ${COMMON_INCLUDES})
|
|
|
|
|
|
2026-04-05 14:30:43 +10:00
|
|
|
target_link_directories(${PROJECT_NAME} PRIVATE
|
|
|
|
|
${ANSLIB_LIB_DIR}
|
|
|
|
|
${OPENCV_LIB_DIR}
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
target_link_libraries(${PROJECT_NAME} PRIVATE
|
|
|
|
|
gtest
|
|
|
|
|
gtest_main
|
|
|
|
|
ANSLIB
|
|
|
|
|
opencv_world4130
|
|
|
|
|
ANSCustomFireNSmokeDetection
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
if(MSVC)
|
|
|
|
|
target_compile_options(${PROJECT_NAME} PRIVATE /W3 /sdl /permissive-)
|
|
|
|
|
endif()
|
|
|
|
|
|
|
|
|
|
include(GoogleTest)
|
|
|
|
|
gtest_discover_tests(${PROJECT_NAME} DISCOVERY_MODE PRE_TEST)
|
2026-04-06 07:11:04 +10:00
|
|
|
|
|
|
|
|
# ============================================================================
|
|
|
|
|
# 2. Interactive video demo executable (visual verification with OpenCV window)
|
|
|
|
|
# ============================================================================
|
|
|
|
|
add_executable(FireNSmokeDetection_Demo
|
|
|
|
|
main.cpp
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
target_compile_features(FireNSmokeDetection_Demo PRIVATE cxx_std_17)
|
|
|
|
|
target_compile_definitions(FireNSmokeDetection_Demo PRIVATE ${COMMON_DEFS})
|
|
|
|
|
target_include_directories(FireNSmokeDetection_Demo PRIVATE ${COMMON_INCLUDES})
|
|
|
|
|
|
|
|
|
|
target_link_directories(FireNSmokeDetection_Demo PRIVATE
|
|
|
|
|
${ANSLIB_LIB_DIR}
|
|
|
|
|
${OPENCV_LIB_DIR}
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
target_link_libraries(FireNSmokeDetection_Demo PRIVATE
|
|
|
|
|
ANSLIB
|
|
|
|
|
opencv_world4130
|
|
|
|
|
ANSCustomFireNSmokeDetection
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
if(MSVC)
|
|
|
|
|
target_compile_options(FireNSmokeDetection_Demo PRIVATE /W3 /sdl /permissive-)
|
|
|
|
|
endif()
|