Skip to content

Commit 9f9766e

Browse files
committed
Support successful compilation and artifact generation on Linux, enabling use in Linux pipelines.
1 parent 72d71ec commit 9f9766e

4 files changed

Lines changed: 20 additions & 15 deletions

File tree

CMakeLists.txt

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,9 @@ project(ccap VERSION 1.0.0 LANGUAGES CXX)
1919

2020
# Currently only Windows and macOS are supported; other platforms are not supported yet
2121
if(NOT WIN32 AND NOT APPLE)
22-
message(FATAL_ERROR "ccap: Unsupported platform, only Windows and macOS are supported by now.")
22+
message(WARNING "ccap: Unsupported platform, only Windows and macOS are supported by now.")
23+
set(CCAP_BUILD_EXAMPLES OFF CACHE BOOL "Disable examples for unsupported platforms" FORCE)
24+
set(CCAP_BUILD_TESTS OFF CACHE BOOL "Disable tests for unsupported platforms" FORCE)
2325
endif()
2426

2527
# Installation options
@@ -78,7 +80,7 @@ if(MSVC)
7880
)
7981
endif()
8082

81-
target_include_directories(ccap PUBLIC
83+
target_include_directories(ccap PUBLIC
8284
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
8385
$<INSTALL_INTERFACE:include>
8486
)
@@ -103,7 +105,7 @@ if(APPLE)
103105
"-framework CoreVideo"
104106
"-framework CoreMedia"
105107
"-framework Accelerate")
106-
108+
107109
# Set pkg-config private libs for macOS
108110
set(PKG_CONFIG_LIBS_PRIVATE "Libs.private: -framework Foundation -framework AVFoundation -framework CoreVideo -framework CoreMedia -framework Accelerate")
109111
else()
@@ -148,16 +150,16 @@ endif()
148150
# ############### Installation ################
149151
if(CCAP_INSTALL)
150152
message(STATUS "ccap: Installing enabled")
151-
153+
152154
# Include necessary modules for installation
153155
include(GNUInstallDirs)
154156
include(CMakePackageConfigHelpers)
155-
157+
156158
# Set installation directories
157159
set(CCAP_INSTALL_LIBDIR ${CMAKE_INSTALL_LIBDIR})
158160
set(CCAP_INSTALL_INCLUDEDIR ${CMAKE_INSTALL_INCLUDEDIR})
159161
set(CCAP_INSTALL_CMAKEDIR ${CMAKE_INSTALL_LIBDIR}/cmake/ccap)
160-
162+
161163
# Install the library
162164
install(TARGETS ccap
163165
EXPORT ccapTargets
@@ -166,52 +168,52 @@ if(CCAP_INSTALL)
166168
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
167169
INCLUDES DESTINATION ${CCAP_INSTALL_INCLUDEDIR}
168170
)
169-
171+
170172
# Install header files
171173
install(DIRECTORY include/
172174
DESTINATION ${CCAP_INSTALL_INCLUDEDIR}
173175
FILES_MATCHING PATTERN "*.h" PATTERN "*.hpp"
174176
)
175-
177+
176178
# Create and install package configuration files
177179
configure_package_config_file(
178180
"${CMAKE_CURRENT_SOURCE_DIR}/cmake/ccapConfig.cmake.in"
179181
"${CMAKE_CURRENT_BINARY_DIR}/ccapConfig.cmake"
180182
INSTALL_DESTINATION ${CCAP_INSTALL_CMAKEDIR}
181183
PATH_VARS CCAP_INSTALL_INCLUDEDIR CCAP_INSTALL_LIBDIR
182184
)
183-
185+
184186
write_basic_package_version_file(
185187
"${CMAKE_CURRENT_BINARY_DIR}/ccapConfigVersion.cmake"
186188
VERSION ${PROJECT_VERSION}
187189
COMPATIBILITY SameMajorVersion
188190
)
189-
191+
190192
# Install the configuration files
191-
install(FILES
193+
install(FILES
192194
"${CMAKE_CURRENT_BINARY_DIR}/ccapConfig.cmake"
193195
"${CMAKE_CURRENT_BINARY_DIR}/ccapConfigVersion.cmake"
194196
DESTINATION ${CCAP_INSTALL_CMAKEDIR}
195197
)
196-
198+
197199
# Install the targets file
198200
install(EXPORT ccapTargets
199201
FILE ccapTargets.cmake
200202
NAMESPACE ccap::
201203
DESTINATION ${CCAP_INSTALL_CMAKEDIR}
202204
)
203-
205+
204206
# Generate pkg-config file
205207
configure_file(
206208
"${CMAKE_CURRENT_SOURCE_DIR}/cmake/ccap.pc.in"
207209
"${CMAKE_CURRENT_BINARY_DIR}/ccap.pc"
208210
@ONLY
209211
)
210-
212+
211213
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/ccap.pc"
212214
DESTINATION "${CMAKE_INSTALL_LIBDIR}/pkgconfig"
213215
)
214-
216+
215217
message(STATUS "ccap: Installation paths:")
216218
message(STATUS " Libraries: ${CMAKE_INSTALL_PREFIX}/${CCAP_INSTALL_LIBDIR}")
217219
message(STATUS " Headers: ${CMAKE_INSTALL_PREFIX}/${CCAP_INSTALL_INCLUDEDIR}")

src/ccap_convert_frame.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
#include "ccap_imp.h"
1313

1414
#include <cassert>
15+
#include <cstring>
1516

1617
namespace ccap {
1718
bool inplaceConvertFrameYUV2RGBColor(VideoFrame* frame, PixelFormat toFormat, bool verticalFlip) { /// (NV12/I420) -> (BGR24/BGRA32)

src/ccap_core.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212

1313
#include <cassert>
1414
#include <chrono>
15+
#include <cmath>
1516
#include <cstdio>
1617

1718
#ifdef _MSC_VER

src/ccap_utils.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818

1919
#include <algorithm>
2020
#include <chrono>
21+
#include <cstring>
2122
#include <ctime>
2223
#include <vector>
2324

0 commit comments

Comments
 (0)