mfreerdp: cleanup makefiles
This commit is contained in:
parent
f1c0ffb130
commit
1d1d04149c
@ -1,10 +1,10 @@
|
||||
|
||||
project(MacFreeRDP-library)
|
||||
|
||||
set(MODULE_NAME "MacFreeRDP-library")
|
||||
set(MODULE_OUTPUT_NAME "MacFreeRDP")
|
||||
set(MODULE_PREFIX "FREERDP_CLIENT_MAC-LIB")
|
||||
set(MODULE_PREFIX "FREERDP_CLIENT_MAC_LIBRARY")
|
||||
|
||||
# Import frameworks
|
||||
find_library(FOUNDATION_LIBRARY Foundation)
|
||||
find_library(COCOA_LIBRARY Cocoa)
|
||||
find_library(APPKIT_LIBRARY AppKit)
|
||||
@ -21,34 +21,45 @@ set(MACOSX_BUNDLE_SHORT_VERSION_STRING 1.1.0)
|
||||
set(MACOSX_BUNDLE_BUNDLE_VERSION 1.1.0)
|
||||
set(MACOSX_BUNDLE_COPYRIGHT "Copyright 2013. All Rights Reserved.")
|
||||
|
||||
set(${MODULE_NAME}_RESOURCES "en.lproj/InfoPlist.strings")
|
||||
set(${MODULE_PREFIX}_XIBS PasswordDialog.xib)
|
||||
|
||||
# OS X Interface Builder files
|
||||
file(GLOB ${MODULE_NAME}_XIBS *.xib)
|
||||
set(${MODULE_PREFIX}_SOURCES "")
|
||||
|
||||
# source files
|
||||
file(GLOB ${MODULE_NAME}_SRC *.c *.m)
|
||||
set(${MODULE_PREFIX}_OBJECTIVE_SOURCES
|
||||
main.m
|
||||
mf_client.m
|
||||
MRDPCursor.m
|
||||
MRDPView.m
|
||||
PasswordDialog.m)
|
||||
|
||||
# header files
|
||||
file(GLOB ${MODULE_NAME}_HEADERS *.h)
|
||||
list(APPEND ${MODULE_PREFIX}_SOURCES ${${MODULE_PREFIX}_OBJECTIVE_SOURCES})
|
||||
|
||||
set(${MODULE_PREFIX}_HEADERS
|
||||
mfreerdp.h
|
||||
mf_client.h
|
||||
MRDPCursor.h
|
||||
MRDPView.h
|
||||
PasswordDialog.h)
|
||||
|
||||
set(${MODULE_PREFIX}_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}")
|
||||
set(${MODULE_NAME}_RESOURCES ${${MODULE_NAME}_RESOURCES} ${${MODULE_NAME}_XIBS})
|
||||
set(${MODULE_PREFIX}_RESOURCES ${${MODULE_PREFIX}_RESOURCES} ${${MODULE_PREFIX}_XIBS})
|
||||
endif()
|
||||
|
||||
add_library(${MODULE_NAME}
|
||||
SHARED
|
||||
../common/client.c
|
||||
${${MODULE_NAME}_SRC}
|
||||
${${MODULE_NAME}_HEADERS}
|
||||
${${MODULE_NAME}_RESOURCES})
|
||||
${${MODULE_PREFIX}_SOURCES}
|
||||
${${MODULE_PREFIX}_HEADERS}
|
||||
${${MODULE_PREFIX}_RESOURCES})
|
||||
|
||||
set_target_properties(${MODULE_NAME} PROPERTIES OUTPUT_NAME "${MODULE_OUTPUT_NAME}")
|
||||
|
||||
# configures the framework to always be looked for in the application bundle in the Frameworks sub-folder.
|
||||
SET_TARGET_PROPERTIES(${MODULE_NAME} PROPERTIES XCODE_ATTRIBUTE_INSTALL_PATH @executable_path/../Frameworks/)
|
||||
set_target_properties(${MODULE_NAME} PROPERTIES XCODE_ATTRIBUTE_INSTALL_PATH @executable_path/../Frameworks/)
|
||||
|
||||
set_target_properties(${MODULE_NAME} PROPERTIES
|
||||
RUNTIME_OUTPUT_DIRECTORY_DEBUG ${EXECUTABLE_OUTPUT_PATH}
|
||||
@ -57,10 +68,6 @@ set_target_properties(${MODULE_NAME} PROPERTIES
|
||||
# Support for automatic reference counting requires non-fragile abi.
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fobjc-nonfragile-abi")
|
||||
|
||||
set_target_properties(${MODULE_NAME} PROPERTIES XCODE_ATTRIBUTE_ARCHS "$(NATIVE_ARCH_ACTUAL)")
|
||||
|
||||
set(MODULE_VERSION, 1.1.0)
|
||||
|
||||
set_target_properties(${MODULE_NAME} PROPERTIES
|
||||
FRAMEWORK TRUE
|
||||
MACOSX_FRAMEWORK_IDENTIFIER com.awakecoding.${MODULE_NAME}
|
||||
@ -159,7 +166,7 @@ endif()
|
||||
# endif()
|
||||
|
||||
# Copy the public header files into the framework
|
||||
foreach(HEADER ${${MODULE_NAME}_HEADERS})
|
||||
foreach(HEADER ${${MODULE_PREFIX}_HEADERS})
|
||||
# message("adding post-build dependency: ${LIB}")
|
||||
add_custom_command(TARGET ${MODULE_NAME} POST_BUILD
|
||||
COMMAND ditto ${HEADER} ${CMAKE_CURRENT_BINARY_DIR}/$(CONFIGURATION)/${MODULE_OUTPUT_NAME}.framework/Headers/
|
||||
|
@ -65,7 +65,6 @@
|
||||
#import "freerdp/client/file.h"
|
||||
#import "freerdp/client/cmdline.h"
|
||||
|
||||
|
||||
/******************************************
|
||||
Forward declarations
|
||||
******************************************/
|
||||
@ -804,9 +803,6 @@ BOOL mac_pre_connect(freerdp* instance)
|
||||
instance->update->EndPaint = mac_end_paint;
|
||||
instance->update->SetBounds = mac_set_bounds;
|
||||
//instance->update->BitmapUpdate = mac_bitmap_update;
|
||||
|
||||
mfContext *mfc = (mfContext*) instance->context;
|
||||
MRDPView* view = (MRDPView*) mfc->view;
|
||||
|
||||
settings = instance->settings;
|
||||
|
||||
|
@ -1,4 +1,5 @@
|
||||
project(MacFreeRDP-client)
|
||||
|
||||
project(MacFreeRDP)
|
||||
|
||||
set(MODULE_NAME "MacFreeRDP")
|
||||
set(MODULE_OUTPUT_NAME "MacFreeRDP")
|
||||
@ -9,7 +10,6 @@ set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -mmacosx-version-min
|
||||
find_library(FOUNDATION_LIBRARY Foundation)
|
||||
find_library(COCOA_LIBRARY Cocoa)
|
||||
find_library(APPKIT_LIBRARY AppKit)
|
||||
#find_library(FREERDP_LIBRARY NAMES MacFreeRDP PATHS ${CMAKE_CURRENT_BINARY_DIR}/../${CONFIGURATION})
|
||||
|
||||
set(MACOSX_BUNDLE_INFO_STRING "MacFreeRDP")
|
||||
set(MACOSX_BUNDLE_ICON_FILE "FreeRDP.icns")
|
||||
@ -27,28 +27,32 @@ set(MACOSX_BUNDLE_NSPRINCIPAL_CLASS "NSApplication")
|
||||
mark_as_advanced(COCOA_LIBRARY FOUNDATION_LIBRARY APPKIT_LIBRARY)
|
||||
set(APP_TYPE MACOSX_BUNDLE)
|
||||
|
||||
# OS X Interface Builder files
|
||||
file(GLOB ${MODULE_NAME}_XIBS *.xib)
|
||||
set(${MODULE_PREFIX}_XIBS MainMenu.xib)
|
||||
|
||||
set(${MODULE_NAME}_RESOURCES ${MACOSX_BUNDLE_ICON_FILE})
|
||||
set(${MODULE_PREFIX}_SOURCES "")
|
||||
|
||||
set(${MODULE_PREFIX}_OBJECTIVE_SOURCES
|
||||
main.m
|
||||
AppDelegate.m)
|
||||
|
||||
list(APPEND ${MODULE_PREFIX}_SOURCES ${${MODULE_PREFIX}_OBJECTIVE_SOURCES})
|
||||
|
||||
set(${MODULE_PREFIX}_HEADERS
|
||||
AppDelegate.h)
|
||||
|
||||
set(${MODULE_PREFIX}_RESOURCES ${MACOSX_BUNDLE_ICON_FILE})
|
||||
|
||||
# Include XIB file in Xcode resources.
|
||||
if("${CMAKE_GENERATOR}" MATCHES "Xcode")
|
||||
message(STATUS "Adding Xcode XIB resources for ${MODULE_NAME}")
|
||||
set(${MODULE_NAME}_RESOURCES ${${MODULE_NAME}_RESOURCES} ${${MODULE_NAME}_XIBS})
|
||||
endif("${CMAKE_GENERATOR}" MATCHES "Xcode")
|
||||
|
||||
# Headers
|
||||
file(GLOB ${MODULE_NAME}_HEADERS *.h)
|
||||
|
||||
# Source
|
||||
file(GLOB ${MODULE_NAME}_SOURCES *.m)
|
||||
set(${MODULE_PREFIX}_RESOURCES ${${MODULE_PREFIX}_RESOURCES} ${${MODULE_PREFIX}_XIBS})
|
||||
endif()
|
||||
|
||||
add_executable(${MODULE_NAME}
|
||||
${APP_TYPE}
|
||||
${${MODULE_NAME}_HEADERS}
|
||||
${${MODULE_NAME}_SOURCES}
|
||||
${${MODULE_NAME}_RESOURCES})
|
||||
${${MODULE_PREFIX}_HEADERS}
|
||||
${${MODULE_PREFIX}_SOURCES}
|
||||
${${MODULE_PREFIX}_RESOURCES})
|
||||
|
||||
set_target_properties(${MODULE_NAME} PROPERTIES OUTPUT_NAME "${MODULE_OUTPUT_NAME}")
|
||||
|
||||
@ -56,11 +60,7 @@ set_target_properties(${MODULE_NAME} PROPERTIES OUTPUT_NAME "${MODULE_OUTPUT_NAM
|
||||
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/Info.plist ${CMAKE_CURRENT_BINARY_DIR}/Info.plist)
|
||||
|
||||
# This allows for automatic xib to nib ibitool
|
||||
set_target_properties(${MODULE_NAME} PROPERTIES RESOURCE "${${MODULE_NAME}_RESOURCES}")
|
||||
|
||||
# Automatic ref counting
|
||||
# temporary turn off for x86_64 build issue
|
||||
# set_target_properties(${MODULE_NAME} PROPERTIES XCODE_ATTRIBUTE_CLANG_ENABLE_OBJC_ARC YES)
|
||||
set_target_properties(${MODULE_NAME} PROPERTIES RESOURCE "${${MODULE_PREFIX}_RESOURCES}")
|
||||
|
||||
# Support for automatic reference counting requires non-fragile abi.
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fobjc-nonfragile-abi")
|
||||
@ -72,8 +72,6 @@ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -F../")
|
||||
set_target_properties(${MODULE_NAME} PROPERTIES XCODE_ATTRIBUTE_FRAMEWORK_SEARCH_PATHS
|
||||
"${XCODE_ATTRIBUTE_FRAMEWORK_SEARCH_PATHS} ${CMAKE_CURRENT_BINARY_DIR}/../$(CONFIGURATION)")
|
||||
|
||||
set_target_properties(${MODULE_NAME} PROPERTIES XCODE_ATTRIBUTE_ARCHS "$(NATIVE_ARCH_ACTUAL)")
|
||||
|
||||
# Set the info plist to the custom instance
|
||||
set_target_properties(${MODULE_NAME} PROPERTIES MACOSX_BUNDLE_INFO_PLIST ${CMAKE_CURRENT_BINARY_DIR}/Info.plist)
|
||||
|
||||
@ -106,7 +104,7 @@ if("${CMAKE_GENERATOR}" MATCHES "Unix Makefiles")
|
||||
add_custom_command(TARGET ${MODULE_NAME} PRE_BUILD COMMAND mkdir -p ${CMAKE_CURRENT_BINARY_DIR}/\${CONFIGURATION}/${MODULE_OUTPUT_NAME}.app/Contents/Resources)
|
||||
|
||||
# Compile the .xib files using the 'ibtool' program with the destination being the app package
|
||||
foreach(xib ${${MODULE_NAME}_XIBS})
|
||||
foreach(xib ${${MODULE_PREFIX}_XIBS})
|
||||
get_filename_component(XIB_WE ${xib} NAME_WE)
|
||||
|
||||
add_custom_command (TARGET ${MODULE_NAME} POST_BUILD
|
||||
@ -115,4 +113,4 @@ if("${CMAKE_GENERATOR}" MATCHES "Unix Makefiles")
|
||||
COMMENT "Compiling ${xib}")
|
||||
endforeach()
|
||||
|
||||
endif("${CMAKE_GENERATOR}" MATCHES "Unix Makefiles")
|
||||
endif()
|
||||
|
Loading…
Reference in New Issue
Block a user