38 lines
1.1 KiB
CMake
38 lines
1.1 KiB
CMake
cmake_minimum_required (VERSION 2.6)
|
|
project(cookiebot)
|
|
set (cookiebot_VERSION_MAJOR 0)
|
|
set (cookiebot_VERSION_MINOR 0)
|
|
find_package (ZLIB)
|
|
find_package (BZip2)
|
|
find_program (XZ_FOUND xz)
|
|
if (ZLIB_FOUND)
|
|
option (MOD_GZIP "Enable Module compression with gzip" ON)
|
|
else (!ZLIB_FOUND)
|
|
option (MOD_GZIP "Enable Module compression with gzip" OFF)
|
|
endif (ZLIB_FOUND)
|
|
if (BZIP2_FOUND)
|
|
option (MOD_BZ2 "Enable Module compression with bz2" ON)
|
|
else (!BZIP2_FOUND)
|
|
option (MOD_BZ2 "Enable Module compression with bz2" OFF)
|
|
endif (BZIP2_FOUND)
|
|
if (XZ_FOUND)
|
|
option (MOD_XZ "Enable Module compression with xz/lzma" ON)
|
|
else (!XZ_FOUND)
|
|
option (MOD_XZ "Enable Module compression with xz/lzma" OFF)
|
|
endif (XZ_FOUND)
|
|
configure_file (
|
|
"${PROJECT_SOURCE_DIR}/cookiebot_conf.h.in"
|
|
"${PROJECT_BINARY_DIR}/cookiebot_conf.h"
|
|
)
|
|
include_directories("${PROJECT_BINARY_DIR}")
|
|
if (MOD_GZIP)
|
|
set(EXTRA_LIBS ${EXTRA_LIBS} z)
|
|
endif (MOD_GZIP)
|
|
if (MOD_BZ2)
|
|
set(EXTRA_LIBS ${EXTRA_LIBS} bz2)
|
|
endif (MOD_BZ2)
|
|
if (MOD_XZ)
|
|
set(EXTRA_LIBS ${EXTRA_LIBS} lzma)
|
|
endif (MOD_XZ)
|
|
add_executable(cookiebot cookiebot.cpp)
|
|
target_link_libraries (cookiebot ${EXTRA_LIBS})
|