49 lines
1.6 KiB
CMake
49 lines
1.6 KiB
CMake
cmake_minimum_required (VERSION 2.6)
|
|
project(cookiebot)
|
|
set(CMAKE_BUILD_TYPE DEBUG)
|
|
set(CMAKE_C_FLAGS_DEBUG "-O0 -g3 -pg -std=c99")
|
|
set(CMAKE_C_FLAGS_MINSIZEREL "-Os -std=c99")
|
|
set(CMAKE_C_FLAGS_RELWITHDEBINFO "-O0 -g -std=c99")
|
|
set(CMAKE_C_FLAGS_RELEASE "-O3 -std=c99")
|
|
set(CMAKE_CXX_FLAGS_DEBUG "-O0 -g3 -pg -std=gnu++14")
|
|
set(CMAKE_CXX_FLAGS_MINSIZEREL "-Os -std=gnu++14")
|
|
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O0 -g -std=gnu++14")
|
|
set(CMAKE_CXX_FLAGS_RELEASE "-O3 -std=gnu++14")
|
|
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}")
|
|
include_directories("${PROJECT_SOURCE_DIR}/include")
|
|
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 module_storage.cpp)
|
|
target_link_libraries (cookiebot ${EXTRA_LIBS})
|