From ff02d527990c22bce609dfc4af08dc4d67a7c4e4 Mon Sep 17 00:00:00 2001 From: Bartosz Wieczorek Date: Fri, 3 Nov 2023 13:08:30 +0100 Subject: [PATCH] inicjalizacja cmake na linuxie --- COMMON/CMakeLists.txt | 7 + COMMON/CMakeLists.txt.user | 258 +++++++++++++++++++++++++++++++++ COMMON/Common/CMakeLists.txt | 36 +++++ COMMON/Common/E2GDebug.cpp | 1 + COMMON/Common/E2GDebug.h | 5 +- COMMON/Common/E2GDecimal.cpp | 14 +- COMMON/Common/E2GTemplates.cpp | 13 +- COMMON/Common/E2GWyjatek.cpp | 1 + COMMON/Podstawa/CMakeLists.txt | 37 +++++ COMMON/Staze/CMakeLists.txt | 37 +++++ COMMON/Staze/E2GDaty.cpp | 1 + COMMON/Staze/E2GOkresy.cpp | 1 + COMMON/Staze/E2GSSlOkresow.cpp | 1 + 13 files changed, 399 insertions(+), 13 deletions(-) create mode 100644 COMMON/CMakeLists.txt create mode 100644 COMMON/CMakeLists.txt.user create mode 100644 COMMON/Common/CMakeLists.txt create mode 100644 COMMON/Podstawa/CMakeLists.txt create mode 100644 COMMON/Staze/CMakeLists.txt diff --git a/COMMON/CMakeLists.txt b/COMMON/CMakeLists.txt new file mode 100644 index 0000000..81aa77c --- /dev/null +++ b/COMMON/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.19) + +project(e2alg LANGUAGES C CXX) + +add_subdirectory(Common) +add_subdirectory(Staze) +add_subdirectory(Podstawa) diff --git a/COMMON/CMakeLists.txt.user b/COMMON/CMakeLists.txt.user new file mode 100644 index 0000000..c3a3d09 --- /dev/null +++ b/COMMON/CMakeLists.txt.user @@ -0,0 +1,258 @@ + + + + + + EnvironmentId + {a43cdd5b-7966-46da-935c-9a6c3d6cfb16} + + + ProjectExplorer.Project.ActiveTarget + 0 + + + ProjectExplorer.Project.EditorSettings + + true + false + true + + Cpp + + CppGlobal + + + + QmlJS + + QmlJSGlobal + + + 2 + UTF-8 + false + 4 + false + 80 + true + true + 1 + 0 + false + true + false + 0 + true + true + 0 + 8 + true + false + 1 + true + true + false + *.md,*.MD,Makefile + false + true + true + + + + ProjectExplorer.Project.PluginSettings + + + true + false + true + true + true + true + + + 0 + true + + + true + true + Builtin.DefaultTidyAndClazy + 8 + true + + + + true + + + + + + + + + ProjectExplorer.Project.Target.0 + + Desktop + GCC 12 + GCC 12 + {e1ef4662-de51-4c91-b1d1-e4a1355650a2} + 0 + 0 + 0 + + Debug + 2 + false + + -DCMAKE_GENERATOR:STRING=Ninja +-DCMAKE_BUILD_TYPE:STRING=Debug +-DCMAKE_PROJECT_INCLUDE_BEFORE:FILEPATH=%{BuildConfig:BuildDirectory:NativeFilePath}/.qtc/package-manager/auto-setup.cmake +-DQT_QMAKE_EXECUTABLE:FILEPATH=%{Qt:qmakeExecutable} +-DCMAKE_PREFIX_PATH:PATH=%{Qt:QT_INSTALL_PREFIX} +-DCMAKE_C_COMPILER:FILEPATH=%{Compiler:Executable:C} +-DCMAKE_CXX_COMPILER:FILEPATH=%{Compiler:Executable:Cxx} +-DCMAKE_CXX_COMPILER_LAUNCHER:UNINITIALIZED="distcc" +-DCMAKE_C_COMPILER_LAUNCHER:UNINITIALIZED="distcc" + /home/bartoszek/builds/build-E2ALG-GCC_12-Debug + + + + + all + + false + + true + Zbuduj + CMakeProjectManager.MakeStep + + 1 + Budowanie + Budowanie + ProjectExplorer.BuildSteps.Build + + + + + + clean + + false + + true + Zbuduj + CMakeProjectManager.MakeStep + + 1 + Wyczyść + Wyczyść + ProjectExplorer.BuildSteps.Clean + + 2 + false + + false + + Debug + CMakeProjectManager.CMakeBuildConfiguration + + + Release + 2 + false + + -DCMAKE_GENERATOR:STRING=Ninja +-DCMAKE_BUILD_TYPE:STRING=Release +-DCMAKE_PROJECT_INCLUDE_BEFORE:FILEPATH=%{BuildConfig:BuildDirectory:NativeFilePath}/.qtc/package-manager/auto-setup.cmake +-DQT_QMAKE_EXECUTABLE:FILEPATH=%{Qt:qmakeExecutable} +-DCMAKE_PREFIX_PATH:PATH=%{Qt:QT_INSTALL_PREFIX} +-DCMAKE_C_COMPILER:FILEPATH=%{Compiler:Executable:C} +-DCMAKE_CXX_COMPILER:FILEPATH=%{Compiler:Executable:Cxx} + /home/bartoszek/builds/build-E2ALG-GCC_12-Release + + + + + all + + false + + true + CMakeProjectManager.MakeStep + + 1 + Budowanie + Budowanie + ProjectExplorer.BuildSteps.Build + + + + + + clean + + false + + true + CMakeProjectManager.MakeStep + + 1 + Wyczyść + Wyczyść + ProjectExplorer.BuildSteps.Clean + + 2 + false + + false + + Release + CMakeProjectManager.CMakeBuildConfiguration + + 2 + + + 0 + Zainstaluj + Zainstaluj + ProjectExplorer.BuildSteps.Deploy + + 1 + + false + ProjectExplorer.DefaultDeployConfiguration + + 1 + + true + true + 0 + true + + 2 + + false + + ProjectExplorer.CustomExecutableRunConfiguration + + false + true + true + + 1 + + + + ProjectExplorer.Project.TargetCount + 1 + + + ProjectExplorer.Project.Updater.FileVersion + 22 + + + Version + 22 + + diff --git a/COMMON/Common/CMakeLists.txt b/COMMON/Common/CMakeLists.txt new file mode 100644 index 0000000..cc8d29a --- /dev/null +++ b/COMMON/Common/CMakeLists.txt @@ -0,0 +1,36 @@ +set(LIB E2ALGCommon) + +file(GLOB LIB_INC *.h) +file(GLOB LIB_SRC *.cpp) +add_library(${LIB}_ifc INTERFACE) +add_library(E2ALG::Common_ifc ALIAS ${LIB}_ifc) + +target_include_directories(${LIB}_ifc + PUBLIC INTERFACE + $ +) + +add_library(${LIB} SHARED ${LIB_SRC} ${LIB_INC_PUB} ${LIB_INC}) +add_library(E2ALG::Common ALIAS ${LIB}) + +target_link_libraries(${LIB} + PRIVATE + PUBLIC + E2ALG::Common_ifc +) + +install( + TARGETS + ${LIB} + DESTINATION + lib +) + +install( + FILES + ${LIB_INC} + DESTINATION + include +) + + diff --git a/COMMON/Common/E2GDebug.cpp b/COMMON/Common/E2GDebug.cpp index 2cdec52..18d9237 100644 --- a/COMMON/Common/E2GDebug.cpp +++ b/COMMON/Common/E2GDebug.cpp @@ -1,4 +1,5 @@ //--------------------------------------------------------------------------- +#include #include // JK bylo .h bez c z przodu #include "E2GDebug.h" static char bufDataCzas[100]; diff --git a/COMMON/Common/E2GDebug.h b/COMMON/Common/E2GDebug.h index 57751f6..fc76441 100644 --- a/COMMON/Common/E2GDebug.h +++ b/COMMON/Common/E2GDebug.h @@ -8,7 +8,11 @@ #include #include #include -#ifndef __SOSMVS__ + +#ifdef __linux__ +#include +using namespace std; +#elif defined __SOSMVS__ #include #include #else diff --git a/COMMON/Common/E2GDecimal.cpp b/COMMON/Common/E2GDecimal.cpp index 4ae0119..ed51a0b 100644 --- a/COMMON/Common/E2GDecimal.cpp +++ b/COMMON/Common/E2GDecimal.cpp @@ -1,15 +1,17 @@ //--------------------------------------------------------------------------- -#ifndef __SOSMVS__ - #include -#else +#include +#ifdef __linux__ #include -#endif -#include -#ifndef __SOSMVS__ + #include + #include +#elif not defined(__SOSMVS__) + #include #include #else + #include #include + #include #endif #include #include "E2GDecimal.h" diff --git a/COMMON/Common/E2GTemplates.cpp b/COMMON/Common/E2GTemplates.cpp index 01ae166..0acc757 100644 --- a/COMMON/Common/E2GTemplates.cpp +++ b/COMMON/Common/E2GTemplates.cpp @@ -1,15 +1,16 @@ //--------------------------------------------------------------------------- -#ifndef __SOSMVS__ - #include -#else +#include +#ifdef __linux__ #include -#endif -#include -#ifndef __SOSMVS__ +#elif not defined (__SOSMVS__) + #include #include #else + #include #include #endif +#include + #include "E2GTemplates.h" #include "E2GCommon.h" #include "E2GWyjatek.h" diff --git a/COMMON/Common/E2GWyjatek.cpp b/COMMON/Common/E2GWyjatek.cpp index 7bf02c3..4e4ac02 100644 --- a/COMMON/Common/E2GWyjatek.cpp +++ b/COMMON/Common/E2GWyjatek.cpp @@ -1,6 +1,7 @@ //--------------------------------------------------------------------------- #include // JK bylo z .h bez c #include // JK bylo z .h bez c +#include #include "E2GWyjatek.h" #include "E2GDebug.h" #include "E2GBledy.h" diff --git a/COMMON/Podstawa/CMakeLists.txt b/COMMON/Podstawa/CMakeLists.txt new file mode 100644 index 0000000..d9a2a0a --- /dev/null +++ b/COMMON/Podstawa/CMakeLists.txt @@ -0,0 +1,37 @@ +set(LIB E2ALGPodstawa) + +file(GLOB LIB_INC *.h) +file(GLOB LIB_SRC *.cpp) +add_library(${LIB}_ifc INTERFACE) +add_library(E2ALG::Podstawa_ifc ALIAS ${LIB}_ifc) + +target_include_directories(${LIB}_ifc + PUBLIC INTERFACE + $ +) + +add_library(${LIB} SHARED ${LIB_SRC} ${LIB_INC_PUB} ${LIB_INC}) +add_library(E2::Podstawa ALIAS ${LIB}) + +target_link_libraries(${LIB} + PRIVATE + E2ALG::Common_ifc + PUBLIC + E2ALG::Podstawa_ifc +) + + +install( + TARGETS + ${LIB} + DESTINATION + lib +) + +install( + FILES + ${LIB_INC} + DESTINATION + include +) + diff --git a/COMMON/Staze/CMakeLists.txt b/COMMON/Staze/CMakeLists.txt new file mode 100644 index 0000000..cf989d3 --- /dev/null +++ b/COMMON/Staze/CMakeLists.txt @@ -0,0 +1,37 @@ +set(LIB E2ALGStaze) + +file(GLOB LIB_INC *.h) +file(GLOB LIB_SRC *.cpp) +add_library(${LIB}_ifc INTERFACE) +add_library(E2ALG::Staze_ifc ALIAS ${LIB}_ifc) + +target_include_directories(${LIB}_ifc + PUBLIC INTERFACE + $ +) + +add_library(${LIB} SHARED ${LIB_SRC} ${LIB_INC_PUB} ${LIB_INC}) +add_library(E2ALG::Staze ALIAS ${LIB}) + +target_link_libraries(${LIB} + PRIVATE + E2ALG::Common_ifc + PUBLIC + E2ALG::Staze_ifc +) + + +install( + TARGETS + ${LIB} + DESTINATION + lib +) + +install( + FILES + ${LIB_INC} + DESTINATION + include +) + diff --git a/COMMON/Staze/E2GDaty.cpp b/COMMON/Staze/E2GDaty.cpp index ff618c8..498148b 100644 --- a/COMMON/Staze/E2GDaty.cpp +++ b/COMMON/Staze/E2GDaty.cpp @@ -3,6 +3,7 @@ #include "E2GDaty.h" #include "E2GWyjatek.h" #include "E2GBlStaze.h" +#include #define MIN_DATE (-693593L) /* about year 1 */ #define MAX_DATE 2958465L /* about year 9999 */ diff --git a/COMMON/Staze/E2GOkresy.cpp b/COMMON/Staze/E2GOkresy.cpp index 2882f96..c3e32e0 100644 --- a/COMMON/Staze/E2GOkresy.cpp +++ b/COMMON/Staze/E2GOkresy.cpp @@ -1,5 +1,6 @@ //--------------------------------------------------------------------------- +#include #include #include #include diff --git a/COMMON/Staze/E2GSSlOkresow.cpp b/COMMON/Staze/E2GSSlOkresow.cpp index 18be3a2..bf39b63 100644 --- a/COMMON/Staze/E2GSSlOkresow.cpp +++ b/COMMON/Staze/E2GSSlOkresow.cpp @@ -2,6 +2,7 @@ #include #include +#include #include "E2GCmnStaze.h" #include "E2GSSlOkresow.h" -- 2.40.1