-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
74 lines (63 loc) · 2.09 KB
/
CMakeLists.txt
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
cmake_minimum_required(VERSION 3.20.0)
project(cameo
VERSION 3.0.0
LANGUAGES C
HOMEPAGE_URL "https://code.ill.fr/cameo/cameo"
)
option(CAMEO_ALL "Compile all the components including tests and examples" OFF)
option(CAMEO_JAVA "Compile Java server, console and API" OFF)
option(CAMEO_PROXIES "Compile proxies" OFF)
option(CAMEO_API_CPP "Compile and install C++ api" OFF)
option(CAMEO_API_PYTHON "Compile and install Python api" OFF)
set(ZEROMQ_JAVA "jzmq" CACHE STRING "ZeroMQ Java implementation (jzmq/jeromq)")
# Force Release by default
if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE "Release")
endif()
message(STATUS "Build type: ${CMAKE_BUILD_TYPE}")
# Java
if(${CAMEO_ALL} OR ${CAMEO_JAVA})
if(${ZEROMQ_JAVA} STREQUAL "jzmq")
list(APPEND Java java java/server/jzmq java/console/jzmq)
message(STATUS "Java ZeroMQ implementation: ${ZEROMQ_JAVA}")
elseif(${ZEROMQ_JAVA} STREQUAL "jeromq")
list(APPEND Java java java/server/jeromq java/console/jeromq)
message(STATUS "Java ZeroMQ implementation: ${ZEROMQ_JAVA}")
else()
message(STATUS "Unknown ZeroMQ implementation: ${ZEROMQ_JAVA}")
endif()
endif()
# Proxies
if(${CAMEO_ALL} OR ${CAMEO_PROXIES})
list(APPEND Proxies cpp/proxy)
endif()
# C++ API
if(${CAMEO_ALL} OR ${CAMEO_API_CPP})
list(APPEND APIs cpp/api)
endif()
# Python API
if(${CAMEO_ALL} OR ${CAMEO_API_PYTHON})
list(APPEND APIs cpp/api)
mark_as_advanced(CAMEO_API_CPP)
list(APPEND APIs python/api)
endif()
list(REMOVE_DUPLICATES APIs)
# Tests and examples
if(${CAMEO_ALL})
if(${ZEROMQ_JAVA} STREQUAL "jzmq")
list(APPEND TestsExamples tests/java/jzmq)
elseif(${ZEROMQ_JAVA} STREQUAL "jeromq")
list(APPEND TestsExamples tests/java/jeromq)
endif()
list(APPEND TestsExamples tests/cpp)
if(${ZEROMQ_JAVA} STREQUAL "jzmq")
list(APPEND TestsExamples examples/java/jzmq)
elseif(${ZEROMQ_JAVA} STREQUAL "jeromq")
list(APPEND TestsExamples examples/java/jeromq)
endif()
list(APPEND TestsExamples examples/cpp)
endif()
# Walk through subdirectories
foreach(package ${Java} ${Proxies} ${APIs} ${TestsExamples})
add_subdirectory(${package})
endforeach()