-
-
Notifications
You must be signed in to change notification settings - Fork 47
/
CMakeLists.txt
28 lines (23 loc) · 912 Bytes
/
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
cmake_minimum_required(VERSION 3.2)
project(fzf LANGUAGES C)
add_library(${PROJECT_NAME} SHARED "src/fzf.c")
target_include_directories(${PROJECT_NAME} PUBLIC
$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/src>)
target_compile_options(${PROJECT_NAME}
PRIVATE
$<$<C_COMPILER_ID:MSVC>:/W4>
$<$<NOT:$<C_COMPILER_ID:MSVC>>:-Wall>)
target_compile_definitions(${PROJECT_NAME}
PRIVATE
$<$<PLATFORM_ID:Windows>:_CRT_NONSTDC_NO_DEPRECATE>
$<$<PLATFORM_ID:Windows>:_CRT_SECURE_NO_DEPRECATE>
$<$<PLATFORM_ID:Windows>:_CRT_SECURE_NO_WARNINGS>)
set_target_properties(${PROJECT_NAME} PROPERTIES
WINDOWS_EXPORT_ALL_SYMBOLS ON
C_STANDARD 99
PREFIX lib)
# This cannot be a generator expression in this version of CMake
if (NOT (MSVC OR MSYS OR MINGW OR WIN32))
set_property(TARGET ${PROJECT_NAME} PROPERTY SUFFIX .so)
endif()
install(TARGETS ${PROJECT_NAME} DESTINATION ${CMAKE_BINARY_DIR})