Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
L
libwebsockets
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Issue analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
Fork
libwebsockets
Commits
add3926b
Commit
add3926b
authored
12 years ago
by
Joakim Söderberg
Committed by
Andy Green
12 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Some more Cmake stuff.
parent
08e434eb
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
CMakeLists.txt
+56
-14
56 additions, 14 deletions
CMakeLists.txt
config.h.cmake
+135
-0
135 additions, 0 deletions
config.h.cmake
with
191 additions
and
14 deletions
CMakeLists.txt
+
56
−
14
View file @
add3926b
...
...
@@ -11,13 +11,26 @@ set(PACKAGE_TARNAME "${PACKAGE}")
set
(
PACKAGE_URL
"http://libwebsockets.org"
)
set
(
VERSION
"{PACKAGE_VERSION}"
)
option
(
WITH_SSL
"Include SSL support"
,
ON
)
option
(
WITH_SSL
"Include SSL support
(default OpenSSL, CyaSSL if USE_CYASSL is set)
"
ON
)
option
(
USE_INCLUDED_WIN32_ZLIB
"Use the internal version of ZLib instead of searching the system"
ON
)
option
(
USE_CYASSL
"Use CyaSSL replacement for OpenSSL"
OFF
)
option
(
WITH_BUILTIN_GETIFADDRS
"Use BSD getifaddrs implementation from libwebsockets... default is your libc provides it"
OFF
)
option
(
WITHOUT_TESTAPPS
"Don't build the libwebsocket-test-apps"
OFF
)
option
(
WITHOUT_CLIENT
"Don't build the client part of the library"
OFF
)
option
(
WITHOUT_SERVER
"Don't build the server part of the library"
OFF
)
option
(
WITH_LIBCRYPTO
"Use libcrypto MD5 and SHA1 implementations"
ON
)
option
(
WITHOUT_PING
"Don't build the ping test application"
OFF
)
option
(
WITHOUT_DEBUG
"Don't compile debug related code"
OFF
)
set
(
CYASSL_LIB ON CACHE STRING
""
)
set
(
CYASSL_INCLUDE_DIRS ON CACHE STRING
""
)
if
(
USE_CYASSL
)
if
(
NOT CYASSL_LIB OR NOT CYASSL_INCLUDE_DIRS
)
error
(
"You must set CYASSL_LIB and CYASSL_INCLUDE_DIRS when USE_CYASSL is turned on"
)
endif
()
endif
()
set
(
CMAKE_MODULE_PATH
${
CMAKE_MODULE_PATH
}
"
${
PROJECT_SOURCE_DIR
}
/cmake/"
)
include_directories
(
${
PROJECT_BINARY_DIR
}
)
...
...
@@ -93,13 +106,14 @@ if (WIN32)
add_definitions
(
-D_WIN32_WINNT=0x0501
)
endif
(
WIN32
)
# Group headers and sources.
# Some IDEs use this for nicer file structure.
set
(
HDR_PRIVATE
lib/private-libwebsockets.h
)
set
(
HDR_PUBLIC
lib/private-libwebsockets.h
lib/extension-deflate-frame.h
lib/lib/extension-deflate-stream.h
lib/lib/extension-deflate-stream.h
)
set
(
HDR_PUBLIC
lib/libwebsockets.h
)
...
...
@@ -110,7 +124,7 @@ set(SOURCES
lib/client-parser.c
lib/daemonize.c
lib/extension.c
lib/extension-def
a
lte-frame.c
lib/extension-defl
a
te-frame.c
lib/extension-deflate-stream.c
lib/handshake.c
lib/libwebsockets.c
...
...
@@ -122,17 +136,44 @@ set(SOURCES
lib/sha-1.c
)
source_group
(
"Headers Private"
FILES
${
HDR_PRIVATE
}
)
source_group
(
"Headers Public"
FILES
${
HDR_PUBLIC
}
)
source_group
(
"Sources"
FILES
${
SOURCES
}
)
# Add helper files for Windows.
if
(
WIN32
)
set
(
WIN32_HELPERS_PATH
${
PROJECT_SOURCE_DIR
}
/win32port/win32helpers
)
list
(
APPEND HDR_PRIVATE
${
WIN32_HELPERS_PATH
}
/websock-w32.h
${
WIN32_HELPERS_PATH
}
/gettimeofday.h
)
list
(
APPEND SOURCES
${
WIN32_HELPERS_PATH
}
/websock-w32.c
${
WIN32_HELPERS_PATH
}
/gettimeofday.c
)
endif
()
if
(
UNIX
)
if
(
!WITH_BUILTIN_GETIFADDRS
)
list
(
APPEND HDR_P
UBLIC
lib/getifaddrs.h
)
list
(
APPEND HDR_P
RIVATE
lib/getifaddrs.h
)
list
(
APPEND SOURCES lib/getifaddrs.c
)
endif
()
endif
()
source_group
(
"Headers Private"
FILES
${
HDR_PRIVATE
}
)
source_group
(
"Headers Public"
FILES
${
HDR_PUBLIC
}
)
source_group
(
"Sources"
FILES
${
SOURCES
}
)
#
# Create the lib.
#
add_library
(
websocket STATIC
${
HDR_PRIVATE
}
${
HDR_PUBLIC
}
${
SOURCES
}
)
#
# Find libraries.
#
#
# ZLIB.
#
...
...
@@ -172,7 +213,7 @@ else()
endif
()
include_directories
(
${
ZLIB_INCLUDE_DIRS
}
)
target_link_libraries
(
websocket
s
${
ZLIB_LIBRARIES
}
)
target_link_libraries
(
websocket
${
ZLIB_LIBRARIES
}
)
#
# OpenSSL
...
...
@@ -187,8 +228,9 @@ if (WITH_SSL)
# TODO: Add support for STATIC also.
find_package
(
OpenSSL REQUIRED
)
endif
()
include_directories
(
${
OPENSSL_INCLUDE_DIR
}
)
target_link_libraries
(
websocket
${
OPENSSL_LIBRARIES
}
)
endif
()
include_directories
(
${
OPENSSL_INCLUDE_DIR
}
)
target_link_libraries
(
websockets
${
OPENSSL_LIBRARIES
}
)
This diff is collapsed.
Click to expand it.
config.h.cmake
0 → 100644
+
135
−
0
View file @
add3926b
/* config.h.in. Generated from configure.ac by autoheader. */
#cmakedefine USE_CYASSL
/* Define to 1 if you have the `bzero' function. */
#cmakedefine HAVE_BZERO
/* Define to 1 if you have the <dlfcn.h> header file. */
#cmakedefine HAVE_DLFCN_H
/* Define to 1 if you have the <fcntl.h> header file. */
#cmakedefine HAVE_FCNTL_H
/* Define to 1 if you have the `fork' function. */
#cmakedefine HAVE_FORK
/* Define to 1 if you have the <inttypes.h> header file. */
#cmakedefine HAVE_INTTYPES_H
/* Define to 1 if you have the `ssl'
library
(
-lssl
)
. */
//
#cmakedefine HAVE_LIBSSL
/* Define to 1 if your system has a GNU libc compatible `malloc' function, and
to 0 otherwise. */
#cmakedefine HAVE_MALLOC
/* Define to 1 if you have the <memory.h> header file. */
#cmakedefine HAVE_MEMORY_H
/* Define to 1 if you have the `memset' function. */
#cmakedefine HAVE_MEMSET
/* Define to 1 if you have the <netinet/in.h> header file. */
#cmakedefine HAVE_NETINET_IN_H
/* Define to 1 if your system has a GNU libc compatible `realloc' function,
and to 0 otherwise. */
#cmakedefine HAVE_REALLOC
/* Define to 1 if you have the `socket' function. */
#cmakedefine HAVE_SOCKET
/* Define to 1 if you have the <stdint.h> header file. */
#cmakedefine HAVE_STDINT_H
/* Define to 1 if you have the <stdlib.h> header file. */
#cmakedefine HAVE_STDLIB_H
/* Define to 1 if you have the `strerror' function. */
#cmakedefine HAVE_STRERROR
/* Define to 1 if you have the <strings.h> header file. */
#cmakedefine HAVE_STRINGS_H
/* Define to 1 if you have the <string.h> header file. */
#cmakedefine HAVE_STRING_H
/* Define to 1 if you have the <sys/prctl.h> header file. */
#cmakedefine HAVE_SYS_PRCTL_H
/* Define to 1 if you have the <sys/socket.h> header file. */
#cmakedefine HAVE_SYS_SOCKET_H
/* Define to 1 if you have the <sys/stat.h> header file. */
#cmakedefine HAVE_SYS_STAT_H
/* Define to 1 if you have the <sys/types.h> header file. */
#cmakedefine HAVE_SYS_TYPES_H
/* Define to 1 if you have the <unistd.h> header file. */
#cmakedefine HAVE_UNISTD_H
/* Define to 1 if you have the `vfork' function. */
#cmakedefine HAVE_VFORK
/* Define to 1 if you have the <vfork.h> header file. */
#cmakedefine HAVE_VFORK_H
/* Define to 1 if `fork' works. */
#cmakedefine HAVE_WORKING_FORK
/* Define to 1 if `vfork' works. */
#cmakedefine HAVE_WORKING_VFORK
/* Define to 1 if you have the <zlib.h> header file. */
#cmakedefine HAVE_ZLIB_H
/* Define to the sub-directory in which libtool stores uninstalled libraries.
*/
#undef LT_OBJDIR // We're not using libtool
/* Name of package */
#cmakedefine PACKAGE
/* Define to the address where bug reports for this package should be sent. */
#cmakedefine PACKAGE_BUGREPORT
/* Define to the full name of this package. */
#cmakedefine PACKAGE_NAME
/* Define to the full name and version of this package. */
#cmakedefine PACKAGE_STRING
/* Define to the one symbol short name of this package. */
#cmakedefine PACKAGE_TARNAME
/* Define to the home page for this package. */
#cmakedefine PACKAGE_URL
/* Define to the version of this package. */
#cmakedefine PACKAGE_VERSION
/* Define to 1 if you have the ANSI C header files. */
#cmakedefine STDC_HEADERS
/* Version number of package */
#cmakedefine VERSION
/* Define to rpl_malloc if the replacement function should be used. */
#cmakedefine malloc
/* Define to `int' if <sys/types.h> does not define. */
#cmakedefine pid_t
/* Define to rpl_realloc if the replacement function should be used. */
#cmakedefine realloc
/* Define to `unsigned int' if <sys/types.h> does not define. */
#cmakedefine size_t
/* Define to 1 if we have getifaddrs */
#cmakedefine HAVE_GETIFADDRS
/* Define as `fork' if `vfork' does not work. */
//
#cmakedefine vfork
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment