Comments (13)
Do you know if gtest was properly installed on your system? The two possible issues comes to mind:
- You did not run the
INSTALL
project when you compiled gtest. If you actually ran the INSTALL target, you should have a new directory underC:/Program Files (x86)/googletest-distribution
or maybeC:/Program Files (x86)/gtest
, I can't exactly remember. - If you specified a custom install location for gtest with
-DCMAKE_INSTALL_PREFIX=<somedirectory>
at cmake at configure time (I usually do), look to see if the actual directory was created. Again, execute theINSTALL
target to create the directory.
The install directory should contains the include
and a lib
directories.
If gtest was properly installed, then you need to tell CMake where to find gtest installation directory.
- If you used option 1, then you should not have to specify where gtest is installed. CMake should be able to find gtest without difficulties.
- If you used a custom installation directory for gtest, you must tell CMake where to find the installation directory. This can be done with GTEST_ROOT environment variable. This is a special variable that
find_package()
will use to find the installation directory. In other words, before runningcmake ..
for win32Arduino, run the commandset GTEST_ROOT=<somedirectory>
and trycmake ..
again. This should allow CMake to find gtest dependency.
from win32arduino.
If my previous suggestion fails, take a look at appveyor's scripts. Look particularly at install_googletest.bat
, install_rapidassist.bat
and build_library.bat
. These are the scripts that must actually executed on a new window system. You will see that I use -DCMAKE_INSTALL_PREFIX=<somedirectory>
extensively.
from win32arduino.
As a general rule, if find_package(foobar)
fails, and you know where foobar
was installed, you can usually define the environment variable foobar_DIR
and make it point to the installation directory. This mechanism is already built-it CMake.
Note: I see you are using cmake-3.12
. I am actually using CMake 3.4.3
. Newer version of CMake seem to be requesting foobar_ROOT
environment variable according to the latest win32Arduino build. This is new since 3.4.3. However, CMake is to be able to find GTest
and rapidassist
packages with the foobar_DIR
format.
from win32arduino.
sorry, i am an noob regarding to cmake. I Looked to your install_googletest.bat
that helped me a little bit to understand what to do.
I'm now here:
cmake -DCMAKE_INSTALL_PREFIX=%GTEST_ROOT% -Dgtest_force_shared_crt=ON ..
cmake --build . --config Release
Till that point, i got anything working. But now when i try to install
cmake --build . --config Release --target install
Microsoft (R)-Build-Engine, Version 15.8.166+gd4e8d81a88 für .NET Framework
Copyright (C) Microsoft Corporation. Alle Rechte vorbehalten.
MSBUILD : error MSB1009: Die Projektdatei ist nicht vorhanden.
Schalter: install.vcxproj
It doesn't find any install.vcproj which isn't a suprise to me, because this file doesn't exists.
Also the GTEST_ROOT directory is empty
This seems to be an GTest issue i know, but otherwise i didn't find any "install" command on the googletest site.
from win32arduino.
If I understand you correctly, when you tried
cmake -DCMAKE_INSTALL_PREFIX=%GTEST_ROOT% -Dgtest_force_shared_crt=ON ..
cmake --build . --config Release
you were actually trying to build gtest and not win32Arduino.
If not, then what are actually saying with cmake -DCMAKE_INSTALL_PREFIX=%GTEST_ROOT% -Dgtest_force_shared_crt=ON ..
is that you want to install win32Arduino into gtest install directory. This could be working but is considered bad practice.
from win32arduino.
Yes, i tried to build and Install gtest. Isn't that correct?
from win32arduino.
Yes that is correct.
from win32arduino.
Regarding your problem with the missing install.vcxproj
, I do not know what to think. As far as I know, CMake always creates an INSTALL target when your CMakeList.txt file contains install()
. The googletest's CMakeList.txt does contains install() commands.
Are you sure that %GTEST_ROOT%
is properly set for your current process? To verify, try to execute echo GTEST_ROOT=%GTEST_ROOT%
and look at the result. If %GTEST_ROOT%
is unset, then it would mean you are actually running cmake -DCMAKE_INSTALL_PREFIX= -Dgtest_force_shared_crt=ON ..
(note the empty CMAKE_INSTALL_PREFIX), which could prevent CMake from generating the INSTALL target.
One more thing, the target should be INSTALL and not install. As far as I know, Windows/Visual Studio should not be case sensitive but you never know...
Another option is difference between Visual Studio versions. I think you are using Visual Studio 2017 (based on Microsoft (R)-Build-Engine, Version 15
) and I also think that VS2017 has its own version of CMake. Could there be a difference ? I build locally with VS2010 and AppVeyor builds with VS2015 (see this line and this line).
from win32arduino.
ok, i got it.
there are two directorys called googletest.
I was trying all that stuff in the subdir googletest of googletest....
win32arduino\lib\googletest\googletest
I then changed to the upper directory and installed googletest
cd build
cmake ..
cmake -DBUILD_GMOCK=0 -DCMAKE_INSTALL_PREFIX=%GTEST_ROOT% -Dgtest_disable_pthreads=on -Dgtest_force_shared_crt=ON ..
cmake --build . --config Release
cmake --build . --config Release --target install
Googletest is now installed.
from win32arduino.
there are two directorys called googletest.
I was trying all that stuff in the subdir googletest of googletest....
win32arduino\lib\googletest\googletest
I then changed to the upper directory and installed googletest
Correct!
But I see you execute cmake configuration twice:
cmake ..
cmake -DBUILD_GMOCK=0 -DCMAKE_INSTALL_PREFIX=%GTEST_ROOT% -Dgtest_disable_pthreads=on -Dgtest_force_shared_crt=ON ..
I am not even sure your second cmake call does something. If I try this I get the following warnings from CMake:
-- Configuring done
-- Generating done
CMake Warning:
Manually-specified variables were not used by the project:
gtest_disable_pthreads
gtest_force_shared_crt
and my solution file is missing both gtest and gmock.
from win32arduino.
I noticed that you call -DBUILD_GMOCK=0
. Note that CMake boolean option should be specified to ON
of OFF
. I do not think that 0
(or 1
) are accepted values. I think that when you call -DBUILD_GMOCK=0
, this results in an empty solution. See How to set a CMake option() at command line and How the heck does one set options for reference.
from win32arduino.
When specifyin the CMAKE_INSTALL_PREFIX to a directory Documents\project\tests\install
cmake -DBUILD_GMOCK=0 -DCMAKE_INSTALL_PREFIX=%GTEST_ROOT% -Dgtest_force_shared_crt=ON ..
cmake --build . --config Release --target install
then cmake must know this path, to look there for installed projects which doen't contain a find file.
set CMAKE_PREFIX_PATH=Documents\project\tests\install
from win32arduino.
Just a info for you.
I got it now, that my testproject and all the libs compiles on linux (travis-ci) and also on my windows machine.
The vs project , which cmake generates was easy to add to my vs project. On linux i hat do debug some things but now it is up and running
from win32arduino.
Related Issues (20)
- Find a new name for library HOT 4
- ATOMIC_BLOCK macro
- Update all documentation for Linux users
- /ci/ant/setupenv.bat is missing HOT 21
- Replace downloaded googletest third party library by a git submodule HOT 1
- Update documentation files in preparation of release v2.1.0 HOT 1
- Circle CI integration HOT 1
- Use RapidAssist as a git submodule
- Pin registers and port mapping functions
- License header in all files HOT 1
- Implement 'make install' command support HOT 1
- Define if `Arduino.h` or `arduino.h` HOT 4
- Missing build step in v2.2.1 HOT 1
- Tag for version 2.2.1 builds as 2.3.0 HOT 1
- rapidassist outside of win32arduino? HOT 6
- wrong syntax for variables on windows HOT 14
- Crash on calling millis() before entering main()
- Logging should be in memory until a test completes
- Change api functions to match officials signatures of Arduino.h
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from win32arduino.