FreeRDP/client/Mac/CMakeLists.txt

110 lines
2.6 KiB
CMake
Raw Normal View History

cmake_minimum_required(VERSION 3.13)
2013-08-08 23:49:24 +04: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
message("project ${PROJECT_NAME} is using version ${PROJECT_VERSION}")
cmake_policy(SET CMP0026 OLD)
cmake_policy(SET CMP0045 OLD)
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
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
set(EXTRA_LIBS ${COCOA_LIBRARY} ${FOUNDATION_LIBRARY} ${APPKIT_LIBRARY} ${IOKIT_LIBRARY})
2013-05-31 22:57:48 +04:00
set(XIBS
CertificateDialog.xib
PasswordDialog.xib)
2013-08-08 23:49:24 +04:00
set(SOURCES "")
2013-08-08 23:49:24 +04:00
set(OBJECTIVE_SOURCES
2013-08-08 23:49:24 +04:00
main.m
mf_client.m
MRDPCursor.m
MRDPView.m
Keyboard.m
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
list(APPEND SOURCES ${OBJECTIVE_SOURCES})
2013-04-12 02:09:28 +04:00
set(HEADERS
2013-08-08 23:49:24 +04:00
mfreerdp.h
mf_client.h
MRDPCursor.h
MRDPView.h
Keyboard.h
Clipboard.h
2018-11-29 19:23:09 +03:00
CertificateDialog.h
2013-08-08 23:49:24 +04:00
PasswordDialog.h)
set(RESOURCES "en.lproj/InfoPlist.strings")
# Include XIB file in Xcode resources.
if("${CMAKE_GENERATOR}" MATCHES "Xcode")
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
add_library(${PROJECT_NAME}
2013-06-14 00:18:19 +04:00
../common/client.c
${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})
endif()
install(TARGETS ${PROJECT_NAME}
COMPONENT client
RESOURCE DESTINATION ${CMAKE_INSTALL_DATADIR}
)
include_directories(${CMAKE_CURRENT_SOURCE_DIR})
2013-06-23 08:18:55 +04:00
add_subdirectory(cli)