Bring over latest CMakeLists changes from the internal ntv2 repository.

pull/2/head
Paul Hindt 2021-11-02 23:43:52 -07:00
parent fe24622548
commit bb3d0c4c1b
11 changed files with 673 additions and 482 deletions

View File

@ -2,32 +2,74 @@ cmake_minimum_required(VERSION 3.10)
project(ntv2)
# CMake includes
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_SOURCE_DIR}/cmake/")
include(BuildOptions)
include(CommonDefines)
include(CommonFlags)
include(CommonPaths)
include(BuildConfig)
message ("Platform: ${CMAKE_SYSTEM_NAME}")
message ("Arch: ${CMAKE_HOST_SYSTEM_PROCESSOR}")
message ("Compiler: ${CMAKE_CXX_COMPILER_ID}")
if (APPLE)
message ("OSX Architectures: ${CMAKE_OSX_ARCHITECTURES}")
message ("OSX Deployment Target: ${CMAKE_OSX_DEPLOYMENT_TARGET}")
# Override the following variables to set the NTV2 SDK version.
if (AJA_BUILDING_CMAKE)
string(TIMESTAMP DATETIME_NOW "\"%A %b %d, %Y (%m/%d/%Y @ %H:%M:%S GMT+8)\"")
string(TIMESTAMP DATETIME_NOW "\"%m/%d/%Y +8:%H:%M:%S\"")
set(AJA_NTV2_SDK_VERSION_MAJOR 16)
set(AJA_NTV2_SDK_VERSION_MINOR 1)
set(AJA_NTV2_SDK_VERSION_POINT 0)
set(AJA_NTV2_SDK_BUILD_NUMBER 99)
set(AJA_NTV2_SDK_BUILD_DATETIME ${DATETIME_NOW})
set(AJA_NTV2_SDK_BUILD_TYPE "\"d\"")
endif()
if(CMAKE_BUILD_TYPE MATCHES Debug)
message("Build Type: Debug")
add_definitions(-DAJA_DEBUG)
elseif(CMAKE_BUILD_TYPE MATCHES RelWithDebInfo)
message("Build Type: Release with Debug Symbols")
message (STATUS "Platform: ${CMAKE_SYSTEM_NAME}")
message (STATUS "Arch: ${CMAKE_HOST_SYSTEM_PROCESSOR}")
message (STATUS "Compiler: ${CMAKE_CXX_COMPILER_ID}")
if (CMAKE_SYSTEM_NAME STREQUAL "Windows")
message(STATUS "Windows API Version: ${CMAKE_SYSTEM_VERSION}")
string(REPLACE "." ";" AJA_WIN_API_VER "${CMAKE_SYSTEM_VERSION}")
list(GET AJA_WIN_API_VER 0 AJA_WIN_API_VER_MAJOR)
list(GET AJA_WIN_API_VER 1 AJA_WIN_API_VER_MINOR)
list(GET AJA_WIN_API_VER 2 AJA_WIN_API_VER_BUILD)
elseif(CMAKE_SYSTEM_NAME STREQUAL "Darwin")
message (STATUS "macOS Architectures: ${CMAKE_OSX_ARCHITECTURES}")
message (STATUS "macOS Deployment Target: ${CMAKE_OSX_DEPLOYMENT_TARGET}")
elseif(CMAKE_SYSTEM_NAME STREQUAL "Linux")
else()
message("Build Type: Release")
message(FATAL_ERROR "Unsupported platform: ${CMAKE_SYSTEM_NAME}")
endif()
if (BUILD_AJA_APPS)
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
set(BITS 64)
message(STATUS "Bits: 64-bit")
else()
set(BITS 32)
message(STATUS "Bits: 32-bit")
endif()
# Optional build artifacts output directory
if (AJA_DEPLOY_OUTPUTS)
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY
"${AJA_CMAKE_DIR}/../out/${CMAKE_SYSTEM_NAME}-${CMAKE_CXX_COMPILER_ID}-${BITS}bit/lib")
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY
"${AJA_CMAKE_DIR}/../out/${CMAKE_SYSTEM_NAME}-${CMAKE_CXX_COMPILER_ID}-${BITS}bit/lib")
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY
"${AJA_CMAKE_DIR}/../out/${CMAKE_SYSTEM_NAME}-${CMAKE_CXX_COMPILER_ID}-${BITS}bit/bin")
endif()
# Add NTV2 sub-directories to CMake build config
if (AJA_BUILD_APPS AND EXISTS ${AJA_APPS_ROOT})
message(STATUS "Adding ajaapps...")
add_subdirectory(ajaapps)
endif()
if (BUILD_AJA_LIBS)
if (AJA_BUILD_LIBS AND EXISTS ${AJA_LIBRARIES_ROOT})
message(STATUS "Adding ajalibraries...")
add_subdirectory(ajalibraries)
endif()
if (BUILD_AJA_PLUGINS)
if (AJA_BUILD_PLUGINS AND EXISTS ${AJA_PLUGINS_ROOT})
message(STATUS "Adding ajaplugins...")
add_subdirectory(ajaplugins)
endif()
if (AJA_BUILD_QA AND EXISTS ${AJA_QA_ROOT})
message(STATUS "Adding qa...")
add_subdirectory(qa)
endif()

View File

@ -1,49 +1,54 @@
if (BUILD_AJACONV)
add_subdirectory(ajaconv)
message("Added ajaconv to cmake config")
if (BUILD_AJA_UNIT_TESTS)
add_subdirectory(ajaconv/test)
add_dependencies(ut_ajaconv ajaconv)
message("Added ajaconv unit tests to cmake config")
# ajaconv
if (EXISTS ${AJA_LIB_CONV_ROOT})
if (NOT AJA_BUILD_OPENSOURCE)
add_subdirectory(ajaconv)
if (AJA_BUILD_TESTS)
add_subdirectory(ajaconv/test)
endif()
endif()
endif()
if (BUILD_AJANTV2)
add_subdirectory(ajantv2)
message("Added ajantv2 to cmake config")
if (BUILD_AJA_UNIT_TESTS)
add_subdirectory(ajabase/test)
add_dependencies(ut_ajabase ajantv2)
message("Added ajabase unit tests to cmake config")
# ajantv2
if (EXISTS ${AJA_LIB_NTV2_ROOT})
add_subdirectory(ajantv2)
if (AJA_BUILD_TESTS)
add_subdirectory(ajabase/test)
add_subdirectory(ajantv2/test)
add_dependencies(ut_ajantv2 ajantv2)
message("Added ajantv2 unit tests to cmake config")
endif()
endif()
if (BUILD_AJAANC)
add_subdirectory(ajaanc)
add_dependencies(ajaancshared ajantv2shared)
add_dependencies(ajaanc ajantv2)
message("Added ajaanc to cmake config")
endif()
if (BUILD_AJACC)
add_subdirectory(ajacc)
add_dependencies(ajaccshared ajantv2shared)
add_dependencies(ajacc ajantv2)
message("Added ajacc to cmake config")
endif()
if (BUILD_AJAGUI)
add_subdirectory(ajainternal/gui)
add_dependencies(ajagui ajantv2)
message("Added ajagui to cmake config")
endif()
if (BUILD_AJASTREAMS)
add_subdirectory(streams)
add_dependencies(ajastreams ajantv2 ajaconv)
message("Added ajastreams to cmake config")
if (BUILD_AJA_UNIT_TESTS)
add_subdirectory(streams/test)
add_dependencies(ut_ajastreams ajantv2 ajaconv ajastreams)
message("Added ajastreams unit test to cmake config")
# ajacc
if (EXISTS ${AJA_LIB_CC_ROOT}
AND EXISTS ${AJA_LIB_NTV2_ROOT})
if (NOT AJA_BUILD_OPENSOURCE)
add_subdirectory(ajacc)
if (AJA_BUILD_TESTS)
add_subdirectory(ajacc/test)
endif()
endif()
endif()
# ajagui
if (EXISTS ${AJA_LIB_GUI_ROOT}
AND EXISTS ${AJA_LIB_NTV2_ROOT})
if (NOT AJA_BUILD_OPENSOURCE)
add_subdirectory(ajainternal/gui)
endif()
endif()
# ajastreams
if (EXISTS ${AJA_LIB_STREAMS_ROOT}
AND EXISTS ${AJA_LIB_NTV2_ROOT}
AND EXISTS ${AJA_LIB_CONV_ROOT})
if (NOT AJA_BUILD_OPENSOURCE)
# Drastic deck control lib (AKA vvwext2)
add_subdirectory(streams/drasticproj)
add_subdirectory(streams)
if (AJA_BUILD_TESTS)
add_subdirectory(streams/test)
endif()
endif()
endif()

View File

@ -1,76 +1,57 @@
project(ajaanc)
set(NTV2_ROOT ${CMAKE_CURRENT_SOURCE_DIR}/../..)
set(AJALIBRARIES_ROOT ${NTV2_ROOT}/ajalibraries)
set(AJAANC_ROOT ${AJALIBRARIES_ROOT}/ajaanc)
set(AJABASE_ROOT ${AJALIBRARIES_ROOT}/ajabase)
set(AJANTV2_ROOT ${AJALIBRARIES_ROOT}/ajantv2)
message("added ajaanc")
set(AJAANC_TARGET_INCLUDE_DIRS
${AJAANC_ROOT}/includes
${AJABASE_ROOT}/includes
${AJANTV2_ROOT}/includes
${AJALIBRARIES_ROOT})
${AJA_LIBRARIES_ROOT}
${AJA_LIB_ANC_ROOT}/includes
${AJA_LIB_BASE_ROOT}/includes
${AJA_LIB_NTV2_ROOT}/includes)
set(AJAANC_HEADERS
${AJAANC_ROOT}/includes/
${AJAANC_ROOT}/includes/ancillarydata_cea608.h
${AJAANC_ROOT}/includes/ancillarydata_cea608_line21.h
${AJAANC_ROOT}/includes/ancillarydata_cea608_vanc.h
${AJAANC_ROOT}/includes/ancillarydata_cea708.h
${AJAANC_ROOT}/includes/ancillarydatafactory.h
${AJAANC_ROOT}/includes/ancillarydata_framestatusinfo524D.h
${AJAANC_ROOT}/includes/ancillarydata_framestatusinfo5251.h
${AJAANC_ROOT}/includes/ancillarydata.h
${AJAANC_ROOT}/includes/ancillarydata_hdr_hdr10.h
${AJAANC_ROOT}/includes/ancillarydata_hdr_hlg.h
${AJAANC_ROOT}/includes/ancillarydata_hdr_sdr.h
${AJAANC_ROOT}/includes/ancillarydata_timecode_atc.h
${AJAANC_ROOT}/includes/ancillarydata_timecode.h
${AJAANC_ROOT}/includes/ancillarydata_timecode_vitc.h
${AJAANC_ROOT}/includes/ancillarylist.h
includes/ancillarydata_cea608.h
includes/ancillarydata_cea608_line21.h
includes/ancillarydata_cea608_vanc.h
includes/ancillarydata_cea708.h
includes/ancillarydatafactory.h
includes/ancillarydata_framestatusinfo524D.h
includes/ancillarydata_framestatusinfo5251.h
includes/ancillarydata.h
includes/ancillarydata_hdr_hdr10.h
includes/ancillarydata_hdr_hlg.h
includes/ancillarydata_hdr_sdr.h
includes/ancillarydata_timecode_atc.h
includes/ancillarydata_timecode.h
includes/ancillarydata_timecode_vitc.h
includes/ancillarylist.h
)
set(AJAANC_SOURCES
${AJAANC_ROOT}/src/ancillarydata_cea608.cpp
${AJAANC_ROOT}/src/ancillarydata_cea608_line21.cpp
${AJAANC_ROOT}/src/ancillarydata_cea608_vanc.cpp
${AJAANC_ROOT}/src/ancillarydata_cea708.cpp
${AJAANC_ROOT}/src/ancillarydata.cpp
${AJAANC_ROOT}/src/ancillarydatafactory.cpp
${AJAANC_ROOT}/src/ancillarydata_framestatusinfo524D.cpp
${AJAANC_ROOT}/src/ancillarydata_framestatusinfo5251.cpp
${AJAANC_ROOT}/src/ancillarydata_hdr_hdr10.cpp
${AJAANC_ROOT}/src/ancillarydata_hdr_hlg.cpp
${AJAANC_ROOT}/src/ancillarydata_hdr_sdr.cpp
${AJAANC_ROOT}/src/ancillarydata_timecode_atc.cpp
${AJAANC_ROOT}/src/ancillarydata_timecode.cpp
${AJAANC_ROOT}/src/ancillarydata_timecode_vitc.cpp
${AJAANC_ROOT}/src/ancillarylist.cpp
src/ancillarydata_cea608.cpp
src/ancillarydata_cea608_line21.cpp
src/ancillarydata_cea608_vanc.cpp
src/ancillarydata_cea708.cpp
src/ancillarydata.cpp
src/ancillarydatafactory.cpp
src/ancillarydata_framestatusinfo524D.cpp
src/ancillarydata_framestatusinfo5251.cpp
src/ancillarydata_hdr_hdr10.cpp
src/ancillarydata_hdr_hlg.cpp
src/ancillarydata_hdr_sdr.cpp
src/ancillarydata_timecode_atc.cpp
src/ancillarydata_timecode.cpp
src/ancillarydata_timecode_vitc.cpp
src/ancillarylist.cpp
)
if (CMAKE_SYSTEM_NAME STREQUAL "Windows")
add_definitions(
-DMSWindows
-DAJA_WINDOWS)
elseif (CMAKE_SYSTEM_NAME STREQUAL "Linux")
add_definitions(
-DAJALinux
-DAJA_LINUX)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC")
elseif (CMAKE_SYSTEM_NAME STREQUAL "Darwin")
add_definitions(
-DAJAMac
-DAJA_MAC)
endif()
set(AJAANC_TARGET_SOURCES ${AJAANC_SOURCES} ${AJAANC_HEADERS})
add_library(ajaancshared SHARED ${AJAANC_TARGET_SOURCES})
add_library(ajaanc STATIC ${AJAANC_TARGET_SOURCES})
target_include_directories(ajaancshared PUBLIC ${AJAANC_TARGET_INCLUDE_DIRS})
target_include_directories(ajaanc PUBLIC ${AJAANC_TARGET_INCLUDE_DIRS})
target_link_libraries(ajaanc PUBLIC ajantv2)
target_link_libraries(ajaancshared PUBLIC ajantv2shared)
target_link_libraries(ajaanc PUBLIC ajantv2)
if (AJA_BUILD_SHARED)
add_library(ajaancshared SHARED ${AJAANC_TARGET_SOURCES})
target_include_directories(ajaancshared PUBLIC ${AJAANC_TARGET_INCLUDE_DIRS})
target_link_libraries(ajaancshared PUBLIC ajantv2shared)
endif()

View File

@ -1,32 +1,29 @@
project(ajantv2)
message ("added ajantv2")
if(CMAKE_CXX_STANDARD LESS 11)
remove_definitions(
-DAJA_USE_CPLUSPLUS11
-DNTV2_USE_CPLUSPLUS11)
endif()
# TODO(paulh): Re-enable when we start using the CMake version.h.in file
# add_definitions(-DBUILDING_CMAKE)
remove_definitions(
-DUNICODE
-D_UNICODE
-DQT_LARGEFILE_SUPPORT)
set(NTV2_ROOT ${CMAKE_CURRENT_SOURCE_DIR}/../..)
set(AJALIBRARIES_ROOT ${NTV2_ROOT}/ajalibraries)
set(AJAANC_ROOT ${AJALIBRARIES_ROOT}/ajaanc)
set(AJABASE_ROOT ${AJALIBRARIES_ROOT}/ajabase)
set(AJANTV2_TARGET_INCLUDE_DIRS
includes
${AJAANC_ROOT}/includes
${AJALIBRARIES_ROOT}
${AJABASE_ROOT})
includes
${AJA_LIB_ANC_ROOT}/includes
${AJA_LIBRARIES_ROOT}
${AJA_LIB_BASE_ROOT}
${CMAKE_CURRENT_BINARY_DIR})
# TODO(paulh): Re-enable this if we decide to define version number inside of CMake
# version defines in ntv2enums.h populated with version.h values
# configure_file(includes/version.h.in includes/version.h @ONLY)
if (AJA_BUILDING_CMAKE)
add_definitions(-DAJA_NTV2_BUILDING_CMAKE)
configure_file(includes/version.h.in includes/version.h @ONLY)
endif()
set(AJANTV2_HEADERS
includes/ajaexport.h
@ -47,6 +44,8 @@ set(AJANTV2_HEADERS
includes/ntv2debug.h
includes/ntv2debugmacros.h
includes/ntv2devicefeatures.h
includes/ntv2devicefeatures.hh # generated by sdkgen
src/ntv2devicefeatures.hpp # generated by sdkgen
includes/ntv2devicescanner.h
includes/ntv2discover.h
includes/ntv2driverinterface.h
@ -87,24 +86,24 @@ set(AJANTV2_HEADERS
includes/ntv2videodefines.h
includes/ntv2virtualregisters.h
includes/ntv2vpid.h
includes/ntv2vpidfromspec.h
# TODO(paulh): Re-enable when we start using the CMake version.h.in file
# includes/version.h
${AJAANC_ROOT}/includes/ancillarydata.h
${AJAANC_ROOT}/includes/ancillarydatafactory.h
${AJAANC_ROOT}/includes/ancillarydata_cea608.h
${AJAANC_ROOT}/includes/ancillarydata_cea608_line21.h
${AJAANC_ROOT}/includes/ancillarydata_cea608_vanc.h
${AJAANC_ROOT}/includes/ancillarydata_cea708.h
${AJAANC_ROOT}/includes/ancillarydata_framestatusinfo524D.h
${AJAANC_ROOT}/includes/ancillarydata_framestatusinfo5251.h
${AJAANC_ROOT}/includes/ancillarydata_hdr_hdr10.h
${AJAANC_ROOT}/includes/ancillarydata_hdr_hlg.h
${AJAANC_ROOT}/includes/ancillarydata_hdr_sdr.h
${AJAANC_ROOT}/includes/ancillarydata_timecode.h
${AJAANC_ROOT}/includes/ancillarydata_timecode_atc.h
${AJAANC_ROOT}/includes/ancillarydata_timecode_vitc.h
${AJAANC_ROOT}/includes/ancillarylist.h)
includes/ntv2vpidfromspec.h)
set(AJAANC_HEADERS
${AJA_LIB_ANC_ROOT}/includes/ancillarydata.h
${AJA_LIB_ANC_ROOT}/includes/ancillarydatafactory.h
${AJA_LIB_ANC_ROOT}/includes/ancillarydata_cea608.h
${AJA_LIB_ANC_ROOT}/includes/ancillarydata_cea608_line21.h
${AJA_LIB_ANC_ROOT}/includes/ancillarydata_cea608_vanc.h
${AJA_LIB_ANC_ROOT}/includes/ancillarydata_cea708.h
${AJA_LIB_ANC_ROOT}/includes/ancillarydata_framestatusinfo524D.h
${AJA_LIB_ANC_ROOT}/includes/ancillarydata_framestatusinfo5251.h
${AJA_LIB_ANC_ROOT}/includes/ancillarydata_hdr_hdr10.h
${AJA_LIB_ANC_ROOT}/includes/ancillarydata_hdr_hlg.h
${AJA_LIB_ANC_ROOT}/includes/ancillarydata_hdr_sdr.h
${AJA_LIB_ANC_ROOT}/includes/ancillarydata_timecode.h
${AJA_LIB_ANC_ROOT}/includes/ancillarydata_timecode_atc.h
${AJA_LIB_ANC_ROOT}/includes/ancillarydata_timecode_vitc.h
${AJA_LIB_ANC_ROOT}/includes/ancillarylist.h)
set(AJANTV2_SOURCES
src/ntv2anc.cpp
@ -155,45 +154,43 @@ set(AJANTV2_SOURCES
src/ntv2utils.cpp
src/ntv2verticalfilter.cpp
src/ntv2vpid.cpp
src/ntv2vpidfromspec.cpp
${AJAANC_ROOT}/src/ancillarydata.cpp
${AJAANC_ROOT}/src/ancillarydatafactory.cpp
${AJAANC_ROOT}/src/ancillarydata_cea608.cpp
${AJAANC_ROOT}/src/ancillarydata_cea608_line21.cpp
${AJAANC_ROOT}/src/ancillarydata_cea608_vanc.cpp
${AJAANC_ROOT}/src/ancillarydata_cea708.cpp
${AJAANC_ROOT}/src/ancillarydata_framestatusinfo524D.cpp
${AJAANC_ROOT}/src/ancillarydata_framestatusinfo5251.cpp
${AJAANC_ROOT}/src/ancillarydata_hdr_hdr10.cpp
${AJAANC_ROOT}/src/ancillarydata_hdr_hlg.cpp
${AJAANC_ROOT}/src/ancillarydata_hdr_sdr.cpp
${AJAANC_ROOT}/src/ancillarydata_timecode.cpp
${AJAANC_ROOT}/src/ancillarydata_timecode_atc.cpp
${AJAANC_ROOT}/src/ancillarydata_timecode_vitc.cpp
${AJAANC_ROOT}/src/ancillarylist.cpp)
src/ntv2vpidfromspec.cpp)
set (AJAANC_SOURCES
${AJA_LIB_ANC_ROOT}/src/ancillarydata.cpp
${AJA_LIB_ANC_ROOT}/src/ancillarydatafactory.cpp
${AJA_LIB_ANC_ROOT}/src/ancillarydata_cea608.cpp
${AJA_LIB_ANC_ROOT}/src/ancillarydata_cea608_line21.cpp
${AJA_LIB_ANC_ROOT}/src/ancillarydata_cea608_vanc.cpp
${AJA_LIB_ANC_ROOT}/src/ancillarydata_cea708.cpp
${AJA_LIB_ANC_ROOT}/src/ancillarydata_framestatusinfo524D.cpp
${AJA_LIB_ANC_ROOT}/src/ancillarydata_framestatusinfo5251.cpp
${AJA_LIB_ANC_ROOT}/src/ancillarydata_hdr_hdr10.cpp
${AJA_LIB_ANC_ROOT}/src/ancillarydata_hdr_hlg.cpp
${AJA_LIB_ANC_ROOT}/src/ancillarydata_hdr_sdr.cpp
${AJA_LIB_ANC_ROOT}/src/ancillarydata_timecode.cpp
${AJA_LIB_ANC_ROOT}/src/ancillarydata_timecode_atc.cpp
${AJA_LIB_ANC_ROOT}/src/ancillarydata_timecode_vitc.cpp
${AJA_LIB_ANC_ROOT}/src/ancillarylist.cpp)
if (AJA_BUILD_DRIVER STREQUAL ON)
add_definitions(-DNTV2_BUILDING_DRIVER)
set(AJANTV2_HEADERS
${AJANTV2_HEADERS}
list(APPEND AJANTV2_HEADERS
includes/ntv2driverprocamp.h)
set(AJANTV2_SOURCES
${AJANTV2_SOURCES}
list(APPEND AJANTV2_SOURCES
src/ntv2driverprocamp.cpp)
endif()
if (AJA_BUILD_OPENSOURCE STREQUAL OFF)
message("Added ajantv2 HEVC/M31 codec")
set(AJANTV2_HEADERS
${AJANTV2_HEADERS}
message("added ajantv2 HEVC/M31 codec")
list(APPEND AJANTV2_HEADERS
codecs/hevc/m31/ntv2m31.h
codecs/hevc/m31/ntv2m31cparam.h
codecs/hevc/m31/ntv2m31ehparam.h
codecs/hevc/m31/ntv2m31vaparam.h
codecs/hevc/m31/ntv2m31vinparam.h
codecs/hevc/m31/ntv2m31viparam.h)
set(AJANTV2_SOURCES
${AJANTV2_SOURCES}
list(APPEND AJANTV2_SOURCES
codecs/hevc/m31/ntv2m31.cpp
codecs/hevc/m31/ntv2m31cparam.cpp
codecs/hevc/m31/ntv2m31ehparam.cpp
@ -203,100 +200,98 @@ if (AJA_BUILD_OPENSOURCE STREQUAL OFF)
endif()
set(AJABASE_HEADERS
${AJABASE_ROOT}/common/ajarefptr.h
${AJABASE_ROOT}/common/audioutilities.h
${AJABASE_ROOT}/common/buffer.h
${AJABASE_ROOT}/common/bytestream.h
${AJABASE_ROOT}/common/circularbuffer.h
${AJABASE_ROOT}/common/cli_utils.h
${AJABASE_ROOT}/common/common.h
${AJABASE_ROOT}/common/dpxfileio.h
${AJABASE_ROOT}/common/dpx_hdr.h
${AJABASE_ROOT}/common/export.h
${AJABASE_ROOT}/common/guid.h
${AJABASE_ROOT}/common/options_popt.h
${AJABASE_ROOT}/common/performance.h
${AJABASE_ROOT}/common/pixelformat.h
${AJABASE_ROOT}/common/public.h
${AJABASE_ROOT}/common/rawfile.h
${AJABASE_ROOT}/common/testpatterngen.h
${AJABASE_ROOT}/common/timebase.h
${AJABASE_ROOT}/common/timecode.h
${AJABASE_ROOT}/common/timecodeburn.h
${AJABASE_ROOT}/common/timer.h
${AJABASE_ROOT}/common/types.h
${AJABASE_ROOT}/common/videotypes.h
${AJABASE_ROOT}/common/videoutilities.h
${AJABASE_ROOT}/common/wavewriter.h
${AJABASE_ROOT}/network/ip_socket.h
${AJABASE_ROOT}/network/tcp_socket.h
${AJABASE_ROOT}/network/udp_socket.h
${AJABASE_ROOT}/persistence/persistence.h
${AJABASE_ROOT}/persistence/sqlite3.h
${AJABASE_ROOT}/pnp/pnp.h
${AJABASE_ROOT}/system/atomic.h
${AJABASE_ROOT}/system/debug.h
${AJABASE_ROOT}/system/debugshare.h
${AJABASE_ROOT}/system/diskstatus.h
${AJABASE_ROOT}/system/event.h
${AJABASE_ROOT}/system/file_io.h
${AJABASE_ROOT}/system/info.h
${AJABASE_ROOT}/system/lock.h
${AJABASE_ROOT}/system/log.h
${AJABASE_ROOT}/system/make_unique_shim.h
${AJABASE_ROOT}/system/memory.h
${AJABASE_ROOT}/system/process.h
${AJABASE_ROOT}/system/system.h
${AJABASE_ROOT}/system/systemtime.h
${AJABASE_ROOT}/system/thread.h)
${AJA_LIB_BASE_ROOT}/common/ajarefptr.h
${AJA_LIB_BASE_ROOT}/common/audioutilities.h
${AJA_LIB_BASE_ROOT}/common/buffer.h
${AJA_LIB_BASE_ROOT}/common/bytestream.h
${AJA_LIB_BASE_ROOT}/common/circularbuffer.h
${AJA_LIB_BASE_ROOT}/common/cli_utils.h
${AJA_LIB_BASE_ROOT}/common/common.h
${AJA_LIB_BASE_ROOT}/common/dpxfileio.h
${AJA_LIB_BASE_ROOT}/common/dpx_hdr.h
${AJA_LIB_BASE_ROOT}/common/export.h
${AJA_LIB_BASE_ROOT}/common/guid.h
${AJA_LIB_BASE_ROOT}/common/options_popt.h
${AJA_LIB_BASE_ROOT}/common/performance.h
${AJA_LIB_BASE_ROOT}/common/pixelformat.h
${AJA_LIB_BASE_ROOT}/common/public.h
${AJA_LIB_BASE_ROOT}/common/rawfile.h
${AJA_LIB_BASE_ROOT}/common/testpatterngen.h
${AJA_LIB_BASE_ROOT}/common/timebase.h
${AJA_LIB_BASE_ROOT}/common/timecode.h
${AJA_LIB_BASE_ROOT}/common/timecodeburn.h
${AJA_LIB_BASE_ROOT}/common/timer.h
${AJA_LIB_BASE_ROOT}/common/types.h
${AJA_LIB_BASE_ROOT}/common/videotypes.h
${AJA_LIB_BASE_ROOT}/common/videoutilities.h
${AJA_LIB_BASE_ROOT}/common/wavewriter.h
${AJA_LIB_BASE_ROOT}/network/ip_socket.h
${AJA_LIB_BASE_ROOT}/network/tcp_socket.h
${AJA_LIB_BASE_ROOT}/network/udp_socket.h
${AJA_LIB_BASE_ROOT}/persistence/persistence.h
${AJA_LIB_BASE_ROOT}/persistence/sqlite3.h
${AJA_LIB_BASE_ROOT}/pnp/pnp.h
${AJA_LIB_BASE_ROOT}/system/atomic.h
${AJA_LIB_BASE_ROOT}/system/debug.h
${AJA_LIB_BASE_ROOT}/system/debugshare.h
${AJA_LIB_BASE_ROOT}/system/diskstatus.h
${AJA_LIB_BASE_ROOT}/system/event.h
${AJA_LIB_BASE_ROOT}/system/file_io.h
${AJA_LIB_BASE_ROOT}/system/info.h
${AJA_LIB_BASE_ROOT}/system/lock.h
${AJA_LIB_BASE_ROOT}/system/log.h
${AJA_LIB_BASE_ROOT}/system/make_unique_shim.h
${AJA_LIB_BASE_ROOT}/system/memory.h
${AJA_LIB_BASE_ROOT}/system/process.h
${AJA_LIB_BASE_ROOT}/system/system.h
${AJA_LIB_BASE_ROOT}/system/systemtime.h
${AJA_LIB_BASE_ROOT}/system/thread.h)
set(AJABASE_SOURCES
${AJABASE_ROOT}/common/audioutilities.cpp
${AJABASE_ROOT}/common/buffer.cpp
${AJABASE_ROOT}/common/common.cpp
${AJABASE_ROOT}/common/dpxfileio.cpp
${AJABASE_ROOT}/common/dpx_hdr.cpp
${AJABASE_ROOT}/common/guid.cpp
${AJABASE_ROOT}/common/options_popt.cpp
${AJABASE_ROOT}/common/performance.cpp
${AJABASE_ROOT}/common/pixelformat.cpp
${AJABASE_ROOT}/common/testpatterngen.cpp
${AJABASE_ROOT}/common/timebase.cpp
${AJABASE_ROOT}/common/timecode.cpp
${AJABASE_ROOT}/common/timecodeburn.cpp
${AJABASE_ROOT}/common/timer.cpp
${AJABASE_ROOT}/common/videoutilities.cpp
${AJABASE_ROOT}/common/wavewriter.cpp
${AJABASE_ROOT}/network/ip_socket.cpp
${AJABASE_ROOT}/network/tcp_socket.cpp
${AJABASE_ROOT}/network/udp_socket.cpp
${AJABASE_ROOT}/persistence/persistence.cpp
${AJABASE_ROOT}/persistence/sqlite3.c
${AJABASE_ROOT}/pnp/pnp.cpp
${AJABASE_ROOT}/system/atomic.cpp
${AJABASE_ROOT}/system/debug.cpp
${AJABASE_ROOT}/system/diskstatus.cpp
${AJABASE_ROOT}/system/event.cpp
${AJABASE_ROOT}/system/file_io.cpp
${AJABASE_ROOT}/system/info.cpp
${AJABASE_ROOT}/system/lock.cpp
${AJABASE_ROOT}/system/log.cpp
${AJABASE_ROOT}/system/memory.cpp
${AJABASE_ROOT}/system/process.cpp
${AJABASE_ROOT}/system/system.cpp
${AJABASE_ROOT}/system/systemtime.cpp
${AJABASE_ROOT}/system/thread.cpp)
${AJA_LIB_BASE_ROOT}/common/audioutilities.cpp
${AJA_LIB_BASE_ROOT}/common/buffer.cpp
${AJA_LIB_BASE_ROOT}/common/common.cpp
${AJA_LIB_BASE_ROOT}/common/dpxfileio.cpp
${AJA_LIB_BASE_ROOT}/common/dpx_hdr.cpp
${AJA_LIB_BASE_ROOT}/common/guid.cpp
${AJA_LIB_BASE_ROOT}/common/options_popt.cpp
${AJA_LIB_BASE_ROOT}/common/performance.cpp
${AJA_LIB_BASE_ROOT}/common/pixelformat.cpp
${AJA_LIB_BASE_ROOT}/common/testpatterngen.cpp
${AJA_LIB_BASE_ROOT}/common/timebase.cpp
${AJA_LIB_BASE_ROOT}/common/timecode.cpp
${AJA_LIB_BASE_ROOT}/common/timecodeburn.cpp
${AJA_LIB_BASE_ROOT}/common/timer.cpp
${AJA_LIB_BASE_ROOT}/common/videoutilities.cpp
${AJA_LIB_BASE_ROOT}/common/wavewriter.cpp
${AJA_LIB_BASE_ROOT}/network/ip_socket.cpp
${AJA_LIB_BASE_ROOT}/network/tcp_socket.cpp
${AJA_LIB_BASE_ROOT}/network/udp_socket.cpp
${AJA_LIB_BASE_ROOT}/persistence/persistence.cpp
${AJA_LIB_BASE_ROOT}/persistence/sqlite3.c
${AJA_LIB_BASE_ROOT}/pnp/pnp.cpp
${AJA_LIB_BASE_ROOT}/system/atomic.cpp
${AJA_LIB_BASE_ROOT}/system/debug.cpp
${AJA_LIB_BASE_ROOT}/system/diskstatus.cpp
${AJA_LIB_BASE_ROOT}/system/event.cpp
${AJA_LIB_BASE_ROOT}/system/file_io.cpp
${AJA_LIB_BASE_ROOT}/system/info.cpp
${AJA_LIB_BASE_ROOT}/system/lock.cpp
${AJA_LIB_BASE_ROOT}/system/log.cpp
${AJA_LIB_BASE_ROOT}/system/memory.cpp
${AJA_LIB_BASE_ROOT}/system/process.cpp
${AJA_LIB_BASE_ROOT}/system/system.cpp
${AJA_LIB_BASE_ROOT}/system/systemtime.cpp
${AJA_LIB_BASE_ROOT}/system/thread.cpp)
if (CMAKE_SYSTEM_NAME STREQUAL "Windows")
add_definitions(
-DMSWindows
-DAJA_WINDOWS
-D_MBCS
-D_CRT_SECURE_NO_WARNINGS
-DCRT_NONSTDC_DEPRECATE
-D_WINSOCK_DEPRECATED_NO_WARNINGS
-DAJA_NO_AUTOIMPORT
-DWIN32_LEAN_AND_MEAN)
-DAJA_NO_AUTOIMPORT)
remove_definitions(-DUNICODE -D_UNICODE)
set(EXTRA_STATIC_DEFINES
-DAJASTATIC)
@ -306,92 +301,77 @@ if (CMAKE_SYSTEM_NAME STREQUAL "Windows")
-DAJA_WINDLL
-DAJADLL_BUILD)
set(AJANTV2_TARGET_INCLUDE_DIRS
${AJANTV2_TARGET_INCLUDE_DIRS}
list(APPEND AJANTV2_TARGET_INCLUDE_DIRS
src/win
${AJABASE_ROOT}/pnp/windows
${AJABASE_ROOT}/system/windows)
${AJA_LIB_BASE_ROOT}/pnp/windows
${AJA_LIB_BASE_ROOT}/system/windows)
set(AJANTV2_HEADERS
${AJANTV2_HEADERS}
list(APPEND AJANTV2_HEADERS
src/win/ntv2windriverinterface.h
src/win/ntv2winpublicinterface.h)
set(AJANTV2_SOURCES
${AJANTV2_SOURCES}
list(APPEND AJANTV2_SOURCES
# src/win/dllmain.cpp
src/win/ntv2windriverinterface.cpp)
set(AJABASE_HEADERS
${AJABASE_HEADERS}
${AJABASE_ROOT}/pnp/windows/pnpimpl.h
${AJABASE_ROOT}/system/windows/eventimpl.h
${AJABASE_ROOT}/system/windows/infoimpl.h
${AJABASE_ROOT}/system/windows/lockimpl.h
${AJABASE_ROOT}/system/windows/processimpl.h
${AJABASE_ROOT}/system/windows/threadimpl.h)
list(APPEND AJABASE_HEADERS
${AJA_LIB_BASE_ROOT}/pnp/windows/pnpimpl.h
${AJA_LIB_BASE_ROOT}/system/windows/eventimpl.h
${AJA_LIB_BASE_ROOT}/system/windows/infoimpl.h
${AJA_LIB_BASE_ROOT}/system/windows/lockimpl.h
${AJA_LIB_BASE_ROOT}/system/windows/processimpl.h
${AJA_LIB_BASE_ROOT}/system/windows/threadimpl.h)
set(AJABASE_SOURCES
${AJABASE_SOURCES}
${AJABASE_ROOT}/pnp/windows/pnpimpl.cpp
${AJABASE_ROOT}/system/windows/eventimpl.cpp
${AJABASE_ROOT}/system/windows/infoimpl.cpp
${AJABASE_ROOT}/system/windows/lockimpl.cpp
${AJABASE_ROOT}/system/windows/processimpl.cpp
${AJABASE_ROOT}/system/windows/threadimpl.cpp)
list(APPEND AJABASE_SOURCES
${AJA_LIB_BASE_ROOT}/pnp/windows/pnpimpl.cpp
${AJA_LIB_BASE_ROOT}/system/windows/eventimpl.cpp
${AJA_LIB_BASE_ROOT}/system/windows/infoimpl.cpp
${AJA_LIB_BASE_ROOT}/system/windows/lockimpl.cpp
${AJA_LIB_BASE_ROOT}/system/windows/processimpl.cpp
${AJA_LIB_BASE_ROOT}/system/windows/threadimpl.cpp)
set(EXTRA_LIBRARIES
advapi32 comctl32 netapi32
odbc32 psapi rpcrt4 setupapi shell32
shlwapi user32 winmm ws2_32 wsock32)
elseif (CMAKE_SYSTEM_NAME STREQUAL "Linux")
add_definitions(
-DAJALinux
-DAJA_LINUX)
set(EXTRA_STATIC_DEFINES
-DAJASTATIC)
set(EXTRA_DYNAMIC_DEFINES
-DAJADLL_BUILD
-DAJADLL_BUILD)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC")
set(AJANTV2_TARGET_INCLUDE_DIRS
${AJANTV2_TARGET_INCLUDE_DIRS}
list(APPEND AJANTV2_TARGET_INCLUDE_DIRS
src/lin
${AJABASE_ROOT}/pnp/linux
${AJABASE_ROOT}/system/linux)
${AJA_LIB_BASE_ROOT}/pnp/linux
${AJA_LIB_BASE_ROOT}/system/linux)
set(AJANTV2_HEADERS
${AJANTV2_HEADERS}
list(APPEND AJANTV2_HEADERS
src/lin/ntv2linuxdriverinterface.h
src/lin/ntv2linuxpublicinterface.h)
set(AJANTV2_SOURCES
${AJANTV2_SOURCES}
list(APPEND AJANTV2_SOURCES
src/lin/ntv2linuxdriverinterface.cpp)
set(AJABASE_HEADERS
${AJABASE_HEADERS}
${AJABASE_ROOT}/pnp/linux/pnpimpl.h
${AJABASE_ROOT}/system/linux/eventimpl.h
${AJABASE_ROOT}/system/linux/infoimpl.h
${AJABASE_ROOT}/system/linux/lockimpl.h
${AJABASE_ROOT}/system/linux/processimpl.h
${AJABASE_ROOT}/system/linux/threadimpl.h)
list(APPEND AJABASE_HEADERS
${AJA_LIB_BASE_ROOT}/pnp/linux/pnpimpl.h
${AJA_LIB_BASE_ROOT}/system/linux/eventimpl.h
${AJA_LIB_BASE_ROOT}/system/linux/infoimpl.h
${AJA_LIB_BASE_ROOT}/system/linux/lockimpl.h
${AJA_LIB_BASE_ROOT}/system/linux/processimpl.h
${AJA_LIB_BASE_ROOT}/system/linux/threadimpl.h)
set(AJABASE_SOURCES
${AJABASE_SOURCES}
${AJABASE_ROOT}/pnp/linux/pnpimpl.cpp
${AJABASE_ROOT}/system/linux/eventimpl.cpp
${AJABASE_ROOT}/system/linux/infoimpl.cpp
${AJABASE_ROOT}/system/linux/lockimpl.cpp
${AJABASE_ROOT}/system/linux/processimpl.cpp
${AJABASE_ROOT}/system/linux/threadimpl.cpp)
list(APPEND AJABASE_SOURCES
${AJA_LIB_BASE_ROOT}/pnp/linux/pnpimpl.cpp
${AJA_LIB_BASE_ROOT}/system/linux/eventimpl.cpp
${AJA_LIB_BASE_ROOT}/system/linux/infoimpl.cpp
${AJA_LIB_BASE_ROOT}/system/linux/lockimpl.cpp
${AJA_LIB_BASE_ROOT}/system/linux/processimpl.cpp
${AJA_LIB_BASE_ROOT}/system/linux/threadimpl.cpp)
set(EXTRA_LIBRARIES
rt)
elseif (CMAKE_SYSTEM_NAME STREQUAL "Darwin")
add_definitions(
-DAJAMac
-DAJA_MAC)
set(EXTRA_STATIC_DEFINES
-DAJASTATIC)
@ -399,45 +379,40 @@ elseif (CMAKE_SYSTEM_NAME STREQUAL "Darwin")
-DAJADLL_BUILD
-DAJADLL_BUILD)
set(AJANTV2_TARGET_INCLUDE_DIRS
${AJANTV2_TARGET_INCLUDE_DIRS}
list(APPEND AJANTV2_TARGET_INCLUDE_DIRS
src/mac
${AJABASE_ROOT}/pnp/mac
${AJABASE_ROOT}/system/mac
${AJA_LIB_BASE_ROOT}/pnp/mac
${AJA_LIB_BASE_ROOT}/system/mac
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include)
set(AJANTV2_HEADERS
${AJANTV2_HEADERS}
list(APPEND AJANTV2_HEADERS
src/mac/ntv2macdriverinterface.h
src/mac/ntv2macpublicinterface.h)
set(AJANTV2_SOURCES
${AJANTV2_SOURCES}
list(APPEND AJANTV2_SOURCES
src/mac/ntv2macdriverinterface.cpp)
set(AJABASE_HEADERS
${AJABASE_HEADERS}
${AJABASE_ROOT}/pnp/mac/devicenotifier.h
${AJABASE_ROOT}/pnp/mac/masterport.h
${AJABASE_ROOT}/pnp/mac/pnpimpl.h
${AJABASE_ROOT}/system/mac/eventimpl.h
${AJABASE_ROOT}/system/mac/infoimpl.h
${AJABASE_ROOT}/system/mac/lockimpl.h
${AJABASE_ROOT}/system/mac/processimpl.h
${AJABASE_ROOT}/system/mac/pthreadsextra.h
${AJABASE_ROOT}/system/mac/threadimpl.h)
list(APPEND AJABASE_HEADERS
${AJA_LIB_BASE_ROOT}/pnp/mac/devicenotifier.h
${AJA_LIB_BASE_ROOT}/pnp/mac/masterport.h
${AJA_LIB_BASE_ROOT}/pnp/mac/pnpimpl.h
${AJA_LIB_BASE_ROOT}/system/mac/eventimpl.h
${AJA_LIB_BASE_ROOT}/system/mac/infoimpl.h
${AJA_LIB_BASE_ROOT}/system/mac/lockimpl.h
${AJA_LIB_BASE_ROOT}/system/mac/processimpl.h
${AJA_LIB_BASE_ROOT}/system/mac/pthreadsextra.h
${AJA_LIB_BASE_ROOT}/system/mac/threadimpl.h)
set(AJABASE_SOURCES
${AJABASE_SOURCES}
${AJABASE_ROOT}/pnp/mac/devicenotifier.cpp
${AJABASE_ROOT}/pnp/mac/masterport.cpp
${AJABASE_ROOT}/pnp/mac/pnpimpl.cpp
${AJABASE_ROOT}/system/mac/eventimpl.cpp
${AJABASE_ROOT}/system/mac/infoimpl.mm
${AJABASE_ROOT}/system/mac/lockimpl.cpp
${AJABASE_ROOT}/system/mac/processimpl.cpp
${AJABASE_ROOT}/system/mac/pthreadsextra.cpp
${AJABASE_ROOT}/system/mac/threadimpl.cpp)
list(APPEND AJABASE_SOURCES
${AJA_LIB_BASE_ROOT}/pnp/mac/devicenotifier.cpp
${AJA_LIB_BASE_ROOT}/pnp/mac/masterport.cpp
${AJA_LIB_BASE_ROOT}/pnp/mac/pnpimpl.cpp
${AJA_LIB_BASE_ROOT}/system/mac/eventimpl.cpp
${AJA_LIB_BASE_ROOT}/system/mac/infoimpl.mm
${AJA_LIB_BASE_ROOT}/system/mac/lockimpl.cpp
${AJA_LIB_BASE_ROOT}/system/mac/processimpl.cpp
${AJA_LIB_BASE_ROOT}/system/mac/pthreadsextra.cpp
${AJA_LIB_BASE_ROOT}/system/mac/threadimpl.cpp)
find_library(CORE_FOUNDATION_FRAMEWORK CoreFoundation)
find_library(FOUNDATION_FRAMEWORK Foundation)
@ -450,19 +425,76 @@ elseif (CMAKE_SYSTEM_NAME STREQUAL "Darwin")
endif()
set(AJANTV2_TARGET_SOURCES
${AJANTV2_SOURCES}
${AJANTV2_HEADERS}
${AJAANC_HEADERS}
${AJAANC_SOURCES}
${AJABASE_SOURCES}
${AJABASE_HEADERS})
${AJABASE_HEADERS}
${AJANTV2_SOURCES}
${AJANTV2_HEADERS})
add_library(ajantv2shared SHARED ${AJANTV2_TARGET_SOURCES})
add_library(ajantv2 STATIC ${AJANTV2_TARGET_SOURCES})
target_include_directories(ajantv2shared PUBLIC ${AJANTV2_TARGET_INCLUDE_DIRS})
target_include_directories(ajantv2 PUBLIC ${AJANTV2_TARGET_INCLUDE_DIRS})
target_link_libraries(ajantv2shared PUBLIC ${EXTRA_LIBRARIES} ${EXTRA_DYNAMIC_LIBRARIES})
target_link_libraries(ajantv2 PUBLIC ${EXTRA_LIBRARIES})
target_compile_definitions(ajantv2shared PUBLIC ${EXTRA_DYNAMIC_DEFINES})
target_compile_definitions(ajantv2 PUBLIC ${EXTRA_STATIC_DEFINES})
if (AJA_BUILD_SHARED)
add_library(ajantv2shared SHARED ${AJANTV2_TARGET_SOURCES})
target_include_directories(ajantv2shared PUBLIC ${AJANTV2_TARGET_INCLUDE_DIRS})
target_link_libraries(ajantv2shared PUBLIC ${EXTRA_LIBRARIES} ${EXTRA_DYNAMIC_LIBRARIES})
target_compile_definitions(ajantv2shared PUBLIC ${EXTRA_DYNAMIC_DEFINES})
endif()
if (AJA_DEPLOY_SOURCES)
# deploy ajabase sources to build directory
foreach (source_file ${AJABASE_SOURCES})
get_filename_component(source_base_name ${source_file} NAME)
string(REGEX REPLACE "(${AJA_LIB_BASE_ROOT}/)+" "" source_replace ${source_file})
message("ajabase basename: ${source_replace}")
add_custom_command(TARGET ajantv2
POST_BUILD
COMMAND ${CMAKE_COMMAND}
ARGS -E copy "${source_file}" "../ajabase/${source_replace}")
endforeach(source_file)
# deploy ajantv2 sources to build directory
foreach (source_file ${AJANTV2_SOURCES})
add_custom_command(TARGET ajantv2
POST_BUILD
COMMAND ${CMAKE_COMMAND}
ARGS -E copy "${AJA_LIB_NTV2_ROOT}/${source_file}" "${source_file}")
endforeach(source_file)
# deploy ajaanc sources to build directory
foreach (source_file ${AJAANC_SOURCES})
get_filename_component(source_base_name ${source_file} NAME)
add_custom_command(TARGET ajantv2
POST_BUILD
COMMAND ${CMAKE_COMMAND}
ARGS -E copy "${AJA_LIB_ANC_ROOT}/src/${source_base_name}" "../ajaanc/src/${source_base_name}")
endforeach(source_file)
endif()
if (AJA_DEPLOY_HEADERS)
# deploy ajabase headers to build directory
foreach (header_file ${AJABASE_HEADERS})
get_filename_component(header_base_name ${header_file} NAME)
string(REGEX REPLACE "(${AJA_LIB_BASE_ROOT}/)+" "" header_replace ${header_file})
message("ajabase basename: ${header_replace}")
add_custom_command(TARGET ajantv2
POST_BUILD
COMMAND ${CMAKE_COMMAND}
ARGS -E copy "${header_file}" "../ajabase/${header_replace}")
endforeach(header_file)
# deploy ajantv2 headers to build directory
foreach (header_file ${AJANTV2_HEADERS})
add_custom_command(TARGET ajantv2
POST_BUILD
COMMAND ${CMAKE_COMMAND}
ARGS -E copy "${AJA_LIB_NTV2_ROOT}/${header_file}" "${header_file}")
endforeach(header_file)
# deploy ajaanc headers headers to build directory
foreach (header_file ${AJAANC_HEADERS})
get_filename_component(header_base_name ${header_file} NAME)
add_custom_command(TARGET ajantv2
POST_BUILD
COMMAND ${CMAKE_COMMAND}
ARGS -E copy "${AJA_LIB_ANC_ROOT}/includes/${header_base_name}" "../ajaanc/includes/${header_base_name}")
endforeach(header_file)
endif()

View File

@ -22,8 +22,13 @@
SDK VERSION
The next several macro values are patched when the SDK is built by AJA.
**/
#if defined (BUILDING_CMAKE)
#include "version.h" // version.h.in defines are filled out by cmake
#if defined (AJA_NTV2_BUILDING_CMAKE)
// NOTE: Enabling the CMake variable "AJA_BUILDING_CMAKE" will generate an
// include file "includes/version.h" in the CMake build directory for ajantv2.
// The contents of this file are populated by CMake, using the ajantv2/includes/version.h.in
// file as a template. CMake will enable the preprocessor define "BUILDING_CMAKE" so that
// version.h is included here at build time.
#include "includes/version.h"
#else
#define AJA_NTV2_SDK_VERSION_MAJOR 16 ///< @brief The SDK major version number, an unsigned decimal integer.
#define AJA_NTV2_SDK_VERSION_MINOR 1 ///< @brief The SDK minor version number, an unsigned decimal integer.

View File

@ -1,123 +0,0 @@
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED True)
set(CMAKE_DEBUG_POSTFIX d)
# set(CMAKE_OSX_ARCHITECTURES arm64 x86_64)
set(CMAKE_OSX_DEPLOYMENT_TARGET "10.12" CACHE STRING "Minimum OS X deployment version" FORCE)
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
# TODO(paulh): Re-enable when we start using the CMake version.h.in file
# string(TIMESTAMP DATETIME_NOW "\"%A %b %d, %Y (%m/%d/%Y @ %H:%M:%S GMT+8)\"")
# string(TIMESTAMP DATETIME_NOW "\"%m/%d/%Y +8:%H:%M:%S\"")
# set(AJA_NTV2_SDK_VERSION_MAJOR 16)
# set(AJA_NTV2_SDK_VERSION_MINOR 0)
# set(AJA_NTV2_SDK_VERSION_POINT 1)
# set(AJA_NTV2_SDK_BUILD_NUMBER 0)
# set(AJA_NTV2_SDK_BUILD_DATETIME ${DATETIME_NOW})
# set(AJA_NTV2_SDK_BUILD_TYPE "\"d\"")
# control where the static and shared libraries are built so that on windows
# we don't need to tinker with the path to run the executable
#set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}")
#set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}")
#set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}")
#option(BUILD_SHARED_LIBS "Build using shared libraries" ON)
# General compiler flags
if (CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /MP")
if((CMAKE_BUILD_TYPE STREQUAL Debug))
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /Od /RTC1 /W3")
elseif(CMAKE_BUILD_TYPE STREQUAL RelWithDebInfo)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W3")
else()
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /O2 /W3")
endif()
elseif(CMAKE_CXX_COMPILER_ID STREQUAL "Clang" OR CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
if((CMAKE_BUILD_TYPE STREQUAL Debug) OR (CMAKE_BUILD_TYPE STREQUAL RelWithDebInfo))
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -O0 -g")
else()
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O2 -Wall -Wextra")
# Turn on all warnings in Release builds
# set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O2 -Wall -Wextra -pedantic -Werror")
# Remove these switches as we fix the underlying code
# set(CMAKE_CXX_FLAGS
# "${CMAKE_CXX_FLAGS}\
# -Wno-language-extension-token\
# -Wno-microsoft-enum-value\
# -Wno-sign-compare\
# -Wno-deprecated-declarations\
# -Wno-bitwise-conditional-parentheses\
# -Wno-unused-private-field\
# -Wno-unused-parameter\
# -Wno-misleading-indentation\
# -Wno-deprecated-register\
# -Wno-deprecated-declarations\
# -Wno-pointer-to-int-cast\
# -Wno-unused-const-variable\
# -Wno-implicit-const-int-float-conversion\
# -Wno-unused-variable\
# -Wno-missing-braces\
# -Wno-format\
# -Wno-dangling-gsl\
# -Wno-unused-function")
endif()
endif()
option(AJA_BUILD_OPENSOURCE "Build NTV2 SDK as open-source (exclude internal apps/libs)" ON)
option(BUILD_AJA_QT_BASED "Build NTV2 Demos and Apps which depend upon Qt" ON)
# apps
option(BUILD_AJA_APPS "Build AJA NTV2 applications" ON)
option(BUILD_AJA_DEMOS "Build AJA NTV2 Demos" ON)
option(BUILD_AJA_DRIVER "Build AJA NTV2 driver" ON)
option(BUILD_AJA_LIBS "Build AJA libraries" ON)
option(BUILD_AJA_TOOLS "Build AJA NTV2 tools" ON)
# libs
option(BUILD_AJAANC "Build ajaanc library" OFF)
option(BUILD_AJACC "Build ajacc library" ON)
option(BUILD_AJACONV "Build ajaconv library" ON)
option(BUILD_AJAGUI "Build ajagui library" ON)
option(BUILD_AJANTV2 "Build ajantv2 library" ON)
option(BUILD_AJASTREAMS "Build ajastreams library" ON)
# plug-ins
option(BUILD_AJA_PLUGINS "Build AJA Plug-ins" ON)
# demos with additional deps
option(BUILD_AJA_CC_DEMOS "Build NTV2 Demos which depend upon AJACC" ON)
option(BUILD_AJA_CUDA_DEMOS "Build NTV2 Demos which depend upon NVIDIA CUDA" ON)
option(BUILD_AJA_HEVC_DEMOS "Build NTV2 Demos which depend upon the M31 HEVC codec" ON)
option(BUILD_AJA_OPENGL_DEMOS "Build NTV2 Demos which depend upon OpenGL" ON)
# unit tests
option(BUILD_AJA_UNIT_TESTS "Build unit tests" ON)
if (AJA_BUILD_OPENSOURCE)
message("Building MIT-licensed AJA NTV2 SDK components")
set(BUILD_AJA_APPS OFF)
set(BUILD_AJA_DEMOS OFF)
set(BUILD_AJA_DRIVER OFF)
set(BUILD_AJA_LIBS ON)
set(BUILD_AJA_TOOLS OFF)
set(BUILD_AJAANC OFF)
set(BUILD_AJACC OFF)
set(BUILD_AJACONV OFF)
set(BUILD_AJAGUI OFF)
set(BUILD_AJASTREAMS OFF)
set(BUILD_AJANTV2 ON)
set(BUILD_AJA_CC_DEMOS OFF)
set(BUILD_AJA_CUDA_DEMOS OFF)
set(BUILD_AJA_HEVC_DEMOS OFF)
set(BUILD_AJA_OPENGL_DEMOS OFF)
set(BUILD_AJA_PLUGINS OFF)
set(BUILD_AJA_UNIT_TESTS OFF)
endif()

View File

@ -0,0 +1,62 @@
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_C_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED True)
set(CMAKE_DEBUG_POSTFIX d)
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
# macOS build settings
set(CMAKE_OSX_DEPLOYMENT_TARGET "10.12" CACHE STRING "Minimum OS X deployment version" FORCE)
# TODO(paulh): generate universal builds up front
# set(CMAKE_OSX_ARCHITECTURES arm64 x86_64)
option(AJA_BUILDING_CMAKE "Build NTV2 SDK with version.h generated by CMake" OFF)
option(AJA_BUILD_OPENSOURCE "Build NTV2 SDK as open-source (exclude internal apps/libs)" ON)
option(AJA_BUILD_QT_BASED "Build NTV2 Demos and Apps which depend upon Qt" ON)
option(AJA_BUILD_SHARED "Build NTV2 shared libraries" OFF)
option(AJA_DEPLOY_OUTPUTS "Gather build artifacts into top-level directory, and in bin/lib dirs." OFF)
option(AJA_DEPLOY_SOURCES "Deploy sources into build output directory." OFF)
option(AJA_DEPLOY_HEADERS "Deploy headers into build output directory." OFF)
option(AJA_DEPLOY_LIBS "Deploy dependency libraries (DLL/dylib) into the .exe output directory (Win32) or .app bundle (macOS)." OFF)
# apps/demos/tools
option(AJA_BUILD_APPS "Build AJA NTV2 applications" ON)
option(AJA_BUILD_DEMOS "Build AJA NTV2 Demos" ON)
option(AJA_BUILD_TOOLS "Build AJA NTV2 tools" ON)
# driver
option(AJA_BUILD_DRIVER "Build AJA NTV2 driver" OFF)
# libs
option(AJA_BUILD_LIBS "Build AJA libraries" ON)
# plug-ins
option(AJA_BUILD_PLUGINS "Build AJA Plug-ins" ON)
# unit tests
option(AJA_BUILD_TESTS "Build unit tests" ON)
# QA stuff
option(AJA_BUILD_QA "Build AJA NTV2 QA apps and libs" ON)
# Build ajantv2 open-source SDK
if (AJA_BUILD_OPENSOURCE)
message("NOTE: Building open-source AJA NTV2 SDK components (MIT License)")
set(AJA_BUILD_APPS OFF)
set(AJA_BUILD_DEMOS OFF)
set(AJA_BUILD_TOOLS OFF)
set(AJA_BUILD_DRIVER OFF)
set(AJA_BUILD_LIBS ON)
set(AJA_BUILD_PLUGINS OFF)
set(AJA_BUILD_TESTS OFF)
set(AJA_BUILD_QA OFF)
endif()

View File

@ -0,0 +1,33 @@
# Common preprocessor defines
if(CMAKE_BUILD_TYPE MATCHES Debug)
message("Build Type: Debug")
add_definitions(-DAJA_DEBUG -D_DEBUG)
elseif(CMAKE_BUILD_TYPE MATCHES RelWithDebInfo)
message("Build Type: Release with Debug Symbols")
else()
message("Build Type: Release")
add_definitions(-DNDEBUG)
endif()
# Platform-specific preprocessor defines
if (CMAKE_SYSTEM_NAME STREQUAL "Windows")
add_definitions(
-DAJA_WINDOWS
-DMSWindows
-D_WINDOWS
-D_CONSOLE
-DUNICODE
-D_UNICODE
-DWIN32_LEAN_AND_MEAN
-D_CRT_SECURE_NO_WARNINGS
-D_SCL_SECURE_NO_WARNINGS)
elseif (CMAKE_SYSTEM_NAME STREQUAL "Linux")
add_definitions(
-DAJALinux
-DAJA_LINUX)
elseif (CMAKE_SYSTEM_NAME STREQUAL "Darwin")
add_definitions(
-DAJAMac
-DAJA_MAC
-D__STDC_CONSTANT_MACROS)
endif()

View File

@ -0,0 +1,50 @@
# Common compiler flags
if (CMAKE_CXX_COMPILER_ID STREQUAL MSVC)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /MP /Zm200 /Zc:wchar_t-")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /MP /Zm200 /Zc:wchar_t-")
if(CMAKE_BUILD_TYPE STREQUAL Debug|RelWithDebInfo)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /Od /RTC1 /W3")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /Od /RTC1 /W3")
else()
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /O2 /W3")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /O2 /W3")
endif()
elseif(CMAKE_CXX_COMPILER_ID STREQUAL Clang|GNU)
if (CMAKE_SYSTEM_NAME STREQUAL Linux|Darwin)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIC")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC")
endif()
if(CMAKE_BUILD_TYPE STREQUAL Debug|RelWithDebInfo)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -O0 -g")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -O0 -g")
else()
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -O2 -Wall -Wextra")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O2 -Wall -Wextra")
# TODO(paulh): We'll want to fix these compile errors as we work towards better Clang support.
# set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O2 -Wall -Wextra -pedantic -Werror")
# Remove these switches as we fix the underlying code
# set(CMAKE_CXX_FLAGS
# "${CMAKE_CXX_FLAGS}\
# -Wno-language-extension-token\
# -Wno-microsoft-enum-value\
# -Wno-sign-compare\
# -Wno-deprecated-declarations\
# -Wno-bitwise-conditional-parentheses\
# -Wno-unused-private-field\
# -Wno-unused-parameter\
# -Wno-misleading-indentation\
# -Wno-deprecated-register\
# -Wno-deprecated-declarations\
# -Wno-pointer-to-int-cast\
# -Wno-unused-const-variable\
# -Wno-implicit-const-int-float-conversion\
# -Wno-unused-variable\
# -Wno-missing-braces\
# -Wno-format\
# -Wno-dangling-gsl\
# -Wno-unused-function")
endif()
endif()

View File

@ -0,0 +1,35 @@
set(AJA_CMAKE_DIR ${CMAKE_CURRENT_LIST_DIR})
set(AJA_APPS_ROOT ${AJA_CMAKE_DIR}/../ajaapps)
set(AJA_LIBRARIES_ROOT ${AJA_CMAKE_DIR}/../ajalibraries)
set(AJA_PLUGINS_ROOT ${AJA_CMAKE_DIR}/../ajaplugins)
set(AJA_QA_ROOT ${AJA_CMAKE_DIR}/../qa)
set(NON_AJA_ROOT ${AJA_CMAKE_DIR}/../non-aja)
set(AJA_DEMO_COMMON_ROOT ${AJA_APPS_ROOT}/crossplatform/demoapps)
set(AJA_LIB_ANC_ROOT ${AJA_LIBRARIES_ROOT}/ajaanc)
set(AJA_LIB_BASE_ROOT ${AJA_LIBRARIES_ROOT}/ajabase)
set(AJA_LIB_CC_ROOT ${AJA_LIBRARIES_ROOT}/ajacc)
set(AJA_LIB_CONV_ROOT ${AJA_LIBRARIES_ROOT}/ajaconv)
set(AJA_LIB_INTERNAL_ROOT ${AJA_LIBRARIES_ROOT}/ajainternal)
set(AJA_GPUSTUFF_ROOT ${AJA_LIBRARIES_ROOT}/gpustuff)
set(AJA_LIB_GUI_ROOT ${AJA_LIB_INTERNAL_ROOT}/gui)
set(AJA_LIB_NTV2_ROOT ${AJA_LIBRARIES_ROOT}/ajantv2)
set(AJA_LIB_STREAMS_ROOT ${AJA_LIBRARIES_ROOT}/streams)
set(AJA_LIB_RETAIL_ROOT ${AJA_LIBRARIES_ROOT}/ajaretail)
set(AJA_LIB_APPLIANCE_ROOT ${AJA_LIBRARIES_ROOT}/appliance)
set(NON_AJA_ASIO_ROOT ${NON_AJA_ROOT}/asiosdk2.0)
set(NON_AJA_DNX_ROOT ${NON_AJA_ROOT}/dnx2.7.0)
set(NON_AJA_DOCTEST_ROOT ${NON_AJA_ROOT}/doctest)
set(NON_AJA_FFMPEG_ROOT ${NON_AJA_ROOT}/ffmpeg4.3.2)
set(NON_AJA_LIBAIFF_ROOT ${NON_AJA_ROOT}/libaiff-5.0)
set(NON_AJA_LIBSAMPLERATE_ROOT ${NON_AJA_ROOT}/libsamplerate0.1.9)
set(NON_AJA_MAINCONCEPT_ROOT ${NON_AJA_ROOT}/mainconcept8.5.0)
set(NON_AJA_NEWTEK_NDI_ROOT ${NON_AJA_ROOT}/newtek-ndi)
set(NON_AJA_OPENSSL_ROOT ${NON_AJA_ROOT}/openssl1.0.2j)
set(NON_AJA_PRORES_ROOT ${NON_AJA_ROOT}/prores-aja)
set(NON_AJA_QHTTPENGINE_ROOT ${NON_AJA_ROOT}/qhttpengine)
set(NON_AJA_QTSERVICE_ROOT ${NON_AJA_ROOT}/qtservice)
set(NON_AJA_SDL2_ROOT ${NON_AJA_ROOT}/sdl2.0.5)
set(NON_AJA_LIBTIFF_ROOT ${NON_AJA_ROOT}/libtiff)

View File

@ -0,0 +1,69 @@
# https://stackoverflow.com/questions/60854495/qt5-cmake-include-all-libraries-into-executable
# get absolute path to qmake, then use it to find windeployqt executable
function(deploy_qt_libs target)
if (WIN32)
find_package(Qt5Core REQUIRED)
get_target_property(_qmake_executable Qt5::qmake IMPORTED_LOCATION)
get_filename_component(_qt_bin_dir "${_qmake_executable}" DIRECTORY)
add_custom_command(TARGET ${target} POST_BUILD
COMMAND "${_qt_bin_dir}/windeployqt.exe"
--verbose 1
--no-svg
--no-angle
--no-opengl
--no-opengl-sw
--no-compiler-runtime
--no-system-d3d-compiler
--release
\"$<TARGET_FILE:${target}>\"
COMMENT "Deploying Qt Release libraries for target '${target}' via winqtdeploy ..."
)
if (CMAKE_BUILD_TYPE STREQUAL "Debug")
add_custom_command(TARGET ${target} POST_BUILD
COMMAND "${_qt_bin_dir}/windeployqt.exe"
--verbose 1
--no-svg
--no-angle
--no-opengl
--no-opengl-sw
--no-compiler-runtime
--no-system-d3d-compiler
--debug
\"$<TARGET_FILE:${target}>\"
COMMENT "Deploying Qt Debug libraries for target '${target}' via winqtdeploy ..."
)
endif()
elseif (APPLE)
find_package(Qt5Core REQUIRED)
get_target_property(_qmake_executable Qt5::qmake IMPORTED_LOCATION)
get_filename_component(_qt_bin_dir "${_qmake_executable}" DIRECTORY)
get_target_property(_is_target_bundle ${target} MACOSX_BUNDLE)
if (_is_target_bundle)
message("macOS bundle: ${target}")
add_custom_target(
${target}_macqtdeploy ALL
DEPENDS $<TARGET_BUNDLE_DIR:${target}>
COMMAND ${_qt_bin_dir}/macdeployqt $<TARGET_BUNDLE_DIR:${target}>/ -always-overwrite
COMMENT "Deploying Qt Frameworks into .app bundle for target '${target}' via macqtdeploy ..."
VERBATIM
)
else()
message("macOS binary: ${target}")
add_custom_target(
${target}_macqtdeploy ALL
DEPENDS $<TARGET_FILE_DIR:${target}>
COMMAND ${_qt_bin_dir}/macdeployqt $<TARGET_FILE_DIR:${target}>/ -executable=$<TARGET_FILE_DIR:${target}>/${target} -always-overwrite
COMMENT "Deploying Qt Frameworks into for target '${target}' via macqtdeploy ..."
VERBATIM
)
endif()
add_dependencies(${target}_macqtdeploy ${target})
elseif (LINUX)
message("lin_deploy_qt TODO")
return()
endif()
endfunction()