-
Notifications
You must be signed in to change notification settings - Fork 18
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
45 lines (37 loc) · 1.42 KB
/
CMakeLists.txt
File metadata and controls
45 lines (37 loc) · 1.42 KB
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
cmake_minimum_required(VERSION 3.13) # 2.2 - case insensitive syntax
# 3.13 included policy CMP0077
project(ModbusLibAll LANGUAGES C CXX)
option(MB_QT_ENABLED "Build Qt additinal info" OFF)
option(MB_EXAMPLES_ENABLED "Build examples" ON)
option(MB_TESTS_ENABLED "Enable unit tests" OFF)
option(MB_DOC_ENABLED "Enable documentation generation" OFF)
#set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/bin")
#set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/bin")
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}")
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}")
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}")
if (NOT WIN32)
#set(CMAKE_SKIP_BUILD_RPATH FALSE)
set(CMAKE_BUILD_WITH_INSTALL_RPATH TRUE)
set(CMAKE_INSTALL_RPATH $ORIGIN)
#set(CMAKE_INSTALL_RPATH "\${ORIGIN}")
endif()
add_subdirectory(src)
if (MB_EXAMPLES_ENABLED)
add_subdirectory(examples/client)
add_subdirectory(examples/server)
endif()
#######################################
################ TESTS ################
#######################################
if (MB_TESTS_ENABLED)
include(CTest)
enable_testing()
add_subdirectory(tests)
endif()
#######################################
################# DOC #################
#######################################
if (MB_DOC_ENABLED)
add_subdirectory("doc")
endif()