summaryrefslogtreecommitdiffstats
path: root/Tests/FindEXPAT/Test/CMakeLists.txt
diff options
context:
space:
mode:
authorBen Morgan <Ben.Morgan@warwick.ac.uk>2017-08-30 11:18:07 (GMT)
committerBen Morgan <Ben.Morgan@warwick.ac.uk>2017-09-01 15:02:57 (GMT)
commitbfe51369a7f2dd29eb08f24b877fdd01b7534e5c (patch)
tree09a03f97addb4656da7ff311a30e67660bb02ecd /Tests/FindEXPAT/Test/CMakeLists.txt
parent78f166f8730c4da4ad21ba6218803f1a6552a95a (diff)
downloadCMake-bfe51369a7f2dd29eb08f24b877fdd01b7534e5c.zip
CMake-bfe51369a7f2dd29eb08f24b877fdd01b7534e5c.tar.gz
CMake-bfe51369a7f2dd29eb08f24b877fdd01b7534e5c.tar.bz2
FindEXPAT: Add unit test of target and variables
Diffstat (limited to 'Tests/FindEXPAT/Test/CMakeLists.txt')
-rw-r--r--Tests/FindEXPAT/Test/CMakeLists.txt16
1 files changed, 16 insertions, 0 deletions
diff --git a/Tests/FindEXPAT/Test/CMakeLists.txt b/Tests/FindEXPAT/Test/CMakeLists.txt
new file mode 100644
index 0000000..5681f74
--- /dev/null
+++ b/Tests/FindEXPAT/Test/CMakeLists.txt
@@ -0,0 +1,16 @@
+cmake_minimum_required(VERSION 3.9)
+project(TestFindEXPAT C)
+include(CTest)
+
+find_package(EXPAT REQUIRED)
+
+add_definitions(-DCMAKE_EXPECTED_EXPAT_VERSION="${EXPAT_VERSION_STRING}")
+
+add_executable(testexpat_tgt main.c)
+target_link_libraries(testexpat_tgt EXPAT::EXPAT)
+add_test(NAME testexpat_tgt COMMAND testexpat_tgt)
+
+add_executable(testexpat_var main.c)
+target_include_directories(testexpat_var PRIVATE ${EXPAT_INCLUDE_DIRS})
+target_link_libraries(testexpat_var PRIVATE ${EXPAT_LIBRARIES})
+add_test(NAME testexpat_var COMMAND testexpat_var)