Skip to content

Commit 05acf0d

Browse files
authored
19.1.0
1 parent 503e425 commit 05acf0d

File tree

4 files changed

+29
-10
lines changed

4 files changed

+29
-10
lines changed

CMakeLists.txt

Lines changed: 20 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
cmake_minimum_required(VERSION 3.1)
22
project(trick)
33
set(TRICK_MAJOR 19)
4-
set(TRICK_MINOR 0)
5-
set(TRICK_TINY 1)
4+
set(TRICK_MINOR 1)
5+
set(TRICK_TINY 0)
66
#set(CMAKE_VERBOSE_MAKEFILE ON)
77
set(CMAKE_CXX_STANDARD 11)
88
set(CMAKE_CXX_STANDARD_REQUIRED ON)
@@ -11,6 +11,7 @@ set(TRICK_FORCE_32BIT OFF CACHE BOOL "Set Trick to compile in 32bit mode")
1111
#set(USE_JAVA ON CACHE BOOL "Use java")
1212
set(USE_ER7_UTILS ON CACHE BOOL "Use er7_utils")
1313
set(UDUNITS2_ROOT "" CACHE STRING "UDUNITS home directory")
14+
set(TRICK_MONGOOSE "0" CACHE STRING "Enable webserver")
1415

1516
#message("UDUNITS2_ROOT = ${UDUNITS2_ROOT}")
1617

@@ -60,6 +61,10 @@ if(GSL_FOUND)
6061
add_definitions( -D_HAVE_GSL)
6162
endif()
6263

64+
if(USE_MONGOOSE)
65+
add_definitions(-DUSE_MONGOOSE)
66+
endif()
67+
6368
include_directories( ${CMAKE_BINARY_DIR}/include)
6469
include_directories( ${CMAKE_BINARY_DIR}/include/trick/compat)
6570

@@ -84,7 +89,7 @@ configure_file(${CMAKE_CURRENT_SOURCE_DIR}/share/trick/makefiles/config_user_cma
8489
###############################################################
8590
# mongoose lib
8691
###############################################################
87-
92+
if(USE_MONGOOSE)
8893
add_custom_command(
8994
OUTPUT ${CMAKE_BINARY_DIR}/include/mongoose/mongoose.h
9095
COMMAND curl --retry 4 -O https://raw.githubusercontent.com/cesanta/mongoose/6.16/mongoose.h
@@ -100,6 +105,7 @@ add_custom_command(
100105

101106
add_library(mongoose STATIC ${CMAKE_BINARY_DIR}/temp_src/mongoose/mongoose.c)
102107
target_include_directories( mongoose PUBLIC ${CMAKE_BINARY_DIR}/include/mongoose )
108+
endif()
103109

104110
###############################################################
105111
# io_src files
@@ -206,8 +212,6 @@ set( IO_SRC
206212
${CMAKE_BINARY_DIR}/temp_src/io_src/io_VariableServerListenThread.cpp
207213
${CMAKE_BINARY_DIR}/temp_src/io_src/io_VariableServerReference.cpp
208214
${CMAKE_BINARY_DIR}/temp_src/io_src/io_VariableServerThread.cpp
209-
${CMAKE_BINARY_DIR}/temp_src/io_src/io_WebServer.cpp
210-
${CMAKE_BINARY_DIR}/temp_src/io_src/io_WebSocketSession.cpp
211215
${CMAKE_BINARY_DIR}/temp_src/io_src/io_Zeroconf.cpp
212216
${CMAKE_BINARY_DIR}/temp_src/io_src/io_attributes.cpp
213217
${CMAKE_BINARY_DIR}/temp_src/io_src/io_dllist.cpp
@@ -349,6 +353,15 @@ set(SWIG_FLAGS -DUSE_ER7_UTILS_INTEGRATORS)
349353
if(GSL_FOUND)
350354
list( APPEND SWIG_FLAGS -D_HAVE_GSL )
351355
endif()
356+
357+
if(USE_MONGOOSE)
358+
list( APPEND SWIG_FLAGS -DUSE_MONGOOSE)
359+
list( APPEND IO_SRC
360+
${CMAKE_BINARY_DIR}/temp_src/io_src/io_WebServer.cpp
361+
${CMAKE_BINARY_DIR}/temp_src/io_src/io_WebSocketSession.cpp
362+
)
363+
endif()
364+
352365
foreach ( infile ${SWIG_SRC_BASENAME} )
353366
add_custom_command(OUTPUT ${CMAKE_BINARY_DIR}/temp_src/swig/${infile}_wrap.cpp
354367
COMMAND ${SWIG_EXECUTABLE} ${SWIG_FLAGS} -I${CMAKE_CURRENT_SOURCE_DIR}/trick_source -I${CMAKE_CURRENT_SOURCE_DIR}/include -I${CMAKE_CURRENT_SOURCE_DIR} -c++ -python -includeall -ignoremissing -w201,362,389,451 -o $@ -outdir ${CMAKE_BINARY_DIR}/share/trick/swig ${CMAKE_CURRENT_SOURCE_DIR}/trick_source/trick_swig/${infile}.i
@@ -366,7 +379,7 @@ target_include_directories( trick_pyip PUBLIC trick_source )
366379
###############################################################
367380
# libtrickHTTP.a
368381
###############################################################
369-
382+
if(USE_MONGOOSE)
370383
set( TRICKHTTP_SRC
371384
trick_source/web/HttpServer/src/VariableServerSession
372385
trick_source/web/HttpServer/src/VariableServerVariable
@@ -377,7 +390,7 @@ set( TRICKHTTP_SRC
377390

378391
add_library( trickHTTP STATIC ${TRICKHTTP_SRC})
379392
add_dependencies( trickHTTP mongoose)
380-
393+
endif()
381394
###############################################################
382395
# Other Trick libraries
383396
###############################################################

share/trick/makefiles/config_user_cmake.mk.in

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ SWIG = @SWIG_EXECUTABLE@
1111
PYTHON = @PYTHON_EXECUTABLE@
1212
CLANG = @CLANG_EXECUTABLE@
1313
TEE = @TEE_EXECUTABLE@
14-
14+
TRICK_MONGOOSE = @TRICK_MONGOOSE@
1515
USE_JAVA = @USE_JAVA@
1616
JAVAC = @Java_JAVAC_EXECUTABLE@
1717

@@ -22,7 +22,13 @@ LLVM_HOME = @LLVM_ROOT_DIR@
2222
PYTHON_INCLUDES = -I@PYTHON_INCLUDE_DIRS@
2323
PYTHON_LIB = @PYTHON_LIBRARIES@
2424

25+
# Only add udunits include if it is not in /usr/include.
26+
ifneq ("@UDUNITS2_INCLUDES@","/usr/include")
2527
UDUNITS_INCLUDES = -I@UDUNITS2_INCLUDES@
28+
else
29+
UDUNITS_INCLUDES =
30+
endif
31+
2632
UDUNITS_LDFLAGS = @UDUNITS2_LIBRARIES@
2733
TRICK_EXCLUDE += :@UDUNITS_EXCLUDE@
2834

share/trick/trick_ver.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
current_version = "19.0.1"
1+
current_version = "19.1.0"

trick_source/java/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@
33
# Build Java
44
###############################################################
55

6-
add_custom_target(java COMMAND ${MAVEN_EXECUTABLE} -q package -Dcmake=true -DbuildDirectory=${CMAKE_BINARY_DIR}/libexec/trick/java/build -DTRICK_VERSION="${TRICK_MAJOR}.${TRICK_MINOR}.${TRICK_TINY}" WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
6+
add_custom_target(java ALL COMMAND ${MAVEN_EXECUTABLE} -q package -Dcmake=true -DbuildDirectory=${CMAKE_BINARY_DIR}/libexec/trick/java/build -DTRICK_VERSION="${TRICK_MAJOR}.${TRICK_MINOR}.${TRICK_TINY}" WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})

0 commit comments

Comments
 (0)