Trying to use g++-7 with cmake, however, when compiling my g++-7 install is trying to use anaconda's make
base) annaleigh-MacBook-Pro:build annaleigh$ brew reinstall gcc@7
==> Reinstalling gcc@7
==> Downloading https://homebrew.bintray.com/bottles/gcc@7-7.5.0_1.mojave.bottle.tar.gz
Already downloaded: /Users/annaleigh/Library/Caches/Homebrew/downloads/41befd66234ffc03ad4373f51e4c4f87348872de396ac16a79f0a111966ad857--gcc@7-7.5.0_1.mojave.bottle.tar.gz
==> Pouring gcc@7-7.5.0_1.mojave.bottle.tar.gz
/usr/local/Cellar/gcc@7/7.5.0_1: 1,402 files, 254.7MB
(base) annaleigh-MacBook-Pro:build annaleigh$ cmake ../source -DCMAKE_CXX_COMPILER=/usr/local/bin/g++-7
-- The CXX compiler identification is GNU 7.5.0
-- Checking whether CXX compiler has -isysroot
-- Checking whether CXX compiler has -isysroot - yes
-- Checking whether CXX compiler supports OSX deployment target flag
-- Checking whether CXX compiler supports OSX deployment target flag - yes
-- Check for working CXX compiler: /usr/local/bin/g++-7
-- Check for working CXX compiler: /usr/local/bin/g++-7 -- broken
CMake Error at /usr/local/Cellar/cmake/3.16.4/share/cmake/Modules/CMakeTestCXXCompiler.cmake:53 (message):
The C++ compiler
"/usr/local/bin/g++-7"
is not able to compile a simple test program.
It fails with the following output:
Change Dir: /Users/annaleigh/Documents/GitHub/delabel/tutorial/build/CMakeFiles/CMakeTmp
Run Build Command(s):/usr/bin/make cmTC_5cede/fast && /Library/Developer/CommandLineTools/usr/bin/make -f CMakeFiles/cmTC_5cede.dir/build.make CMakeFiles/cmTC_5cede.dir/build
Building CXX object CMakeFiles/cmTC_5cede.dir/testCXXCompiler.cxx.o
/usr/local/bin/g++-7 -march=core2 -mtune=haswell -mssse3 -ftree-vectorize -fPIC -fPIE -fstack-protector-strong -O2 -pipe -stdlib=libc++ -fvisibility-inlines-hidden -std=c++14 -fmessage-length=0 -o CMakeFiles/cmTC_5cede.dir/testCXXCompiler.cxx.o -c /Users/annaleigh/Documents/GitHub/delabel/tutorial/build/CMakeFiles/CMakeTmp/testCXXCompiler.cxx
g++-7: error: unrecognized command line option '-stdlib=libc++'
make[1]: *** [CMakeFiles/cmTC_5cede.dir/testCXXCompiler.cxx.o] Error 1
make: *** [cmTC_5cede/fast] Error 2
I've installed g++7 with brew brew reinstall gcc@7
How can I get my g++7 to use the correct make?