Coder Social home page Coder Social logo

Comments (4)

ethindp avatar ethindp commented on June 8, 2024 1

@gammasoft71 cpm.cmake is pretty neat. I'll give your suggestion a try though - thanks!

from xtd.

gammasoft71 avatar gammasoft71 commented on June 8, 2024

Hi,

First of all, thank you for your interest in xtd.

xtd does not yet have package management, see #221. This may explain your problem.
I don't know cpm.cmake. Maybe adding find_package can be a solution. But I think the best way to do this is to start with a minimal project and for example not to use the xtd.cmake specific commands but the standard cmake commands.

Creates a project too simple like this and try it with cpm.cmake.

  • my_app.cpp
#include <xtd/xtd>

auto main()->int {
  xtd::forms::application::run(xtd::forms::form::create("My app"));
}
  • CMakeLists.txt :
cmake_minimum_required(VERSION 3.20)

project(my_app)
find_package(xtd REQUIRED)
add_executable(${PROJECT_NAME} WIN32 MACOSX_BUNDLE my_app.cpp)
target_link_libraries(${PROJECT_NAME} xtd)

After that, if it works, add specific commands to xtd.cmake like add_sources, add_resources, target_type...
and see what happens.

I hope this helps.

from xtd.

ethindp avatar ethindp commented on June 8, 2024

@gammasoft71 Update: I tried it and it didn't work. It still complained about CMake trying to override my project (saying that, e.g., target_xxx_xxx() (like target_link_libraries) was already called on my CMake project). Essentially what I'm trying to do is download and build xtd alongside my project instead of forcing people to install it separately.

from xtd.

gammasoft71 avatar gammasoft71 commented on June 8, 2024

Sorry this is not working. I don't have enough information to help you.
I think the problem may be that xtd doesn't have package management #221 yet.

Apart from that, I really don't see how xtd's cmake management could be blocking.
The cmake commands added by xtd only set variables to prepare the work of the target_type command.
And it's only when target_type is called that it has specific processing for xtd (such as managing resources, languages and settings).
And if you use standard cmake commands, xtd does nothing...

Stupid question: have you ever tried the same operation with a library as complex as xtd, such as fltk, wxwidgets, or other ?

from xtd.

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.