Improved build system scripts, cleaned up code, added experimental Dockerfile
This commit is contained in:
@ -12,9 +12,8 @@ include_directories(src)
|
||||
add_executable(${PROJECT_NAME} ${sources})
|
||||
|
||||
# Find dependencies
|
||||
find_package(Boost REQUIRED)
|
||||
include_directories(${Boost_INCLUDE_DIRS})
|
||||
target_link_libraries (${PROJECT_NAME} PRIVATE ${Boost_LIBRARIES} ${Boost_SYSTEM_LIBRARY})
|
||||
find_package(Boost COMPONENTS system REQUIRED)
|
||||
target_link_libraries (${PROJECT_NAME} PRIVATE Boost::boost Boost::system)
|
||||
|
||||
# Pthreads
|
||||
set(THREADS_PREFER_PTHREAD_FLAG ON)
|
||||
|
@ -8,44 +8,42 @@ file(GLOB_RECURSE sources
|
||||
|
||||
# Add the src directory to the include path
|
||||
include_directories(src)
|
||||
|
||||
# Find dependencies
|
||||
find_package(libmysql REQUIRED)
|
||||
find_package(Boost COMPONENTS system REQUIRED)
|
||||
find_package(DevIL REQUIRED)
|
||||
find_package(LZO REQUIRED)
|
||||
find_package(cryptopp CONFIG REQUIRED)
|
||||
|
||||
add_executable(${PROJECT_NAME} ${sources})
|
||||
|
||||
# Link dependencies if found
|
||||
target_link_libraries (${PROJECT_NAME} ${MYSQL_LIBRARIES})
|
||||
# Find dependencies
|
||||
|
||||
# MySQL
|
||||
find_package(unofficial-libmysql REQUIRED)
|
||||
target_link_libraries(${PROJECT_NAME} unofficial::libmysql::libmysql)
|
||||
|
||||
# Crypto++
|
||||
target_link_libraries (${PROJECT_NAME} cryptopp-static)
|
||||
find_package(cryptopp CONFIG REQUIRED)
|
||||
target_link_libraries (${PROJECT_NAME} cryptopp::cryptopp)
|
||||
|
||||
# Boost
|
||||
include_directories(${Boost_INCLUDE_DIR})
|
||||
target_link_libraries (${PROJECT_NAME} ${Boost_LIBRARIES})
|
||||
find_package(Boost REQUIRED)
|
||||
target_link_libraries (${PROJECT_NAME} Boost::boost)
|
||||
|
||||
# Libevent
|
||||
find_package(Libevent CONFIG REQUIRED)
|
||||
target_link_libraries(${PROJECT_NAME} libevent::core libevent::extra libevent::pthreads)
|
||||
|
||||
if (IL_FOUND)
|
||||
include_directories(${IL_INCLUDE_DIR})
|
||||
target_link_libraries (${PROJECT_NAME} ${IL_LIBRARIES})
|
||||
endif (IL_FOUND)
|
||||
# DevIL
|
||||
find_package(DevIL REQUIRED)
|
||||
include_directories(${IL_INCLUDE_DIR})
|
||||
target_link_libraries(${PROJECT_NAME} ${IL_LIBRARIES})
|
||||
|
||||
# LZO
|
||||
find_package(LZO REQUIRED)
|
||||
if (LZO_FOUND)
|
||||
include_directories(${LZO_INCLUDE_DIR})
|
||||
target_link_libraries (${PROJECT_NAME} ${LZO_LIBRARIES})
|
||||
target_link_libraries(${PROJECT_NAME} ${LZO_LIBRARIES})
|
||||
endif (LZO_FOUND)
|
||||
|
||||
# Pthreads
|
||||
set(THREADS_PREFER_PTHREAD_FLAG ON)
|
||||
find_package (Threads REQUIRED)
|
||||
target_link_libraries (${PROJECT_NAME} Threads::Threads)
|
||||
find_package(Threads REQUIRED)
|
||||
target_link_libraries(${PROJECT_NAME} Threads::Threads)
|
||||
|
||||
# LibBSD
|
||||
target_link_libraries(${PROJECT_NAME} bsd)
|
||||
|
Reference in New Issue
Block a user