Skip to content

Commit

Permalink
Try to find frameworks last on OSX
Browse files Browse the repository at this point in the history
As suggested by [1], let's try not to use frameworks by default on OSX
and use rvm rubies and things like that when available

[1] https://gitlab.kitware.com/cmake/cmake/-/issues/16427
  • Loading branch information
Romain Coltel committed Nov 4, 2020
1 parent 1653f24 commit 35a2562
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
5 changes: 1 addition & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,8 @@ jobs:
dist: xenial
- os: osx

env:
global:
- PATH="/usr/bin:/usr/local/bin:$PATH"

before_install:
- echo $PATH
- if [ "$TRAVIS_OS_NAME" = "linux" ]; then sudo apt-get update -qq; fi
- if [ "$TRAVIS_OS_NAME" = "linux" ]; then sudo apt-get install -qq libfuse-dev ruby-dev libmbedtls-dev; fi
- if [ "$TRAVIS_OS_NAME" = "osx" ]; then brew update; fi
Expand Down
8 changes: 8 additions & 0 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,19 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
# USA.

set(_Ruby_DEBUG_OUTPUT ON)

if("${CMAKE_SOURCE_DIR}" MATCHES "src/?$")
message(FATAL_ERROR "\nPlease execute cmake from the directory above, not the src/ directory.")
return()
endif()

# On OSX, frameworks are found before installed libraries (cf. https://gitlab.kitware.com/cmake/cmake/-/issues/16427)
if("${CMAKE_SYSTEM_NAME}" STREQUAL "Darwin")
set(CMAKE_FIND_FRAMEWORK Last)
message(STATUS "CMAKE_FIND_FRAMEWORK='${CMAKE_FIND_FRAMEWORK}'")
endif()

add_definitions (-DPROGNAME="${PROJECT_NAME}")
add_definitions (-DAUTHOR="${AUTHOR}")
add_definitions (-DVERSION="${VERSION}")
Expand Down

0 comments on commit 35a2562

Please sign in to comment.