-
Notifications
You must be signed in to change notification settings - Fork 25
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature request: Add Microsoft Visual Studio generators #59
Comments
If you already use Visual Studio, why do you need Eclipse to generate build scripts for Visual Studio? AFAIK VS has built-in cmake support. See issue #53. |
That`s by intent. Cmake4eclipse is there to automatically generate and run build-scripts, but not to just tell cmake to generate IDE project files.
|
I agree that the CDT or other IDE generators should NOT be included. cmake -G "Visual Studio 15 2017" will generate the *.sln Solution file -- consider this your Makefile. I cam currently building projects inside CDT using this approach. I need to point cmake buildfile generation invocation to a batch file that replaces the generator string sent by cmake4eclipse - this is ugly. I do not see how adding an option to a dropdown increases your maintenance. If you do not want to endorse using this path, please consider making the dropdown editable, so people can at their own risk fiddle with the cmake invocation. |
Sorry, I wasn`t aware that VS solution files also serve as build-scripts. Please provide some more information to implement this:
As I am on a Linux box, you will have to test a preview if the implementation is finished. |
Thanks for following up on this. ad 2/ ad 3/ ad 4/ Additional notes:
|
Calling
If MsBuild users are custom with that behavior, I think it would be OK to have keep going as the default for msbuild. But if a Eclipse user will select the keep going option in the CDT UI, msbuild would fail,
The name of the file has to be known, since a missing file will cause cmake4eclipse to trigger cmake to generate the build scripts, which gives poor performance. Additionally, CDT's API requires to return the name of the main build script. I don't know for what purposes CDT needs the name, but just giving it an arbitrary name would require testing on windos -> will be Your Task. Did you try the NMAKE generator? AFAIK, it's a MS product delivered with MS studio and it claims to build there projects. |
I am back on this one, sorry for the delay. As detailed earlier I consider it way cleaner to rely on I understand that you must provide a full command string to CDT. My proposal for this is Please note that config is also supported by XCode, so this is no longer a "stupid Windows" but a "non Linux" issue and may be passed to any build tool and ignored. As of the name of the buildfile, as detailed above the buildfile is called ${PROJECT_NAME}.sln. So you will need to know ${PROJECT_NAME} as known to CMAKE. I hope this further clarifies this issue and sufficiently outlines that this is a notable feature. |
Yes, that makes sense to me.
I'm aware of that, but
Support for OSX can be added when a user asks for it and is willing to test it.
This might be a chicken-egg problem, if CDT wants the name of the makefile before |
Am Sonntag, 6. Mai 2018, 12:19:23 CEST schrieb Keve Müller:
I am back on this one, sorry for the delay.
With the recent update of yours (grabbing CMAKE_MAKE_PROGRAM from the cache)
my workflow stopped working.
The plugin always extracted the CMAKE_MAKE_PROGRAM from the cache since its
first release in 2013. What change exactly are you referring to?
my workflow stopped working. Please consider that CMAKE_MAKE_PROGRAM is not
added by all CMake generators
(https://cmake.org/cmake/help/latest/variable/CMAKE_MAKE_PROGRAM.html) --
Yes, I'm aware of that. But the plugin currently *needs* the
CMAKE_MAKE_PROGRAM entry (see below).
again it is the Visual Studio Generator which prefers not to add this to
the cache. You also seem to depend on extracting CMAKE_MAKE_PROGRAM (and
break with hard error) when the user switches off "Use default build
command". Please do not try to extract CMAKE_MAKE_PROGRAM if the user
Any generator that is supported by the plugin sets the CMAKE_MAKE_PROGRAM
cache entry. As a result, it is perfectly ok to rely on the cache entry being
present. If someone wraps cmake with a script that changes the arguments
actually passed to cmake, it's at her own risk.
prefers to manually provide a build command.
As detailed earlier I consider it way cleaner to rely on `cmake --build` for
the invocation of the build process. This spares you from digging into the
cache for CMAKE_MAKE_PROGRAM and a lot of other things. `cmake --build` is
made exactly for that. For old distros shipping old cmake, the user can
with ease provide a manual override and just type there "make or ninja".
I am one of those people that use a distro with just cmake 2.8.x.
I made the plugin to make my life easier. What you suggest, is to make my life
*harder*.
I understand that you must provide a full command string to CDT. My proposal
for this is `cmake --build . --config <<CMakeConfig>> --target`. With
CMakeConfig a property to be set on the CMake/General sheet. CDT will then
append the target and the build just flies.
Please note that config is also supported by XCode, so this is no longer a
"stupid Windows" but a "non Linux" issue and may be passed to any build
tool and ignored.
No, it's an issue with cmake generators that do set CMAKE_MAKE_PROGRAM vs
those that *not* set it. Mingw generator on windows, for example, is no
problem.
|
The Visual Studio generator adds MAKECOMMAND to the CMakeCache, maybe that works? |
Does VS Generator add this on the initial run of cmake? |
I tested with this CMakeLists.txt
and the variable was indeed not set in the cache. Is that an appropriate test? |
Am Freitag, 12. Oktober 2018, 16:55:32 CEST schrieb Michael Kutschke:
I tested with this CMakeLists.txt
`project(test C CXX)`
and the variable was indeed not set in the cache. Is that an appropriate
test?
YES. The cache is read by the plugin to get the make tool to invoke.
…--
Cd wrttn wtht vwls s mch trsr.
|
cmake4eclipse enforces the use of the -G switch to specify generators, but does not list all supported generators.
On the Windows platform cmake supports the different flavours of Microsoft Visual Studio.
Please add them to the dropdown list that selects the generator.
The text was updated successfully, but these errors were encountered: