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)
28 set(FORCE_OLDLIBUSB "-DFORCE_OLDLIBUSB")
31 set(CMAKE_CXX_FLAGS_DEBUG "-g -Wall -Wstrict-aliasing -Wextra ${UUUSSL} ${FORCE_OLDLIBUSB}")
32 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O2 ${UUUSSL} ${FORCE_OLDLIBUSB}")
56 set(generated_files_dir "${CMAKE_BINARY_DIR}/libuuu/gen")
57 set(gitversion_h "${generated_files_dir}/gitversion.h")
62 COMMAND mkdir -p ${generated_files_dir}
63 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}"'
66 include_directories(${generated_files_dir})
68 #add_library( uuc SHARED ${SOURCES} ))
69 add_library( uuc_s STATIC ${SOURCES} )