2012-10-09 07:02:04 +04:00
|
|
|
# FreeRDP: A Remote Desktop Protocol Implementation
|
2012-08-14 07:19:51 +04:00
|
|
|
# libfreerdp cmake build script
|
|
|
|
#
|
|
|
|
# Copyright 2012 Marc-Andre Moreau <marcandre.moreau@gmail.com>
|
|
|
|
#
|
|
|
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
# you may not use this file except in compliance with the License.
|
|
|
|
# You may obtain a copy of the License at
|
|
|
|
#
|
|
|
|
# http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
#
|
|
|
|
# Unless required by applicable law or agreed to in writing, software
|
|
|
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
# See the License for the specific language governing permissions and
|
|
|
|
# limitations under the License.
|
|
|
|
|
2012-10-05 00:54:16 +04:00
|
|
|
set(MODULE_NAME "freerdp")
|
|
|
|
set(MODULE_PREFIX "FREERDP")
|
|
|
|
|
2019-08-14 17:39:27 +03:00
|
|
|
# CMake modules includes
|
|
|
|
include(FindCairo)
|
|
|
|
|
2013-05-16 22:45:49 +04:00
|
|
|
# Create imported targets for Intel IPP libraries
|
|
|
|
|
|
|
|
if(IPP_FOUND)
|
2022-07-29 13:07:25 +03:00
|
|
|
foreach(ipp_lib ${IPP_LIBRARIES})
|
2020-04-13 10:41:55 +03:00
|
|
|
add_library("${ipp_lib}_imported" STATIC IMPORTED)
|
|
|
|
set_property(TARGET "${ipp_lib}_imported" PROPERTY IMPORTED_LOCATION "${IPP_LIBRARY_DIRS}/${ipp_lib}")
|
|
|
|
endforeach()
|
2013-05-16 22:45:49 +04:00
|
|
|
endif()
|
|
|
|
|
2014-09-12 02:19:53 +04:00
|
|
|
set(LIBFREERDP_DIR ${CMAKE_CURRENT_SOURCE_DIR})
|
|
|
|
set(LIBFREERDP_SRCS "")
|
|
|
|
set(LIBFREERDP_LIBS "")
|
|
|
|
set(LIBFREERDP_INCLUDES "")
|
|
|
|
set(LIBFREERDP_DEFINITIONS "")
|
|
|
|
|
|
|
|
macro (freerdp_module_add)
|
2020-04-13 10:41:55 +03:00
|
|
|
file (RELATIVE_PATH _relPath "${LIBFREERDP_DIR}" "${CMAKE_CURRENT_SOURCE_DIR}")
|
|
|
|
foreach (_src ${ARGN})
|
|
|
|
if (_relPath)
|
|
|
|
list (APPEND LIBFREERDP_SRCS "${_relPath}/${_src}")
|
|
|
|
else()
|
|
|
|
list (APPEND LIBFREERDP_SRCS "${_src}")
|
|
|
|
endif()
|
|
|
|
endforeach()
|
|
|
|
if (_relPath)
|
|
|
|
set (LIBFREERDP_SRCS ${LIBFREERDP_SRCS} PARENT_SCOPE)
|
|
|
|
endif()
|
2014-09-12 02:19:53 +04:00
|
|
|
endmacro()
|
|
|
|
|
|
|
|
macro (freerdp_include_directory_add)
|
2020-04-13 10:41:55 +03:00
|
|
|
file (RELATIVE_PATH _relPath "${LIBFREERDP_DIR}" "${CMAKE_CURRENT_SOURCE_DIR}")
|
|
|
|
foreach (_inc ${ARGN})
|
|
|
|
if (IS_ABSOLUTE ${_inc})
|
|
|
|
list (APPEND LIBFREERDP_INCLUDES "${_inc}")
|
|
|
|
else()
|
|
|
|
if (_relPath)
|
|
|
|
list (APPEND LIBFREERDP_INCLUDES "${_relPath}/${_inc}")
|
|
|
|
else()
|
|
|
|
list (APPEND LIBFREERDP_INCLUDES "${_inc}")
|
|
|
|
endif()
|
|
|
|
endif()
|
|
|
|
endforeach()
|
|
|
|
if (_relPath)
|
|
|
|
set (LIBFREERDP_INCLUDES ${LIBFREERDP_INCLUDES} PARENT_SCOPE)
|
|
|
|
endif()
|
2014-09-12 02:19:53 +04:00
|
|
|
endmacro()
|
|
|
|
|
2023-07-20 12:46:03 +03:00
|
|
|
macro (freerdp_library_add_public)
|
2023-12-13 22:49:31 +03:00
|
|
|
foreach (_lib ${ARGN})
|
|
|
|
list (APPEND LIBFREERDP_PUB_LIBS "${_lib}")
|
|
|
|
endforeach()
|
|
|
|
set (LIBFREERDP_PUB_LIBS ${LIBFREERDP_PUB_LIBS} PARENT_SCOPE)
|
2023-07-20 12:46:03 +03:00
|
|
|
endmacro()
|
|
|
|
|
2014-09-12 02:19:53 +04:00
|
|
|
macro (freerdp_library_add)
|
2023-12-13 22:49:31 +03:00
|
|
|
foreach (_lib ${ARGN})
|
|
|
|
list (APPEND LIBFREERDP_LIBS "${_lib}")
|
|
|
|
endforeach()
|
|
|
|
set (LIBFREERDP_LIBS ${LIBFREERDP_LIBS} PARENT_SCOPE)
|
2014-09-12 02:19:53 +04:00
|
|
|
endmacro()
|
|
|
|
|
|
|
|
macro (freerdp_definition_add)
|
2020-04-13 10:41:55 +03:00
|
|
|
foreach (_define ${ARGN})
|
|
|
|
list (APPEND LIBFREERDP_DEFINITIONS "${_define}")
|
|
|
|
endforeach()
|
|
|
|
set (LIBFREERDP_DEFINITIONS ${LIBFREERDP_DEFINITIONS} PARENT_SCOPE)
|
2014-09-12 02:19:53 +04:00
|
|
|
endmacro()
|
|
|
|
|
2019-05-06 14:18:31 +03:00
|
|
|
if (WITH_SWSCALE)
|
|
|
|
find_package(SWScale REQUIRED)
|
|
|
|
endif(WITH_SWSCALE)
|
|
|
|
if (WITH_CAIRO)
|
|
|
|
find_package(Cairo REQUIRED)
|
|
|
|
endif(WITH_CAIRO)
|
|
|
|
|
2019-10-23 17:13:25 +03:00
|
|
|
# Prefer SWScale over Cairo, both at the same time are not possible.
|
|
|
|
if (WITH_SWSCALE)
|
2019-05-06 14:18:31 +03:00
|
|
|
include_directories(${SWScale_INCLUDE_DIR})
|
|
|
|
freerdp_library_add(${SWScale_LIBRARY})
|
2022-10-19 18:01:35 +03:00
|
|
|
endif()
|
|
|
|
if (WITH_CAIRO)
|
2019-10-23 17:13:25 +03:00
|
|
|
include_directories(${CAIRO_INCLUDE_DIR})
|
|
|
|
freerdp_library_add(${CAIRO_LIBRARY})
|
2022-10-19 18:01:35 +03:00
|
|
|
endif()
|
|
|
|
if (NOT WITH_SWSCALE AND NOT WITH_CAIRO)
|
2020-04-13 10:41:55 +03:00
|
|
|
message(WARNING "-DWITH_SWSCALE=OFF and -DWITH_CAIRO=OFF, compiling without image scaling support!")
|
2019-10-23 17:13:25 +03:00
|
|
|
endif()
|
2019-05-06 14:18:31 +03:00
|
|
|
|
2012-10-05 00:54:16 +04:00
|
|
|
set(${MODULE_PREFIX}_SUBMODULES
|
2021-11-05 15:09:42 +03:00
|
|
|
emu
|
2020-04-13 10:41:55 +03:00
|
|
|
utils
|
|
|
|
common
|
|
|
|
gdi
|
|
|
|
cache
|
|
|
|
crypto
|
|
|
|
locale
|
|
|
|
core)
|
2012-10-04 03:29:28 +04:00
|
|
|
|
2012-10-05 03:15:44 +04:00
|
|
|
foreach(${MODULE_PREFIX}_SUBMODULE ${${MODULE_PREFIX}_SUBMODULES})
|
2020-04-13 10:41:55 +03:00
|
|
|
add_subdirectory(${${MODULE_PREFIX}_SUBMODULE})
|
2012-10-04 03:29:28 +04:00
|
|
|
endforeach()
|
2012-08-14 07:19:51 +04:00
|
|
|
|
2021-05-11 12:32:50 +03:00
|
|
|
if (NOT WITH_DSP_FFMPEG AND NOT WITH_FAAC)
|
|
|
|
message(WARNING "Compiling without WITH_DSP_FFMPEG and WITH_FAAC, AAC encoder support disabled")
|
|
|
|
endif ()
|
|
|
|
|
2014-09-12 02:19:53 +04:00
|
|
|
## cmake source properties are only seen by targets in the same CMakeLists.txt
|
|
|
|
## therefore primitives and codecs need to be defined here
|
|
|
|
|
|
|
|
# codec
|
|
|
|
set(CODEC_SRCS
|
2023-12-13 22:49:31 +03:00
|
|
|
codec/bulk.c
|
|
|
|
codec/bulk.h
|
2020-04-13 10:41:55 +03:00
|
|
|
codec/dsp.c
|
|
|
|
codec/color.c
|
|
|
|
codec/audio.c
|
|
|
|
codec/planar.c
|
|
|
|
codec/bitmap.c
|
|
|
|
codec/interleaved.c
|
|
|
|
codec/progressive.c
|
|
|
|
codec/rfx_bitstream.h
|
|
|
|
codec/rfx_constants.h
|
|
|
|
codec/rfx_decode.c
|
|
|
|
codec/rfx_decode.h
|
|
|
|
codec/rfx_differential.h
|
|
|
|
codec/rfx_dwt.c
|
|
|
|
codec/rfx_dwt.h
|
|
|
|
codec/rfx_encode.c
|
|
|
|
codec/rfx_encode.h
|
|
|
|
codec/rfx_quantization.c
|
|
|
|
codec/rfx_quantization.h
|
|
|
|
codec/rfx_rlgr.c
|
|
|
|
codec/rfx_rlgr.h
|
|
|
|
codec/rfx_types.h
|
|
|
|
codec/rfx.c
|
|
|
|
codec/region.c
|
|
|
|
codec/nsc.c
|
|
|
|
codec/nsc_encode.c
|
|
|
|
codec/nsc_encode.h
|
|
|
|
codec/nsc_types.h
|
|
|
|
codec/ncrush.c
|
|
|
|
codec/xcrush.c
|
|
|
|
codec/mppc.c
|
|
|
|
codec/zgfx.c
|
|
|
|
codec/clear.c
|
|
|
|
codec/jpeg.c
|
|
|
|
codec/h264.c
|
|
|
|
codec/yuv.c)
|
2014-09-12 02:19:53 +04:00
|
|
|
|
|
|
|
set(CODEC_SSE2_SRCS
|
2020-04-13 10:41:55 +03:00
|
|
|
codec/rfx_sse2.c
|
|
|
|
codec/rfx_sse2.h
|
|
|
|
codec/nsc_sse2.c
|
|
|
|
codec/nsc_sse2.h)
|
2014-09-12 02:19:53 +04:00
|
|
|
|
|
|
|
set(CODEC_NEON_SRCS
|
2020-04-13 10:41:55 +03:00
|
|
|
codec/rfx_neon.c
|
|
|
|
codec/rfx_neon.h)
|
2014-09-12 02:19:53 +04:00
|
|
|
|
|
|
|
if(WITH_SSE2)
|
2020-04-13 10:41:55 +03:00
|
|
|
set(CODEC_SRCS ${CODEC_SRCS} ${CODEC_SSE2_SRCS})
|
2014-09-12 02:19:53 +04:00
|
|
|
|
2020-04-13 10:41:55 +03:00
|
|
|
if(CMAKE_COMPILER_IS_GNUCC OR ${CMAKE_C_COMPILER_ID} STREQUAL "Clang")
|
|
|
|
set_source_files_properties(${CODEC_SSE2_SRCS} PROPERTIES COMPILE_FLAGS "-msse2" )
|
|
|
|
endif()
|
2014-09-12 02:19:53 +04:00
|
|
|
|
2020-04-13 10:41:55 +03:00
|
|
|
if(MSVC)
|
|
|
|
set_source_files_properties(${CODEC_SSE2_SRCS} PROPERTIES COMPILE_FLAGS "/arch:SSE2" )
|
|
|
|
endif()
|
2014-09-12 02:19:53 +04:00
|
|
|
endif()
|
|
|
|
|
2018-02-20 14:15:30 +03:00
|
|
|
if (WITH_DSP_FFMPEG)
|
2020-04-13 10:41:55 +03:00
|
|
|
set(CODEC_SRCS
|
|
|
|
${CODEC_SRCS}
|
|
|
|
codec/dsp_ffmpeg.c
|
|
|
|
codec/dsp_ffmpeg.h)
|
2023-12-13 22:49:31 +03:00
|
|
|
freerdp_include_directory_add(${FFMPEG_INCLUDE_DIRS})
|
|
|
|
freerdp_library_add(${FFMPEG_LIBRARIES})
|
2018-02-20 14:15:30 +03:00
|
|
|
endif (WITH_DSP_FFMPEG)
|
|
|
|
|
2018-11-13 16:04:43 +03:00
|
|
|
if (WITH_SOXR)
|
2020-04-13 10:41:55 +03:00
|
|
|
freerdp_library_add(${SOXR_LIBRARIES})
|
|
|
|
include_directories(${SOXR_INCLUDE_DIR})
|
2018-11-13 16:04:43 +03:00
|
|
|
endif(WITH_SOXR)
|
|
|
|
|
2018-02-20 14:15:30 +03:00
|
|
|
if(GSM_FOUND)
|
2020-04-13 10:41:55 +03:00
|
|
|
freerdp_library_add(${GSM_LIBRARIES})
|
|
|
|
include_directories(${GSM_INCLUDE_DIRS})
|
2018-02-20 14:15:30 +03:00
|
|
|
endif()
|
|
|
|
|
|
|
|
if(LAME_FOUND)
|
2020-04-13 10:41:55 +03:00
|
|
|
freerdp_library_add(${LAME_LIBRARIES})
|
|
|
|
include_directories(${LAME_INCLUDE_DIRS})
|
2018-02-20 14:15:30 +03:00
|
|
|
endif()
|
|
|
|
|
2023-11-20 11:20:41 +03:00
|
|
|
set(OPUS_DEFAULT OFF)
|
|
|
|
if (NOT WITH_DSP_FFMPEG)
|
2023-12-13 22:49:31 +03:00
|
|
|
find_package(Opus)
|
|
|
|
if (Opus_FOUND)
|
|
|
|
set(OPUS_DEFAULT ${OPUS_FOUND})
|
|
|
|
else()
|
|
|
|
find_package(PkgConfig)
|
|
|
|
if (PkgConfig_FOUND)
|
|
|
|
pkg_check_modules(OPUS opus)
|
|
|
|
set(OPUS_DEFAULT ${OPUS_FOUND})
|
|
|
|
endif()
|
|
|
|
endif()
|
2023-11-20 11:20:41 +03:00
|
|
|
endif()
|
|
|
|
|
|
|
|
option(WITH_OPUS "compile with opus codec support" ${OPUS_DEFAULT})
|
|
|
|
if (WITH_OPUS)
|
2023-12-13 22:49:31 +03:00
|
|
|
find_package(Opus)
|
|
|
|
if (Opus_FOUND)
|
|
|
|
freerdp_library_add(Opus::opus)
|
|
|
|
else()
|
|
|
|
find_package(PkgConfig REQUIRED)
|
|
|
|
pkg_check_modules(OPUS REQUIRED opus)
|
|
|
|
if(OPUS_FOUND)
|
|
|
|
freerdp_library_add(${OPUS_LIBRARIES})
|
|
|
|
include_directories(${OPUS_INCLUDE_DIRS})
|
|
|
|
link_directories(${OPUS_LIBRARY_DIRS})
|
|
|
|
endif()
|
2023-11-20 11:20:41 +03:00
|
|
|
endif()
|
2023-11-18 13:43:21 +03:00
|
|
|
endif()
|
|
|
|
|
2018-02-20 14:15:30 +03:00
|
|
|
if(FAAD2_FOUND)
|
2020-04-13 10:41:55 +03:00
|
|
|
freerdp_library_add(${FAAD2_LIBRARIES})
|
|
|
|
include_directories(${FAAD2_INCLUDE_DIRS})
|
2018-02-20 14:15:30 +03:00
|
|
|
endif()
|
|
|
|
|
|
|
|
if(FAAC_FOUND)
|
2020-04-13 10:41:55 +03:00
|
|
|
freerdp_library_add(${FAAC_LIBRARIES})
|
|
|
|
include_directories(${FAAC_INCLUDE_DIRS})
|
2018-02-20 14:15:30 +03:00
|
|
|
endif()
|
|
|
|
|
2023-10-20 13:40:57 +03:00
|
|
|
if (WITH_AAD)
|
2023-12-13 22:49:31 +03:00
|
|
|
if (NOT cJSON_FOUND)
|
|
|
|
find_package(PkgConfig REQUIRED)
|
2024-01-29 11:12:08 +03:00
|
|
|
pkg_check_modules(CJSON libcjson)
|
|
|
|
endif()
|
|
|
|
if (NOT CJSON_LIBRARIES OR NOT CJSON_INCLUDE_DIRS)
|
|
|
|
find_path(CJSON_INCLUDE_DIRS
|
|
|
|
NAMES cjson/cJSON.h
|
|
|
|
REQUIRED
|
|
|
|
)
|
|
|
|
find_library(CJSON_LIBRARIES
|
|
|
|
NAMES cjson
|
|
|
|
REQUIRED
|
|
|
|
)
|
2023-12-13 22:49:31 +03:00
|
|
|
endif()
|
2023-10-20 13:40:57 +03:00
|
|
|
|
2023-12-13 22:49:31 +03:00
|
|
|
freerdp_library_add(${CJSON_LIBRARIES})
|
2023-03-10 22:55:50 +03:00
|
|
|
include_directories(${CJSON_INCLUDE_DIRS})
|
|
|
|
endif()
|
|
|
|
|
2014-09-12 02:19:53 +04:00
|
|
|
if(WITH_NEON)
|
2021-07-07 09:58:02 +03:00
|
|
|
check_symbol_exists("_M_AMD64" "" MSVC_ARM64)
|
|
|
|
check_symbol_exists("__aarch64__" "" ARCH_ARM64)
|
|
|
|
|
|
|
|
if (NOT MSVC_ARM64 AND NOT ARCH_ARM64)
|
|
|
|
set_source_files_properties(${CODEC_NEON_SRCS} PROPERTIES COMPILE_FLAGS "-mfpu=neon" )
|
|
|
|
endif()
|
|
|
|
|
2020-04-13 10:41:55 +03:00
|
|
|
set(CODEC_SRCS ${CODEC_SRCS} ${CODEC_NEON_SRCS})
|
2014-09-12 02:19:53 +04:00
|
|
|
endif()
|
|
|
|
|
|
|
|
if(WITH_OPENH264)
|
2020-04-13 10:41:55 +03:00
|
|
|
set(CODEC_SRCS ${CODEC_SRCS} codec/h264_openh264.c)
|
|
|
|
freerdp_include_directory_add(${OPENH264_INCLUDE_DIR})
|
|
|
|
if (NOT WITH_OPENH264_LOADING)
|
|
|
|
freerdp_library_add(${OPENH264_LIBRARIES})
|
|
|
|
endif (NOT WITH_OPENH264_LOADING)
|
2014-09-12 02:19:53 +04:00
|
|
|
endif()
|
|
|
|
|
2022-07-05 18:30:35 +03:00
|
|
|
if(WITH_VIDEO_FFMPEG)
|
2020-04-13 10:41:55 +03:00
|
|
|
set(CODEC_SRCS ${CODEC_SRCS} codec/h264_ffmpeg.c)
|
|
|
|
freerdp_include_directory_add(${FFMPEG_INCLUDE_DIRS})
|
|
|
|
freerdp_library_add(${FFMPEG_LIBRARIES})
|
2014-09-12 02:19:53 +04:00
|
|
|
endif()
|
|
|
|
|
2017-06-14 17:04:54 +03:00
|
|
|
if(WIN32 AND WITH_MEDIA_FOUNDATION)
|
2020-04-13 10:41:55 +03:00
|
|
|
set(CODEC_SRCS ${CODEC_SRCS} codec/h264_mf.c)
|
2017-06-14 17:04:54 +03:00
|
|
|
endif()
|
|
|
|
|
2022-01-07 17:08:45 +03:00
|
|
|
if(ANDROID AND WITH_MEDIACODEC)
|
2022-01-26 11:53:26 +03:00
|
|
|
list(APPEND CODEC_SRCS codec/h264_mediacodec.c)
|
2022-02-24 12:55:45 +03:00
|
|
|
|
2023-12-13 22:49:31 +03:00
|
|
|
find_library(MEDIACODEC mediandk REQUIRED)
|
|
|
|
freerdp_library_add(${MEDIACODEC})
|
2022-01-07 17:08:45 +03:00
|
|
|
endif()
|
|
|
|
|
2014-09-12 02:19:53 +04:00
|
|
|
freerdp_module_add(${CODEC_SRCS})
|
|
|
|
|
|
|
|
if(BUILD_TESTING)
|
2020-04-13 10:41:55 +03:00
|
|
|
add_subdirectory(codec/test)
|
2014-09-12 02:19:53 +04:00
|
|
|
endif()
|
|
|
|
|
|
|
|
# /codec
|
|
|
|
|
|
|
|
# primitives
|
|
|
|
|
|
|
|
set(PRIMITIVES_SRCS
|
2020-04-13 10:41:55 +03:00
|
|
|
primitives/prim_add.c
|
|
|
|
primitives/prim_andor.c
|
|
|
|
primitives/prim_alphaComp.c
|
|
|
|
primitives/prim_colors.c
|
|
|
|
primitives/prim_copy.c
|
|
|
|
primitives/prim_set.c
|
|
|
|
primitives/prim_shift.c
|
|
|
|
primitives/prim_sign.c
|
|
|
|
primitives/prim_YUV.c
|
|
|
|
primitives/prim_YCoCg.c
|
|
|
|
primitives/primitives.c
|
|
|
|
primitives/prim_internal.h)
|
2014-09-12 02:19:53 +04:00
|
|
|
|
2022-12-09 16:05:00 +03:00
|
|
|
if (WITH_SSE2 OR WITH_NEON)
|
|
|
|
set(PRIMITIVES_SSE2_SRCS
|
|
|
|
primitives/prim_colors_opt.c
|
|
|
|
primitives/prim_set_opt.c)
|
|
|
|
|
|
|
|
set(PRIMITIVES_SSE3_SRCS
|
|
|
|
primitives/prim_add_opt.c
|
|
|
|
primitives/prim_alphaComp_opt.c
|
|
|
|
primitives/prim_andor_opt.c
|
|
|
|
primitives/prim_shift_opt.c)
|
|
|
|
|
|
|
|
set(PRIMITIVES_SSSE3_SRCS
|
|
|
|
primitives/prim_sign_opt.c
|
|
|
|
primitives/prim_YCoCg_opt.c)
|
|
|
|
|
|
|
|
if (WITH_SSE2)
|
|
|
|
set(PRIMITIVES_SSSE3_SRCS ${PRIMITIVES_SSSE3_SRCS}
|
|
|
|
primitives/prim_YUV_ssse3.c)
|
|
|
|
endif()
|
2018-01-25 11:43:48 +03:00
|
|
|
|
2022-12-09 16:05:00 +03:00
|
|
|
if (WITH_NEON)
|
|
|
|
set(PRIMITIVES_SSSE3_SRCS ${PRIMITIVES_SSSE3_SRCS}
|
|
|
|
primitives/prim_YUV_neon.c)
|
|
|
|
endif()
|
2018-01-25 11:43:48 +03:00
|
|
|
endif()
|
2017-12-25 00:58:07 +03:00
|
|
|
|
2018-01-29 18:20:59 +03:00
|
|
|
if (WITH_OPENCL)
|
2020-04-13 10:41:55 +03:00
|
|
|
set(PRIMITIVES_OPENCL_SRCS primitives/prim_YUV_opencl.c)
|
2018-01-29 18:20:59 +03:00
|
|
|
|
2019-11-07 17:19:49 +03:00
|
|
|
freerdp_include_directory_add(${OpenCL_INCLUDE_DIRS})
|
|
|
|
freerdp_library_add(OpenCL::OpenCL)
|
2018-01-29 18:20:59 +03:00
|
|
|
|
|
|
|
endif()
|
|
|
|
|
2017-12-25 00:58:07 +03:00
|
|
|
set(PRIMITIVES_OPT_SRCS
|
2020-04-13 10:41:55 +03:00
|
|
|
${PRIMITIVES_SSE2_SRCS}
|
|
|
|
${PRIMITIVES_SSE3_SRCS}
|
|
|
|
${PRIMITIVES_SSSE3_SRCS}
|
|
|
|
${PRIMITIVES_OPENCL_SRCS})
|
2014-09-12 02:19:53 +04:00
|
|
|
|
|
|
|
### IPP Variable debugging
|
|
|
|
if(WITH_IPP)
|
2022-05-03 21:46:15 +03:00
|
|
|
if(CMAKE_COMPILER_IS_GNUCC OR ${CMAKE_C_COMPILER_ID} STREQUAL "Clang")
|
2020-04-13 10:41:55 +03:00
|
|
|
foreach(INCLDIR ${IPP_INCLUDE_DIRS})
|
|
|
|
set(OPTIMIZATION "${OPTIMIZATION} -I${INCLDIR}")
|
|
|
|
endforeach(INCLDIR)
|
|
|
|
endif()
|
2014-09-12 02:19:53 +04:00
|
|
|
endif()
|
|
|
|
|
|
|
|
if(WITH_SSE2)
|
2020-04-13 10:41:55 +03:00
|
|
|
if(CMAKE_COMPILER_IS_GNUCC OR ${CMAKE_C_COMPILER_ID} STREQUAL "Clang")
|
|
|
|
set_source_files_properties(${PRIMITIVES_SSE2_SRCS}
|
|
|
|
PROPERTIES COMPILE_FLAGS "${OPTIMIZATION} -msse2")
|
|
|
|
set_source_files_properties(${PRIMITIVES_SSE3_SRCS}
|
|
|
|
PROPERTIES COMPILE_FLAGS "${OPTIMIZATION} -msse3")
|
|
|
|
set_source_files_properties(${PRIMITIVES_SSSE3_SRCS}
|
|
|
|
PROPERTIES COMPILE_FLAGS "${OPTIMIZATION} -mssse3")
|
|
|
|
endif()
|
|
|
|
|
|
|
|
if(MSVC)
|
|
|
|
set_source_files_properties(${PRIMITIVES_OPT_SRCS}
|
|
|
|
PROPERTIES COMPILE_FLAGS "${OPTIMIZATION} /arch:SSE2")
|
|
|
|
endif()
|
2014-09-12 02:19:53 +04:00
|
|
|
elseif(WITH_NEON)
|
2022-05-03 21:46:15 +03:00
|
|
|
if(CMAKE_COMPILER_IS_GNUCC OR ${CMAKE_C_COMPILER_ID} STREQUAL "Clang")
|
|
|
|
if (NOT MSVC_ARM64 AND NOT ARCH_ARM64)
|
|
|
|
set_source_files_properties(${PRIMITIVES_OPT_SRCS}
|
|
|
|
PROPERTIES COMPILE_FLAGS "${OPTIMIZATION} -mfpu=neon")
|
|
|
|
endif()
|
2020-04-13 10:41:55 +03:00
|
|
|
endif()
|
|
|
|
# TODO: Add MSVC equivalent
|
2014-09-12 02:19:53 +04:00
|
|
|
endif()
|
|
|
|
|
|
|
|
set(PRIMITIVES_SRCS ${PRIMITIVES_SRCS} ${PRIMITIVES_OPT_SRCS})
|
|
|
|
|
|
|
|
freerdp_module_add(${PRIMITIVES_SRCS})
|
|
|
|
|
|
|
|
if(IPP_FOUND)
|
2020-04-13 10:41:55 +03:00
|
|
|
freerdp_include_directory_add(${IPP_INCLUDE_DIRS})
|
|
|
|
foreach(ipp_lib ${IPP_LIBRARIES})
|
|
|
|
freerdp_library_add("${ipp_lib}_imported")
|
|
|
|
endforeach()
|
2014-09-12 02:19:53 +04:00
|
|
|
endif()
|
|
|
|
|
|
|
|
if(BUILD_TESTING AND NOT WIN32 AND NOT APPLE)
|
2020-04-13 10:41:55 +03:00
|
|
|
add_subdirectory(primitives/test)
|
2014-09-12 02:19:53 +04:00
|
|
|
endif()
|
|
|
|
|
2012-10-04 03:29:28 +04:00
|
|
|
|
2014-09-12 02:19:53 +04:00
|
|
|
# /primitives
|
2012-08-15 03:55:48 +04:00
|
|
|
|
2023-08-31 11:53:49 +03:00
|
|
|
list(APPEND LIBFREERDP_PUB_LIBS winpr)
|
|
|
|
|
2014-09-12 02:19:53 +04:00
|
|
|
list(REMOVE_DUPLICATES LIBFREERDP_DEFINITIONS)
|
|
|
|
list(REMOVE_DUPLICATES LIBFREERDP_LIBS)
|
2023-07-20 12:46:03 +03:00
|
|
|
list(REMOVE_DUPLICATES LIBFREERDP_PUB_LIBS)
|
2014-09-12 02:19:53 +04:00
|
|
|
list(REMOVE_DUPLICATES LIBFREERDP_INCLUDES)
|
|
|
|
include_directories(${LIBFREERDP_INCLUDES})
|
2014-10-03 17:17:40 +04:00
|
|
|
|
|
|
|
# On windows create dll version information.
|
|
|
|
# Vendor, product and year are already set in top level CMakeLists.txt
|
|
|
|
if (WIN32)
|
|
|
|
set (RC_VERSION_MAJOR ${FREERDP_VERSION_MAJOR})
|
|
|
|
set (RC_VERSION_MINOR ${FREERDP_VERSION_MINOR})
|
|
|
|
set (RC_VERSION_BUILD ${FREERDP_VERSION_REVISION})
|
2021-06-10 10:54:35 +03:00
|
|
|
set (RC_VERSION_FILE "${CMAKE_SHARED_LIBRARY_PREFIX}${MODULE_NAME}${FREERDP_API_VERSION}${CMAKE_SHARED_LIBRARY_SUFFIX}" )
|
2014-10-03 17:17:40 +04:00
|
|
|
|
|
|
|
configure_file(
|
2021-06-21 12:39:34 +03:00
|
|
|
${PROJECT_SOURCE_DIR}/cmake/WindowsDLLVersion.rc.in
|
2014-10-03 17:17:40 +04:00
|
|
|
${CMAKE_CURRENT_BINARY_DIR}/version.rc
|
|
|
|
@ONLY)
|
|
|
|
|
|
|
|
set (LIBFREERDP_SRCS ${LIBFREERDP_SRCS} ${CMAKE_CURRENT_BINARY_DIR}/version.rc)
|
|
|
|
endif()
|
|
|
|
|
2014-09-12 02:19:53 +04:00
|
|
|
add_library(${MODULE_NAME} ${LIBFREERDP_SRCS})
|
|
|
|
add_definitions(${LIBFREERDP_DEFINITIONS})
|
2012-08-14 08:31:06 +04:00
|
|
|
|
2014-09-12 02:19:53 +04:00
|
|
|
set_target_properties(${MODULE_NAME} PROPERTIES LINKER_LANGUAGE C)
|
2016-12-21 17:25:03 +03:00
|
|
|
set_target_properties(${MODULE_NAME} PROPERTIES OUTPUT_NAME ${MODULE_NAME}${FREERDP_VERSION_MAJOR})
|
2014-02-11 06:07:05 +04:00
|
|
|
|
2014-09-12 02:19:53 +04:00
|
|
|
if (WITH_LIBRARY_VERSIONING)
|
2015-08-19 10:02:20 +03:00
|
|
|
set_target_properties(${MODULE_NAME} PROPERTIES VERSION ${FREERDP_VERSION} SOVERSION ${FREERDP_API_VERSION})
|
2014-09-12 02:19:53 +04:00
|
|
|
endif()
|
2014-09-15 12:30:07 +04:00
|
|
|
|
2023-08-01 10:07:39 +03:00
|
|
|
target_include_directories(${MODULE_NAME} INTERFACE $<INSTALL_INTERFACE:include>)
|
2023-07-20 12:46:03 +03:00
|
|
|
target_link_libraries(${MODULE_NAME} PRIVATE ${LIBFREERDP_LIBS})
|
2023-08-31 11:53:49 +03:00
|
|
|
target_link_libraries(${MODULE_NAME} PUBLIC ${LIBFREERDP_PUB_LIBS})
|
2021-05-24 07:51:42 +03:00
|
|
|
install(TARGETS ${MODULE_NAME} COMPONENT libraries EXPORT FreeRDPTargets
|
|
|
|
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
|
|
|
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
|
|
|
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
|
|
|
|
|
2015-07-31 12:35:54 +03:00
|
|
|
if (WITH_DEBUG_SYMBOLS AND MSVC AND BUILD_SHARED_LIBS)
|
2017-01-31 15:32:51 +03:00
|
|
|
get_target_property(OUTPUT_FILENAME ${MODULE_NAME} OUTPUT_NAME)
|
|
|
|
install(FILES ${CMAKE_PDB_BINARY_DIR}/${OUTPUT_FILENAME}.pdb DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT symbols)
|
2015-07-31 12:35:54 +03:00
|
|
|
endif()
|
|
|
|
|
2014-09-12 02:19:53 +04:00
|
|
|
set_property(TARGET ${MODULE_NAME} PROPERTY FOLDER "FreeRDP/libfreerdp")
|
2016-01-08 16:07:35 +03:00
|
|
|
|
2023-10-09 11:00:58 +03:00
|
|
|
include(pkg-config-install-prefix)
|
2024-03-14 11:44:37 +03:00
|
|
|
set(FREERDP_REQUIRES_PRIVATE "")
|
|
|
|
if(cJSON_FOUND)
|
|
|
|
string(APPEND FREERDP_REQUIRES_PRIVATE " libcjson")
|
2024-03-14 12:21:38 +03:00
|
|
|
list(APPEND FREERDP_PC_PRIVATE_LIBS "-lcjson")
|
2024-03-14 11:44:37 +03:00
|
|
|
endif()
|
|
|
|
if(WITH_SMARTCARD_EMULATE)
|
|
|
|
string(APPEND FREERDP_REQUIRES_PRIVATE " zlib")
|
2024-03-14 12:21:38 +03:00
|
|
|
list(APPEND FREERDP_PC_PRIVATE_LIBS "-lz")
|
2024-03-14 11:44:37 +03:00
|
|
|
endif()
|
2024-03-14 12:21:38 +03:00
|
|
|
list(JOIN FREERDP_PC_PRIVATE_LIBS " " FREERDP_PC_PRIVATE_LIBS)
|
2016-01-08 16:07:35 +03:00
|
|
|
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/freerdp.pc.in ${CMAKE_CURRENT_BINARY_DIR}/freerdp${FREERDP_VERSION_MAJOR}.pc @ONLY)
|
2024-01-02 21:51:33 +03:00
|
|
|
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/freerdp${FREERDP_VERSION_MAJOR}.pc DESTINATION ${PKG_CONFIG_PC_INSTALL_DIR})
|
2016-01-08 16:07:35 +03:00
|
|
|
|
|
|
|
## cmake project
|
2021-06-10 10:54:35 +03:00
|
|
|
export(PACKAGE freerdp)
|
2016-01-08 16:07:35 +03:00
|
|
|
|
2021-06-10 10:54:35 +03:00
|
|
|
SetFreeRDPCMakeInstallDir(FREERDP_CMAKE_INSTALL_DIR "FreeRDP${FREERDP_VERSION_MAJOR}")
|
2016-01-08 16:07:35 +03:00
|
|
|
|
2021-06-10 10:54:35 +03:00
|
|
|
configure_package_config_file(FreeRDPConfig.cmake.in ${CMAKE_CURRENT_BINARY_DIR}/FreeRDPConfig.cmake
|
|
|
|
INSTALL_DESTINATION ${FREERDP_CMAKE_INSTALL_DIR}
|
2023-04-22 12:07:59 +03:00
|
|
|
PATH_VARS FREERDP_INCLUDE_DIR FREERDP_PLUGIN_PATH)
|
2016-01-08 16:07:35 +03:00
|
|
|
|
2021-06-10 10:54:35 +03:00
|
|
|
write_basic_package_version_file(${CMAKE_CURRENT_BINARY_DIR}/FreeRDPConfigVersion.cmake
|
|
|
|
VERSION ${FREERDP_VERSION} COMPATIBILITY SameMajorVersion)
|
2016-01-08 16:07:35 +03:00
|
|
|
|
2021-06-10 10:54:35 +03:00
|
|
|
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/FreeRDPConfig.cmake ${CMAKE_CURRENT_BINARY_DIR}/FreeRDPConfigVersion.cmake
|
|
|
|
DESTINATION ${FREERDP_CMAKE_INSTALL_DIR})
|
2016-01-08 16:07:35 +03:00
|
|
|
|
2021-06-10 10:54:35 +03:00
|
|
|
install(EXPORT FreeRDPTargets DESTINATION ${FREERDP_CMAKE_INSTALL_DIR})
|