-
Notifications
You must be signed in to change notification settings - Fork 22
/
CMakeLists.txt
71 lines (53 loc) · 1.44 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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
cmake_minimum_required(VERSION 3.8.0)
project(fir VERSION 1.8.0 LANGUAGES CXX)
set (CMAKE_CXX_STANDARD 11)
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
set(CMAKE_BUILD_TYPE "RelWithDebInfo")
endif()
include(GNUInstallDirs)
add_subdirectory(demo)
add_subdirectory(test)
enable_testing()
if (MSVC)
add_compile_options(/W4 -D_CRT_SECURE_NO_WARNINGS)
else()
add_compile_options(-Wall -Wconversion -Wextra -pedantic)
endif()
set(LIBSRC
Fir1.cpp
)
set(LIBINCLUDE
Fir1.h
)
if (UNIX)
add_library(fir
SHARED
${LIBSRC}
)
set_target_properties(fir PROPERTIES
SOVERSION 1
VERSION ${PROJECT_VERSION}
PUBLIC_HEADER "${LIBINCLUDE}")
install(TARGETS fir EXPORT fir-targets
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
configure_file(fir.pc.in fir.pc @ONLY)
endif ()
add_library(fir_static
STATIC
${LIBSRC}
)
set_target_properties(fir_static PROPERTIES
VERSION ${PROJECT_VERSION}
PUBLIC_HEADER "${LIBINCLUDE}")
install(TARGETS fir_static EXPORT fir-targets
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
PRIVATE_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/fir)
install(EXPORT fir-targets
DESTINATION lib/cmake/fir
FILE fir-config.cmake
)