-
Notifications
You must be signed in to change notification settings - Fork 1
/
CmakeLists.txt
83 lines (62 loc) · 2.56 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
72
73
74
75
76
77
78
79
80
81
82
83
cmake_minimum_required(VERSION 3.10)
if(WIN32)
message("This is a Windows System")
set( CMAKE_VERBOSE_MAKEFILE ON)
project( slhdrwrapper VERSION 1.0.0 DESCRIPTION "C wrapper to use Interdigital SLHDR library")
set( SLHDR_LIBRARIES "C:/Users/quinquisc/VS/SLHDR_SDK_v1.7.0_win10_msvc16_AVX2/SLHDR_SDK_v1.7.0_win10_msvc16_AVX2/lib/x64/Release" CACHE PATH "Path to SL-HDR libraries")
set( SLHDR_INCLUDES "C:/Users/quinquisc/VS/SLHDR_SDK_v1.7.0_win10_msvc16_AVX2/SLHDR_SDK_v1.7.0_win10_msvc16_AVX2/include" CACHE PATH "Path to SLHDR Common includes")
set( PUBLIC_HEADER "C:/Users/quinquisc/VS/SLHDR_Wrapper/pp_wrapper_slhdr.h")
set( CMAKE_INSTALL_PREFIX "${PROJECT_SOURCE_DIR}")
# to install libraries
include(GNUInstallDirs)
# to create the .dll
add_library(libslhdrwrapperlib SHARED pp_wrapper_slhdr.cpp pp_wrapper_slhdr.h)
add_library(libslhdrwrapperlibStatic STATIC pp_wrapper_slhdr.cpp pp_wrapper_slhdr.h)
#set_target_properties(
# slhdrwrapperlibStatic PROPERTIES
# OUTPUT_NAME test
# ARCHIVE_OUTPUT_DIRECTORY slhdrwrapperlibStatic
#)
# to search SL_HDR libraries
find_library(SLHDRPOSTPROCESSOR_LIB
NAMES
SLHDRPostprocessor
PATHS
"${SLHDR_LIBRARIES}"
NO_DEFAULT_PATH)
message("SLHDRPOSTPROCESSOR_LIB is: ${SLHDRPOSTPROCESSOR_LIB}")
find_library(SLHDRCOMMON_LIB
NAMES
SLHDRCommon
PATHS
"${SLHDR_LIBRARIES}"
NO_DEFAULT_PATH)
message("SLHDRCOMMON_LIB is: ${SLHDRCOMMON_LIB}")
find_path(SLHDRPOSTPROCESSOR_PATH
NAMES
SLPostprocessorContext.h
PATHS
"${SLHDR_INCLUDES}/SLHDRPostprocessor"
NO_DEFAULT_PATH)
message("SLHDRPOSTPROCESSOR_PATH is: ${SLHDRPOSTPROCESSOR_PATH}")
find_path(SLHDRCOMMON_PATH
NAMES
SLHDRCommonExport.h
PATHS
"${SLHDR_INCLUDES}/SLHDRCommon"
NO_DEFAULT_PATH)
message("SLHDRCOMMON_PATH is: ${SLHDRCOMMON_PATH}")
include_directories("${SLHDRPOSTPROCESSOR_PATH}/..")
include_directories("${SLHDRCOMMON_PATH}/..")
# For the linker
target_link_libraries(libslhdrwrapperlib PRIVATE "${SLHDRPOSTPROCESSOR_LIB}" "${SLHDRCOMMON_LIB}")
# to be checked
set(pc_libs_private)
set(pc_req_private)
set(pc_req_public)
configure_file(slhdr_cwrap.pc.in slhdr_cwrap.pc @ONLY)
install(TARGETS libslhdrwrapperlib RUNTIME DESTINATION bin)
install(TARGETS libslhdrwrapperlibStatic RUNTIME DESTINATION lib)
install(FILES ${PUBLIC_HEADER} DESTINATION include)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/slhdr_cwrap.pc DESTINATION lib/pkgconfig)
endif()