8/1/2023 0 Comments Cmake include subdirectories![]() The issue when using Qt6 is when linking the project: /usr/bin/ld: CMakeFiles/projectname.dir/projectname_autogen/mocs_: in function `Counter::qt_static_metacall(QObject*, QMetaObject::Call, int, void**)': ![]() Target_link_libraries(projectname PRIVATE Qt6::Widgets)Ī very similar CMakeLists.txt file is working for me when compiling a Qt5 project. The CMakeLists.txt: cmake_minimum_required(VERSION 3.10.0)įind_package(Qt6 REQUIRED COMPONENTS Widgets)Īdd_executable(projectname $/include") I am struggling to compile Qt application where includes, sources and ui files are separated into different directories. Including SDL2 headers for your project must happen after SDL2 built by itself.Ĭhange the order then it’ll work: #. If you set SDL2 inside a folder and use add_subdirectory to build it and include_directories to include the headers, the order matters. I just encountered this “ Wrong SDL_config.h” problem with CMake and figured it out. has a patch that is supposed to fix that problem, but hasn’t been merged yet. So people usually end up copying a FindSDL2.cmake from some other project (originally based on FindSDL.cmake for SDL1.2 that’s shipped with cmake), but that’s not really great of course… Using SDL2 with cmake currently sucks because cmake doesn’t provide a FindSDL2.cmake and SDL2 doesn’t provide it (or anything else for integration) either. +1 from my side, too.Am um 21:06 schrieb Daniel Gibson : ![]() The trick to building the SDL source and linking it to my project as I got a “Wrong SDL_config.h” error multiple times. It appeared to work until I tried building my little program in Visual To add the SDL2 source as a subdirectory that is built as part of my Naturally I used cmake with my little program with the intent Would like for users to just type “cmake” and it makes the whole Need to create separate binaries or have multi-leveled build process. My intention was to allow this little program to beĭistributed via source and built on multiple platforms so I wouldn’t I decided to write a little program to try integrating the SDL2 source Supposed to fix that problem, but hasn’t been merged yet. With cmake), but that’s not really great of course… Project (originally based on FindSDL.cmake for SDL1.2 that’s shipped So people usually end up copying a FindSDL2.cmake from some other Using SDL2 with cmake currently sucks because cmake doesn’t provide aįindSDL2.cmake and SDL2 doesn’t provide it (or anything else for In the newly created “build” folder, open the VS2013 solution.Steps to reproduce (in Windows with VS 2013). What is the trick to building the SDL source and linking it to my project as part of my cmake build script? It appeared to work until I tried building my little program in Visual Studio 2013. Naturally I used cmake with my little program with the intent to add the SDL2 source as a subdirectory that is built as part of my cmake build script. I would like for users to just type “cmake” and it makes the whole project. My intention was to allow this little program to be distributed via source and built on multiple platforms so I wouldn’t need to create separate binaries or have multi-leveled build process. I decided to write a little program to try integrating the SDL2 source into my project.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |