Skip to content

Commit

Permalink
CMake: fix Framework linking with recent CMake & Xcode
Browse files Browse the repository at this point in the history
  • Loading branch information
paroj committed Feb 19, 2021
1 parent a828f18 commit 84ae939
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
5 changes: 2 additions & 3 deletions OgreMain/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -220,10 +220,9 @@ endif()
if (APPLE)
if (APPLE_IOS)
set_target_properties(OgreMain PROPERTIES INSTALL_NAME_DIR "OGRE")
else ()
set(OGRE_OSX_BUILD_CONFIGURATION "$(PLATFORM_NAME)/$(CONFIGURATION)")

else()
if(OGRE_BUILD_LIBS_AS_FRAMEWORKS)
set(OGRE_OSX_BUILD_CONFIGURATION "$ENV{PLATFORM_NAME}/$ENV{CONFIGURATION}")
add_custom_command(TARGET OgreMain POST_BUILD
COMMAND mkdir ARGS -p ${PROJECT_BINARY_DIR}/lib/${OGRE_OSX_BUILD_CONFIGURATION}/Ogre.framework/Headers/Threading
COMMAND ditto
Expand Down
7 changes: 3 additions & 4 deletions Samples/Browser/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -193,13 +193,12 @@ if (APPLE)
# NOTE: $(CONFIGURATION) is not resolvable at CMake run time, it's only
# valid at build time (hence parenthesis rather than braces)

set(OGRE_OSX_BUILD_CONFIGURATION "$(PLATFORM_NAME)/$(CONFIGURATION)")
set(OGRE_BUILT_FRAMEWORK "$(PLATFORM_NAME)/$(CONFIGURATION)")
set(OGRE_OSX_BUILD_CONFIGURATION "$ENV{PLATFORM_NAME}/$ENV{CONFIGURATION}")
set (OGRE_SAMPLE_CONTENTS_PATH
${PROJECT_BINARY_DIR}/bin/$(CONFIGURATION)/SampleBrowser.app/Contents)
${PROJECT_BINARY_DIR}/bin/$ENV{CONFIGURATION}/SampleBrowser.app/Contents)
add_custom_command(TARGET SampleBrowser POST_BUILD
COMMAND mkdir ARGS -p ${OGRE_SAMPLE_CONTENTS_PATH}/Frameworks
COMMAND ln ARGS -s -f ${PROJECT_BINARY_DIR}/lib/${OGRE_BUILT_FRAMEWORK}/Ogre.framework ${OGRE_SAMPLE_CONTENTS_PATH}/Frameworks/
COMMAND ln ARGS -s -f ${PROJECT_BINARY_DIR}/lib/${OGRE_OSX_BUILD_CONFIGURATION}/Ogre.framework ${OGRE_SAMPLE_CONTENTS_PATH}/Frameworks/
COMMAND ln ARGS -s -f ${Cg_LIBRARY_REL} ${OGRE_SAMPLE_CONTENTS_PATH}/Frameworks/
)
# now cfg files
Expand Down

0 comments on commit 84ae939

Please sign in to comment.