Skip to content

Commit

Permalink
EmptyProject: Fix CMake errors caused by extra unwanted if()
Browse files Browse the repository at this point in the history
Some Android fixes
Fix zzip search on Linux
  • Loading branch information
darksylinc committed Sep 25, 2021
1 parent 52dfa11 commit ec91c90
Showing 1 changed file with 20 additions and 9 deletions.
29 changes: 20 additions & 9 deletions Samples/2.0/Tutorials/EmptyProject/CMake/Dependencies/OGRE.cmake
Expand Up @@ -88,10 +88,10 @@ macro( setupPluginFileFromTemplate BUILD_TYPE OGRE_USE_SCENE_FORMAT OGRE_USE_PLA
${CMAKE_SOURCE_DIR}/bin/${BUILD_TYPE}/plugins.cfg )
endif()

# Copy
# "${OGRE_BINARIES}/bin/${BUILD_TYPE}/OgreMain.dll" to "${CMAKE_SOURCE_DIR}/bin/${BUILD_TYPE}
# and the other DLLs as well. On non-Windows machines, we can only the DLLs for the current build.
if( WIN32 OR OGRE_BUILD_TYPE_MATCHES )
# Copy
# "${OGRE_BINARIES}/bin/${BUILD_TYPE}/OgreMain.dll" to "${CMAKE_SOURCE_DIR}/bin/${BUILD_TYPE}
# and the other DLLs as well.

# Lists of DLLs to copy
set( OGRE_DLLS
OgreMain
Expand Down Expand Up @@ -139,11 +139,12 @@ macro( setupPluginFileFromTemplate BUILD_TYPE OGRE_USE_SCENE_FORMAT OGRE_USE_PLA
"${CMAKE_SOURCE_DIR}/bin/${BUILD_TYPE}" )
endforeach()
endif()

unset( OGRE_PLUGIN_RS_D3D11 )
unset( OGRE_PLUGIN_RS_GL3PLUS )
unset( OGRE_PLUGIN_RS_VULKAN )
endif()

unset( OGRE_PLUGIN_RS_D3D11 )
unset( OGRE_PLUGIN_RS_GL3PLUS )
unset( OGRE_PLUGIN_RS_VULKAN )
unset( OGRE_BUILD_TYPE_MATCHES )
endmacro()

Expand All @@ -155,6 +156,8 @@ function( setupResourceFileFromTemplate )
${CMAKE_SOURCE_DIR}/CMake/Templates/Resources.cfg.in" )
if( APPLE )
set( OGRE_MEDIA_DIR "Contents/Resources/" )
elseif( ANDROID )
set( OGRE_MEDIA_DIR "" )
else()
set( OGRE_MEDIA_DIR "../" )
endif()
Expand Down Expand Up @@ -188,6 +191,9 @@ if( WIN32 )
elseif( APPLE )
set( OGRE_BINARIES "${OGRE_SOURCE}/build" CACHE STRING "Path to OGRE's build folder generated by CMake" )
link_directories( "${OGRE_BINARIES}/lib/$(PLATFORM_NAME)/$(CONFIGURATION)" )
elseif( ANDROID )
set( OGRE_BINARIES "${OGRE_SOURCE}/build/Android/${CMAKE_BUILD_TYPE}" CACHE STRING "Path to OGRE's build folder generated by CMake" )
link_directories( "${OGRE_BINARIES}/lib" )
else()
set( OGRE_BINARIES "${OGRE_SOURCE}/build/${CMAKE_BUILD_TYPE}" CACHE STRING "Path to OGRE's build folder generated by CMake" )
link_directories( "${OGRE_BINARIES}/lib" )
Expand Down Expand Up @@ -354,9 +360,14 @@ macro( addStaticDependencies OGRE_SOURCE, OGRE_BINARIES, OGRE_BUILD_SETTINGS_STR
string( FIND "${OGRE_BUILD_SETTINGS_STR}" "#define OGRE_NO_ZIP_ARCHIVE 0" OGRE_USES_ZIP )
if( NOT OGRE_USES_FREEIMAGE EQUAL -1 )
message( STATUS "Static lib needs zzip. Linking against it." )
if( UNIX )
set( ZZIPNAME zziplib )
else()
set( ZZIPNAME zzip )
endif()
set( TMP_DEPENDENCY_LIBS ${TMP_DEPENDENCY_LIBS}
debug zzip${OGRE_DEP_DEBUG_SUFFIX}
optimized zzip )
debug ${ZZIPNAME}${OGRE_DEP_DEBUG_SUFFIX}
optimized ${ZZIPNAME} )
endif()

set( OGRE_DEPENDENCY_LIBS ${TMP_DEPENDENCY_LIBS} )
Expand Down

0 comments on commit ec91c90

Please sign in to comment.