Skip to content

Commit

Permalink
Merge pull request #17 from aja-video/use_cmake_install_prefix
Browse files Browse the repository at this point in the history
cmake: Update to latest CMake from AJA internal
  • Loading branch information
paulh-aja authored Mar 22, 2022
2 parents 9e7309f + 13e467e commit 6c44a94
Show file tree
Hide file tree
Showing 39 changed files with 355 additions and 265 deletions.
5 changes: 4 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,16 @@ cmake_minimum_required(VERSION 3.10)

project(ntv2)

# CMake includes
set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake/")
# AJA Includes
include(AJAHelpers)
include(BuildOptions)
include(CommonDefines)
include(CommonFlags)
include(CommonPaths)
include(CommonVars)
# CMake includes
include(GNUInstallDirs)

# Override the following variables to set the NTV2 SDK version defines and strings used for the SDK and apps
if (AJA_BUILDING_CMAKE)
Expand Down Expand Up @@ -54,6 +56,7 @@ elseif(CMAKE_SYSTEM_NAME STREQUAL "Linux")
else()
message(FATAL_ERROR "Unsupported platform: ${CMAKE_SYSTEM_NAME}")
endif()

message(STATUS "CMAKE_INSTALL_PREFIX = ${CMAKE_INSTALL_PREFIX}")

# Optional build artifacts output directory
Expand Down
4 changes: 2 additions & 2 deletions ajaapps/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ if (AJA_BUILD_APPS)
add_subdirectory(crossplatform/ajadaemon)
add_subdirectory(crossplatform/controlpanel)
add_subdirectory(crossplatform/controlroom)
if (CMAKE_SYSTEM_NAME STREQUAL "Linux")
# only on Linux for now
if (CMAKE_SYSTEM_NAME STREQUAL "Linux" AND AJA_BUILD_NONAJA)
# ndibridge is currently Linux-only, and requires building libsamplerate
add_subdirectory(crossplatform/ndibridge)
endif()

Expand Down
152 changes: 106 additions & 46 deletions ajaapps/crossplatform/demoapps/NVIDIA/cudalowlatencydemo/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,49 +1,94 @@
project(cudalowlatencydemo)
# NOTE: Ensure that the CUDA Toolkit v11.4 or later is installed and in your PATH.

message("added cudalowlatencydemo")
if (NOT CMAKE_SYSTEM_NAME STREQUAL "Linux")
message("skipping cudalowlatencydemo (requires Linux)")
return()
endif()
find_package(CUDA 11.4)
if (NOT FOUND_CUDA)
message("skipping cudalowlatencydemo (CUDA not found)")
return()
endif()
set(OpenGL_GL_PREFERENCE LEGACY)
find_package(OpenGL)
if (NOT OPENGL_FOUND)
message("skipping cudalowlatencydemo (OpenGL not found)")
return()
endif()
find_package(GLEW)
if (NOT GLEW_FOUND)
message("skipping cudalowlatencydemo (GLEW not found)")
return()
endif()
find_package(X11)
if (NOT X11_FOUND)
message("skipping cudalowlatencydemo (X11 not found)")
return()
endif()

project(cudalowlatencydemo LANGUAGES CUDA CXX)

set(TARGET_COMPILE_DEFS
-DAJA_LINUX
-DAJALinux
-DAJA_RDMA=1)

set(CUDALOWLATENCYDEMO_TARGET_INCLUDE_DIRS
${CMAKE_CURRENT_SOURCE_DIR}/../
set(TARGET_INCLUDE_DIRS
${AJA_APPS_ROOT}/crossplatform/demoapps/NVIDIA/common
${AJA_APPS_ROOT}/crossplatform/demoapps/NVIDIA/commonCUDA
${AJA_APPS_ROOT}/crossplatform/demoapps
${AJA_LIBRARIES_ROOT}
${AJA_LIB_NTV2_ROOT}/includes)
${AJA_LIB_BASE_ROOT}/system
${AJA_LIB_NTV2_ROOT}/includes
${CUDA_INCLUDE_DIRS}
${OPENGL_INCLUDE_DIRS}
${GLEW_INCLUDE_DIRS})

message("GLEW INCLUDE: ${GLEW_INCLUDE_DIRS}")

set(DEMO_APPS_SOURCES
${AJA_APPS_ROOT}/crossplatform/demoapps/ntv2democommon.cpp)
set(DEMO_APPS_HEADERS
${AJA_APPS_ROOT}/crossplatform/demoapps/ntv2democommon.h)

set(CUDALOWLATENCYDEMO_BUILD_FILES
Makefile
kernel.cu)
set(CUDALOWLATENCYDEMO_SOURCES
cudaapp.cpp)
set(NVIDIA_COMMON_SOURCES
${CMAKE_CURRENT_SOURCE_DIR}/../common/ntv2errorlist.cpp
${CMAKE_CURRENT_SOURCE_DIR}/../common/ntv2errorlist.h
${CMAKE_CURRENT_SOURCE_DIR}/../common/ntv2glTextureTransfer.h
${CMAKE_CURRENT_SOURCE_DIR}/../common/ntv2glTextureTransferNV.cpp
${CMAKE_CURRENT_SOURCE_DIR}/../common/ntv2glTextureTransferNV.h
${CMAKE_CURRENT_SOURCE_DIR}/../common/ntv2gpucircularbuffer.cpp
${CMAKE_CURRENT_SOURCE_DIR}/../common/ntv2gpucircularbuffer.h
${CMAKE_CURRENT_SOURCE_DIR}/../common/ntv2rendertotexture.cpp
${CMAKE_CURRENT_SOURCE_DIR}/../common/ntv2rendertotexture.h
${CMAKE_CURRENT_SOURCE_DIR}/../common/ntv2texture.cpp
${CMAKE_CURRENT_SOURCE_DIR}/../common/ntv2texture.h
${CMAKE_CURRENT_SOURCE_DIR}/../common/oglview.cpp
${CMAKE_CURRENT_SOURCE_DIR}/../common/oglview.h
${CMAKE_CURRENT_SOURCE_DIR}/../common/opengl.h
${CMAKE_CURRENT_SOURCE_DIR}/../common/simplegpuvio.cpp
${CMAKE_CURRENT_SOURCE_DIR}/../common/simplegpuvio.h)
# ${CMAKE_CURRENT_SOURCE_DIR}/../common/ntv2errorlist.cpp
# ${CMAKE_CURRENT_SOURCE_DIR}/../common/ntv2errorlist.h
# ${CMAKE_CURRENT_SOURCE_DIR}/../common/ntv2glTextureTransfer.h
# ${CMAKE_CURRENT_SOURCE_DIR}/../common/ntv2glTextureTransferNV.cpp
# ${CMAKE_CURRENT_SOURCE_DIR}/../common/ntv2glTextureTransferNV.h
# ${CMAKE_CURRENT_SOURCE_DIR}/../common/ntv2gpucircularbuffer.cpp
# ${CMAKE_CURRENT_SOURCE_DIR}/../common/ntv2gpucircularbuffer.h
# ${CMAKE_CURRENT_SOURCE_DIR}/../common/ntv2rendertotexture.cpp
# ${CMAKE_CURRENT_SOURCE_DIR}/../common/ntv2rendertotexture.h
# ${CMAKE_CURRENT_SOURCE_DIR}/../common/ntv2texture.cpp
# ${CMAKE_CURRENT_SOURCE_DIR}/../common/ntv2texture.h
# ${CMAKE_CURRENT_SOURCE_DIR}/../common/oglview.cpp
# ${CMAKE_CURRENT_SOURCE_DIR}/../common/oglview.h
# ${CMAKE_CURRENT_SOURCE_DIR}/../common/opengl.h
# ${CMAKE_CURRENT_SOURCE_DIR}/../common/simplegpuvio.cpp
# ${CMAKE_CURRENT_SOURCE_DIR}/../common/simplegpuvio.h
)
set(NVIDIA_COMMONCUDA_SOURCES
${CMAKE_CURRENT_SOURCE_DIR}/../commonCUDA/assertion.h
# ${CMAKE_CURRENT_SOURCE_DIR}/../commonCUDA/assertion.h
${CMAKE_CURRENT_SOURCE_DIR}/../commonCUDA/cudaUtils.h
${CMAKE_CURRENT_SOURCE_DIR}/../commonCUDA/gpuvio.h
${CMAKE_CURRENT_SOURCE_DIR}/../commonCUDA/ntv2cudaArrayTransfer.h
# ${CMAKE_CURRENT_SOURCE_DIR}/../commonCUDA/gpuvio.h
# ${CMAKE_CURRENT_SOURCE_DIR}/../commonCUDA/ntv2cudaArrayTransfer.h
${CMAKE_CURRENT_SOURCE_DIR}/../commonCUDA/ntv2cudaArrayTransferNV.cpp
${CMAKE_CURRENT_SOURCE_DIR}/../commonCUDA/ntv2cudaArrayTransferNV.h
${CMAKE_CURRENT_SOURCE_DIR}/../commonCUDA/ntv2errorlist.cpp
${CMAKE_CURRENT_SOURCE_DIR}/../commonCUDA/ntv2errorlist.h
${CMAKE_CURRENT_SOURCE_DIR}/../commonCUDA/ntv2glTextureTransfer.h
${CMAKE_CURRENT_SOURCE_DIR}/../commonCUDA/ntv2glTextureTransferNV.cpp
${CMAKE_CURRENT_SOURCE_DIR}/../commonCUDA/ntv2glTextureTransferNV.h
# ${CMAKE_CURRENT_SOURCE_DIR}/../commonCUDA/ntv2glTextureTransfer.h
# ${CMAKE_CURRENT_SOURCE_DIR}/../commonCUDA/ntv2glTextureTransferNV.cpp
# ${CMAKE_CURRENT_SOURCE_DIR}/../commonCUDA/ntv2glTextureTransferNV.h
${CMAKE_CURRENT_SOURCE_DIR}/../commonCUDA/ntv2gpucircularbuffer.cpp
${CMAKE_CURRENT_SOURCE_DIR}/../commonCUDA/ntv2gpucircularbuffer.h
${CMAKE_CURRENT_SOURCE_DIR}/../commonCUDA/ntv2gpuTextureTransfer.h
# ${CMAKE_CURRENT_SOURCE_DIR}/../commonCUDA/ntv2gpuTextureTransfer.h
${CMAKE_CURRENT_SOURCE_DIR}/../commonCUDA/ntv2gpuTextureTransferNV.cpp
${CMAKE_CURRENT_SOURCE_DIR}/../commonCUDA/ntv2gpuTextureTransferNV.h
${CMAKE_CURRENT_SOURCE_DIR}/../commonCUDA/ntv2rendertotexture.cpp
Expand All @@ -52,34 +97,49 @@ set(NVIDIA_COMMONCUDA_SOURCES
${CMAKE_CURRENT_SOURCE_DIR}/../commonCUDA/ntv2texture.h
${CMAKE_CURRENT_SOURCE_DIR}/../commonCUDA/oglview.cpp
${CMAKE_CURRENT_SOURCE_DIR}/../commonCUDA/oglview.h
${CMAKE_CURRENT_SOURCE_DIR}/../commonCUDA/opengl.h
${CMAKE_CURRENT_SOURCE_DIR}/../commonCUDA/simplecudavio.cpp
${CMAKE_CURRENT_SOURCE_DIR}/../commonCUDA/simplecudavio.h
# ${CMAKE_CURRENT_SOURCE_DIR}/../commonCUDA/opengl.h
# ${CMAKE_CURRENT_SOURCE_DIR}/../commonCUDA/simplecudavio.cpp
# ${CMAKE_CURRENT_SOURCE_DIR}/../commonCUDA/simplecudavio.h
${CMAKE_CURRENT_SOURCE_DIR}/../commonCUDA/simplegpuvio.cpp
${CMAKE_CURRENT_SOURCE_DIR}/../commonCUDA/simplegpuvio.h
${CMAKE_CURRENT_SOURCE_DIR}/../commonCUDA/simpleoglvio.cpp
${CMAKE_CURRENT_SOURCE_DIR}/../commonCUDA/simpleoglvio.h)
if (CMAKE_SYSTEM_NAME STREQUAL "Windows")
elseif (CMAKE_SYSTEM_NAME STREQUAL "Darwin")
find_library(FOUNDATION_FRAMEWORK Foundation)
set(EXTRA_LIBRARIES ${FOUNDATION_FRAMEWORK})
elseif (CMAKE_SYSTEM_NAME STREQUAL "Linux")
set(EXTRA_LIBRARIES cuda cudart dl pthread rt)
endif()
# ${CMAKE_CURRENT_SOURCE_DIR}/../commonCUDA/simpleoglvio.cpp
# ${CMAKE_CURRENT_SOURCE_DIR}/../commonCUDA/simpleoglvio.h
)

set(CUDALOWLATENCYDEMO_TARGET_SOURCES
set(TARGET_SOURCES
${CUDALOWLATENCYDEMO_SOURCES}
${NVIDIA_COMMON_SOURCES}
${NVIDIA_COMMONCUDA_SOURCES})
${NVIDIA_COMMONCUDA_SOURCES}
${DEMO_APPS_HEADERS}
${DEMO_APPS_SOURCES})

# add_executable(cudalowlatencydemo ${CUDALOWLATENCYDEMO_TARGET_SOURCES})
# add_dependencies(cudalowlatencydemo ajantv2)
# target_include_directories(cudalowlatencydemo PUBLIC ${CUDALOWLATENCYDEMO_TARGET_INCLUDE_DIRS})
# target_link_libraries(cudalowlatencydemo PUBLIC ajantv2 ${EXTRA_LIBRARIES})
if (CMAKE_SYSTEM_NAME STREQUAL "Windows")
elseif (CMAKE_SYSTEM_NAME STREQUAL "Darwin")
find_library(FOUNDATION_FRAMEWORK Foundation)
set(TARGET_LINK_LIBS ${FOUNDATION_FRAMEWORK})
elseif (CMAKE_SYSTEM_NAME STREQUAL "Linux")
set(TARGET_LINK_LIBS X11 OpenGL::GL OpenGL::GLU GLEW::GLEW cuda cudart dl pthread rt)
# cuda_include_directories(${TARGET_INCLUDE_DIRS})
# cuda_compile(CUDA_OBJ kernel.cu)
add_executable(cudalowlatencydemo ${TARGET_SOURCES} kernel.cu)
add_dependencies(cudalowlatencydemo ${CUDA_OBJ} ajantv2)
target_compile_definitions(cudalowlatencydemo PUBLIC ${TARGET_COMPILE_DEFS})
target_include_directories(cudalowlatencydemo PUBLIC ${TARGET_INCLUDE_DIRS})
target_link_libraries(cudalowlatencydemo PUBLIC ajantv2 ${TARGET_LINK_LIBS})
# add_custom_command(
# TARGET cudalowlatencydemo
# PRE_BUILD
# COMMAND ${CUDA_HOST_COMPILER} -c -I${AJA_APPS_ROOT}/crossplatform/demoapps/NVIDIA/common -I${AJA_APPS_ROOT}/crossplatform/demoapps/NVIDIA/commonCUDA -I${AJA_APPS_ROOT}/crossplatform/demoapps -I${AJA_LIBRARIES_ROOT} -I${AJA_LIB_NTV2_ROOT}/includes -I${CUDA_INCLUDE_DIRS} -I${OPENGL_INCLUDE_DIRS} -I${GLEW_INCLUDE_DIRS} -I${CMAKE_CURRENT_SOURCE_DIR}/../commonCUDA kernel.cu
# DEPENDS kernel.cu
# WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
# VERBATIM)
endif()

if (AJA_INSTALL_SOURCES)
install(FILES ${CUDALOWLATENCYDEMO_SOURCES} DESTINATION ${CMAKE_INSTALL_PREFIX}/ajaapps/crossplatform/demoapps/NVIDIA/cudalowlatencydemo)
install(FILES ${CUDALOWLATENCYDEMO_BUILD_FILES} DESTINATION ${CMAKE_INSTALL_PREFIX}/ajaapps/crossplatform/demoapps/NVIDIA/cudalowlatencydemo)
install(FILES ${NVIDIA_COMMON_SOURCES} DESTINATION ${CMAKE_INSTALL_PREFIX}/ajaapps/crossplatform/demoapps/NVIDIA/common)
install(FILES ${NVIDIA_COMMONCUDA_SOURCES} DESTINATION ${CMAKE_INSTALL_PREFIX}/ajaapps/crossplatform/demoapps/NVIDIA/commonCUDA)
endif()

message("added cudalowlatencydemo")
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
project(dvplowlatencydemo)

message("added dvplowlatencydemo")
if (NOT CMAKE_SYSTEM_NAME STREQUAL "Linux")
message("skipping dvplowlatencydemo (requires Linux)")
return()
endif()

set(DVPLOWLATENCYDEMO_TARGET_INCLUDE_DIRS
set(TARGET_INCLUDE_DIRS
${CMAKE_CURRENT_SOURCE_DIR}/../
${AJA_LIBRARIES_ROOT}
${AJA_LIB_NTV2_ROOT}/includes)
Expand Down Expand Up @@ -63,24 +66,26 @@ set(NVIDIA_COMMONCUDA_SOURCES
if (CMAKE_SYSTEM_NAME STREQUAL "Windows")
elseif (CMAKE_SYSTEM_NAME STREQUAL "Darwin")
find_library(FOUNDATION_FRAMEWORK Foundation)
set(EXTRA_LIBRARIES ${FOUNDATION_FRAMEWORK})
set(TARGET_LINK_LIBS ${FOUNDATION_FRAMEWORK})
elseif (CMAKE_SYSTEM_NAME STREQUAL "Linux")
set(EXTRA_LIBRARIES cuda cudart dl pthread rt)
set(TARGET_LINK_LIBS cuda cudart dl pthread rt)
endif()

set(DVPLOWLATENCYDEMO_TARGET_SOURCES
set(TARGET_SOURCES
${DVPLOWLATENCYDEMO_SOURCES}
${NVIDIA_COMMON_SOURCES}
${NVIDIA_COMMONCUDA_SOURCES})

# add_executable(dvplowlatencydemo ${DVPLOWLATENCYDEMO_TARGET_SOURCES})
# add_executable(dvplowlatencydemo ${TARGET_SOURCES})
# add_dependencies(dvplowlatencydemo ajantv2)
# target_include_directories(dvplowlatencydemo PUBLIC ${DVPLOWLATENCYDEMO_TARGET_INCLUDE_DIRS})
# target_link_libraries(dvplowlatencydemo PUBLIC ajantv2 ${EXTRA_LIBRARIES})
# target_include_directories(dvplowlatencydemo PUBLIC ${TARGET_INCLUDE_DIRS})
# target_link_libraries(dvplowlatencydemo PUBLIC ajantv2 ${TARGET_LINK_LIBS})

if (AJA_INSTALL_SOURCES)
install(FILES ${DVPLOWLATENCYDEMO_SOURCES} DESTINATION ${CMAKE_INSTALL_PREFIX}/ajaapps/crossplatform/demoapps/NVIDIA/dvplowlatencydemo)
install(FILES ${DVPLOWLATENCYDEMO_BUILD_FILES} DESTINATION ${CMAKE_INSTALL_PREFIX}/ajaapps/crossplatform/demoapps/NVIDIA/dvplowlatencydemo)
install(FILES ${NVIDIA_COMMON_SOURCES} DESTINATION ${CMAKE_INSTALL_PREFIX}/ajaapps/crossplatform/demoapps/NVIDIA/common)
install(FILES ${NVIDIA_COMMONCUDA_SOURCES} DESTINATION ${CMAKE_INSTALL_PREFIX}/ajaapps/crossplatform/demoapps/NVIDIA/commonCUDA)
endif()

message("added dvplowlatencydemo")
14 changes: 7 additions & 7 deletions ajaapps/crossplatform/demoapps/ntv2burn/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ project(ntv2burn)

message("added ntv2burn")

set(NTV2BURN_TARGET_INCLUDE_DIRS
set(TARGET_INCLUDE_DIRS
${AJA_LIBRARIES_ROOT}
${AJA_APPS_ROOT}/crossplatform/demoapps
${AJA_LIB_NTV2_ROOT}/includes
Expand All @@ -24,21 +24,21 @@ if (CMAKE_SYSTEM_NAME STREQUAL "Windows")
# noop
elseif (CMAKE_SYSTEM_NAME STREQUAL "Darwin")
find_library(FOUNDATION_FRAMEWORK Foundation)
set(EXTRA_LIBRARIES ${FOUNDATION_FRAMEWORK})
set(TARGET_LINK_LIBS ${FOUNDATION_FRAMEWORK})
elseif (CMAKE_SYSTEM_NAME STREQUAL "Linux")
set(EXTRA_LIBRARIES dl pthread rt)
set(TARGET_LINK_LIBS dl pthread rt)
endif()

set(NTV2BURN_TARGET_SOURCES
set(TARGET_SOURCES
${NTV2BURN_SOURCES}
${NTV2BURN_HEADERS}
${DEMO_APPS_SOURCES}
${DEMO_APPS_HEADERS})

add_executable(ntv2burn ${NTV2BURN_TARGET_SOURCES})
add_executable(ntv2burn ${TARGET_SOURCES})
add_dependencies(ntv2burn ajantv2)
target_include_directories(ntv2burn PUBLIC ${NTV2BURN_TARGET_INCLUDE_DIRS})
target_link_libraries(ntv2burn PUBLIC ajantv2 ${EXTRA_LIBRARIES})
target_include_directories(ntv2burn PUBLIC ${TARGET_INCLUDE_DIRS})
target_link_libraries(ntv2burn PUBLIC ajantv2 ${TARGET_LINK_LIBS})

if (AJA_INSTALL_SOURCES)
install(FILES ${DEMO_APPS_HEADERS} DESTINATION ${CMAKE_INSTALL_PREFIX}/ajaapps/crossplatform/demoapps)
Expand Down
14 changes: 7 additions & 7 deletions ajaapps/crossplatform/demoapps/ntv2burn4kquadrant/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ project(ntv2burn4kquadrant)

message("added ntv2burn4kquadrant")

set(NTV2BURN4KQUADRANT_TARGET_INCLUDE_DIRS
set(TARGET_INCLUDE_DIRS
${AJA_LIBRARIES_ROOT}
${AJA_APPS_ROOT}/crossplatform/demoapps
${AJA_LIB_NTV2_ROOT}/includes
Expand All @@ -24,21 +24,21 @@ if (CMAKE_SYSTEM_NAME STREQUAL "Windows")
# noop
elseif (CMAKE_SYSTEM_NAME STREQUAL "Darwin")
find_library(FOUNDATION_FRAMEWORK Foundation)
set(EXTRA_LIBRARIES ${FOUNDATION_FRAMEWORK})
set(TARGET_LINK_LIBS ${FOUNDATION_FRAMEWORK})
elseif (CMAKE_SYSTEM_NAME STREQUAL "Linux")
set(EXTRA_LIBRARIES dl pthread rt)
set(TARGET_LINK_LIBS dl pthread rt)
endif()

set(NTV2BURN4KQUADRANT_TARGET_SOURCES
set(TARGET_SOURCES
${NTV2BURN4KQUADRANT_SOURCES}
${NTV2BURN4KQUADRANT_HEADERS}
${DEMO_APPS_SOURCES}
${DEMO_APPS_HEADERS})

add_executable(ntv2burn4kquadrant ${NTV2BURN4KQUADRANT_TARGET_SOURCES})
add_executable(ntv2burn4kquadrant ${TARGET_SOURCES})
add_dependencies(ntv2burn4kquadrant ajantv2)
target_include_directories(ntv2burn4kquadrant PUBLIC ${NTV2BURN4KQUADRANT_TARGET_INCLUDE_DIRS})
target_link_libraries(ntv2burn4kquadrant PUBLIC ajantv2 ${EXTRA_LIBRARIES})
target_include_directories(ntv2burn4kquadrant PUBLIC ${TARGET_INCLUDE_DIRS})
target_link_libraries(ntv2burn4kquadrant PUBLIC ajantv2 ${TARGET_LINK_LIBS})

if (AJA_INSTALL_SOURCES)
install(FILES ${DEMO_APPS_HEADERS} DESTINATION ${CMAKE_INSTALL_PREFIX}/ajaapps/crossplatform/demoapps)
Expand Down
14 changes: 7 additions & 7 deletions ajaapps/crossplatform/demoapps/ntv2capture/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ project(ntv2capture)

message("added ntv2capture")

set(NTV2CAPTURE_TARGET_INCLUDE_DIRS
set(TARGET_INCLUDE_DIRS
${AJA_LIBRARIES_ROOT}
${AJA_APPS_ROOT}/crossplatform/demoapps
${AJA_LIB_NTV2_ROOT}/includes
Expand All @@ -24,21 +24,21 @@ if (CMAKE_SYSTEM_NAME STREQUAL "Windows")
# noop
elseif (CMAKE_SYSTEM_NAME STREQUAL "Darwin")
find_library(FOUNDATION_FRAMEWORK Foundation)
set(EXTRA_LIBRARIES ${FOUNDATION_FRAMEWORK})
set(TARGET_LINK_LIBS ${FOUNDATION_FRAMEWORK})
elseif (CMAKE_SYSTEM_NAME STREQUAL "Linux")
set(EXTRA_LIBRARIES dl pthread rt)
set(TARGET_LINK_LIBS dl pthread rt)
endif()

set(NTV2CAPTURE_TARGET_SOURCES
set(TARGET_SOURCES
${NTV2CAPTURE_SOURCES}
${NTV2CAPTURE_HEADERS}
${DEMO_APPS_SOURCES}
${DEMO_APPS_HEADERS})

add_executable(ntv2capture ${NTV2CAPTURE_TARGET_SOURCES})
add_executable(ntv2capture ${TARGET_SOURCES})
add_dependencies(ntv2capture ajantv2)
target_include_directories(ntv2capture PUBLIC ${NTV2CAPTURE_TARGET_INCLUDE_DIRS})
target_link_libraries(ntv2capture PUBLIC ajantv2 ${EXTRA_LIBRARIES})
target_include_directories(ntv2capture PUBLIC ${TARGET_INCLUDE_DIRS})
target_link_libraries(ntv2capture PUBLIC ajantv2 ${TARGET_LINK_LIBS})

if (AJA_INSTALL_SOURCES)
install(FILES ${DEMO_APPS_HEADERS} DESTINATION ${CMAKE_INSTALL_PREFIX}/ajaapps/crossplatform/demoapps)
Expand Down
Loading

0 comments on commit 6c44a94

Please sign in to comment.