diff --git a/.gitignore b/.gitignore index 5ed97f792ec8e3f95437d94e572a2d16c0b39725..7ddf9b7e3c77a0cc492c738c47b5a97a6b7e7997 100644 --- a/.gitignore +++ b/.gitignore @@ -145,3 +145,12 @@ flycheck_*.el # Python/Sphinx env/ + +# Conan build files +build_tools +conan.lock +conan_imports_manifest.txt +conanbuildinfo.cmake +conanbuildinfo.txt +conaninfo.txt +graph_info.json diff --git a/Makefile b/Makefile index a024d31675b8ca1e3c1ec9967b0e5e3045872f25..367c0de989e9fa373b7a01afffc2720a5834508d 100644 --- a/Makefile +++ b/Makefile @@ -23,6 +23,23 @@ CLANG_FORMAT ?= clang-format-11 +CONAN_SETTINGS = "compiler.libcxx=libstdc++11" + +# OS specific handling, with code by Ken Jackson and oHo, +# from https://stackoverflow.com/a/52062069/232888 and +# https://stackoverflow.com/a/14777895/232888 +ifeq '$(findstring ;,$(PATH))' ';' + DETECTED_OS := Windows +else + DETECTED_OS := $(shell uname 2>/dev/null || echo Unknown) + DETECTED_OS := $(patsubst CYGWIN%,Cygwin,$(DETECTED_OS)) + DETECTED_OS := $(patsubst MSYS%,MSYS,$(DETECTED_OS)) + DETECTED_OS := $(patsubst MINGW%,MSYS,$(DETECTED_OS)) +endif +ifeq ($(DETECTED_OS),Darwin) # Test if we are on MacOS + CONAN_SETTINGS := "cppstd=11" +endif + .PHONY: help help: @@ -36,11 +53,13 @@ style: .PHONY: style conan-install: - conan install . -s "compiler.libcxx=libstdc++11" + conan install . -s $(CONAN_SETTINGS) || \ + (echo "'conan install' failed, trying to build from sources..."; \ + conan install . -s $(CONAN_SETTINGS) --build=missing) .PHONY: conan-install conan-create: - conan create . -s "compiler.libcxx=libstdc++11" + conan create . -s $(CONAN_SETTINGS) .PHONY: conan-create conan: conan-install conan-create diff --git a/doc/README_SETUP.md b/doc/README_SETUP.md index a5976af95de78a01e6ae174e39cc6a66881c28ac..46026eee1da7ea078f93687812833f957bd75312 100644 --- a/doc/README_SETUP.md +++ b/doc/README_SETUP.md @@ -34,6 +34,11 @@ have to add `build/lib/` (or, alternatively after installation, `CMAKE_INSTALL_PREFIX/lib`) to your `DYLD_LIBRARY_PATH` environmental variable. +#### Problems and solutions #### + +- Make sure that your conan version supports your XCode version. A typical symptom of version + mismatch is for example conan complaining about incompatible `compiler.version` settings. + ### How to build on Windows We use [Visual Studio 2019](https://visualstudio.microsoft.com/de/vs/features/cplusplus/)