Код: Выделить всё
|
|---sqlite_modern_cpp/
| |
| |---CMakeLists.txt
| |
| |---hdr/
| |
| |---
|
|---CMakeLists.txt
|
|---
|-----------------------------------------------
Код: Выделить всё
...
set(BOT_NAME "guidingLight")
... # The file is quite large
add_subdirectory(sqlite_modern_cpp)
target_compile_options(${BOT_NAME} PUBLIC -Wall -Wextra -Wpedantic)
...
Код: Выделить всё
cmake_minimum_required(VERSION 3.15)
set(SUBDIR_NAME sqlite_modern_cpp)
add_library(${SUBDIR_NAME} STATIC hdr/sqlite_modern_cpp.h)
target_compile_options(${SUBDIR_NAME} PRIVATE -w)
# If this is PUBLIC, the warnings are disabled for my own code.
# If this is PRIVATE, both the library and my own code generate warnings.
set_target_properties(${SUBDIR_NAME} PROPERTIES LINKER_LANGUAGE CXX)
target_include_directories(${SUBDIR_NAME} PUBLIC hdr)
find_package(SQLite3 REQUIRED MODULE) # Checking if sqlite3 exists
target_link_libraries(${SUBDIR_NAME} PUBLIC sqlite3)
Я также попытался сделать SQLite_modern_cpp библиотека , но я тот же, как и для кода, не знает, что для изучения кода. Цели, как я совершенно новичок в Cmake. < /p>
Заранее спасибо. Дайте мне знать, если есть что -нибудь, что может помочь вам помочь.
Подробнее здесь: https://stackoverflow.com/questions/797 ... ject-files
Мобильная версия