I use cmake to build my project and conan to install Google Test as dependency:
conanfile.txt
[requires]
gtest/1.7.0@lasote/stable
The issue is that you are installing conan dependencies using the default settings (which is build type Release):
$ conan install --build=missing
# equivalent to
$ conan install -s build_type=Release ... --build=missing
The default settings can be seen in your conan.conf
file
Then, you are using cmake in a nix system with the default build type which is Debug, which is a single-conf environment (opposed to multi-configuration Debug/Release environments, as Visual Studio), so when you are doing:
$ cmake .. && cmake --build .
# equivalent to
$ cmake .. -DCMAKE_BUILD_TYPE=Debug && cmake --build .
The incompatibility of Debug/Release build leads to that unresolved issue. So the solution would be to use the same build type that matches your installed dependencies:
$ cmake .. -DCMAKE_BUILD_TYPE=Release && cmake --build .
If using multi-configuration environments like Visual Studio, the correct way would be:
$ cmake .. && cmake --build . --config Release