You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

65 lines
2.0 KiB
CMake

2 years ago
# CMakeList.txt : CMake project for iec103, include source and define
# project specific logic here.
#
2 years ago
cmake_minimum_required (VERSION 2.8)
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED On)
set(CMAKE_CXX_EXTENSIONS Off)
set(CMAKE_CXX_FLAGS_DEBUG "-g")
# SET(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake)
# list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/cmake")
project ("iec103")
set_property( GLOBAL PROPERTY CXX_STANDARD 11)
add_definitions(-DOS_UNIX)
# Add source to this project's executable.
add_executable (iec103 basefunc.cpp
buban103.cpp
buban104.cpp
chainlist.cpp
commport.cpp
conf_close.cpp
conf_open.cpp
conf_read_key.cpp
conf_write_key.cpp
display.cpp
DSFileSystem.cpp
Inifile.cpp
list_entry.cpp
netport.cpp
os_heap.cpp
Profile_Hash.cpp
scadaprotect.cpp
# tcphost.cpp
# udpcomm.cpp
# udpping.cpp
widgets.cpp)
# set(THREADS_PREFER_PTHREAD_FLAG ON)
# find_package(Threads REQUIRED)
#target_link_libraries(iec103 PUBLIC Threads::Threads)
set_target_properties(iec103 PROPERTIES
COMPILE_FLAGS "-pthread"
LINK_FLAGS "-pthread")
# find_package (SQLite3)
#if (SQLITE3_FOUND)
# include_directories(${SQLITE3_INCLUDE_DIRS})
# target_link_libraries (iec103 ${SQLite3_LIBRARIES})
# # target_link_libraries (${OUT_TARGET} ${SQLite3_LIBRARIES})
#endif (SQLITE3_FOUND)
find_package (ZLIB)
if (ZLIB_FOUND)
include_directories(${ZLIB_INCLUDE_DIRS})
target_link_libraries (iec103 ${ZLIB_LIBRARIES})
# target_link_libraries (${OUT_TARGET} ${SQLite3_LIBRARIES})
endif (ZLIB_FOUND)
# TODO: Add tests and install targets if needed.