Базовая библиотека
This commit is contained in:
parent
604a600690
commit
451708a3ba
@ -32,3 +32,6 @@ find_package(Qt5 COMPONENTS Core Network Gui Widgets DBus Concurrent Sql REQUIRE
|
|||||||
# Автоматически генерируемый заголовочный файл
|
# Автоматически генерируемый заголовочный файл
|
||||||
cmlib_config_hpp_generate()
|
cmlib_config_hpp_generate()
|
||||||
|
|
||||||
|
# Библиотека
|
||||||
|
add_subdirectory(src/libcmex)
|
||||||
|
|
||||||
|
@ -1 +1 @@
|
|||||||
Subproject commit 6e5e08aac02b2b9dce71265e9aff85e758cd3648
|
Subproject commit 405cced4a59588719e7cb3ef3f4c778326223a9d
|
28
src/libcmex/CMakeLists.txt
Normal file
28
src/libcmex/CMakeLists.txt
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
# Название основной цели и имя библиотеки в текущем каталоге
|
||||||
|
set(current_target cmex)
|
||||||
|
|
||||||
|
# Список файлов исходных текстов
|
||||||
|
set(current_target_sources
|
||||||
|
cmex.cpp
|
||||||
|
)
|
||||||
|
|
||||||
|
# Список заголовочных файлов (используется для установки)
|
||||||
|
set(current_target_headers
|
||||||
|
cmex.hpp
|
||||||
|
)
|
||||||
|
|
||||||
|
add_common_library(${current_target} ${current_target_sources})
|
||||||
|
common_target_properties(${current_target})
|
||||||
|
|
||||||
|
# Цель, используемая только для установки заголовочных файлов, без компиляции проекта
|
||||||
|
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})
|
||||||
|
install(TARGETS ${current_target}_shared LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR})
|
||||||
|
install(FILES ${CMAKE_BINARY_DIR}/include/config.hpp ${current_target_headers}
|
||||||
|
COMPONENT headers DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/${current_target})
|
||||||
|
|
6
src/libcmex/cmex.cpp
Normal file
6
src/libcmex/cmex.cpp
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
#include "cmex.hpp"
|
||||||
|
|
||||||
|
int32_t cmex_init(int32_t i = 0) {
|
||||||
|
return i;
|
||||||
|
}
|
||||||
|
|
9
src/libcmex/cmex.hpp
Normal file
9
src/libcmex/cmex.hpp
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
#ifndef LIBCMEX_CMEX_HPP_
|
||||||
|
#define LIBCMEX_CMEX_HPP_
|
||||||
|
|
||||||
|
#include <stdint.h>
|
||||||
|
|
||||||
|
int32_t cmex_init(int32_t i);
|
||||||
|
|
||||||
|
#endif // LIBCMEX_CMEX_HPP_
|
||||||
|
|
Loading…
x
Reference in New Issue
Block a user