44 lines
1.1 KiB
CMake
44 lines
1.1 KiB
CMake
cmake_minimum_required(VERSION 3.9)
|
|
set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
|
|
|
|
set(EXECUTABLE_OUTPUT_PATH "${CMAKE_CURRENT_SOURCE_DIR}/bin")
|
|
set(LIBRARY_OUTPUT_PATH "${CMAKE_CURRENT_SOURCE_DIR}/bin")
|
|
|
|
project(SDB C)
|
|
set(CMAKE_C_STANDARD 11)
|
|
|
|
#Check options
|
|
include(CheckCSourceCompiles)
|
|
include(CheckCSourceRuns)
|
|
include(CheckFunctionExists)
|
|
include(CheckIncludeFile)
|
|
include(CheckIncludeFiles)
|
|
include(CheckLibraryExists)
|
|
include(CheckSymbolExists)
|
|
include(CheckTypeSize)
|
|
set(INCLUDES "")
|
|
macro(ck_check_include_file header var)
|
|
check_include_files("${INCLUDES};${header}" ${var})
|
|
if(${var})
|
|
set(INCLUDES ${INCLUDES} ${header})
|
|
endif(${var})
|
|
endmacro(ck_check_include_file)
|
|
|
|
ck_check_include_file("stdlib.h" HAVE_STDLIB_H)
|
|
check_type_size(intmax_t INTMAX_T)
|
|
check_type_size(uintmax_t UINTMAX_T)
|
|
|
|
check_type_size(pid_t PID_T)
|
|
if(NOT HAVE_PID_T)
|
|
if(WIN32)
|
|
set(pid_t "int")
|
|
else(WIN32)
|
|
MESSAGE(FATAL_ERROR "pid_t doesn't exist on this platform?")
|
|
endif(WIN32)
|
|
endif(NOT HAVE_PID_T)
|
|
|
|
add_subdirectory(src)
|
|
add_subdirectory(tests)
|
|
|
|
enable_testing()
|
|
add_test(NAME check_SDB COMMAND check_SDB) |