Поиск стандартных каталогов
This commit is contained in:
45
examples/filesystem/01_minimal/CMakeLists.txt
Normal file
45
examples/filesystem/01_minimal/CMakeLists.txt
Normal file
@ -0,0 +1,45 @@
|
||||
# Название основной цели в текущем каталоге
|
||||
set(current_target example-filesystem-minimal)
|
||||
|
||||
# Список файлов исходных текстов
|
||||
set(current_target_sources
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/minimal.cpp
|
||||
)
|
||||
|
||||
# Путь поиска библиотек внутри проекта
|
||||
link_directories(${CMAKE_INSTALL_LIBDIR})
|
||||
link_directories(${CMAKE_BINARY_DIR}/src/filesystem/lib)
|
||||
|
||||
# Цель для создания исполняемого файла
|
||||
add_executable(${current_target} ${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_uncrustify_format(${current_target} ${current_target_sources})
|
||||
add_pvs_check(${current_target})
|
||||
|
||||
# Qt5
|
||||
# qt_translation(TARGET ${current_target} TS_DIR ${CMAKE_SOURCE_DIR}/l10n LANGUAGES ru_RU)
|
||||
target_include_directories(${current_target} PRIVATE ${CMAKE_SOURCE_DIR}/src)
|
||||
target_include_directories(${current_target} SYSTEM PUBLIC ${FMT_INCLUDE_DIRS})
|
||||
target_include_directories(${current_target} SYSTEM PUBLIC ${SPDLOG_INCLUDE_DIRS})
|
||||
target_include_directories(${current_target} SYSTEM PUBLIC ${Qt5Core_INCLUDE_DIRS})
|
||||
target_compile_options(${current_target} PUBLIC "${Qt5Core_EXECUTABLE_COMPILE_FLAGS}")
|
||||
|
||||
target_link_libraries(${current_target} filesystem_static)
|
||||
target_link_libraries(${current_target} Qt5::Core)
|
||||
|
||||
# Имя выходного файла для цели
|
||||
set_target_properties(${current_target}
|
||||
PROPERTIES
|
||||
OUTPUT_NAME filesystem-minimal
|
||||
RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_BINDIR}
|
||||
)
|
||||
|
||||
add_sanitizers(${current_target})
|
||||
|
||||
# cotire(${current_target})
|
||||
|
||||
# Правила для установки
|
||||
install(TARGETS ${current_target} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
|
17
examples/filesystem/01_minimal/minimal.cpp
Normal file
17
examples/filesystem/01_minimal/minimal.cpp
Normal file
@ -0,0 +1,17 @@
|
||||
#include "filesystem/paths.hpp"
|
||||
|
||||
namespace MF = myx::filesystem;
|
||||
|
||||
|
||||
int main( int argc, char** argv )
|
||||
{
|
||||
(void)argc;
|
||||
(void)argv;
|
||||
MF::Paths paths;
|
||||
|
||||
paths.updatePaths();
|
||||
paths.makePaths();
|
||||
paths.findConfigFile( "test" );
|
||||
|
||||
return( 0 );
|
||||
}
|
@ -0,0 +1,2 @@
|
||||
add_subdirectory(01_minimal)
|
||||
|
||||
|
Reference in New Issue
Block a user