From 4009682bd8bb6cb1b00468f76773c390dbf4be2a Mon Sep 17 00:00:00 2001 From: Matthew Date: Tue, 14 Nov 2023 18:20:19 +0800 Subject: [PATCH] =?UTF-8?q?=20=20=E4=BF=AE=E6=94=B9=E7=BC=96=E8=AF=91?= =?UTF-8?q?=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CMakeLists.txt | 63 ++++++++++++++++++++++++++++++++++++++++++++++++++ basefunc.cpp | 2 ++ 2 files changed, 65 insertions(+) create mode 100644 CMakeLists.txt diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 0000000..07d2499 --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,63 @@ +# CMakeList.txt : CMake project for iec103, include source and define +# project specific logic here. +# +cmake_minimum_required (VERSION 3.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 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. diff --git a/basefunc.cpp b/basefunc.cpp index fe07ccd..c73810c 100644 --- a/basefunc.cpp +++ b/basefunc.cpp @@ -1,7 +1,9 @@ //#ifdef OS_WINDOWS +#ifdef _WIN32 #include #include #include +#endif /*#else #include #endif*/