Announcement

Collapse
No announcement yet.

How to compile a plugin project with XCode

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    How to compile a plugin project with XCode

    Following the description to copy an existing engine plugin:

    - I copied the BlankPlugin and renamed all strings and filenames from BlankPlugin to MyPlugin.
    - Then deleted binaries and intermediate files.
    - Copied the MyPlugin folder containing Sources and Resources and the MyPlugin.uplugin file into the XCode project under UE4-Engine-Plugins.

    In order to compile the plugin, I would need a target, but none of the stock plugins has one. So Im struggling here, wondering how to compile it.
    Anybody knows the hidden magic? Thank You. :-)
    Get your GAME done - Productivity Plugins for Unreal Engine.

    My articles in Game Programming Gems:
    Real Time Modular Audio Processing For Games
    A Lightweight Generator for Real-Time Sound Effects
    Controlling Real-Time Sound Synthesis from Game Physics

    #2
    Is there nobody here, who had success compiling an engine plugin on OSX?
    Thank you for considering helping me. :-)
    Get your GAME done - Productivity Plugins for Unreal Engine.

    My articles in Game Programming Gems:
    Real Time Modular Audio Processing For Games
    A Lightweight Generator for Real-Time Sound Effects
    Controlling Real-Time Sound Synthesis from Game Physics

    Comment


      #3
      Where exactly did you put the plugin source? And did you run the GenerateProjectFiles.command to regenerate the UE4 XCode project after doing so?
      Contact: enlight in #unrealengine IRC channel on Freenode, or @macagonator on Twitter

      Comment


        #4
        Originally posted by enlight_2014 View Post
        Where exactly did you put the plugin source? And did you run the GenerateProjectFiles.command to regenerate the UE4 XCode project after doing so?
        Thank you for helping.
        I copied my new renamed plugin MyPlugin to the same level as the BlankPlugin under
        .../UnrealEngine/Engine/Plugins/Developer/

        Then I dragged this MyPlugin folder into the XCode project under UE4-Engine->Plugins->Developer,
        also at the same level as the BlankPlugin.

        I leave XCode and run the GenerateProjectFiles.command, but cant see any changes made to the XCode project (still 27 targets).
        Building the UE4Editor target doesn't build the plugin, no intermediate files or binaries ( expecting a dylib) are created.

        What did you to make your engine plugin compile?
        Get your GAME done - Productivity Plugins for Unreal Engine.

        My articles in Game Programming Gems:
        Real Time Modular Audio Processing For Games
        A Lightweight Generator for Real-Time Sound Effects
        Controlling Real-Time Sound Synthesis from Game Physics

        Comment


          #5
          Originally posted by rotwang View Post
          Then I dragged this MyPlugin folder into the XCode project under UE4-Engine->Plugins->Developer,
          also at the same level as the BlankPlugin.
          You shouldn't need to do this, GenerateProjectFiles.command should do this for you.

          Originally posted by rotwang View Post
          I leave XCode and run the GenerateProjectFiles.command, but cant see any changes made to the XCode project (still 27 targets).
          Building the UE4Editor target doesn't build the plugin, no intermediate files or binaries ( expecting a dylib) are created.
          I'm using Visual Studio myself, but assuming that the generated UE4 XCode project has a similar layout plugins will not have a separate target, they'll be built as part of the UE4Editor target.

          Originally posted by rotwang View Post
          What did you to make your engine plugin compile?
          I haven't actually tried compiling my plugin as part of the UE4 project, what I've done is create a new "Basic C++" project from the Editor and then put my plugin into the Plugins directory of that project. That way I can easily build my plugin using the source version or the launcher version of the engine, and avoid accidental rebuilds of the entire engine. More details here: https://github.com/enlight/ue4-hg-pl...g-from-scratch
          Contact: enlight in #unrealengine IRC channel on Freenode, or @macagonator on Twitter

          Comment


            #6
            Thank you, I will start with a new "Basic C++" project to integrate my source, like you did.
            Hoping, that in the next weeks, someone will solve that plugin problem.

            So, if any developer on OSX reads this: Please show me the steps to get an engine plugin target build.
            Get your GAME done - Productivity Plugins for Unreal Engine.

            My articles in Game Programming Gems:
            Real Time Modular Audio Processing For Games
            A Lightweight Generator for Real-Time Sound Effects
            Controlling Real-Time Sound Synthesis from Game Physics

            Comment


              #7
              Did you ever get your plugin to build using xcode? i'm currently trying to go through the process, however i am having difficulty finding the resources to do so.

              Comment


                #8
                Since I had problems this week and this thread keeps showing up for this question, I'll try to answer:

                Here's how I got it working with UE 4.13.2:
                1. Download the code for UE from Github
                2. Run GenerateProjectFiles.command
                3. Open the generated XCode project file (I used Xcode 8.1).
                3a. Make sure the Command Line Tools are installed.
                4. Build the UnrealEngine project.
                4a. This takes a couple of hours on a recent MBP, so kick it off and go do something else
                5. Open Unreal Editor and create a new Basic C++ project.
                5a. Close UnrealEd
                6. Run GenerateProjectFiles.sh against the new project's base directory.
                6a. This will create an xcode project structure for the entire project
                7. Create the Plugins folder in the base project folder.
                8. Copy BlankPlugin from the Unreal Engine folder (for me, /Users/Shared/UnrealEngine/4.13/Engine/Plugins/Developer/BlankPlugin to the project's Plugins folder
                9. Rename folders, files, and classes to the new plugin's name.
                9a. Don't forget to modify the .uplugin file as well!
                10. Open the project in Xcode and run the Build task. Your plugin should build.

                It's very likely that at this point you could just create that same project, however, and then click Settings->Plugin->New Plugin. Which is...well, it's a bit frustrating, isn't it?

                Comment


                  #9
                  Really - this seems very painful. Trying to work out how to build a mac plugin here too - documentation is lacking. Thanks for the post Michael, i will try your method.

                  Comment


                    #10
                    For everyone who needs to compile plugins on a Mac you need:
                    1. Mac with UE installed.
                    2. Blank C++ project.
                    3. Create a folder named "plugins" inside your project.
                    4. Inside "plugins" folder create your actual plugin folder with Source and uplugin files.
                    5. Delete Intermediate and Build folder from your plugin.
                    6. Inside your .uplugin file add "OSX" to the whitelist.
                    7. Generate XCode files by right clicking your uproject file.
                    8. Double click the uproject file to open UE4.
                    9. Compile.

                    After that you should have Binaries folder inside your plugin.

                    If after all that UE4 can see the plugin enabled, but can't use any of its functions, try adding your plugin as a module to game.build.cs inside your project source folder.

                    Hope it would be helpful!

                    Comment


                      #11
                      Sorry to necro this, but does anyone have an idea why for "7.Generate XCode files by right clicking your uproject file" I dont have an option to generate xcode files when i right click? Thanks for the help.

                      Comment


                        #12
                        Originally posted by EmpireLion View Post
                        Sorry to necro this, but does anyone have an idea why for "7.Generate XCode files by right clicking your uproject file" I dont have an option to generate xcode files when i right click? Thanks for the help.
                        It should be way at the bottom in the submenu for Services. Yeah, I missed it too.

                        Comment


                          #13
                          Originally posted by Hnomer View Post
                          For everyone who needs to compile plugins on a Mac you need:
                          1. Mac with UE installed.
                          2. Blank C++ project.
                          3. Create a folder named "plugins" inside your project.
                          4. Inside "plugins" folder create your actual plugin folder with Source and uplugin files.
                          5. Delete Intermediate and Build folder from your plugin.
                          6. Inside your .uplugin file add "OSX" to the whitelist.
                          7. Generate XCode files by right clicking your uproject file.
                          8. Double click the uproject file to open UE4.
                          9. Compile.

                          After that you should have Binaries folder inside your plugin.

                          If after all that UE4 can see the plugin enabled, but can't use any of its functions, try adding your plugin as a module to game.build.cs inside your project source folder.

                          Hope it would be helpful!
                          Mannnnn here we are in 2020 and this post saved me! i've been pounding my head against the wall trying to figure this issue out for days! Thank you so much!!

                          Comment


                            #14
                            This post is rising from the dead, just in time for Halloween!

                            My library shows that I own the plugin:

                            Click image for larger version

Name:	autosettings_destroyme.jpg
Views:	92
Size:	470.2 KB
ID:	1822255

                            ...I created that image for a Discord forum where someone said they had success, but it turned out they had a windows machine install the plugin across a repo.

                            I would like to know if it's possible to do this from macOS without involving windows, since I have many more plugins now and for going ahead to the future.

                            So:

                            Step 4: How do I put the Source and .uplugin files in a folder if I can't find those original files?

                            Also:
                            Step 6. Where is the definitive .uplugin file? What's the format for adding OSX to the list?

                            Thank you from a derelict starship!

                            Comment

                            Working...
                            X