-
Notifications
You must be signed in to change notification settings - Fork 61
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
Elliottc/cmake support #164
Conversation
…c support for custom types.
…ed by CMake modules.
…he same each time.
…implify generated CMakeLists.txt files.
… have been modified to replace environment variables.
… regular expressions for splitting the string work properly.
… on the command line.
…s. Also, added output_option to custom_commands.
…notlast, default template variable values, and scope function parameters. Utilize this to correct processing errors in the cmake template.
… and out of the target property. Having it in the target property caused CMake to lose all of the project dependencies.
Any documentation additions needed, like what are the restrictions, how to add find_package(), etc? |
…variable to allow for multiple user-determined packages.
I will do another review early next week, do you plan to add an example to ace/tao/opendds, would be nice when we would build/test tese examples as part of the github actions |
…ated to projects that use the generated project.
…he user to set the variable at the CMake level, instead of in the environment.
What's the recommended way to invoke this? |
Naively using it gives an error:
|
The main thing is that if you're building ACE or ACE related projects, you're going to need to run MPC out of $ACE_ROOT/bin/ instead of $MPC_ROOT. |
I cloned latest MPC and tried with ACE 7.0.11, by setting MPC_ROOT but still error: # created config.h and platform_macros.GNU
$ export MPC_ROOT=$HOME/Git/MPC
$ export ACE_ROOT=$HOME/Downloads/ACE_wrappers
$ cd $ACE_ROOT/bin
$ $MPC_ROOT/mwc.pl -type cmake $ACE_ROOT/ACE.mwc
Generating 'cmake' output using /Users/dev/Downloads/ACE_wrappers/ACE.mwc
XML.mpc: line 1:
ERROR: Unable to locate parent: ace_output
ACE.mwc: line 28:
ERROR: Unable to process ace/XML_Utils/XML.mpc
ERROR: Unable to process: ACE.mwc However deleting and replacing perl ./mwc.pl -type cmake ../TAO/TAO_ACE.mwc
MPC_ROOT was set to /Users/dev/Downloads/ACE_wrappers/MPC.
Using .../Downloads/ACE_wrappers/bin/MakeProjectCreator/config/MPC.cfg
Generating 'cmake' output using /Users/dev/Downloads/ACE_wrappers/TAO/TAO_ACE.mwc
Skipping ACE_XML_Utils (XML.mpc); it requires xerces.
Skipping ACE_FlReactor (ace_flreactor.mpc); it requires fl.
Skipping ACE_FOR_TAO (ace_for_tao.mpc); it requires ace_for_tao.
Skipping ACE_Qt5Reactor_moc (ace_qt5reactor.mpc); it requires qt5.
Skipping ACE_Qt5Reactor (ace_qt5reactor.mpc); it requires qt5.
Skipping ACE_Qt4Reactor_moc (ace_qt4reactor.mpc); it requires qt4.
Skipping ACE_Qt4Reactor (ace_qt4reactor.mpc); it requires qt4.
Skipping ACE_XtReactor (ace_xtreactor.mpc); it requires xt.
Skipping ACE_TkReactor (ace_tkreactor.mpc); it requires tk.
Skipping QoS (qos.mpc); it requires qos.
Skipping ace_svcconf_gen (svcconfgen.mpc); it requires ace_svcconf_gen.
Skipping ACE_FoxReactor (ace_foxreactor.mpc); it requires fox.
Skipping SSL (ssl.mpc); it requires ssl.
Skipping SSL_FOR_TAO (ssl_for_tao.mpc); it requires ssl.
Skipping INet_SSL (inet_ssl.mpc); it requires ssl.
PortableServer.mpc: line 1:
ERROR: Unable to locate parent: pidl_install
TAO_ACE.mwc: line 22:
ERROR: Unable to process tao/PortableServer/PortableServer.mpc
ERROR: Unable to process: TAO_ACE.mwc (Note that I need this to work on older ACE+TAO (6.3.3 or 6.5.11), not just latest.) |
Try running MPC from TAO_ROOT: However I should say building TAO wasn't in scope for these changes and I know it's not going to work. It should be possible, but it just wasn't a priority for us. @ocielliottc could comment on what else is needed, but I know there's currently no way for CMake to generate files from IDL. I think it was mentioned somewhere earlier in this PR, but someone could take the CMake tao_idl support from OpenDDS and adapt it for TAO. |
No luck, same error: $ perl $ACE_ROOT/bin/mwc.pl -type cmake TAO_ACE.mwc
MPC_ROOT was set to /Users/dev/Downloads/ACE_wrappers/MPC.
Using .../Downloads/ACE_wrappers/bin/MakeProjectCreator/config/MPC.cfg
Generating 'cmake' output using TAO_ACE.mwc
Skipping ACE_XML_Utils (XML.mpc); it requires xerces.
Skipping ACE_FlReactor (ace_flreactor.mpc); it requires fl.
Skipping ACE_FOR_TAO (ace_for_tao.mpc); it requires ace_for_tao.
Skipping ACE_Qt5Reactor_moc (ace_qt5reactor.mpc); it requires qt5.
Skipping ACE_Qt5Reactor (ace_qt5reactor.mpc); it requires qt5.
Skipping ACE_Qt4Reactor_moc (ace_qt4reactor.mpc); it requires qt4.
Skipping ACE_Qt4Reactor (ace_qt4reactor.mpc); it requires qt4.
Skipping ACE_XtReactor (ace_xtreactor.mpc); it requires xt.
Skipping ACE_TkReactor (ace_tkreactor.mpc); it requires tk.
Skipping QoS (qos.mpc); it requires qos.
Skipping ace_svcconf_gen (svcconfgen.mpc); it requires ace_svcconf_gen.
Skipping ACE_FoxReactor (ace_foxreactor.mpc); it requires fox.
Skipping SSL (ssl.mpc); it requires ssl.
Skipping SSL_FOR_TAO (ssl_for_tao.mpc); it requires ssl.
Skipping INet_SSL (inet_ssl.mpc); it requires ssl.
PortableServer.mpc: line 1:
ERROR: Unable to locate parent: pidl_install
TAO_ACE.mwc: line 22:
ERROR: Unable to process tao/PortableServer/PortableServer.mpc
ERROR: Unable to process: TAO_ACE.mwc Deleting
My primary need, greater than building ACE/TAO via CMake, is just generating CMake lists that export the ACE/TAO packages (built by whatever means), so other CMake projects can use them. |
It appears that you do not have the At any rate, as @iguessthislldo said, cmake support for TAO isn't available at this time. ACE, gperf, and the tests should build with cmake. |
This is what I was referring to when I answered the comment here DOCGroup/ACE_TAO#266 (comment) the other day. What you're asking for already exists. Here's an example, it may help to download and build this code locally to learn more about it. Everything required is open source and all the build steps are running in GitHub Actions on multiple platforms. Our "downstream" application in this example is https://github.com/OpenDDS/opendds-monitor |
I'm trying to work out how to extract OpenDDS's ACE+TAO CMake bits. Is it necessary to run |
@ocielliottc That was sufficient. export ACE_ROOT=$HOME/Downloads/ACE_wrappers
export TAO_ROOT=$ACE_ROOT/TAO
export MPC_ROOT=$ACE_ROOT/MPC
rm -r $ACE_ROOT/MPC
git clone https://github.com/DOCGroup/MPC.git $ACE_ROOT/MPC
cd $ACE_ROOT/bin
perl ./mwc.pl -type cmake ../ACE.mwc
cd $ACE_ROOT/TAO
perl $ACE_ROOT/bin/mwc.pl -type cmake TAO_ACE.mwc If ACE+TAO is built with MPC before or after this, will the generated CMakeLists export those build artifacts correctly, or try to rebuild them? |
That wouldn't work. CMake would still want to build everything because the object files and libraries wouldn't be where it would expect them to be. It might work if you generate all of the code from the IDL and then try to build using CMake. But, I really don't know if this would work. I've never tried it. |
It's not necessary. If
|
Technically no, all the CMake module needs is the
I don't know if this has been said yet, but just to make sure there's no misunderstanding, the changes in this PR do not allow the generated CMake to export anything, only build what the mpc files are describing. The way MPC is designed separates build ( |
@iguessthislldo That is good to know, I need to link against ACE+TAO from a downstream CMake project, not just build them. This limitation doesn't apply to the OpenDDS CMake stuff, right? opendds-monitor links against things that CMake exports from OpenDDS, ACE, and TAO? |
Yes, that's correct. The CMake support in OpenDDS was created to allow linking with MPC-built OpenDDS and ACE/TAO. If that's all you need then a version with the OpenDDS support stripped out should work for you. |
It's quite difficult to figure out which bits of Is it necessary to configure and build OpenDDS and its dependencies without CMake, as the opendds-monitor action appears to do, before using it from a downstream CMake project? |
Yes I can imagine. I can give you a starting point. I started making a list of what would be the bare minimum to remove, but I realized that it would be easier if I just did it and pushed it to a branch. It also allowed me to test that it works. Some notes on it:
As I said this is the bare minimum and is basically just skipping the critical OpenDDS parts. It would take a decent amount more work to turn into a proper thing that doesn't mention OpenDDS, but I hope it helps.
I'm not sure if this answer is needed anymore, but yes, the CMake module needs to be able to find the built libraries and application from OpenDDS and ACE/TAO. |
Thank you, I've been chewing through this.
Just making sure I wasn't missing anything; OpenDDS's CMake module just exports (not builds), while this PR can build.
That's ok. These correspond to the MPC I'm also trying to understand, what's left before this PR's generated CMake is usable? MPC appears to spit out |
@ocielliottc So, tweaking the CMake template to emit custom targets for IDL files has gotten me very close to a complete CMake build generated from MPC. (cmake.mpd) Because the consumer projects (e.g. AnyTypeCode) reference generated IDL files directly (e.g.
|
I pushed a self-contained example here, using this fork of MPC.
|
I now have a working CMake build of ACE+TAO with IDL generation and no hard-coding. See here with this MPC fork. |
Limited support for CMake.
Custom commands are not inserted into the generated CMakeLists.txt files. It is expected that the user will provide a package or module that will handle generated files in a CMake fashion.