[Libwebsockets] some small changes needed to be consistent

Edwin van den Oetelaar oetelaar.automatisering at gmail.com
Sat Mar 9 21:27:17 CET 2013


Hello Andy and others,

Indentation in the CmakeLists.txt (see patch)
The m4 directory is not used and can be removed.
The INSTALL file mentions ./configure etc, since it is for autotools.
(can be removed)
The libwebsockets.spec file is for autotools, it does not work for
cmake (I have not enough knowledge or time to fix it right now)

Very excellent :-)

Greetings,
Edwin van den Oetelaar


diff --git a/CMakeLists.txt b/CMakeLists.txt
index 5d09cc4..a15debe 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -214,7 +214,7 @@ configure_file(
 if (MSVC)
        # Turn off stupid microsoft security warnings.
        add_definitions(-D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE)
-endif()
+endif(MSVC)

 include_directories(${PROJECT_SOURCE_DIR}/lib)

@@ -274,25 +274,25 @@ if (WIN32)
                ${WIN32_HELPERS_PATH}/websock-w32.h
                ${WIN32_HELPERS_PATH}/gettimeofday.h
                )
-if (MINGW)
-       list(APPEND SOURCES
-               ${WIN32_HELPERS_PATH}/gettimeofday.c
-               )
-else()
-       list(APPEND SOURCES
-               ${WIN32_HELPERS_PATH}/websock-w32.c
-               ${WIN32_HELPERS_PATH}/gettimeofday.c
-               )
-endif()
+       if (MINGW)
+               list(APPEND SOURCES
+                       ${WIN32_HELPERS_PATH}/gettimeofday.c
+                       )
+       else(MINGW)
+               list(APPEND SOURCES
+                       ${WIN32_HELPERS_PATH}/websock-w32.c
+                       ${WIN32_HELPERS_PATH}/gettimeofday.c
+                       )
+       endif(MINGW)
        include_directories(${WIN32_HELPERS_PATH})
-else()
+else(WIN32)
        # Unix.
        if (NOT WITHOUT_DAEMONIZE)
                list(APPEND SOURCES
                        lib/daemonize.c
                        )
        endif()
-endif()
+endif(WIN32)

 if (UNIX)
        if (NOT HAVE_GETIFADDRS)
@@ -443,11 +443,11 @@ endif(WITH_SSL)
 #
 if (WIN32)
        list(APPEND LIB_LIST ws2_32.lib)
-endif()
+endif(WIN32)

 if (UNIX)
        list(APPEND LIB_LIST m)
-endif()
+endif(UNIX)

 # Setup the linking for all libs.
 foreach (lib websockets websockets_shared)
@@ -487,10 +487,10 @@ if (NOT WITHOUT_TESTAPPS)
                if (LINK_TESTAPPS_DYNAMIC)
                        target_link_libraries(${TEST_NAME} websockets_shared)
                        add_dependencies(${TEST_NAME} websockets_shared)
-               else()
+               else(LINK_TESTAPPS_DYNAMIC)
                        target_link_libraries(${TEST_NAME} websockets)
                        add_dependencies(${TEST_NAME} websockets)
-               endif()
+               endif(LINK_TESTAPPS_DYNAMIC)

                # Set test app specific defines.
                set_property(TARGET ${TEST_NAME}
@@ -543,7 +543,7 @@ if (NOT WITHOUT_TESTAPPS)
                        # We need to link against winsock code.
                        if (WIN32)

target_link_libraries(test-server-extpoll ws2_32.lib)
-                       endif()
+                       endif(WIN32)
                endif()

                # Data files for running the test server.
@@ -696,7 +696,7 @@ Cflags: -I\${includedir}"

        install(FILES ${PROJECT_BINARY_DIR}/libwebsockets.pc
                DESTINATION include/pkgconfig)
-endif()
+endif(UNIX)

 # Install headers.
 install(FILES ${HDR_PUBLIC}



More information about the Libwebsockets mailing list