UsenetSearch/CMakeLists.txt

60 lines
1.8 KiB
CMake

# Copyright© 2021 John Sennesael
#
# UsenetSearch is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# UsenetSearch is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with UsenetSearch. If not, see <https://www.gnu.org/licenses/>.
cmake_minimum_required(VERSION 3.5)
set (CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -O0 -ggdb -fno-omit-frame-pointer -fsanitize=address")
set (CMAKE_LINKER_FLAGS_DEBUG "${CMAKE_LINKER_FLAGS_DEBUG} -fno-omit-frame-pointer -fsanitize=address")
#set (CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -O0 -ggdb -fno-omit-frame-pointer -pthread")
#set (CMAKE_LINKER_FLAGS_DEBUG "${CMAKE_LINKER_FLAGS_DEBUG} -fno-omit-frame-pointer -pthread")
if(NOT DEFINED CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE "DEBUG" CACHE STRING "Type of build: Debug|Release")
endif()
project(usenetsearch CXX)
set(CMAKE_CXX_STANDARD 17)
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
find_package(OpenSSL REQUIRED)
add_executable(usenetsearch
"src/Configuration.cpp"
"src/Database.cpp"
"src/Dns.cpp"
"src/Except.cpp"
"src/IoSocket.cpp"
"src/main.cpp"
"src/Serialize.cpp"
"src/SSLConnection.cpp"
"src/StringUtils.cpp"
"src/TcpConnection.cpp"
"src/ThreadPool.cpp"
"src/UsenetClient.cpp"
)
target_link_libraries(usenetsearch
${OPENSSL_LIBRARIES}
)
target_include_directories(usenetsearch
PRIVATE
include
PUBLIC
${OPENSSL_INCLUDE_DIR}
)