1 cmake_minimum_required(VERSION 3.4)
3 set(CMAKE_CXX_STANDARD 14)
4 set(CMAKE_CXX_STANDARD_REQUIRED ON)
5 set(CMAKE_SKIP_RPATH ON)
7 find_package(BZip2 REQUIRED)
8 find_package(PkgConfig REQUIRED)
9 pkg_check_modules(LIBUSB REQUIRED libusb-1.0>=1.0.16)
10 pkg_check_modules(LIBZSTD REQUIRED libzstd)
14 set(OPENSSL_USE_STATIC_LIBS TRUE)
20 set(UUUSSL "-DUUUSSL")
21 set(UUUOPENSLL_INCLUDE_DIR ${OPENSSL_INCLUDE_DIR})
24 include_directories(${LIBUSB_INCLUDE_DIRS} ${LIBZSTD_INCLUDE_DIRS} ${UUUOPENSLL_INCLUDE_DIR} include)
27 set(CMAKE_CXX_FLAGS_DEBUG "-g -Wall -Wstrict-aliasing -Wextra ${UUUSSL}")
28 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O2 ${UUUSSL}")
52 set(generated_files_dir "${CMAKE_BINARY_DIR}/libuuu/gen")
53 set(gitversion_h "${generated_files_dir}/gitversion.h")
58 COMMAND mkdir -p ${generated_files_dir}
59 COMMAND sh -c 'cd ${CMAKE_CURRENT_SOURCE_DIR} && rm -f ${gitversion_h} && ./gen_ver.sh "${gitversion_h}.tmp" && mv -f "${gitversion_h}.tmp" "${gitversion_h}"'
62 include_directories(${generated_files_dir})
64 #add_library( uuc SHARED ${SOURCES} ))
65 add_library( uuc_s STATIC ${SOURCES} )