51 lines
1.2 KiB
CMake
51 lines
1.2 KiB
CMake
cmake_minimum_required(VERSION 3.10)
|
|
project(dropshell_template_registry)
|
|
|
|
set(CMAKE_CXX_STANDARD 17)
|
|
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
|
|
|
# Find required packages
|
|
find_package(Threads REQUIRED)
|
|
find_package(SQLite3 REQUIRED)
|
|
|
|
# Find all source files in src directory
|
|
file(GLOB_RECURSE SOURCES
|
|
"src/*.cpp"
|
|
"hash.cpp"
|
|
)
|
|
|
|
# Find all header files in src directory
|
|
file(GLOB_RECURSE HEADERS
|
|
"src/*.hpp"
|
|
"hash.hpp"
|
|
)
|
|
|
|
# Add include directories
|
|
include_directories(
|
|
${CMAKE_CURRENT_SOURCE_DIR}
|
|
${CMAKE_CURRENT_SOURCE_DIR}/src
|
|
)
|
|
|
|
# Create executable
|
|
add_executable(dropshell_template_registry ${SOURCES})
|
|
|
|
# Link libraries
|
|
target_link_libraries(dropshell_template_registry
|
|
Threads::Threads # Use modern Threads target
|
|
SQLite::SQLite3 # Use SQLite3 target
|
|
# ssl and crypto might still be needed by httplib if used
|
|
# ssl
|
|
# crypto
|
|
)
|
|
|
|
# Set compile options for static linking
|
|
# Note: Static linking SQLite might require additional setup depending on the system
|
|
# set_target_properties(dropshell_template_registry PROPERTIES
|
|
# LINK_SEARCH_START_STATIC ON
|
|
# LINK_SEARCH_END_STATIC ON
|
|
# )
|
|
|
|
# Install target
|
|
install(TARGETS dropshell_template_registry
|
|
RUNTIME DESTINATION bin
|
|
) |