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
[QUESTION] using xtd in a pre-written CMake project #251
Comments
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. Creates a project too simple like this and try it with
#include <xtd/xtd>
auto main()->int {
xtd::forms::application::run(xtd::forms::form::create("My app"));
}
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 I hope this helps. |
@gammasoft71 cpm.cmake is pretty neat. I'll give your suggestion a try though - thanks! |
@gammasoft71 Update: I tried it and it didn't work. It still complained about CMake trying to override my project (saying that, e.g., |
Sorry this is not working. I don't have enough information to help you. Apart from that, I really don't see how xtd's cmake management could be blocking. Stupid question: have you ever tried the same operation with a library as complex as xtd, such as fltk, wxwidgets, or other ? |
Your question
I'm trying to incorporate xtd into a project via the cpm.cmake package manager. However, this doesn't work because I have to first execute
find_package
and then when I try to dotarget_xxx
CMake either: (1) claims that target_link_libraries(...) has already been used, or (2) the library tries to generate assembly information, but it does it in a weird way (it does something like${CMAKE_SOURCE_DIR}/{generated_code_here}
). Obviously, this doesn't work. What am I doing wrong?The text was updated successfully, but these errors were encountered: