Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lower CMAKE dependency to version 2.8 #105

Merged
merged 2 commits into from
Aug 21, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 27 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
cmake_minimum_required(VERSION 3.1)
# 3.1 preferred, but we can often get by with 2.8.
cmake_minimum_required(VERSION 2.8)
project(EncFS C CXX)

set (ENCFS_MAJOR 1)
Expand All @@ -12,8 +13,31 @@ set (CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH}
"${CMAKE_SOURCE_DIR}/cmake")

# We need C++ 11
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED on)
if (${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION} GREATER 3.0)
# CMake 3.1 has built-in CXX standard checks.
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED on)
else ()
if (CMAKE_COMPILER_IS_GNUCXX)
message ("Assuming that GNU CXX uses -std=c++11 flag for C++11 compatibility.")
list(APPEND CMAKE_CXX_FLAGS "-std=c++11")
else()
message ("No CMAKE C++11 check. If the build breaks, you're on your own.")
endif()
endif ()

# http://www.cmake.org/Wiki/CMake_RPATH_handling#Mac_OS_X_and_the_RPATH
if (APPLE)
set(CMAKE_MACOSX_RPATH ON)
set(CMAKE_SKIP_BUILD_RPATH FALSE)
set(CMAKE_BUILD_WITH_INSTALL_RPATH FALSE)
set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib")
set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
list(FIND CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES "${CMAKE_INSTALL_PREFIX}/lib" isSystemDir)
if("${isSystemDir}" STREQUAL "-1")
set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib")
endif()
endif()

# Check for FUSE.
find_package (FUSE REQUIRED)
Expand Down
2 changes: 1 addition & 1 deletion ci/config.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ set -x
set -e
mkdir build
cd build
../ci/cmake/bin/cmake -DCMAKE_INSTALL_PREFIX:PATH=/tmp/encfs -DCMAKE_BUILD_TYPE=Debug ..
cmake -DCMAKE_INSTALL_PREFIX:PATH=/tmp/encfs -DCMAKE_BUILD_TYPE=Debug ..
3 changes: 0 additions & 3 deletions circle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,6 @@ dependencies:
- sudo apt-get update
- sudo apt-get install cmake libfuse-dev librlog-dev libgettextpo-dev
- bash ./ci/install-gcc.sh
- bash ./ci/install-cmake.sh
cache_directories:
- "ci/cmake"

test:
override:
Expand Down