4 Replies Latest reply on Mar 30, 2020 12:13 AM by GaAn_541926

    How to Use CMakeLists.txt files in Wiced Studio (Eclipse IDE)

    GaAn_541926

      Support People:

       

      I need some help with this one please:

       

      I have a Visual Studio 2017 project that starts with a "head" CMakeLists.txt file (see attachment) to build the project, then descends into many sub-folders and files, each with their own CMakeLists.txt files for building the lower-level support code.

       

      I have tried to create an "MK" file to use with the Wiced-Eclipse project builder, but that has too many possibilities for human error during creation.

       

      The CMakeLists.txt build system works correctly in the Visual Studio environment, so it would be nice if that system could be used by Wiced-Eclipse.

       

      QUESTION: Is there a good way that I can launch the CMakeLists.txt compile-chain from within Wiced-Eclipse, and if so, where may I find the steps to follow for its implementation?

       

      I am thinking that this must be documented somewhere, because I am not the first one to consider this build option.

       

      Any help would be greatly appreciated.

       

      Thanks,

      Garry Anderson.

      email 1 = garry.lifebooster@gmail.com

      email 2 = design@robustfirmware.com

        • 1. Re: How to Use CMakeLists.txt files in Wiced Studio (Eclipse IDE)
          RaktimR_11

          As ridiculous it may sound, we have not tried this. So, my advice to you would be using the cmake generators to generate the .mk files and port them to WICED. While porting you might come across some errors but still manually editing the .mk files to make it work seems to be the only way forward.

          1 of 1 people found this helpful
          • 2. Re: How to Use CMakeLists.txt files in Wiced Studio (Eclipse IDE)
            GaAn_541926

            Hi RaktimR_11:

             

            Thanks for your reply.  That was my conclusion this morning, so now I am looking at  cmake -G "Eclipse CDT4 - Unix Makefiles" ./  as the way to generate that MK file, but I don't know what it will generate and where the results will be stored.

            See: https://stackoverflow.com/questions/11645575/importing-a-cmake-project-into-eclipse-cdt

             

            Is that your suggestion too, to use "cmake -G" to generate at CDT4 Unix Makefile format?  If not, are there other alternatives that you suggest?

             

            Do you know how many MK files are made by the Generator, and now many MK files do I need for WICED to build?  I seem to recall that there are several MK files in my folders.

             

            I also found a converter called "cmake4eclipse" in the Eclipse Marketplace, but trying to import it with "Help->Install New Software" does not work, so I cannot check out that idea.  Would you see if you can Install New Software called "cmake4eclipse" and let me know how you made it work?  When I tried it, the "cmake-eclipse-helper" installed okay, but the "cmake4eclipse" failed.

             

            Thanks, Garry Anderson.

            • 3. Re: How to Use CMakeLists.txt files in Wiced Studio (Eclipse IDE)
              GaAn_541926

              Hi RaktimR_11:

               

              Here are the images of the failure to install the cmake4eclipse plug-in.

              Can you help identify the reason for this failure, and how t get around it.

               

              Thanks,

              Garry.

               

              Cmake4Eclipse_MarketPlaceConfirm.jpgCMake4Eclipse_MarketPlaceFailure.jpg

              • 4. Re: How to Use CMakeLists.txt files in Wiced Studio (Eclipse IDE)
                GaAn_541926

                Hi RaktimR_11:

                 

                The "cmake" generator (cmake -G "Eclipse CDT4 - Unix Makefiles"), creates a tree of make files called "cmake.install.cmake" and each file is like the attached file, and uses the files in its own directory.  This is good, and it appears to be the MK file structure that I need,

                 

                BUT ...  How can I modify Wiced-Eclipse "build" action to look for "cmake.install.cmake" files instead of MK files?  Or, is there a command-line option to have the cmake command add "MK" extensions instead of "cmake" extensions?

                 

                Do I have to rename all the files, and any references that refer to them?  It is a lot of work, so it seems better to simply change the way the "build" command works.

                 

                Thanks for your help.