Git Product home page Git Product logo

Comments (16)

atteneder avatar atteneder commented on July 20, 2024 2

I want to load KTX files within Unity3D (editor and runtime)
With the existing build tools it's not easy to quickly integrate the library though, especially since I only need the KTX loading/transcoding part.

So I forked this repo and created my own CMake configuration (plus some C wrapping code) for this purpose only. It will be used in my Texture loading Unity package

from ktx-software.

MarkCallow avatar MarkCallow commented on July 20, 2024 1

Thanks to @atteneder, there is now a CMake build system.

from ktx-software.

MarkCallow avatar MarkCallow commented on July 20, 2024

build/cmake/linux/{Debug,Release}/CMakeLists.txt are generated by GYP from the various .gyp and .gypi files specifically for Linux. It should not be hand edited.

That said, I am interested in replacing gyp with cmake as the reasons I originally chose gyp no longer hold and Google has stopped supporting it. This would replace all the .gyp & .gypi files with one or more CMakeLists.txt files which should probably be in the project root directory, definitely not in the build directory. There are 4 projects: ktxdoc, ktxtests, ktxtools and libktx. I say "one or more" because I am interested in providing Linux distribution packages for ktxtools and libktx and that might require separate CMakeLists.txt for each. I do not know. I have no familiarity with creating distribution packages and limited familiarity with cmake.

from ktx-software.

AbandonedCart avatar AbandonedCart commented on July 20, 2024

The entire setup for trying to build this project on Mac was far more complicated than necessary because of the gyp files and how little material is readily available about non-node gyp.

from ktx-software.

MarkCallow avatar MarkCallow commented on July 20, 2024

@AbandonedCart, did the included xcode projects (build/xcode/{mac,ios}) not work for you? If not what was the issue? I build on the Mac all the time. It's my main development machine. The .xcodeproj files were generated from the gyp files via make xcode in the project root.

If there is something I should fix in the gyp files, please open a new issue.

from ktx-software.

AbandonedCart avatar AbandonedCart commented on July 20, 2024

@MarkCallow Much in the same way I do not like to settle for downloading the compiled binary of something to resolve issues building the source, I would not settle for the .xcodeproj working a solution for difficulty with .gyp files. (Edit: Revised to avoid sounding like an accusation)

I am interested in replacing gyp with cmake as the reasons I originally chose gyp no longer hold and Google has stopped supporting it.

I think this is a good idea. The .gyp files add unnecessary difficulty due to the lack of available support for them.

Hopefully that better explains the purpose of my original post.

from ktx-software.

MarkCallow avatar MarkCallow commented on July 20, 2024

@AbandonedCart, so your main point is to support replacing gyp with cmake. Thanks for the vote.

Much in the same way I do not like to settle for downloading the compiled binary of something to resolve issues building the source

Did you have issues with make xcode?

from ktx-software.

AbandonedCart avatar AbandonedCart commented on July 20, 2024

It failed for the missing gyp. After a lot of stumbling around trying to figure out if it was something that should have been there or something I needed to install, I ended up finding out how travis handles it and doing that. It seemed to work fine after that.

from ktx-software.

 avatar commented on July 20, 2024

@bradc6 @MarkCallow
Has there been any progress on this? We are currently integrating KTX2 with https://github.com/KhronosGroup/glTF-Compressonator and a regular CMake setup would be helpful. @UX3D-wahlster @UX3D-kanzler

from ktx-software.

MarkCallow avatar MarkCallow commented on July 20, 2024

There has been no progress on my end. I keep hoping for a volunteer who knows cmake well to step up.

And a note for anyone who stumbles on this thread who is having a problem, like @AbandonedCart with "missing gyp", there are pointers to both GYP and instructions for installing it in the file BUILDING.md in this repo.

from ktx-software.

MarkCallow avatar MarkCallow commented on July 20, 2024

Thanks for letting us know @atteneder. Hopefully someone can turn it into a more general CMake configuration.

from ktx-software.

MarkCallow avatar MarkCallow commented on July 20, 2024

@atteneder why is it easier to integrate the library within Unity with a CMake configuration? I know very little about CMake.

from ktx-software.

atteneder avatar atteneder commented on July 20, 2024

@atteneder why is it easier to integrate the library within Unity with a CMake configuration? I know very little about CMake.

It's less about CMake, that just happens to be the build tool I'm familiar with. What I needed:

  1. Unity (on macOS) needs native libraries to be in .bundle format (dynamic libs are usually .dynlib files, just like the GYP Xcode project delivers)
  2. To make integrating into C# Unity code easier, I like to create a small C wrapper around the KTX functions I need.
  3. The library binary should be small/stripped to just the things I need.

To achieve this I thought were 3 options:

  1. Learn GYP and tweak it => did not want to since that takes time and GYP does not seem vital anymore
  2. Alter the GYP generated projects (Xcode, cmake, etc.) manually and repeat this everytime they are updated in the future => sounds like a lot of work long/mid-term
  3. Create a new tailor-made CMake configuration

So, option 3 won out.

I may try to add the missing targets (especially the ktxtools) once I've got some time for it.

from ktx-software.

UX3D-wahlster avatar UX3D-wahlster commented on July 20, 2024

A general CMake list that works out of the box would be much appreciated. Right now libktx is not convenient to integrate in other (CMake) projects.

from ktx-software.

MarkCallow avatar MarkCallow commented on July 20, 2024

@atteneder could you provide a PR with the changes to limit the library to reading, transcoding and uploading? It's something in the TODO list. If I get a PR you won't have to apply that change in future pulls.

from ktx-software.

atteneder avatar atteneder commented on July 20, 2024

@atteneder could you provide a PR with the changes to limit the library to reading, transcoding and uploading? It's something in the TODO list. If I get a PR you won't have to apply that change in future pulls.

Sure. I'll try to do it today/tomorrow.

from ktx-software.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.