merge with organizing targets

This commit is contained in:
Bechir
2024-03-08 13:28:34 +01:00
parent 47d381d299
commit 146d2aed19
7 changed files with 44 additions and 69 deletions

View File

@ -1,4 +1,8 @@
FetchContent_Declare(json
GIT_REPOSITORY https://github.com/nlohmann/json
GIT_TAG v3.11.3
)
FetchContent_MakeAvailable(json)
set(SourceFiles
${CMAKE_CURRENT_SOURCE_DIR}/src/File.cpp
@ -13,18 +17,6 @@ set(SourceFiles
add_library(file_io STATIC ${SourceFiles})
target_include_directories(file_io PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/include)
target_link_libraries(file_io PUBLIC fmt::fmt core nlohmann_json::nlohmann_json)
target_link_libraries(file_io PRIVATE fmt::fmt core nlohmann_json::nlohmann_json aare_compiler_flags)
set_property(TARGET file_io PROPERTY POSITION_INDEPENDENT_CODE ON)
# if(AARE_BUILD_TESTS)
# set(TestSources
# ${CMAKE_CURRENT_SOURCE_DIR}/src/defs.test.cpp
# )
# target_sources(tests PRIVATE ${TestSources} )
# #Work around to remove, this is not the way to do it =)
# # target_include_directories(tests PRIVATE ${CMAKE_SOURCE_DIR}/include/common)
# target_link_libraries(tests PRIVATE file_io)
# endif()

View File

@ -10,9 +10,9 @@ class FileHandler{
File<detector,DataType>* f;
public:
FileHandler<detector,DataType>(std::filesystem::path fpath){
this->fpath = fpath;
this->fileFactory= FileFactory<detector,DataType>::get_factory(fpath);
FileHandler<detector,DataType>(std::filesystem::path fname){
this->fpath = fname;
this->fileFactory= FileFactory<detector,DataType>::get_factory(fname);
this->f= fileFactory->load_file();
delete fileFactory;
}