mirror of
https://github.com/slsdetectorgroup/aare.git
synced 2025-06-13 15:57:14 +02:00
saving work: failed attempt at sublibraries
This commit is contained in:
@ -8,6 +8,8 @@ project(aare
|
||||
)
|
||||
|
||||
cmake_policy(SET CMP0135 NEW)
|
||||
cmake_policy(SET CMP0079 NEW)
|
||||
|
||||
|
||||
include(GNUInstallDirs)
|
||||
|
||||
@ -71,21 +73,22 @@ set(SUPPRESSED_WARNINGS "-Wno-return-type")
|
||||
set(CMAKE_CXX_FLAGS "${OPTIONAL_FLAGS} ${OPTIMIZATION_FLAGS} ${SUPPRESSED_WARNINGS}")
|
||||
|
||||
|
||||
|
||||
add_executable(aare)
|
||||
|
||||
target_link_libraries( aare
|
||||
PRIVATE
|
||||
nlohmann_json::nlohmann_json
|
||||
PUBLIC
|
||||
fmt::fmt
|
||||
)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
add_subdirectory(src)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
add_library(aare INTERFACE)
|
||||
|
||||
# target_link_libraries( aare
|
||||
# PRIVATE
|
||||
# nlohmann_json::nlohmann_json
|
||||
# PUBLIC
|
||||
# fmt::fmt
|
||||
# )
|
||||
|
||||
target_link_libraries(aare INTERFACE common core file_io)
|
||||
|
||||
|
||||
add_subdirectory(examples)
|
||||
|
7
examples/CMakeLists.txt
Normal file
7
examples/CMakeLists.txt
Normal file
@ -0,0 +1,7 @@
|
||||
add_executable(example "${CMAKE_CURRENT_SOURCE_DIR}/main.cpp")
|
||||
|
||||
target_include_directories(example PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}")
|
||||
|
||||
target_link_libraries(example PUBLIC aare)
|
||||
|
||||
|
@ -2,6 +2,3 @@ add_subdirectory(file_io)
|
||||
add_subdirectory(core)
|
||||
add_subdirectory(processing)
|
||||
add_subdirectory(common)
|
||||
|
||||
target_include_directories(aare PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
|
||||
target_sources(aare PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/main.cpp)
|
||||
|
@ -1,5 +1,7 @@
|
||||
target_include_directories(aare PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
|
||||
add_library(common "${CMAKE_CURRENT_SOURCE_DIR}/defs.cpp")
|
||||
|
||||
target_sources(aare PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/defs.cpp")
|
||||
target_include_directories(common PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}")
|
||||
|
||||
target_link_libraries(common PUBLIC fmt::fmt)
|
||||
|
||||
|
||||
|
@ -40,4 +40,6 @@ template <> TimingMode StringTo(std::string mode){
|
||||
auto msg = fmt::format("Could not decode timing mode from: \"{}\"", mode);
|
||||
throw std::runtime_error(msg);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// template <> TimingMode StringTo<TimingMode>(std::string mode);
|
@ -1,3 +1,12 @@
|
||||
target_include_directories(aare PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
|
||||
# target_include_directories(aare PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
|
||||
|
||||
# target_sources(aare PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/Frame.cpp")
|
||||
|
||||
|
||||
add_library(core "${CMAKE_CURRENT_SOURCE_DIR}/Frame.cpp")
|
||||
|
||||
target_include_directories(core PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}")
|
||||
|
||||
target_link_libraries(core PUBLIC common)
|
||||
|
||||
|
||||
target_sources(aare PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/Frame.cpp")
|
@ -4,7 +4,7 @@
|
||||
#include <cstdint>
|
||||
#include <bits/unique_ptr.h>
|
||||
#include <vector>
|
||||
#include "defs.hpp"
|
||||
#include "common/defs.hpp"
|
||||
|
||||
|
||||
|
||||
|
@ -1,6 +1,3 @@
|
||||
target_include_directories(aare PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/file")
|
||||
target_include_directories(aare PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/file_factory")
|
||||
target_include_directories(aare PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}")
|
||||
|
||||
set(FILE_IO_SOURCES "file/File.cpp"
|
||||
"file/JsonFile.cpp"
|
||||
@ -15,4 +12,12 @@ foreach(FILE_IO_SOURCE ${FILE_IO_SOURCES})
|
||||
list(APPEND FILE_IO_SOURCES_WITH_PATH "${CMAKE_CURRENT_SOURCE_DIR}/${FILE_IO_SOURCE}")
|
||||
endforeach()
|
||||
|
||||
target_sources(aare PRIVATE ${FILE_IO_SOURCES_WITH_PATH})
|
||||
add_library(file_io ${FILE_IO_SOURCES_WITH_PATH})
|
||||
|
||||
|
||||
target_include_directories(file_io PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/file")
|
||||
target_include_directories(file_io PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/file_factory")
|
||||
target_include_directories(file_io PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}")
|
||||
|
||||
|
||||
target_link_libraries(file_io common fmt::fmt core nlohmann_json::nlohmann_json)
|
@ -1,8 +1,8 @@
|
||||
#pragma once
|
||||
|
||||
#include "defs.hpp"
|
||||
#include "Frame.hpp"
|
||||
#include "SubFile.hpp"
|
||||
#include "defs.hpp"
|
||||
#include <filesystem>
|
||||
#include <fmt/core.h>
|
||||
#include <iostream>
|
||||
|
Reference in New Issue
Block a user