forked from VOLTTRON/dnp3-python
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
51 lines (34 loc) · 1.51 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
cmake_minimum_required (VERSION 2.8)
project (pydnp3)
set(PYDNP3_MAJOR_VERSION 0)
set(PYDNP3_MINOR_VERSION 1)
set(PYDNP3_MICRO_VERSION 1)
set(PYDNP3_VERSION ${PYDNP3_MAJOR_VERSION}.${PYDNP3_MINOR_VERSION}.${PYDNP3_MICRO_VERSION})
if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE "Release" CACHE STRING
"Choose the type of build, options are: Debug Release
RelWithDebInfo MinSizeRel."
FORCE)
endif()
message("CMake build is: ${CMAKE_BUILD_TYPE}")
#include(${PROJECT_SOURCE_DIR}/settings.cmake)
# other options off-by-default that you can enable
option(WERROR "Set all warnings to errors" OFF)
option(STATICLIBS "Builds static versions of all installed libraries" OFF)
option(COVERAGE "Builds the libraries with coverage info for gcov (gcc only)" OFF)
option(PROFILE "Builds the libraries with profiling support (gcc only)" OFF)
set(CMAKE_REQUIRED_FLAGS ${CMAKE_CXX_FLAGS})
set(STATICLIBS ON)
if(NOT CMAKE_CXX_COMPILER_ID MATCHES "MSVC")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fvisibility=hidden")
endif()
add_subdirectory(deps/pybind11)
add_subdirectory(deps/dnp3)
# include paths for all the local libraries
include_directories(deps/dnp3/cpp/libs/include)
include_directories(deps/dnp3/cpp/libs/src)
# asio
include_directories(deps/dnp3/deps/asio/asio/include)
add_definitions(-DASIO_STANDALONE)
pybind11_add_module(pydnp3 MODULE src/pydnp3.cpp src/pydnp3asiodnp3.cpp src/pydnp3asiopal.cpp src/pydnp3opendnp3.cpp src/pydnp3openpal.cpp)
target_link_libraries(pydnp3 PRIVATE asiopal asiodnp3 openpal opendnp3)