aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--CMakeLists.txt3
-rw-r--r--test/CMakeLists.txt8
2 files changed, 9 insertions, 2 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index a67ed2a1..07c6d342 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -270,8 +270,7 @@ set (GAWK_SOURCES ${GAWK_SOURCES}
add_executable (gawk ${GAWK_SOURCES})
target_link_libraries (gawk m ${EXTRA_LIBS})
-if(${CMAKE_CROSSCOMPILING} STREQUAL "TRUE")
-else()
+if(NOT ${CMAKE_CROSSCOMPILING} STREQUAL "TRUE")
add_subdirectory(test)
add_subdirectory(doc)
endif()
diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt
index 2ed72205..d54aad1f 100644
--- a/test/CMakeLists.txt
+++ b/test/CMakeLists.txt
@@ -24,3 +24,11 @@
## process this file with CMake to produce Makefile
+add_custom_target(check)
+add_custom_command(
+ TARGET check
+ WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
+ COMMAND ${CMAKE_BINARY_DIR}/gawk -f addcomma.awk < addcomma.in > _addcomma 2>&1 || echo EXIT CODE: $$? >>_$@
+ COMMAND cmp addcomma.ok _addcomma && rm -f _addcomma
+)
+