From fa91beed17bfaa078e801478a7fa9fe529110b75 Mon Sep 17 00:00:00 2001 From: Nikolaus Demmel Date: Tue, 30 Apr 2019 21:08:39 +0200 Subject: [PATCH 1/3] ci: tweak 'modified' detection in clang-format job --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index bf51e76..9742e2f 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -140,7 +140,7 @@ clang-format: script: - ./scripts/clang-format-all.sh # check if any files are now modified and error if yes - - (if git diff --name-only --diff-filter=M | grep '\..pp$'; then echo $'\n Some files are not properly formatted. You can use "./scripts/clang-format-all.sh".\n'; git diff --diff-filter=M; false; fi) + - (if [ -n "`git diff --name-only --diff-filter=M`" ]; then echo $'\n Some files are not properly formatted. You can use "./scripts/clang-format-all.sh".\n'; git diff --diff-filter=M; false; fi) bionic-test: <<: *test_deb_definition From ef8f5e40bdadc54e4e195abba2a96274b6897340 Mon Sep 17 00:00:00 2001 From: Nikolaus Demmel Date: Mon, 13 May 2019 21:40:02 +0200 Subject: [PATCH 2/3] cmake: more strictly enforce finding the included eigen version --- CMakeLists.txt | 2 +- cmake_modules/FindEigen3.cmake | 11 +++++------ 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 9791c08..c064a37 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -167,7 +167,7 @@ set(CMAKE_CXX_FLAGS "${BASALT_CXX_FLAGS} -march=${CXX_MARCH} ${BASALT_PASSED_CXX set(EIGEN_INCLUDE_DIR_HINTS ${EIGEN_ROOT}) -find_package(Eigen3 3.3.7 REQUIRED) +find_package(Eigen3 3.3.7 EXACT REQUIRED MODULE) include_directories(${EIGEN3_INCLUDE_DIR}) message(STATUS "Found Eigen headers in: ${EIGEN3_INCLUDE_DIR}") if(NOT EIGEN3_INCLUDE_DIR MATCHES "^${EIGEN_ROOT}") diff --git a/cmake_modules/FindEigen3.cmake b/cmake_modules/FindEigen3.cmake index 9c44084..9826d69 100644 --- a/cmake_modules/FindEigen3.cmake +++ b/cmake_modules/FindEigen3.cmake @@ -15,6 +15,10 @@ # Copyright (c) 2009 Benoit Jacob # Redistribution and use is allowed according to the terms of the 2-clause BSD license. +# Adaptations (c) Nikolaus Demmel 2019 +# - pass NO_DEFAULT_PATH --> only works when passing exact HINTS + + if(NOT Eigen3_FIND_VERSION) if(NOT Eigen3_FIND_VERSION_MAJOR) set(Eigen3_FIND_VERSION_MAJOR 2) @@ -63,12 +67,7 @@ else (EIGEN3_INCLUDE_DIR) find_path(EIGEN3_INCLUDE_DIR NAMES signature_of_eigen3_matrix_library HINTS ${EIGEN_INCLUDE_DIR_HINTS} - PATHS - /usr/local/include - /opt/local/include - ${CMAKE_INSTALL_PREFIX}/include - ${KDE4_INCLUDE_DIR} - PATH_SUFFIXES eigen3 eigen + NO_DEFAULT_PATH ) if(EIGEN3_INCLUDE_DIR) From ce03cf1518f08ceb0ab945a1bb3d5e2026127a9c Mon Sep 17 00:00:00 2001 From: Nikolaus Demmel Date: Mon, 13 May 2019 21:40:35 +0200 Subject: [PATCH 3/3] cmake: fix recent cmake regression on macos --- CMakeLists.txt | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index c064a37..8f4b3cc 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -110,9 +110,11 @@ if(APPLE) set(CMAKE_FIND_FRAMEWORK LAST) # use brewed llvm's libc++ - add_compile_options("-nostdinc++") - include_directories("/usr/local/opt/llvm/include/c++/v1") + # Note: the suffix "/../v1" for the include path is needed to work around a recent cmake issue: + # https://gitlab.kitware.com/cmake/cmake/issues/19251#note_571030 + include_directories("/usr/local/opt/llvm/include/c++/v1/../v1") link_directories("/usr/local/opt/llvm/lib") + add_compile_options("-nostdinc++") set(STD_CXX_FS c++fs) if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang")