include_directories( ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR} ${CPPUNIT_INCLUDE_DIR} ) if (MSVC) add_definitions(-D_CRT_SECURE_NO_WARNINGS) endif (MSVC) set( UnitTest_SRCS CapabilitiesTest.cpp ClientServicesTest.cpp CommandTest.cpp CommonTest.cpp ExpressionParseTest.cpp ExpressionTest.cpp FilterParseTest.cpp FilterTest.cpp GeometryTest.cpp GeometryMemPerfTest.cpp IoTest.cpp SchemaTest.cpp SpatialContextTest.cpp TestProcessor.cpp UnitTestUtil.cpp XmlFormatter.cpp XmlTest.cpp GmlTest.cpp GmlWriteTest.cpp ) add_unit_test_entry_point(UnitTest_SRCS "FdoCore") if (NOT INTERNAL_XALANC AND NOT WIN32) # HACK: Workaround a bug in system-installed xalan # # https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=718303 # https://issues.apache.org/jira/browse/XALANC-751 # # TODO: We ideally should version check known distros that have # the fix. Also if/when we merge the fix into our internal copy # of xalan, we should also check if we're building against system # or internal copy of xalan add_definitions(-DHAS_XALANC_751_BUG) endif (NOT INTERNAL_XALANC AND NOT WIN32) link_directories( ${CPPUNIT_LIBRARY_DIR} ) msvc_add_precompiled_header("Pch.h" "Pch.cpp" UnitTest_SRCS) add_executable( UnitTest ${UnitTest_SRCS} ) add_sanitizers( UnitTest ) add_dependencies( UnitTest FDOMessage ) if( LOCAL_CPPUNIT ) add_dependencies( UnitTest Internal_Cppunit ) endif( LOCAL_CPPUNIT ) if (WIN32) target_link_libraries( UnitTest ${CPPUNIT_LIBRARIES} FDOCommon FDOGeometry FDOSpatial FDO ) FdoCopyBinaries(UnitTest) else (WIN32) target_link_libraries( UnitTest ${CPPUNIT_LIBRARIES} FDO${FDO_VERSION_SUFFIX} dl ) endif (WIN32) # Ensure test data is copied to where the unit test binary is generated file(GLOB UnitTestFdo_TESTDATA "*.txt" "*.xml" "*.xsd" ) file(COPY ${UnitTestFdo_TESTDATA} DESTINATION ${CMAKE_CURRENT_BINARY_DIR})