set(tests_headers
comfun.h
xmldom.h
)

set(tests_sources
${tests_headers}
main.cpp
amass_test.cpp
bias_test.cpp
catfile_test.cpp
ccdfile_test.cpp
comfun.cpp
common_test.cpp
dark_test.cpp
flat_test.cpp
fset_test.cpp
helcor_test.cpp
kombine_test.cpp
konve_test.cpp
list_test.cpp
main.cpp
match_test.cpp
mbias_test.cpp
mdark_test.cpp
mflat_test.cpp
phot_test.cpp
phtfile_test.cpp
table_test.cpp
tcorr_test.cpp
xmldom.cpp
xml_test.cpp
)

set(tests_libs
cmpack_static
)

if(ENABLE_TESTS)

	add_executable(tests ${tests_sources})
	set_target_properties (tests PROPERTIES FOLDER tests/core)
	target_compile_options(tests PRIVATE /W3 /WX)
	target_link_libraries(tests PRIVATE ${tests_libs} gtest gmock cmpack_cfitsio cmpack_expat)

	gtest_discover_tests(tests)

	if(MSVC)
		target_compile_definitions(tests PRIVATE _CRT_SECURE_NO_DEPRECATE _CRT_SECURE_NO_WARNINGS _NO_OLDNAMES)
	endif(MSVC)

endif(ENABLE_TESTS)