]> granicus.if.org Git - libevent/commitdiff
CMake: Get rid of python not found warning when regress tests turned off.
authorJoakim Söderberg <joakim.soderberg@gmail.com>
Tue, 21 Jan 2014 23:06:21 +0000 (00:06 +0100)
committerJoakim Söderberg <joakim.soderberg@gmail.com>
Tue, 21 Jan 2014 23:06:21 +0000 (00:06 +0100)
It would warn that python wasn't found when it was, just because the regress tests where turned off... confusing.

CMakeLists.txt

index 98bd56e159e30f2e153eaa6396bb8c2582d14132..00f4aa35aa235fa292e784f0201c054279ef2c73 100644 (file)
@@ -734,62 +734,64 @@ if (NOT EVENT__DISABLE_TESTS)
     #
     # Generate Regress tests.
     #
-    if (NOT EVENT__DISABLE_REGRESS AND PYTHONINTERP_FOUND)
-        message("Generating regress tests...")
-        add_definitions(-DTINYTEST_LOCAL)
-        add_custom_command(
-            OUTPUT 
-                ${CMAKE_CURRENT_SOURCE_DIR}/test/regress.gen.c 
-                ${CMAKE_CURRENT_SOURCE_DIR}/test/regress.gen.h
-            DEPENDS 
-                event_rpcgen.py
-                test/regress.rpc 
-            COMMAND ${PYTHON_EXECUTABLE} ../event_rpcgen.py regress.rpc 
-            WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/test
-            )
-
-        list(APPEND SRC_REGRESS 
-            test/regress.c
-            test/regress.gen.c
-            test/regress.gen.h
-            test/regress_buffer.c
-            test/regress_bufferevent.c
-            test/regress_dns.c
-            test/regress_et.c
-            test/regress_finalize.c
-            test/regress_http.c 
-            test/regress_listener.c 
-            test/regress_main.c
-            test/regress_minheap.c
-            test/regress_rpc.c
-            test/regress_testutils.c
-            test/regress_testutils.h
-            test/regress_util.c 
-            test/tinytest.c
-            )
-
-        if (WIN32)
-            list(APPEND SRC_REGRESS test/regress_iocp.c)
-            list(APPEND SRC_REGRESS test/regress_thread.c)
-        endif()
-
-        if (CMAKE_USE_PTHREADS_INIT)
-            list(APPEND SRC_REGRESS test/regress_thread.c)
-        endif()
-
-        if (ZLIB_LIBRARY)
-            list(APPEND SRC_REGRESS test/regress_zlib.c)
-        endif()
-
-        if (OPENSSL_LIBRARIES)
-            list(APPEND SRC_REGRESS test/regress_ssl.c)
+    if (NOT EVENT__DISABLE_REGRESS)
+        if (PYTHONINTERP_FOUND)
+            message("Generating regress tests...")
+            add_definitions(-DTINYTEST_LOCAL)
+            add_custom_command(
+                OUTPUT 
+                    ${CMAKE_CURRENT_SOURCE_DIR}/test/regress.gen.c 
+                    ${CMAKE_CURRENT_SOURCE_DIR}/test/regress.gen.h
+                DEPENDS 
+                    event_rpcgen.py
+                    test/regress.rpc 
+                COMMAND ${PYTHON_EXECUTABLE} ../event_rpcgen.py regress.rpc 
+                WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/test
+                )
+
+            list(APPEND SRC_REGRESS 
+                test/regress.c
+                test/regress.gen.c
+                test/regress.gen.h
+                test/regress_buffer.c
+                test/regress_bufferevent.c
+                test/regress_dns.c
+                test/regress_et.c
+                test/regress_finalize.c
+                test/regress_http.c 
+                test/regress_listener.c 
+                test/regress_main.c
+                test/regress_minheap.c
+                test/regress_rpc.c
+                test/regress_testutils.c
+                test/regress_testutils.h
+                test/regress_util.c 
+                test/tinytest.c
+                )
+
+            if (WIN32)
+                list(APPEND SRC_REGRESS test/regress_iocp.c)
+                list(APPEND SRC_REGRESS test/regress_thread.c)
+            endif()
+
+            if (CMAKE_USE_PTHREADS_INIT)
+                list(APPEND SRC_REGRESS test/regress_thread.c)
+            endif()
+
+            if (ZLIB_LIBRARY)
+                list(APPEND SRC_REGRESS test/regress_zlib.c)
+            endif()
+
+            if (OPENSSL_LIBRARIES)
+                list(APPEND SRC_REGRESS test/regress_ssl.c)
+            endif()
+
+            add_executable(regress ${SRC_REGRESS})
+            target_link_libraries(regress event ${LIB_APPS} ${LIB_PLATFORM})
+            add_dependencies(regress event)
+        else()
+            message(WARNING "Python not found, cannot generate regress tests!")
         endif()
-
-        add_executable(regress ${SRC_REGRESS})
-        target_link_libraries(regress event ${LIB_APPS} ${LIB_PLATFORM})
-        add_dependencies(regress event)
-    else()
-        message(WARNING "Python not found, cannot generate regress tests!")
     endif()
 
     #