Commit d5d985ed authored by Michael Turner's avatar Michael Turner

remove cmake hack for homebrew and macports

parent 1d749570
......@@ -42,6 +42,33 @@ IF (CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
SET(CMAKE_INSTALL_PREFIX ${CMAKE_BINARY_DIR}/dist CACHE PATH "" FORCE)
ENDIF()
# Find default search paths for OS X; adapted from Stack Overflow question
# 1487752
IF (APPLE)
EXECUTE_PROCESS(COMMAND which port
RESULT_VARIABLE DETECT_MACPORTS
OUTPUT_VARIABLE MACPORTS_PREFIX
ERROR_QUIET OUTPUT_STRIP_TRAILING_WHITESPACE)
EXECUTE_PROCESS(COMMAND brew --prefix
RESULT_VARIABLE DETECT_HOMEBREW
OUTPUT_VARIABLE HOMEBREW_PREFIX
ERROR_QUIET OUTPUT_STRIP_TRAILING_WHITESPACE)
IF (${DETECT_MACPORTS} EQUAL 0)
GET_FILENAME_COMPONENT(MACPORTS_PREFIX ${MACPORTS_PREFIX} DIRECTORY)
GET_FILENAME_COMPONENT(MACPORTS_PREFIX ${MACPORTS_PREFIX} DIRECTORY)
SET(CMAKE_LIBRARY_PATH ${MACPORTS_PREFIX}/lib ${CMAKE_LIBRARY_PATH})
SET(CMAKE_INCLUDE_PATH ${MACPORTS_PREFIX}/include ${CMAKE_INCLUDE_PATH})
MESSAGE(STATUS "Detected MacPorts installation: ${MACPORTS_PREFIX}")
ENDIF()
IF (${DETECT_HOMEBREW} EQUAL 0)
SET(CMAKE_LIBRARY_PATH ${HOMEBREW_PREFIX}/lib ${CMAKE_LIBRARY_PATH})
SET(CMAKE_INCLUDE_PATH ${HOMEBREW_PREFIX}/include ${CMAKE_INCLUDE_PATH})
MESSAGE(STATUS "Detected Homebrew installation: ${HOMEBREW_PREFIX}")
ENDIF()
ENDIF()
# Attempt to retrieve git branch and SHA1 hash of current changeset.
INCLUDE(GetGitRevisionDescription)
get_git_head_revision(GIT_REFSPEC GIT_SHA1)
......
......@@ -2,13 +2,20 @@
set(TEST_ENV $ENV{OCE_ROOT})
set(TEST_ENV1 $ENV{OCE_DIR})
# First try to find OpenCASCADE Community Edition if not instruction has been given
if(NOT DEFINED TEST_ENV AND NOT DEFINED TEST_ENV1)
message(STATUS "manually scan for oce")
if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
set(ENV{OCE_DIR} "/opt/local/Library/Frameworks")
elseif(UNIX)
set(ENV{OCE_DIR} "/usr/local/share/cmake/")
# Check for OSX needs to come first because UNIX evaluates to true on OSX
MESSAGE(STATUS "OCE_DIR or OCE_ROOT not set, manually searching for OCE")
if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
if(DEFINED MACPORTS_PREFIX)
find_package(OCE 0.17 QUIET HINTS ${MACPORTS_PREFIX}/Library/Frameworks)
elseif(DEFINED HOMEBREW_PREFIX)
find_package(OCE 0.17 QUIET HINTS ${HOMEBREW_PREFIX}/Cellar/oce/*)
endif()
elseif(UNIX)
set(ENV{OCE_DIR} "/usr/local/share/cmake/")
endif()
endif()
find_package(OCE 0.17 QUIET)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment