2021-09-21 22:46:31 +00:00
|
|
|
# Copyright© 2021 John Sennesael
|
2021-09-21 01:02:23 +00:00
|
|
|
#
|
2021-10-08 20:17:22 +00:00
|
|
|
# UsenetSearch is Free software: you can redistribute it and/or modify
|
2021-09-21 22:46:31 +00:00
|
|
|
# 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.
|
2021-09-21 01:02:23 +00:00
|
|
|
#
|
2021-09-21 22:46:31 +00:00
|
|
|
# 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/>.
|
2021-09-21 01:02:23 +00:00
|
|
|
|
2021-09-19 21:05:16 +00:00
|
|
|
cmake_minimum_required(VERSION 3.5)
|
|
|
|
|
2021-10-08 20:17:22 +00:00
|
|
|
#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")
|
2021-09-19 21:05:16 +00:00
|
|
|
|
2021-10-08 20:17:22 +00:00
|
|
|
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")
|
2021-09-19 21:05:16 +00:00
|
|
|
|
|
|
|
if(NOT DEFINED CMAKE_BUILD_TYPE)
|
|
|
|
set(CMAKE_BUILD_TYPE "DEBUG" CACHE STRING "Type of build: Debug|Release")
|
|
|
|
endif()
|
|
|
|
|
2021-10-08 20:17:22 +00:00
|
|
|
project(usenetsearchd CXX)
|
2021-09-19 21:05:16 +00:00
|
|
|
|
|
|
|
set(CMAKE_CXX_STANDARD 17)
|
|
|
|
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
|
|
|
|
|
|
|
|
find_package(OpenSSL REQUIRED)
|
|
|
|
|
2021-10-08 20:17:22 +00:00
|
|
|
# Usenetsearch common library --------------------------------------------------
|
|
|
|
|
|
|
|
add_library(usenetsearch
|
|
|
|
"src/Application.cpp"
|
2021-09-21 00:48:49 +00:00
|
|
|
"src/Configuration.cpp"
|
|
|
|
"src/Database.cpp"
|
2021-09-19 21:05:16 +00:00
|
|
|
"src/Dns.cpp"
|
|
|
|
"src/Except.cpp"
|
2021-10-08 22:31:23 +00:00
|
|
|
"src/Filter.cpp"
|
2021-10-19 01:19:11 +00:00
|
|
|
"src/Indexer.cpp"
|
2021-09-19 21:05:16 +00:00
|
|
|
"src/IoSocket.cpp"
|
2021-09-29 23:52:54 +00:00
|
|
|
"src/Serialize.cpp"
|
2021-09-19 21:05:16 +00:00
|
|
|
"src/SSLConnection.cpp"
|
2021-09-21 00:48:49 +00:00
|
|
|
"src/StringUtils.cpp"
|
2021-09-19 21:05:16 +00:00
|
|
|
"src/TcpConnection.cpp"
|
2021-09-29 23:52:54 +00:00
|
|
|
"src/ThreadPool.cpp"
|
2021-09-19 21:05:16 +00:00
|
|
|
"src/UsenetClient.cpp"
|
|
|
|
)
|
|
|
|
|
|
|
|
target_include_directories(usenetsearch
|
|
|
|
PRIVATE
|
|
|
|
include
|
|
|
|
PUBLIC
|
|
|
|
${OPENSSL_INCLUDE_DIR}
|
|
|
|
)
|
2021-10-08 20:17:22 +00:00
|
|
|
|
|
|
|
target_link_libraries(usenetsearch
|
2021-10-13 18:59:37 +00:00
|
|
|
PUBLIC ${OPENSSL_LIBRARIES} stdc++fs
|
2021-10-08 20:17:22 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
# Indexer executable -----------------------------------------------------------
|
|
|
|
|
|
|
|
add_executable(usenetindexd
|
|
|
|
"src/usenetindexd.cpp"
|
|
|
|
)
|
|
|
|
|
|
|
|
target_link_libraries(usenetindexd
|
2021-10-13 18:59:37 +00:00
|
|
|
PUBLIC ${OPENSSL_LIBRARIES} stdc++fs
|
2021-10-08 20:17:22 +00:00
|
|
|
PRIVATE usenetsearch
|
|
|
|
)
|
|
|
|
|
|
|
|
target_include_directories(usenetindexd
|
|
|
|
PRIVATE
|
|
|
|
include
|
|
|
|
)
|
|
|
|
|
|
|
|
# usenetfind executable --------------------------------------------------------
|
|
|
|
|
|
|
|
add_executable(usenetfind
|
|
|
|
"src/usenetfind.cpp"
|
|
|
|
)
|
|
|
|
|
|
|
|
target_link_libraries(usenetfind
|
2021-10-13 18:59:37 +00:00
|
|
|
PUBLIC ${OPENSSL_LIBRARIES} stdc++fs
|
2021-10-08 20:17:22 +00:00
|
|
|
PRIVATE usenetsearch
|
|
|
|
)
|
|
|
|
|
|
|
|
target_include_directories(usenetfind
|
|
|
|
PRIVATE
|
|
|
|
include
|
|
|
|
)
|
|
|
|
|
2021-10-19 01:19:11 +00:00
|
|
|
# dbdump executable ------------------------------------------------------------
|
2021-10-08 20:17:22 +00:00
|
|
|
|
2021-10-19 01:19:11 +00:00
|
|
|
add_executable(dbdump
|
|
|
|
"src/dbdump.cpp"
|
2021-10-08 20:17:22 +00:00
|
|
|
)
|
|
|
|
|
2021-10-19 01:19:11 +00:00
|
|
|
target_link_libraries(dbdump
|
2021-10-13 18:59:37 +00:00
|
|
|
PUBLIC ${OPENSSL_LIBRARIES} stdc++fs
|
2021-10-08 20:17:22 +00:00
|
|
|
PRIVATE usenetsearch
|
|
|
|
)
|
|
|
|
|
2021-10-19 01:19:11 +00:00
|
|
|
target_include_directories(dbdump
|
2021-10-08 20:17:22 +00:00
|
|
|
PRIVATE
|
|
|
|
include
|
|
|
|
)
|