2022-05-10 06:43:27 +00:00
|
|
|
SET(LIB_PROJECT_TARGET common)
|
|
|
|
|
2022-12-14 02:16:10 +00:00
|
|
|
PROJECT(${LIB_PROJECT_TARGET} VERSION 1.1.0)
|
|
|
|
|
|
|
|
CONFIGURE_FILE(lib_config.h.in lib_config.h)
|
2022-05-10 06:43:27 +00:00
|
|
|
|
2022-11-07 06:21:24 +00:00
|
|
|
INCLUDE_DIRECTORIES(include
|
2022-12-02 02:51:51 +00:00
|
|
|
./ ./include ../lwip/src/include ../lwip/src/arch_linux/include ../include
|
2022-12-23 06:04:51 +00:00
|
|
|
../httpserver/include ../httpserver/src/haywire ../httpserver/src/haywire/configuration)
|
|
|
|
FILE(GLOB C_HEADS include/*.h include/uthash/*.h include/s2j/*.h vector/*.h ${CMAKE_BINARY_DIR}/*.h)
|
2022-05-10 06:43:27 +00:00
|
|
|
|
|
|
|
AUX_SOURCE_DIRECTORY(json C_SRC)
|
2022-09-27 09:43:16 +00:00
|
|
|
|
2022-10-28 08:46:55 +00:00
|
|
|
AUX_SOURCE_DIRECTORY(args C_SRC)
|
|
|
|
AUX_SOURCE_DIRECTORY(init C_SRC)
|
|
|
|
AUX_SOURCE_DIRECTORY(misc C_SRC)
|
|
|
|
AUX_SOURCE_DIRECTORY(banner C_SRC)
|
|
|
|
AUX_SOURCE_DIRECTORY(configure C_SRC)
|
|
|
|
AUX_SOURCE_DIRECTORY(network C_SRC)
|
|
|
|
AUX_SOURCE_DIRECTORY(task C_SRC)
|
|
|
|
AUX_SOURCE_DIRECTORY(mq C_SRC)
|
|
|
|
AUX_SOURCE_DIRECTORY(cmdline C_SRC)
|
|
|
|
AUX_SOURCE_DIRECTORY(crypto C_SRC)
|
|
|
|
AUX_SOURCE_DIRECTORY(hardware C_SRC)
|
2022-12-03 08:46:52 +00:00
|
|
|
AUX_SOURCE_DIRECTORY(protocol C_SRC)
|
2022-11-28 09:57:57 +00:00
|
|
|
|
2022-12-02 02:51:51 +00:00
|
|
|
IF (USED_REDIS)
|
2022-11-28 09:57:57 +00:00
|
|
|
ADD_DEFINITIONS(-DUSED_REDIS)
|
2022-12-02 02:51:51 +00:00
|
|
|
ENDIF ()
|
2022-11-28 09:57:57 +00:00
|
|
|
|
2022-12-02 02:51:51 +00:00
|
|
|
IF (USED_SQLITE)
|
2022-11-28 09:57:57 +00:00
|
|
|
ADD_DEFINITIONS(-DUSED_SQLITE)
|
2022-11-29 10:17:25 +00:00
|
|
|
AUX_SOURCE_DIRECTORY(database/sqlite3 C_SRC)
|
2022-12-02 02:51:51 +00:00
|
|
|
ENDIF ()
|
2022-11-28 09:57:57 +00:00
|
|
|
|
2022-12-02 02:51:51 +00:00
|
|
|
IF (USED_MYSQL)
|
2022-11-28 09:57:57 +00:00
|
|
|
ADD_DEFINITIONS(-DUSED_MYSQL)
|
2022-12-02 02:51:51 +00:00
|
|
|
ENDIF ()
|
2022-05-10 06:43:27 +00:00
|
|
|
|
|
|
|
SET(CMAKE_C_STANDARD 99)
|
|
|
|
|
2022-11-23 02:41:05 +00:00
|
|
|
SET_SOURCE_FILES_PROPERTIES(misc/zvector.c PROPERTIES COMPILE_FLAGS "-Wall -Wextra -flto")
|
2022-12-02 02:51:51 +00:00
|
|
|
IF (USED_SQLITE)
|
2022-11-29 10:17:25 +00:00
|
|
|
SET_SOURCE_FILES_PROPERTIES(database/sqlite3/sqlite3.c PROPERTIES
|
2022-12-02 02:51:51 +00:00
|
|
|
COMPILE_FLAGS "-DSQLITE_HAS_CODEC \
|
2022-11-28 09:57:57 +00:00
|
|
|
-DSQLCIPHER_CRYPTO_OPENSSL -DSQLITE_OS_UNIX=1 \
|
|
|
|
-D_HAVE_SQLITE_CONFIG_H -DBUILD_sqlite -DNDEBUG -DSQLITE_THREADSAFE=1 \
|
|
|
|
-DSQLITE_ENABLE_MATH_FUNCTIONS -DSQLITE_ENABLE_UPDATE_DELETE_LIMIT \
|
|
|
|
-DSQLITE_ENABLE_MATH_FUNCTIONS -DSQLITE_ENABLE_UPDATE_DELETE_LIMIT \
|
|
|
|
-DSQLITE_HAVE_ZLIB=1 -DSQLITE_TEMP_STORE=2")
|
2022-12-02 02:51:51 +00:00
|
|
|
ENDIF ()
|
2022-11-17 07:27:32 +00:00
|
|
|
|
2022-12-23 06:04:51 +00:00
|
|
|
ADD_DEFINITIONS(${COMMON_DEFINE})
|
2022-11-16 02:36:28 +00:00
|
|
|
|
2022-05-10 06:43:27 +00:00
|
|
|
LINK_LIBRARIES(${COMMON_LIBS})
|
2022-11-07 06:21:24 +00:00
|
|
|
ADD_LIBRARY(${LIB_PROJECT_TARGET} ${C_SRC} ${C_HEADS})
|
|
|
|
|
|
|
|
TARGET_LINK_LIBRARIES(${LIB_PROJECT_TARGET} haywire)
|
2022-12-14 02:16:10 +00:00
|
|
|
|
2022-12-15 08:26:39 +00:00
|
|
|
IF (USED_OPENDHCPD)
|
|
|
|
TARGET_LINK_LIBRARIES(${LIB_PROJECT_TARGET} opendhcpd)
|
|
|
|
ENDIF()
|
2022-12-14 02:16:10 +00:00
|
|
|
|
2022-12-23 06:04:51 +00:00
|
|
|
TARGET_INCLUDE_DIRECTORIES(${LIB_PROJECT_TARGET} PUBLIC ${PROJECT_BINARY_DIR}/ ${CMAKE_BINARY_DIR}/)
|