Skip to content

Commit

Permalink
Merge pull request e8tools#252 from dmpas/feature/merge-system-classes
Browse files Browse the repository at this point in the history
Слил SystemClasses
  • Loading branch information
dmpas authored Apr 13, 2018
2 parents d3c1201 + 39725bd commit 423c0e4
Show file tree
Hide file tree
Showing 10 changed files with 52 additions and 43 deletions.
3 changes: 1 addition & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@ set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${BINARY_DIR}/bin")
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${BINARY_DIR}/lib")

add_definitions (-DBOOST_ALL_NO_LIB)
set (Boost_USE_STATIC_LIBS ON)

# Переделываем shared-runtime на static-runtime
# Это нужно, чтобы под Windows Tool1CD не требовал vcredist
if (NOGUI)

set (Boost_USE_STATIC_LIBS ON)
set (Boost_USE_MULTITHREADED OFF)
set (Boost_USE_STATIC_RUNTIME ON)

Expand Down Expand Up @@ -48,7 +48,6 @@ set (CMAKE_CXX_STANDARD 11)
set (CMAKE_CXX_STANDARD_REQUIRED YES)
set (CMAKE_CXX_EXTENSIONS OFF)

add_subdirectory(${SOURCE_DIR}/SystemClasses)
add_subdirectory(${SOURCE_DIR}/tool1cd)
add_subdirectory(${SOURCE_DIR}/ctool1cd)
add_subdirectory(${SOURCE_DIR}/tests)
Expand Down
18 changes: 0 additions & 18 deletions src/SystemClasses/CMakeLists.txt

This file was deleted.

2 changes: 0 additions & 2 deletions src/ctool1cd/App.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -495,8 +495,6 @@ int App::Run()
return 0;
}

mess.setlogfile("tool1cd.log");

// Первый цикл просмотра команд для определения ключей параметров
for (const auto &pc : commands) {
switch (pc.command) {
Expand Down
4 changes: 1 addition & 3 deletions src/ctool1cd/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,8 @@ set (CTOOL_HEADERS cTool_1CD_Main.h ParseCommandLine.h ErrorCode.h App.h)

add_executable (ctool1cd ${CTOOL_SOURCES} ${CTOOL_HEADERS})

include_directories (${SOURCE_DIR}/SystemClasses)
target_link_libraries (ctool1cd SystemClasses)

include_directories (${SOURCE_DIR}/tool1cd)
include_directories (${SOURCE_DIR}/SystemClasses)
target_link_libraries (ctool1cd tool1cd)

find_package (Boost 1.53 REQUIRED COMPONENTS filesystem regex system)
Expand Down
4 changes: 1 addition & 3 deletions src/ctool1cd/cTool_1CD_Main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,7 @@
#include "ErrorCode.h"
#include "App.h"

TMultiReadExclusiveWriteSynchronizer* tr_syn = new TMultiReadExclusiveWriteSynchronizer();

Registrator msreg_g;
extern Registrator msreg_g;


//***************************************************************************
Expand Down
4 changes: 1 addition & 3 deletions src/gtool1cd/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,8 @@ set (RESOURCES gtool1cd.rc gtool1cd.qrc)

add_executable(gtool1cd WIN32 ${SOURCE_FILES} ${HEADER_FILES} ${UI_FILES} ${RESOURCES})

include_directories (${SOURCE_DIR}/SystemClasses)
target_link_libraries (gtool1cd SystemClasses)

include_directories (${SOURCE_DIR}/tool1cd)
include_directories (${SOURCE_DIR}/SystemClasses)
target_link_libraries (gtool1cd tool1cd)


Expand Down
6 changes: 1 addition & 5 deletions src/gtool1cd/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,7 @@
#include <MessageRegistration.h>
#include <QCommandLineParser>

Registrator msreg_g;

TMultiReadExclusiveWriteSynchronizer*
tr_syn = new TMultiReadExclusiveWriteSynchronizer();

extern Registrator msreg_g;


int main(int argc, char *argv[])
Expand Down
4 changes: 1 addition & 3 deletions src/tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,8 @@ add_executable(testproject ${TEST_SYSTEM_SOURCES} ${TEST_TOOL1CD_SOURCES} catch_

add_definitions (-DCMAKE_SOURCE_DIR="${CMAKE_SOURCE_DIR}")

include_directories (${SOURCE_DIR}/SystemClasses)
target_link_libraries (testproject SystemClasses)

include_directories (${SOURCE_DIR}/tool1cd)
include_directories (${SOURCE_DIR}/SystemClasses)
target_link_libraries (testproject tool1cd)

find_package (Boost 1.53 REQUIRED COMPONENTS filesystem regex system)
Expand Down
41 changes: 37 additions & 4 deletions src/tool1cd/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,12 +1,39 @@
cmake_minimum_required (VERSION 2.8)
project (tool1cd)

include_directories(../SystemClasses)
set (SYSTEMCLASSES_SOURCES ../SystemClasses/String.cpp
../SystemClasses/System.Classes.cpp
../SystemClasses/System.cpp
../SystemClasses/System.IOUtils.cpp
../SystemClasses/TFileStream.cpp
../SystemClasses/TMemoryStream.cpp
../SystemClasses/TStream.cpp
../SystemClasses/TStreamReader.cpp
../SystemClasses/TStreamWriter.cpp
../SystemClasses/System.SysUtils.cpp
../SystemClasses/GetTickCount.cpp)
set (SYSTEMCLASSES_HEADERS ../SystemClasses/String.hpp
../SystemClasses/System.Classes.hpp
../SystemClasses/System.hpp
../SystemClasses/System.IOUtils.hpp
../SystemClasses/TFileStream.hpp
../SystemClasses/TMemoryStream.hpp
../SystemClasses/TStream.hpp
../SystemClasses/TStreamReader.hpp
../SystemClasses/TStreamWriter.hpp
../SystemClasses/System.SysUtils.hpp
../SystemClasses/GetTickCount.hpp
../SystemClasses/Exception.hpp)


set (TOOL1CD_SOURCES MessageRegistration.cpp Class_1CD.cpp
Common.cpp ConfigStorage.cpp Parse_tree.cpp TempStream.cpp Base64.cpp UZLib.cpp Messenger.cpp
V8Object.cpp Field.cpp Index.cpp Table.cpp TableFiles.cpp TableFileStream.cpp
MemBlock.cpp CRC32.cpp Packdata.cpp PackDirectory.cpp FieldType.cpp DetailedException.cpp
BinaryDecimalNumber.cpp save_depot_config.cpp save_part_depot_config.cpp
SupplierConfig.cpp TableRecord.cpp BinaryGuid.cpp TableIterator.cpp SupplierConfigBuilder.cpp)
SupplierConfig.cpp TableRecord.cpp BinaryGuid.cpp TableIterator.cpp SupplierConfigBuilder.cpp
main.cpp)

set (TOOL1CD_HEADERS MessageRegistration.h Class_1CD.h
Common.h ConfigStorage.h Parse_tree.h TempStream.h Base64.h UZLib.h Messenger.h
Expand All @@ -20,10 +47,16 @@ set (TOOL1CD_SOURCES ${TOOL1CD_SOURCES} cfapi/V8File.cpp cfapi/V8Catalog.cpp cfa
set (TOOL1CD_HEADERS ${TOOL1CD_HEADERS} cfapi/V8File.h cfapi/V8Catalog.h cfapi/TV8FileStream.h
cfapi/APIcfBase.h cfapi/V8Time.h)

add_library (tool1cd STATIC ${TOOL1CD_SOURCES} ${TOOL1CD_HEADERS})
set (TOOL1CD_SOURCES ${TOOL1CD_SOURCES} ${SYSTEMCLASSES_SOURCES})
set (TOOL1CD_HEADERS ${TOOL1CD_HEADERS} ${SYSTEMCLASSES_HEADERS})

if (NOGUI)
add_library (tool1cd STATIC ${TOOL1CD_SOURCES} ${TOOL1CD_HEADERS})
else()
add_library (tool1cd SHARED ${TOOL1CD_SOURCES} ${TOOL1CD_HEADERS})
endif()

include_directories (${SOURCE_DIR}/SystemClasses)
target_link_libraries (tool1cd SystemClasses)
set_target_properties(tool1cd PROPERTIES LINKER_LANGUAGE CXX)

find_package (Boost 1.53 REQUIRED COMPONENTS filesystem regex system)
include_directories (${Boost_INCLUDE_DIRS})
Expand Down
9 changes: 9 additions & 0 deletions src/tool1cd/main.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#include "MessageRegistration.h"
#include "System.SysUtils.hpp"

Registrator msreg_g;
TMultiReadExclusiveWriteSynchronizer* tr_syn = new TMultiReadExclusiveWriteSynchronizer();

extern "C" {

}

0 comments on commit 423c0e4

Please sign in to comment.