[geos-commits] r2892 - in trunk: . tests/unit

svn_geos at osgeo.org svn_geos at osgeo.org
Thu Jan 28 20:43:27 EST 2010


Author: mloskot
Date: 2010-01-28 20:43:22 -0500 (Thu, 28 Jan 2010)
New Revision: 2892

Modified:
   trunk/CMakeLists.txt
   trunk/tests/unit/CMakeLists.txt
Log:
Configured 'make test' target for CMake build (#317). Now only geos_unit is executed

Modified: trunk/CMakeLists.txt
===================================================================
--- trunk/CMakeLists.txt	2010-01-28 18:42:24 UTC (rev 2891)
+++ trunk/CMakeLists.txt	2010-01-29 01:43:22 UTC (rev 2892)
@@ -54,6 +54,7 @@
   option(GEOS_ENABLE_ASSERT
     "Set to ON to build GEOS with assert() macro enabled" OFF) 
 endif()
+
 #################################################################################
 # Setup C/C++ compiler options
 #################################################################################
@@ -210,6 +211,10 @@
 # Configure subdirectories
 #################################################################################
 
+if(GEOS_ENABLE_TESTS)
+  enable_testing()
+endif()
+
 add_subdirectory(include)
 add_subdirectory(src)
 add_subdirectory(capi)

Modified: trunk/tests/unit/CMakeLists.txt
===================================================================
--- trunk/tests/unit/CMakeLists.txt	2010-01-28 18:42:24 UTC (rev 2891)
+++ trunk/tests/unit/CMakeLists.txt	2010-01-29 01:43:22 UTC (rev 2892)
@@ -12,12 +12,23 @@
 #
 #################################################################################
 
-include_directories(${CMAKE_SOURCE_DIR}/capi)
-include_directories(${CMAKE_CURRENT_SOURCE_DIR}/tut)
-include_directories(${CMAKE_CURRENT_SOURCE_DIR})
+set(STATUS_MESSAGE "Enable GEOS tests build and run")
+set(STATUS_RESULT "OFF")
 
-file(GLOB_RECURSE geos_unit_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp)
+if(GEOS_ENABLE_TESTS)
+  include_directories(${CMAKE_SOURCE_DIR}/capi)
+  include_directories(${CMAKE_CURRENT_SOURCE_DIR}/tut)
+  include_directories(${CMAKE_CURRENT_SOURCE_DIR})
+  
+  file(GLOB_RECURSE geos_unit_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp)
+  
+  add_executable(geos_unit ${geos_unit_SOURCES})
+  target_link_libraries(geos_unit geos geos_c)
 
-add_executable(geos_unit ${geos_unit_SOURCES})
+  add_test(geos_unit ${CMAKE_CURRENT_BINARY_DIR}/geos_unit)
 
-target_link_libraries(geos_unit geos geos_c)
+  set(STATUS_RESULT "ON")
+endif()
+
+message(STATUS "${STATUS_MESSAGE} - ${STATUS_RESULT}")
+



More information about the geos-commits mailing list