CMake should be informed about the modules folder where it will look for a FindXXX. You could create a modules-directory in the source directory of your project (where the CMakeLists.txt file resides). So there is no working find_package(SDL2 REQUIRED) out of the box.Īnother approach is using some FindSDL2.cmake file that is floating around in the internet. ![]() While SFML 2.5 Source Code comes with an own SFMLConfig.cmake file that takes care of finding the corresponding libraries when invoking find_package(.) in CMake, this seems to be broken for the SDL2 Source Code that can be downloaded from the official SDL2-Website - at least for the Windows Plattform. They all had in common that they did not work for me - i could not get my project using SDL2-facilities to run on my Windows machine, no matter what. sdl2-config.cmake or SDL2Config.cmake is for CMake standard packaging and it may fill this gap in the. There is an older article describing how to setup SDL2 with CMake and some StackOverflow discussions regarding this topic. Windows and macOS simply lacks standard library packaging system so you will have to do manual configuration or explicitly target some particular 3rd party packaging like vcpkg or homebrew, regardless whether or not your project is in CMake. The official Wiki at gives only little information on how to build and install SDL2 on Windows to utilize the library for your projects. In this case, to view documentation for a symbol at caret, press Control+Q or click View | Quick Documentation from the main menu.Coming from SFML i noticed that setting up SDL2 on Windows using CMake can be.quite tricky. You can also click in the popup and disable the Show on Mouse Move option. ![]() In the Settings dialog ( Control+Alt+S), go to Editor | Code Editing | Quick Documentation and clear the Show quick documentation on hover checkbox. ![]() CLion will attempt to detect the Cygwin installation automatically. Click and select Cygwin to add a new Cygwin toolchain. To specify the delay in milliseconds after which the popup should appear, go to Settings | Editor | Code Editing | Editor Tooltips and enter the necessary value in the Tooltip delay field. To select a package, type its name in the Search field and set the version in the New column: Once the installation is finished, open CLion and go to File Settings Build, Execution, Deployment Toolchains. You can return to the editor and view documentation for other code elements that will open either in the popup or in a new tab in the tool window. Right-click the tab with the documentation in the documentation tool window and enable the Keep This Documentation option.Īfter that, the current documentation tab will be pinned. The asterisk symbol ( *) on the documentation tab means that the tab is not pinned, so its content will be replaced by documentation for another code element that you select in the editor. If the popup appears, press Control+Q again to switch to the tool window. Place the caret at the required code element and press Control+Q. You can open a piece of documentation for a specific code element in the tool window and keep viewing documentation for other elements in your current file. In the Documentation tool window, click the icon on the tool window toolbar and disable the Show Documentation Popup First option. In the quick documentation popup, click and disable the Show Documentation Popup First option. You can change the settings to view documentation in the tool window. With the default settings, pressing Control+Q ( View | Quick Documentation) opens quick documentation in a popup. For example, you can view quick documentation for completion suggestions in find_package:Ĭlick in the popup to change the font size, display the quick documentation toolbar, or go to the source code: In CMake scripts, CLion shows documentation for variables, commands, properties, modules, and policies. ![]() Value and size of a constant expression evaluated at compile time:Ĭompile-time evaluation is especially helpful for working with constexpr and consteval calculations and in template metaprogramming: In the popup, you will see the final macro replacement properly formatted, with highlighted strings and keywords: Macro replacements to help you better understand and debug nested macros (like Boost.Test or Catch macros). In the example below, you can also refer to the TODO comments included in the popup:įor a standard function, structure, or another item, the popup also includes a link to its cppreference: Depending on the element you invoke it for, the popup can include:įunction signature details and code documentation (either regular or Doxygen comments):Ĭopy/move details for structs and classes. CLion shows quick documentation in a popup on mouseover automatically. Quick Documentation popup helps you get more information on a code element at caret.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |