-
Notifications
You must be signed in to change notification settings - Fork 14
/
CMakeLists.txt
45 lines (37 loc) · 1.04 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
# Copyright 2019 Saleem Abdulrasool <compnerd@compnerd.org>
cmake_minimum_required(VERSION 3.4)
project(eds LANGUAGES C)
set(CMAKE_C_STANDARD 99)
option(WITH_EXAMPLES "build example program" YES)
include(CheckFunctionExists)
include(CheckLibraryExists)
include(GNUInstallDirs)
check_function_exists(sqrt HAVE_SQRT)
if(NOT HAVE_SQRT)
unset(HAVE_SQRT CACHE)
check_library_exists(m sqrt "" HAVE_SQRT)
if(NOT HAVE_SQRT)
message(SEND_ERROR "unable to find `sqrt`")
endif()
set(LIBM_LIBS m)
endif()
if(WITH_EXAMPLES)
add_executable(parse-edid
src/examples/parse-edid/parse-edid.c)
if(MSVC)
target_compile_options(parse-edid PRIVATE
/FI${CMAKE_SOURCE_DIR}/src/eds/macros.h)
else()
target_compile_options(parse-edid PRIVATE
-include;${CMAKE_SOURCE_DIR}/src/eds/macros.h)
endif()
target_include_directories(parse-edid PRIVATE
src
src/eds)
endif()
install(FILES
src/eds/cea861.h
src/eds/edid.h
src/eds/hdmi.h
DESTINATION
${CMAKE_INSTALL_FULL_INCLUDE_DIR}/eds)