-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
36 lines (24 loc) · 1017 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
29
30
31
32
33
34
35
36
cmake_minimum_required(VERSION 3.10)
project(ufbgc VERSION 1.0.0 DESCRIPTION "ufbgc unit test framework")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -O3 -Wall")
include(GNUInstallDirs)
add_library(ufbgc SHARED
src/ufbgc.c
)
set_target_properties(ufbgc PROPERTIES
VERSION ${PROJECT_VERSION}
SOVERSION 1
PUBLIC_HEADER src/ufbgc.h)
configure_file(ufbgc.pc.in ufbgc.pc @ONLY)
target_include_directories(ufbgc PUBLIC src)
install(TARGETS ufbgc
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
install(FILES ${CMAKE_BINARY_DIR}/ufbgc.pc
DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/pkgconfig)
#set_source_files_properties(src/ufbgc.c PROPERTIES LANGUAGE CXX )
#set_source_files_properties(example/example.c PROPERTIES LANGUAGE CXX )
add_executable(ufbgc_example example/example.c)
target_link_libraries (ufbgc_example LINK_PUBLIC ufbgc)
target_include_directories(ufbgc_example PUBLIC example)
target_include_directories(ufbgc_example PUBLIC src)