Основа проекта разрастается
This commit is contained in:
38
src/base/CMakeLists.txt
Normal file
38
src/base/CMakeLists.txt
Normal file
@ -0,0 +1,38 @@
|
||||
# Название основной цели и имя библиотеки в текущем каталоге
|
||||
set(current_target base)
|
||||
|
||||
set(current_target_sources
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/config.cpp
|
||||
)
|
||||
|
||||
# Список заголовочных файлов (используется для установки)
|
||||
set(current_target_headers
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/config.hpp
|
||||
)
|
||||
|
||||
add_common_library(TARGET ${current_target} SOURCES ${current_target_sources} ${current_target_headers})
|
||||
common_target_properties(${current_target})
|
||||
add_clang_tidy_check(${current_target} ${current_target_sources})
|
||||
add_clang_analyze_check(${current_target} ${current_target_sources})
|
||||
add_clazy_check(${current_target} ${current_target_sources})
|
||||
add_pvs_check(${current_target})
|
||||
add_uncrustify_format(${current_target} ${current_target_sources} ${current_target_headers})
|
||||
|
||||
# Цель, используемая только для установки заголовочных файлов без компиляции проекта
|
||||
add_custom_target(${current_target}-install-headers
|
||||
COMMAND "${CMAKE_COMMAND}"
|
||||
-DCMAKE_INSTALL_COMPONENT=headers -P "${CMAKE_BINARY_DIR}/cmake_install.cmake"
|
||||
)
|
||||
|
||||
# Правила для установки
|
||||
install(TARGETS ${current_target}_static ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})
|
||||
if(BUILD_SHARED_LIBS)
|
||||
install(TARGETS ${current_target}_shared LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR})
|
||||
endif()
|
||||
install(FILES ${CMAKE_BINARY_DIR}/include/cmlib_config.hpp
|
||||
${CMAKE_BINARY_DIR}/include/config_flags.hpp
|
||||
${current_target_headers}
|
||||
COMPONENT headers
|
||||
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/${current_target})
|
||||
install(FILES ${CMAKE_BINARY_DIR}/${current_target}.pc DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig)
|
||||
|
1
src/base/config.cpp
Normal file
1
src/base/config.cpp
Normal file
@ -0,0 +1 @@
|
||||
#include "config.hpp"
|
25
src/base/config.hpp
Normal file
25
src/base/config.hpp
Normal file
@ -0,0 +1,25 @@
|
||||
#ifndef MYX_BASE_CONFIG_HPP_
|
||||
#define MYX_BASE_CONFIG_HPP_
|
||||
|
||||
#include "cmlib_config.hpp"
|
||||
#include "config_flags.hpp"
|
||||
|
||||
#if ( defined ( TARGET_LSB_ID_AstraLinuxSE ) && defined ( TARGET_LSB_CODENAME_smolensk ) )
|
||||
|
||||
#define override
|
||||
|
||||
#if QT_VERSION <= 0x050700
|
||||
#include <QtGlobal>
|
||||
template< typename ... Args >
|
||||
struct QOverload
|
||||
{
|
||||
template< typename C, typename R >
|
||||
static constexpr auto of( R ( C::* pmf )( Args... ) )->decltype( pmf )
|
||||
{
|
||||
return( pmf );
|
||||
}
|
||||
};
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#endif // MYX_BASE_CONFIG_HPP_
|
7
src/base/config_flags.hpp.in
Normal file
7
src/base/config_flags.hpp.in
Normal file
@ -0,0 +1,7 @@
|
||||
#ifndef @CMLIB_PROJECT_NAME_CANONICAL@_CONFIG_FLAGS_HPP_
|
||||
#define @CMLIB_PROJECT_NAME_CANONICAL@_CONFIG_FLAGS_HPP_
|
||||
|
||||
// #cmakedefine
|
||||
|
||||
#endif /* @CMLIB_PROJECT_NAME_CANONICAL@_CONFIG_FLAGS_HPP_ */
|
||||
|
@ -0,0 +1,37 @@
|
||||
# Название основной цели и имя библиотеки в текущем каталоге
|
||||
set(current_target filesystem)
|
||||
|
||||
# Список файлов исходных текстов
|
||||
set(current_target_sources
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/paths.cpp
|
||||
)
|
||||
|
||||
# Список заголовочных файлов (используется для установки)
|
||||
set(current_target_headers
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/paths.hpp
|
||||
)
|
||||
|
||||
add_common_library(TARGET ${current_target} SOURCES ${current_target_sources})
|
||||
common_target_properties(${current_target})
|
||||
add_clang_tidy_check(${current_target} ${current_target_sources})
|
||||
add_clang_analyze_check(${current_target} ${current_target_sources})
|
||||
add_clazy_check(${current_target} ${current_target_sources})
|
||||
add_pvs_check(${current_target})
|
||||
add_uncrustify_format(${current_target} ${current_target_sources} ${current_target_headers})
|
||||
|
||||
# Цель, используемая только для установки заголовочных файлов без компиляции проекта
|
||||
add_custom_target(${current_target}-install-headers
|
||||
COMMAND "${CMAKE_COMMAND}"
|
||||
-DCMAKE_INSTALL_COMPONENT=headers -P "${CMAKE_BINARY_DIR}/cmake_install.cmake"
|
||||
)
|
||||
|
||||
# Правила для установки
|
||||
install(TARGETS ${current_target}_static ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})
|
||||
if(BUILD_SHARED_LIBS)
|
||||
install(TARGETS ${current_target}_shared LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR})
|
||||
endif()
|
||||
install(FILES ${current_target_headers}
|
||||
COMPONENT headers
|
||||
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/${current_target})
|
||||
install(FILES ${CMAKE_BINARY_DIR}/${current_target}.pc DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig)
|
||||
|
||||
|
9
src/filesystem/paths.cpp
Normal file
9
src/filesystem/paths.cpp
Normal file
@ -0,0 +1,9 @@
|
||||
#include "paths.hpp"
|
||||
|
||||
namespace MF = myx::filesystem;
|
||||
|
||||
|
||||
int32_t MF::init( int32_t i = 0 )
|
||||
{
|
||||
return( i );
|
||||
}
|
16
src/filesystem/paths.hpp
Normal file
16
src/filesystem/paths.hpp
Normal file
@ -0,0 +1,16 @@
|
||||
#ifndef MYX_FILESYSTEM_PATHS_HPP_
|
||||
#define MYX_FILESYSTEM_PATHS_HPP_
|
||||
|
||||
#include <cstdint>
|
||||
|
||||
namespace myx {
|
||||
|
||||
namespace filesystem {
|
||||
|
||||
int32_t init( int32_t i );
|
||||
|
||||
} // namespace filesystem
|
||||
|
||||
} // namespace myx
|
||||
|
||||
#endif // MYX_FILESYSTEM_PATHS_HPP_
|
Reference in New Issue
Block a user