From 99e0adaf456c153f072fbd9489659eb9b1da472c Mon Sep 17 00:00:00 2001 From: Braden Obrzut Date: Thu, 12 Aug 2010 02:32:03 +0000 Subject: [PATCH] - Fixed some issues with compiling on the Mac. Some options were added to force compilation of internal libraries and added checks for building ppc binaries on x86. SVN r2515 (trunk) --- CMakeLists.txt | 22 +++++++++++++--------- src/CMakeLists.txt | 12 ++++++------ 2 files changed, 19 insertions(+), 15 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 215858b14..b541a9c20 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -64,35 +64,39 @@ set( CMAKE_CXX_FLAGS_MINSIZEREL "${CMAKE_CXX_FLAGS_MINSIZEREL} ${REL_C_FLAGS}" ) set( CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} ${REL_C_FLAGS}" ) set( CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} ${DEB_C_FLAGS} -D_DEBUG" ) -if( ZLIB_FOUND ) +option(FORCE_INTERNAL_ZLIB "Use internal zlib") +option(FORCE_INTERNAL_JPEG "Use internal jpeg") +option(FORCE_INTERNAL_BZIP2 "Use internal bzip2") + +if( ZLIB_FOUND AND NOT FORCE_INTERNAL_ZLIB ) message( STATUS "Using system zlib" ) -else( ZLIB_FOUND ) +else( ZLIB_FOUND AND NOT FORCE_INTERNAL_ZLIB ) message( STATUS "Using internal zlib" ) add_subdirectory( zlib ) set( ZLIB_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/zlib ) set( ZLIB_LIBRARIES z ) set( ZLIB_LIBRARY z ) -endif( ZLIB_FOUND ) +endif( ZLIB_FOUND AND NOT FORCE_INTERNAL_ZLIB ) -if( JPEG_FOUND ) +if( JPEG_FOUND AND NOT FORCE_INTERNAL_JPEG ) message( STATUS "Using system jpeg library" ) -else( JPEG_FOUND ) +else( JPEG_FOUND AND NOT FORCE_INTERNAL_JPEG ) message( STATUS "Using internal jpeg library" ) add_subdirectory( jpeg-6b ) set( JPEG_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/jpeg-6b ) set( JPEG_LIBRARIES jpeg ) set( JPEG_LIBRARY jpeg ) -endif( JPEG_FOUND ) +endif( JPEG_FOUND AND NOT FORCE_INTERNAL_JPEG ) -if( BZIP2_FOUND ) +if( BZIP2_FOUND AND NOT FORCE_INTERNAL_BZIP2 ) message( STATUS "Using system bzip2 library" ) -else( BZIP2_FOUND ) +else( BZIP2_FOUND AND NOT FORCE_INTERNAL_BZIP2 ) message( STATUS "Using internal bzip2 library" ) add_subdirectory( bzip2 ) set( BZIP2_INCLUDE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/bzip2" ) set( BZIP2_LIBRARIES bz2 ) set( BZIP2_LIBRARY bz2 ) -endif( BZIP2_FOUND) +endif( BZIP2_FOUND AND NOT FORCE_INTERNAL_BZIP2 ) set( LZMA_INCLUDE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/lzma/C" ) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 67e06cf3b..45b65da1e 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -232,12 +232,12 @@ endif( FMOD_LIBRARY ) # Search for NASM -if( CMAKE_SYSTEM_PROCESSOR MATCHES powerpc ) +if( CMAKE_SYSTEM_PROCESSOR MATCHES powerpc OR CMAKE_OSX_ARCHITECTURES MATCHES ppc) if( NOT NO_ASM ) message( STATUS "Disabling assembly code for PowerPC." ) set( NO_ASM ON ) endif( NOT NO_ASM ) -endif( CMAKE_SYSTEM_PROCESSOR MATCHES powerpc ) +endif( CMAKE_SYSTEM_PROCESSOR MATCHES powerpc OR CMAKE_OSX_ARCHITECTURES MATCHES ppc ) if( NOT NO_ASM ) if( UNIX AND X64 ) @@ -432,7 +432,7 @@ add_custom_target( revision_check ALL # Libraries ZDoom needs set( ZDOOM_LIBS ${ZDOOM_LIBS} "${ZLIB_LIBRARIES}" "${JPEG_LIBRARIES}" "${BZIP2_LIBRARIES}" "${FMOD_LIBRARY}" ) -include_directories( "${ZLIB_INCLUDE_DIR}" "${JPEG_INCLUDE_DIR}" "${FMOD_INCLUDE_DIR}" "${BZIP2_INCLUDE_DIR}" "${LZMA_INCLUDE_DIR}" ) +include_directories( "${ZLIB_INCLUDE_DIR}" "${FMOD_INCLUDE_DIR}" "${BZIP2_INCLUDE_DIR}" "${LZMA_INCLUDE_DIR}" "${JPEG_INCLUDE_DIR}" ) # Start defining source files for ZDoom @@ -515,12 +515,12 @@ add_custom_command( OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/sc_man_scanner.h include_directories( ${CMAKE_CURRENT_BINARY_DIR} ) -if( CMAKE_SYSTEM_PROCESSOR MATCHES powerpc ) +if( CMAKE_SYSTEM_PROCESSOR MATCHES powerpc OR CMAKE_OSX_ARCHITECTURES MATCHES ppc ) set( X86_SOURCES ) set( NOT_X86 ON ) -else( CMAKE_SYSTEM_PROCESSOR MATCHES powerpc ) +else( CMAKE_SYSTEM_PROCESSOR MATCHES powerpc OR CMAKE_OSX_ARCHITECTURES MATCHES ppc ) set( X86_SOURCES nodebuild_classify_sse2.cpp ) -endif( CMAKE_SYSTEM_PROCESSOR MATCHES powerpc ) +endif( CMAKE_SYSTEM_PROCESSOR MATCHES powerpc OR CMAKE_OSX_ARCHITECTURES MATCHES ppc ) add_executable( zdoom WIN32 autostart.cpp