49 lines
1.3 KiB
CMake
49 lines
1.3 KiB
CMake
cmake_minimum_required(VERSION 3.0)
|
|
project(hathor)
|
|
INCLUDE(CheckIncludeFiles)
|
|
INCLUDE(CheckLibraryExists)
|
|
include(CheckFunctionExists)
|
|
|
|
check_include_files(libintl.h HAVE_LIBINTL_H)
|
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -Wall")
|
|
|
|
set(Boost_USE_STATIC_LIBS OFF)
|
|
set(Boost_USE_MULTITHREADED ON)
|
|
set(Boost_USE_STATIC_RUNTIME OFF)
|
|
find_package(Boost 1.58.0 COMPONENTS system filesystem)
|
|
|
|
if(NOT Boost_FOUND)
|
|
message( SEND_ERROR "One or more boost libraries were not found. If you have boost installed check that it is version 1.58 or above." )
|
|
endif()
|
|
find_package(PkgConfig)
|
|
pkg_check_modules(TAGLIB23 REQUIRED taglib)
|
|
#find_package(mysqlcppconn 1.0)
|
|
#pkg_check_modules(MYSQL QUIET libmysqlcppconn-1.0)
|
|
#pkg_check_modules(MYSQL REQUIRED mysqlcppconn-1.0)
|
|
#CHECK_LIBRARY_EXISTS(pipecolors pcprintf "/usr/lib" PIPE)
|
|
find_library(MYSQLCONNECTORCPP_LIBRARY
|
|
NAMES
|
|
mysqlcppconn
|
|
mysqlcppconn-static
|
|
HINTS
|
|
"/usr/lib"
|
|
PATH_SUFFIXES
|
|
lib)
|
|
|
|
if(NOT MYSQLCONNECTORCPP_LIBRARY)
|
|
message( SEND_ERROR "Oracle's mysqlconnector lib is required.")
|
|
else()
|
|
message(STATUS "Found libmysqlcppconn")
|
|
endif()
|
|
|
|
set(SOURCE_FILES
|
|
mysql.cc
|
|
config.cc
|
|
common.cc
|
|
scanner.cc
|
|
3rdparty/crypt_blowfish.c
|
|
)
|
|
|
|
add_executable(scanner ${SOURCE_FILES})
|
|
TARGET_LINK_LIBRARIES(scanner "-lboost_system -lboost_filesystem -ltag -lmysqlcppconn")
|