2012-05-11 00:18:29 +04:00
|
|
|
|
2012-10-19 07:10:45 +04:00
|
|
|
project(MacFreeRDP)
|
|
|
|
|
|
|
|
set(MODULE_NAME "MacFreeRDP")
|
|
|
|
set(MODULE_PREFIX "FREERDP_CLIENT_MAC")
|
|
|
|
|
|
|
|
set(FRAMEWORK_HEADERS_PATH /System/Library/Frameworks/Cocoa.framework/Versions/A/Headers/)
|
|
|
|
include_directories(${FRAMEWORK_HEADERS_PATH} /System/Library/Frameworks)
|
2012-05-11 00:18:29 +04:00
|
|
|
|
2012-11-01 07:30:52 +04:00
|
|
|
# set(CMAKE_OSX_SYSROOT MacOSX10.7.sdk)
|
2012-10-19 07:10:45 +04:00
|
|
|
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -mmacosx-version-min=10.4")
|
|
|
|
set(GUI_TYPE MACOSX_BUNDLE)
|
2012-05-11 00:18:29 +04:00
|
|
|
|
2012-10-19 07:10:45 +04:00
|
|
|
# Import libraries
|
|
|
|
find_library(FOUNDATION_LIBRARY Foundation)
|
|
|
|
find_library(COCOA_LIBRARY Cocoa)
|
|
|
|
find_library(APPKIT_LIBRARY AppKit)
|
2012-11-01 07:30:52 +04:00
|
|
|
|
2012-10-19 07:10:45 +04:00
|
|
|
set(MACOSX_BUNDLE_INFO_STRING "MacFreeRDP")
|
|
|
|
set(MACOSX_BUNDLE_GUI_IDENTIFIER "com.freerdp.mac")
|
|
|
|
set(MACOSX_BUNDLE_BUNDLE_IDENTIFIER "FreeRDP.Mac")
|
|
|
|
set(MACOSX_BUNDLE_LONG_VERSION_STRING "MacFreeRDP Version 1.0.1")
|
|
|
|
set(MACOSX_BUNDLE_BUNDLE_NAME "MacFreeRDP")
|
|
|
|
set(MACOSX_BUNDLE_SHORT_VERSION_STRING 1.0.1)
|
|
|
|
set(MACOSX_BUNDLE_BUNDLE_VERSION 1.0.1)
|
|
|
|
set(MACOSX_BUNDLE_COPYRIGHT "Copyright 2012. All Rights Reserved.")
|
|
|
|
|
|
|
|
set(MACOSX_BUNDLE_NSMAIN_NIB_FILE "MainMenu")
|
|
|
|
set(MACOSX_BUNDLE_NSPRINCIPAL_CLASS "NSApplication")
|
2012-05-11 00:18:29 +04:00
|
|
|
|
2012-10-19 07:10:45 +04:00
|
|
|
mark_as_advanced(COCOA_LIBRARY FOUNDATION_LIBRARY APPKIT_LIBRARY)
|
|
|
|
set(EXTRA_LIBS ${COCOA_LIBRARY} ${FOUNDATION_LIBRARY} ${APPKIT_LIBRARY})
|
|
|
|
set(APP_TYPE MACOSX_BUNDLE)
|
2012-05-11 00:18:29 +04:00
|
|
|
|
2012-05-13 04:07:23 +04:00
|
|
|
# OS X Interface Builder files
|
2012-10-19 07:10:45 +04:00
|
|
|
file(GLOB MacFreeRDP_XIBS *.xib)
|
2012-05-11 00:18:29 +04:00
|
|
|
|
2012-05-13 04:07:23 +04:00
|
|
|
# Headers
|
2012-10-19 07:10:45 +04:00
|
|
|
file(GLOB MacFreeRDP_Headers *.h)
|
2012-05-11 00:18:29 +04:00
|
|
|
|
2012-05-13 04:07:23 +04:00
|
|
|
# Source
|
2012-10-19 07:10:45 +04:00
|
|
|
file(GLOB MacFreeRDP_Source *.m)
|
2012-05-11 00:18:29 +04:00
|
|
|
|
2012-10-19 07:10:45 +04:00
|
|
|
add_executable(MacFreeRDP
|
2012-05-11 00:18:29 +04:00
|
|
|
${APP_TYPE}
|
|
|
|
${MacFreeRDP_Headers}
|
|
|
|
${MacFreeRDP_Source}
|
|
|
|
${MacFreeRDP_XIBS})
|
|
|
|
|
|
|
|
# This is necessary for the xib file part below
|
|
|
|
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/Info.plist ${CMAKE_CURRENT_BINARY_DIR}/Info.plist)
|
2012-05-13 04:07:23 +04:00
|
|
|
|
2012-05-11 00:18:29 +04:00
|
|
|
# This allows for automatic xib to nib ibitool
|
|
|
|
set_target_properties(MacFreeRDP PROPERTIES RESOURCE "${MacFreeRDP_XIBS}")
|
2012-05-13 04:07:23 +04:00
|
|
|
|
|
|
|
# Automatic ref counting
|
2012-08-16 08:07:51 +04:00
|
|
|
# temporary turn off for x86_64 build issue
|
|
|
|
# set_target_properties(MacFreeRDP PROPERTIES XCODE_ATTRIBUTE_CLANG_ENABLE_OBJC_ARC YES)
|
2012-05-11 00:18:29 +04:00
|
|
|
|
2012-05-13 04:07:23 +04:00
|
|
|
# Support for automatic reference counting requires non-fragile abi.
|
|
|
|
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fobjc-nonfragile-abi")
|
|
|
|
|
|
|
|
# XCode project architecture to native architecture of build machine
|
|
|
|
# -----------------------------------------------------------------------------------------------------
|
|
|
|
# Issue: Had some issues with FreeRDP project building only 64 bit and
|
|
|
|
# MacFreeRDP attempting to link to both 32 and 64 for dual target.
|
|
|
|
# In the future the FreeRDP Xcode project should be pulled in for a couple of reasons:
|
|
|
|
# 1) better step-into debugging 2) automatic dependency compilation and multi-arch compilation + linkage
|
|
|
|
# If you know the solutions for 1 and 2, please add below.
|
|
|
|
set_target_properties(MacFreeRDP PROPERTIES XCODE_ATTRIBUTE_ARCHS "$(NATIVE_ARCH_ACTUAL)")
|
2012-05-11 00:18:29 +04:00
|
|
|
|
2012-05-13 04:07:23 +04:00
|
|
|
# Set the info plist to the custom instance
|
2012-05-11 00:18:29 +04:00
|
|
|
set_target_properties(MacFreeRDP PROPERTIES MACOSX_BUNDLE_INFO_PLIST ${CMAKE_CURRENT_BINARY_DIR}/Info.plist)
|
|
|
|
|
2012-10-19 07:10:45 +04:00
|
|
|
set(${MODULE_PREFIX}_LIBS ${${MODULE_PREFIX}_LIBS} ${EXTRA_LIBS})
|
|
|
|
|
|
|
|
set(${MODULE_PREFIX}_LIBS ${${MODULE_PREFIX}_LIBS} freerdp-client)
|
|
|
|
|
|
|
|
set_complex_link_libraries(VARIABLE ${MODULE_PREFIX}_LIBS MONOLITHIC ${MONOLITHIC_BUILD}
|
|
|
|
MODULE freerdp
|
2013-01-19 02:32:58 +04:00
|
|
|
MODULES freerdp-core freerdp-cache freerdp-gdi freerdp-codec freerdp-primitives freerdp-rail freerdp-utils)
|
2012-10-19 07:10:45 +04:00
|
|
|
|
2012-11-01 07:30:52 +04:00
|
|
|
set_complex_link_libraries(VARIABLE ${MODULE_PREFIX}_LIBS MONOLITHIC ${MONOLITHIC_BUILD}
|
|
|
|
MODULE winpr
|
|
|
|
MODULES winpr-crt)
|
|
|
|
|
2012-10-19 07:10:45 +04:00
|
|
|
target_link_libraries(${MODULE_NAME} ${${MODULE_PREFIX}_LIBS})
|
2012-10-01 19:48:53 +04:00
|
|
|
|
|
|
|
set_property(TARGET MacFreeRDP PROPERTY FOLDER "Client/Mac")
|