-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
executable file
·48 lines (40 loc) · 1.78 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
# This file is part of ArtadoBot Crawler.
#
# ArtadoBot Crawler 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.
#
# ArtadoBot Crawler 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
# ArtadoBot Crawler. If not, see <https://www.gnu.org/licenses/>.
cmake_minimum_required(VERSION 3.10)
project(crawler)
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
# Comment the following line out for production
set(CMAKE_BUILD_TYPE Debug)
find_package(CURL REQUIRED)
include_directories(${CURL_INCLUDE_DIRS})
find_package(LibXml2 REQUIRED)
include_directories(${LIBXML2_INCLUDE_DIR})
find_library(ODBC_LIBRARY NAMES odbc32 odbc)
find_path(ODBC_INCLUDE_DIR sql.h)
if (ODBC_LIBRARY AND ODBC_INCLUDE_DIR)
message(STATUS "Found ODBC library: ${ODBC_LIBRARY}")
message(STATUS "Found ODBC include directory: ${ODBC_INCLUDE_DIR}")
else()
message(FATAL_ERROR "ODBC library or include directory not found")
endif()
include_directories(${ODBC_INCLUDE_DIR})
add_executable(crawler main.cpp visit.cpp visit.hpp queue.cpp queue.hpp core.cpp core.hpp config.hpp db.cpp db.hpp)
if(MSVC)
target_compile_options(crawler PRIVATE /W4 /WX)
else()
target_compile_options(crawler PRIVATE -Wall -Wextra -Wpedantic -Wno-unknown-pragmas)
endif()
target_link_libraries(crawler ${CURL_LIBRARIES} ${LIBXML2_LIBRARIES} ${ODBC_LIBRARY})