2023-12-21 19:24:43 +03:00
|
|
|
cmake_minimum_required(VERSION 3.13)
|
2013-08-08 23:49:24 +04:00
|
|
|
|
2023-12-21 19:24:43 +03:00
|
|
|
if (NOT FREERDP_DEFAULT_PROJECT_VERSION)
|
|
|
|
set(FREERDP_DEFAULT_PROJECT_VERSION "1.0.0.0")
|
|
|
|
endif()
|
|
|
|
|
|
|
|
project(MacFreeRDP-library
|
|
|
|
VERSION ${FREERDP_DEFAULT_PROJECT_VERSION}
|
|
|
|
)
|
2012-10-19 07:10:45 +04:00
|
|
|
|
2023-12-21 19:24:43 +03:00
|
|
|
message("project ${PROJECT_NAME} is using version ${PROJECT_VERSION}")
|
2014-12-12 21:25:43 +03:00
|
|
|
|
2021-06-10 10:54:35 +03:00
|
|
|
cmake_policy(SET CMP0026 OLD)
|
|
|
|
cmake_policy(SET CMP0045 OLD)
|
2014-12-12 21:25:43 +03:00
|
|
|
|
2023-11-07 17:41:01 +03:00
|
|
|
list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/../../cmake/)
|
2023-12-21 11:27:19 +03:00
|
|
|
include(CommonConfigOptions)
|
2023-11-07 17:41:01 +03:00
|
|
|
|
2023-12-01 12:51:28 +03:00
|
|
|
find_library(FOUNDATION_LIBRARY Foundation REQUIRED)
|
|
|
|
find_library(COCOA_LIBRARY Cocoa REQUIRED)
|
|
|
|
find_library(APPKIT_LIBRARY AppKit REQUIRED)
|
|
|
|
find_library(IOKIT_LIBRARY IOKit REQUIRED)
|
|
|
|
find_library(COREGRAPHICS_LIBRARY CoreGraphics REQUIRED)
|
2013-03-11 08:35:15 +04:00
|
|
|
|
2014-03-04 23:01:01 +04:00
|
|
|
set(EXTRA_LIBS ${COCOA_LIBRARY} ${FOUNDATION_LIBRARY} ${APPKIT_LIBRARY} ${IOKIT_LIBRARY})
|
2013-05-31 22:57:48 +04:00
|
|
|
|
2023-12-01 12:51:28 +03:00
|
|
|
set(XIBS
|
2018-11-29 20:13:31 +03:00
|
|
|
CertificateDialog.xib
|
|
|
|
PasswordDialog.xib)
|
2013-08-08 23:49:24 +04:00
|
|
|
|
2023-12-01 12:51:28 +03:00
|
|
|
set(SOURCES "")
|
2013-08-08 23:49:24 +04:00
|
|
|
|
2023-12-01 12:51:28 +03:00
|
|
|
set(OBJECTIVE_SOURCES
|
2013-08-08 23:49:24 +04:00
|
|
|
main.m
|
|
|
|
mf_client.m
|
|
|
|
MRDPCursor.m
|
|
|
|
MRDPView.m
|
2014-03-04 23:01:01 +04:00
|
|
|
Keyboard.m
|
2014-11-06 01:14:32 +03:00
|
|
|
Clipboard.m
|
2018-11-29 19:23:09 +03:00
|
|
|
CertificateDialog.m
|
2013-08-08 23:49:24 +04:00
|
|
|
PasswordDialog.m)
|
2013-04-12 02:09:28 +04:00
|
|
|
|
2023-12-01 12:51:28 +03:00
|
|
|
list(APPEND SOURCES ${OBJECTIVE_SOURCES})
|
2013-04-12 02:09:28 +04:00
|
|
|
|
2023-12-01 12:51:28 +03:00
|
|
|
set(HEADERS
|
2013-08-08 23:49:24 +04:00
|
|
|
mfreerdp.h
|
|
|
|
mf_client.h
|
|
|
|
MRDPCursor.h
|
|
|
|
MRDPView.h
|
2014-03-04 23:01:01 +04:00
|
|
|
Keyboard.h
|
2014-11-06 01:14:32 +03:00
|
|
|
Clipboard.h
|
2018-11-29 19:23:09 +03:00
|
|
|
CertificateDialog.h
|
2013-08-08 23:49:24 +04:00
|
|
|
PasswordDialog.h)
|
2013-06-11 22:56:43 +04:00
|
|
|
|
2023-12-01 12:51:28 +03:00
|
|
|
set(RESOURCES "en.lproj/InfoPlist.strings")
|
2013-06-11 22:56:43 +04:00
|
|
|
|
2023-08-03 10:45:43 +03:00
|
|
|
# Include XIB file in Xcode resources.
|
2013-05-31 20:48:40 +04:00
|
|
|
if("${CMAKE_GENERATOR}" MATCHES "Xcode")
|
2023-12-01 12:51:28 +03:00
|
|
|
message(STATUS "Adding Xcode XIB resources for ${MODULE_NAME}")
|
|
|
|
list(APPEND RESOURCES ${XIBS})
|
|
|
|
set(IS_XCODE ON)
|
2013-06-23 08:18:55 +04:00
|
|
|
endif()
|
2013-04-12 02:09:28 +04:00
|
|
|
|
2023-12-01 12:51:28 +03:00
|
|
|
|
|
|
|
add_library(${PROJECT_NAME}
|
2013-06-14 00:18:19 +04:00
|
|
|
../common/client.c
|
2023-12-01 12:51:28 +03:00
|
|
|
${SOURCES}
|
|
|
|
${HEADERS}
|
|
|
|
${RESOURCES})
|
|
|
|
|
|
|
|
set(LIBS
|
|
|
|
${EXTRA_LIBS}
|
|
|
|
freerdp-client
|
|
|
|
)
|
|
|
|
|
|
|
|
target_link_libraries(${PROJECT_NAME} PUBLIC ${LIBS})
|
|
|
|
|
|
|
|
set_target_properties(${PROJECT_NAME} PROPERTIES RESOURCE "${RESOURCES}")
|
|
|
|
|
|
|
|
if (NOT IS_XCODE)
|
|
|
|
find_program(IBTOOL ibtool REQUIRED
|
|
|
|
HINTS
|
|
|
|
"/usr/bin"
|
|
|
|
"${OSX_DEVELOPER_ROOT}/usr/bin"
|
|
|
|
)
|
|
|
|
|
|
|
|
# Compile the .xib files using the 'ibtool' program with the destination being the app package
|
|
|
|
foreach(xib ${XIBS})
|
|
|
|
get_filename_component(XIB_WE ${xib} NAME_WE)
|
|
|
|
set(NIB ${CMAKE_CURRENT_BINARY_DIR}/${XIB_WE}.nib)
|
|
|
|
list(APPEND NIBS ${NIB})
|
|
|
|
|
|
|
|
add_custom_command (TARGET ${PROJECT_NAME} POST_BUILD
|
|
|
|
COMMAND ${IBTOOL} --errors --warnings --notices --output-format human-readable-text
|
|
|
|
--compile ${NIB} ${CMAKE_CURRENT_SOURCE_DIR}/${xib}
|
|
|
|
COMMENT "Compiling ${xib}")
|
|
|
|
endforeach()
|
|
|
|
|
|
|
|
install(FILES ${NIBS} DESTINATION ${CMAKE_INSTALL_DATADIR})
|
2022-12-15 01:34:54 +03:00
|
|
|
endif()
|
|
|
|
|
2013-05-31 20:48:40 +04:00
|
|
|
|
2023-12-01 12:51:28 +03:00
|
|
|
install(TARGETS ${PROJECT_NAME}
|
|
|
|
COMPONENT client
|
|
|
|
RESOURCE DESTINATION ${CMAKE_INSTALL_DATADIR}
|
|
|
|
)
|
2013-06-11 22:56:43 +04:00
|
|
|
|
2023-12-01 12:51:28 +03:00
|
|
|
include_directories(${CMAKE_CURRENT_SOURCE_DIR})
|
2013-06-23 08:18:55 +04:00
|
|
|
add_subdirectory(cli)
|