Notes |
|
(0014273)
|
Robert Lenhardt
|
2008-12-03 03:24
|
|
I made a fix in cmLocalVisualStudio7Generator.cxx where the CMAKE_INTDIR define is passed to the midl compiler through AdditionalOptions and not with PreprocessorDefinitions. This way the define which already has quotes in it does not get double quoted as a whole by the IDE. This fixes the problem. Maybe all defines with double quotes should be passed this way -- in my project i do not have any of those. |
|
|
(0016649)
|
Lluís Batlle
|
2009-06-08 05:57
|
|
I need to use the midl compiler in one of my projects, and I hit with this problem. Is there any chance to have that in a cmake release anytime soon?
Regards,
Lluís. |
|
|
(0018331)
|
Jeroen Dierckx
|
2009-11-03 12:01
|
|
This still doesn't work correctly in Visual Studio 2008, with cmake 2.6-patch4. |
|
|
(0018691)
|
qbproger
|
2009-12-03 09:19
|
|
Just ran into this with Visual Studio 2005, cmake 2.6-patch4. I was trying to convert from vcproj files to cmake. If you'd like me to test with cmake 2.8 I can. |
|
|
(0019235)
|
gfr10
|
2010-01-21 01:07
|
|
Added patch for cmake-2.8.0. |
|
|
(0019362)
|
Robert Lenhardt
|
2010-01-29 06:17
|
|
I added a patch with my not so intrusive fix for 2.8.0.
I can also confirm that this bug applies to VS2008.
So i ask you to put this little fix in the next CMake release.
It would make those locked up in COM very happy.
Thank you, keep up the good work! |
|
|
(0023198)
|
David Cole
|
2010-11-12 07:16
|
|
I have been discouraged from simply applying the simple patch because:
- it only deals with the one CMAKE_INTDIR define, and it should apply to any define that is double-quoted
- it's not clear to me that we should be passing all the C++ defines as MIDL defines in the first place
- there is no test in the CMake test suite that will automatically verify this as fixed on the dashboard runs
If everybody listening in on this bug thinks the simple patch is sufficient, then I guess I should apply it -- after all, it's better than the way things are now, right?
Chime in, add a note, and let me know how many people are listening here, and if you all think the "cmLocalVisualStudio7Generator.cxx.2.8.0.patch" is sufficient. |
|
|
(0023209)
|
Robert Lenhardt
|
2010-11-12 13:23
|
|
Hi everybody,
i can understand your points, but here are some points in favor of this patch:
- the CMAKE_INTDIR macro is special because it is inserted unconditionally -- you can work around in CMakeLists.txt if there is some misbehaving define in one of the COMPILE_DEFINITIONS variables
- witout it you can not include .idl files as cmake sources for VS2005/8
I had a look at the possibility to pass all preprocessor defintions as additional options, but it looks as if you need to change the Options class a lot to make it work, or capture the output of OutputPreprocessorDefinitions and do some dirty string replacement (the following does not work because the defines are missing the /D):
std::ostringsstream oss;
targetOptions.OutputPreprocessorDefinitions(oss, "\n\t\t\t\t", "");
std::string addOptions = oss.str();
std::string::size_type p = 0;
while (p=addOptions.find(p,"PreprocessorDefinitions") != std::string::npos) {
addOptions.replace(p,"AdditionalOptions");
}
So i would opt for including the patch. Regarding your third point -- please point me to the code of some example test for cmake and i will happily provide you with a midl test. I would say the test should do a midl run on an empty .idl file to at least make sure that cmake can run midl out of the box. |
|
|
(0023230)
|
Robert Lenhardt
|
2010-11-12 17:05
|
|
On second thought i favor the removal of preprocessor definitions for midl altogether. If you need defines passed to the idl file you can include a header.
If you add an idl file to an empty Visual Studio project, there are no default defines in the vcproj for midl. So there is no need to try to force passing definitions to the midl commandline in CMake. What do the idl experts monitoring this issue think? |
|
|
(0023231)
|
Scott
|
2010-11-12 17:15
|
|
It would be nice to see a fix for this in the next release so the patch doesn't have to be applied each time a new one is downloaded. |
|
|
(0023236)
|
Robert Lenhardt
|
2010-11-13 02:27
|
|
Just for the record there is now a patch with the removal of the preprocesor options for midl. I have tested it with my idl files and can can confirm it works.
Thank you David for bringing up that issue once again. Sometimes you need to think for two years to remove one line of code ;-)
Can you point me to an example of the cmake test suite, so i can create a simple midl test for the dashboard runs? |
|
|
(0023254)
|
David Cole
|
2010-11-15 07:56
|
|
The CMake test suite is best approached through CMake/Tests/CMakeLists.txt. Many of the subdirectories of CMake/Tests are standalone projects that get built as part of running ctest on CMake itself.
A test for this is probably best wrapped in a block like this:
IF(${CMAKE_TEST_GENERATOR} MATCHES "Visual Studio")
...similar to the VSExternalInclude test. |
|
|
(0023268)
|
Robert Lenhardt
|
2010-11-15 15:47
|
|
I added a midl test run on a barebone idl file with small check if generated files are includeable in main. You can add the following to Tests/CmakeLists.txt right after the VSExternalInclude Test:
ADD_TEST(VSMidl ${CMAKE_CTEST_COMMAND}
--build-and-test
"${CMake_SOURCE_DIR}/Tests/VSMidl"
"${CMake_BINARY_DIR}/Tests/VSMidl"
--build-two-config
--build-generator ${CMAKE_TEST_GENERATOR}
--build-project VSMidl
--build-makeprogram ${CMAKE_TEST_MAKEPROGRAM}
--test-command VSMidl)
LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/VSMidl") |
|
|
(0024421)
|
David Cole
|
2011-01-05 11:08
|
|
|
|
(0026308)
|
David Cole
|
2011-05-02 14:45
|
|
Closing resolved issues that have not been updated in more than 3 months. |
|