C Utility Library
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

38 lines
1.6 KiB

cmake_minimum_required(VERSION 3.12)
project(libutil LANGUAGES C)
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}/lib)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}/lib)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}/bin)
set(CMAKE_STATIC_LIBRARY_PREFIX "")
set(CMAKE_SHARED_LIBRARY_PREFIX "")
file(GLOB SRC ${PROJECT_SOURCE_DIR}/src/*)
add_library(libutil_static STATIC ${SRC})
add_library(libutil_shared SHARED ${SRC})
link_libraries(libutil_static)
add_executable(test_base32 ${PROJECT_SOURCE_DIR}/src/test/test_base32.c)
add_executable(test_base64 ${PROJECT_SOURCE_DIR}/src/test/test_base64.c)
add_executable(test_crypt ${PROJECT_SOURCE_DIR}/src/test/test_crypt.c)
add_executable(test_endian ${PROJECT_SOURCE_DIR}/src/test/test_endian.c)
add_executable(test_error ${PROJECT_SOURCE_DIR}/src/test/test_error.c)
add_executable(test_fnv ${PROJECT_SOURCE_DIR}/src/test/test_fnv.c)
add_executable(test_map ${PROJECT_SOURCE_DIR}/src/test/test_map.c)
add_executable(test_optget ${PROJECT_SOURCE_DIR}/src/test/test_optget.c)
add_executable(test_rc2 ${PROJECT_SOURCE_DIR}/src/test/test_rc2.c)
add_executable(test_strtou ${PROJECT_SOURCE_DIR}/src/test/test_strtou.c)
enable_testing()
add_test(NAME test_base32 COMMAND test_base32)
add_test(NAME test_base64 COMMAND test_base64)
add_test(NAME test_crypt COMMAND test_crypt)
add_test(NAME test_endian COMMAND test_endian)
add_test(NAME test_error COMMAND test_error)
add_test(NAME test_fnv COMMAND test_fnv)
add_test(NAME test_map COMMAND test_map)
add_test(NAME test_optget COMMAND test_optget)
add_test(NAME test_rc2 COMMAND test_rc2)
add_test(NAME test_strtou COMMAND test_strtou)