blob: e4558d73de5218cab64e52e811d14f95bfb7998b (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
|
cmake_minimum_required(VERSION 2.6.3)
project(librcc)
set(CMAKE_VERBOSE_MAKEFILE YES)
set(CMAKE_BUILD_TYPE RELEASE)
if (WIN32)
SET(USR_FOLDER "C:/DEVEL/UNIX" CACHE PATH "Path to libraries and includes")
SET(CMAKE_REQUIRED_INCLUDES ${CMAKE_REQUIRED_INCLUDES};${USR_FOLDER}/include)
INCLUDE_DIRECTORIES(${USR_FOLDER}/include)
INCLUDE_DIRECTORIES(${CMAKE_INSTALL_PREFIX}/include)
INCLUDE_DIRECTORIES(${CMAKE_INSTALL_PREFIX}/include/libxml2)
find_library(ZLIB_LIBRARY NAMES zlib z PATHS ${USR_FOLDER} PATH_SUFFIXES "lib")
if (NOT ZLIB_LIBRARY)
MESSAGE(FATAL_ERROR "Could not find zlib")
endif()
find_library(LIBXML2_LIBRARY NAMES libxml2 PATHS ${USR_FOLDER} PATH_SUFFIXES "lib")
if (NOT LIBXML2_LIBRARY)
MESSAGE(FATAL_ERROR "Could not find LibXML2")
endif()
find_library(ICONV_LIBRARY NAMES libiconv PATHS ${USR_FOLDER} PATH_SUFFIXES "lib")
if (NOT ICONV_LIBRARY)
MESSAGE(FATAL_ERROR "Could not find iconv")
endif ()
find_library(ENCA_LIBRARY NAMES libenca PATHS ${USR_FOLDER} ${CMAKE_INSTALL_PREFIX} PATH_SUFFIXES "lib")
if (ENCA_LIBRARY)
SET(HAVE_ENCA TRUE)
endif()
find_library(LIBRCD_LIBRARY NAMES rcd PATHS ${USR_FOLDER} ${CMAKE_INSTALL_PREFIX} PATH_SUFFIXES "lib")
if (LIBRCD_LIBRARY)
SET(HAVE_RCD TRUE)
endif()
find_library(WSOCK_LIBRARY NAMES wsock32 PATHS ${USR_FOLDER} PATH_SUFFIXES "lib")
if (NOT WSOCK_LIBRARY)
MESSAGE(FATAL_ERROR "Could not find wsock library")
endif()
else (WIN32)
MESSAGE(FATAL_ERROR "Windows build only, use autoconf for POSIX-compliant systems")
endif (WIN32)
INCLUDE(CheckIncludeFiles)
CHECK_INCLUDE_FILES (sys/types.h HAVE_SYS_TYPES_H)
CHECK_INCLUDE_FILES (sys/stat.h HAVE_SYS_STAT_H)
CHECK_INCLUDE_FILES (sys/file.h HAVE_SYS_FILE_H)
CHECK_INCLUDE_FILES (sys/time.h HAVE_SYS_TIME_H)
CHECK_INCLUDE_FILES (sys/select.h HAVE_SYS_SELECT_H)
CHECK_INCLUDE_FILES (sys/socket.h HAVE_SYS_SOCKET_H)
CHECK_INCLUDE_FILES (sys/wait.h HAVE_SYS_WAIT_H)
CHECK_INCLUDE_FILES (signal.h HAVE_SIGNAL_H)
CHECK_INCLUDE_FILES (sys/un.h HAVE_SYS_UN_H)
CHECK_INCLUDE_FILES (unistd.h HAVE_UNISTD_H)
CHECK_INCLUDE_FILES (pwd.h HAVE_PWD_H)
CHECK_INCLUDE_FILES (dlfcn.h HAVE_DLFCN_H)
CHECK_INCLUDE_FILES (fcntl.h HAVE_FCNTL_H)
CHECK_INCLUDE_FILES (iconv.h HAVE_ICONV_H)
CHECK_INCLUDE_FILES (inttypes.h HAVE_INTTYPES_H)
CHECK_INCLUDE_FILES (strings.h HAVE_STRINGS_H)
INCLUDE (CheckTypeSize)
CHECK_TYPE_SIZE(size_t SIZEOF_SIZE_T)
IF(NOT HAVE_SIZEOF_SIZE_T)
SET(size_t "unsigned int")
ENDIF(NOT HAVE_SIZEOF_SIZE_T)
CHECK_TYPE_SIZE(ssize_t SIZEOF_SSIZE_T)
IF(NOT HAVE_SIZEOF_SSIZE_T)
CHECK_TYPE_SIZE("long" SIZEOF_LONG)
CHECK_TYPE_SIZE("__int64" SIZEOF___INT64)
IF(SIZEOF_LONG EQUAL SIZEOF_SIZE_T)
SET(ssize_t long)
ENDIF(SIZEOF_LONG EQUAL SIZEOF_SIZE_T)
IF(NOT ssize_t AND SIZEOF___INT64 EQUAL SIZEOF_SIZE_T)
SET(ssize_t __int64)
ENDIF(NOT ssize_t AND SIZEOF___INT64 EQUAL SIZEOF_SIZE_T)
ENDIF(NOT HAVE_SIZEOF_SSIZE_T)
INCLUDE (CheckFunctionExists)
CHECK_FUNCTION_EXISTS(nanosleep HAVE_NANOSLEEP)
CHECK_FUNCTION_EXISTS(usleep HAVE_USLEEP)
CHECK_FUNCTION_EXISTS(flock HAVE_FLOCK)
CHECK_FUNCTION_EXISTS(lockf HAVE_LOCKF)
CHECK_FUNCTION_EXISTS(fsync HAVE_FSYNC)
CHECK_FUNCTION_EXISTS(strcasecmp HAVE_STRCASECMP)
CHECK_FUNCTION_EXISTS(strncasecmp HAVE_STRNCASECMP)
CHECK_FUNCTION_EXISTS(ftruncate HAVE_FTRUNCATE)
IF(NOT HAVE_STRCASECMP AND WIN32)
SET(strcasecmp _stricmp)
endif(NOT HAVE_STRCASECMP AND WIN32)
IF(NOT HAVE_STRNCASECMP AND WIN32)
SET(strncasecmp _strnicmp)
endif(NOT HAVE_STRNCASECMP AND WIN32)
IF(NOT HAVE_FTRUNCATE AND WIN32)
SET(ftruncate _chsize)
endif(NOT HAVE_FTRUNCATE AND WIN32)
INCLUDE (CheckLibraryExists)
INCLUDE (CheckSymbolExists)
CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/config.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config.h)
add_subdirectory(src)
add_subdirectory(examples)
|