From: James Turner Date: Sat, 11 Aug 2012 14:21:52 +0000 (+0100) Subject: Mac changes for Subversion bundling. X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=3270edcf8780e4fbe68c2e6a713aef1fc8a97464;p=simgear.git Mac changes for Subversion bundling. --- diff --git a/CMakeLists.txt b/CMakeLists.txt index c2124c4b..1f4db46f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -118,9 +118,6 @@ endif (MSVC AND MSVC_3RDPARTY_ROOT) find_package(Boost REQUIRED) set (BOOST_CXX_FLAGS "-DBOOST_MULTI_INDEX_DISABLE_SERIALIZATION -DBOOST_BIMAP_DISABLE_SERIALIZATION") -find_package(ZLIB REQUIRED) -find_package(Threads REQUIRED) - if(SIMGEAR_HEADLESS) message(STATUS "SimGear mode: HEADLESS") else() @@ -156,6 +153,9 @@ else() message(STATUS "Subversion client support: DISABLED") endif(ENABLE_LIBSVN) +find_package(ZLIB REQUIRED) +find_package(Threads REQUIRED) + check_include_file(sys/time.h HAVE_SYS_TIME_H) check_include_file(sys/timeb.h HAVE_SYS_TIMEB_H) check_include_file(unistd.h HAVE_UNISTD_H) diff --git a/CMakeModules/FindSvnClient.cmake b/CMakeModules/FindSvnClient.cmake index 15f6ba27..5a985c53 100644 --- a/CMakeModules/FindSvnClient.cmake +++ b/CMakeModules/FindSvnClient.cmake @@ -16,14 +16,18 @@ macro(find_static_component comp libs) string(TOUPPER "${comp}" compLibBase) set( compLibName ${compLibBase}_LIBRARY ) + # NO_DEFAULT_PATH is important on Mac - we need to ensure subversion + # libraires in dist/ or Macports are picked over the Apple version + # in /usr, since that's what we will ship. FIND_LIBRARY(${compLibName} + NO_DEFAULT_PATH NAMES ${compLib} - HINTS $ENV{PLIBDIR} + HINTS $ENV{LIBSVN_DIR} ${CMAKE_INSTALL_PREFIX} PATH_SUFFIXES lib64 lib libs64 libs libs/Win32 libs/Win64 PATHS + /opt/local /usr/local /usr - /opt ) list(APPEND ${libs} ${${compLibName}}) @@ -49,13 +53,14 @@ endif(HAVE_APR_CONFIG) if(HAVE_APR_CONFIG OR MSVC) find_path(LIBSVN_INCLUDE_DIR svn_client.h + NO_DEFAULT_PATH HINTS - $ENV{LIBSVN_DIR} + $ENV{LIBSVN_DIR} ${CMAKE_INSTALL_PREFIX} PATH_SUFFIXES include/subversion-1 PATHS + /opt/local /usr/local /usr - /opt ) set(LIBSVN_LIBRARIES "") diff --git a/simgear/CMakeLists.txt b/simgear/CMakeLists.txt index fb5f8b1c..46a22b65 100644 --- a/simgear/CMakeLists.txt +++ b/simgear/CMakeLists.txt @@ -59,12 +59,7 @@ if(SIMGEAR_SHARED) if(LIBSVN_FOUND) add_definitions(${APR_CFLAGS}) - - IF(APPLE) - set_property(SOURCE scene/tsync/terrasync.cxx PROPERTY COMPILE_FLAGS "-iwithsysroot ${LIBSVN_INCLUDE_DIR}") - ELSE() - include_directories(${LIBSVN_INCLUDE_DIR}) - ENDIF(APPLE) + include_directories(${LIBSVN_INCLUDE_DIR}) target_link_libraries(SimGearCore ${LIBSVN_LIBRARIES}) endif(LIBSVN_FOUND) diff --git a/simgear/scene/tsync/CMakeLists.txt b/simgear/scene/tsync/CMakeLists.txt index 5c0be429..fceba2de 100644 --- a/simgear/scene/tsync/CMakeLists.txt +++ b/simgear/scene/tsync/CMakeLists.txt @@ -10,13 +10,7 @@ set(SOURCES if(LIBSVN_FOUND) add_definitions(${APR_CFLAGS}) - - IF(APPLE) - set_property(SOURCE terrasync.cxx PROPERTY COMPILE_FLAGS "-iwithsysroot ${LIBSVN_INCLUDE_DIR}") - ELSE() - include_directories(${LIBSVN_INCLUDE_DIR}) - ENDIF(APPLE) - + include_directories(${LIBSVN_INCLUDE_DIR}) endif() simgear_component(tsync scene/tsync "${SOURCES}" "${HEADERS}")