Julius Pfrommer пре 9 година
родитељ
комит
0ed23beeb7
4 измењених фајлова са 19 додато и 40 уклоњено
  1. 13 33
      CMakeLists.txt
  2. 0 0
      deps/queue.h
  3. 0 1
      src/ua_config.h.in
  4. 6 6
      src/ua_util.h

+ 13 - 33
CMakeLists.txt

@@ -4,7 +4,7 @@ cmake_minimum_required(VERSION 2.8.8)
 project(open62541 C)
 set(open62541_VERSION_MAJOR 0)
 set(open62541_VERSION_MINOR 0)
-set(NVIM_VERSION_PATCH 0)
+set(open62541_VERSION_PATCH 0)
 
 set(CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake")
 
@@ -70,14 +70,6 @@ else()
     list(APPEND lib_sources src/server/ua_nodestore.c)
 endif()
 
-
-## set debug flag
-if(CMAKE_BUILD_TYPE MATCHES Debug)
-    set(UA_DEBUG ON)
-else()
-    set(UA_DEBUG OFF)
-endif()
-
 ## extensions
 option(EXTENSION_STATELESS "Enable stateless extension" OFF)
 option(EXTENSION_UDP "Enable udp extension" OFF)
@@ -97,18 +89,6 @@ if(EXTENSION_STATELESS)
     endif()
 endif()
 
-## self-signed certificates
-option(ENABLE_SELFSIGNED "Enable self-signed certificates" OFF)
-if(ENABLE_SELFSIGNED)
-    message(STATUS "Enabling self-signed certificates")
-    SET(lib_sources ${lib_sources} ${PROJECT_BINARY_DIR}/localhost.der ${PROJECT_BINARY_DIR}/ca.crt)
-    add_custom_command(OUTPUT ${PROJECT_BINARY_DIR}/localhost.der
-                              ${PROJECT_BINARY_DIR}/ca.crt
-                   COMMAND python ${PROJECT_SOURCE_DIR}/tools/certs/create_self-signed.py ${PROJECT_BINARY_DIR}
-                   DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/tools/certs/create_self-signed.py
-                           ${CMAKE_CURRENT_SOURCE_DIR}/tools/certs/localhost.cnf)
-endif()
-
 add_library(open62541-objects OBJECT ${lib_sources}) # static version that exports all symbols
 add_library(open62541 SHARED $<TARGET_OBJECTS:open62541-objects>)
 target_compile_definitions(open62541-objects PUBLIC UA_DYNAMIC_LINKING)
@@ -129,18 +109,6 @@ endif()
 # set the precompiler flags
 configure_file("src/ua_config.h.in" "${PROJECT_BINARY_DIR}/src_generated/ua_config.h")
 
-# download queue.h if required
-if(WIN32)
-    if(NOT EXISTS "${PROJECT_BINARY_DIR}/src_generated/queue.h")
-        file(DOWNLOAD "http://openbsd.cs.toronto.edu/cgi-bin/cvsweb/~checkout~/src/sys/sys/queue.h" "${PROJECT_BINARY_DIR}/src_generated/queue.h" STATUS result)
-        list(GET result 0 download_ok)
-        if(NOT ${download_ok} MATCHES 0)
-            file(REMOVE "${PROJECT_BINARY_DIR}/src_generated/queue.h") # remove empty file if created
-            message(FATAL_ERROR "queue.h could not be downloaded")
-        endif()
-    endif()
-endif(WIN32)
-
 # generate code from xml definitions
 file(MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/src_generated")
 include_directories("${PROJECT_BINARY_DIR}/src_generated") 
@@ -198,6 +166,18 @@ if(MULTITHREADING)
 endif()
 endif()
 
+## self-signed certificates
+option(GENERATE_SELFSIGNED "Generate self-signed certificates" OFF)
+if(GENERATE_SELFSIGNED)
+    message(STATUS "Enabling self-signed certificates")
+    SET(lib_sources ${lib_sources} ${PROJECT_BINARY_DIR}/localhost.der ${PROJECT_BINARY_DIR}/ca.crt)
+    add_custom_command(OUTPUT ${PROJECT_BINARY_DIR}/localhost.der
+                              ${PROJECT_BINARY_DIR}/ca.crt
+                   COMMAND python ${PROJECT_SOURCE_DIR}/tools/certs/create_self-signed.py ${PROJECT_BINARY_DIR}
+                   DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/tools/certs/create_self-signed.py
+                           ${CMAKE_CURRENT_SOURCE_DIR}/tools/certs/localhost.cnf)
+endif()
+
 # build unit tests
 option(ENABLE_UNIT_TESTS "Run unit tests after building" OFF)
 if(ENABLE_UNIT_TESTS)

include/queue.h → deps/queue.h


+ 0 - 1
src/ua_config.h.in

@@ -1,7 +1,6 @@
 /* Buid options and configuration (set by cmake) */
 
 #define UA_LOGLEVEL ${UA_LOGLEVEL}
-#cmakedefine UA_DEBUG
 #cmakedefine UA_MULTITHREADING
 
 /* Function Export */

+ 6 - 6
src/ua_util.h

@@ -1,7 +1,7 @@
 #ifndef UA_UTIL_H_
 #define UA_UTIL_H_
 
-#ifndef  __USE_POSIX
+#ifndef __USE_POSIX
 #define __USE_POSIX
 #endif
 #include <stdlib.h> // malloc, free
@@ -10,11 +10,11 @@
 #include <stddef.h> /* Needed for queue.h */
 
 #ifdef _WIN32
-#  include <malloc.h>
-#  include "queue.h"
+# include <malloc.h>
+# include "../deps/queue.h"
 #else
-#  include <alloca.h>
-#  include <sys/queue.h>
+# include <alloca.h>
+# include <sys/queue.h>
 #endif
 
 #include "ua_types.h"
@@ -27,7 +27,7 @@
 
 #define UA_assert(ignore) assert(ignore)
 
-/* Replace the macros with functions for custom allocators.. */
+/* Replace the macros with functions for custom allocators if necessary */
 #define UA_free(ptr) free(ptr)
 #define UA_malloc(size) malloc(size)
 #define UA_realloc(ptr, size) realloc(ptr, size)