From f1d1c7bd687ac764b9708f81e5972e05f5f917e2 Mon Sep 17 00:00:00 2001 From: Joakim Soderberg Date: Tue, 14 Oct 2014 15:24:31 +0200 Subject: [PATCH] BUGFIX: Failed to get proper output dir for test-server When creating the directory where to put the files needed by the test-server CMake would fail because it tried to create the directory /../share/libwebsockets-test-server, which is not possible. This happens since the TARGET_FILE_DIR for the test-server is not fetched properly. Also mentioned in this trac ticket: http://libwebsockets.org/trac/libwebsockets/ticket/84 --- CMakeLists.txt | 8 ++++++-- test-server/test-server.c | 2 ++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index f7fc82bf2..f33c20f29 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -679,7 +679,9 @@ if (NOT LWS_WITHOUT_TESTAPPS) add_custom_command(TARGET test-server POST_BUILD - COMMAND "${CMAKE_COMMAND}" -E make_directory "$/../share/libwebsockets-test-server") + COMMAND "${CMAKE_COMMAND}" -E make_directory "$/../share/libwebsockets-test-server" + COMMENT "Creating test-server $ share directory" + VERBATIM) # Copy the file needed to run the server so that the test apps can # reach them from their default output location @@ -687,7 +689,9 @@ if (NOT LWS_WITHOUT_TESTAPPS) if (EXISTS ${TEST_FILE}) add_custom_command(TARGET test-server POST_BUILD - COMMAND "${CMAKE_COMMAND}" -E copy "${TEST_FILE}" "$/../share/libwebsockets-test-server" VERBATIM) + COMMAND "${CMAKE_COMMAND}" -E copy "${TEST_FILE}" "$/../share/libwebsockets-test-server" + COMMENT "Copying test-server files" + VERBATIM) endif() endforeach() endif(NOT LWS_WITHOUT_SERVER) diff --git a/test-server/test-server.c b/test-server/test-server.c index d33d2f98e..b13182215 100644 --- a/test-server/test-server.c +++ b/test-server/test-server.c @@ -842,6 +842,8 @@ int main(int argc, char **argv) lwsl_notice("libwebsockets test server - " "(C) Copyright 2010-2014 Andy Green - " "licensed under LGPL2.1\n"); + + printf("Using resource path \"%s\"\n", resource_path); #ifdef EXTERNAL_POLL max_poll_elements = getdtablesize(); pollfds = malloc(max_poll_elements * sizeof (struct pollfd));