wxWidgets also provides an example CMake file in the minimal sample folder. Have a look at the CMake Documentation for detailed instructions. You can use find_package(wxWidgets) to use a compiled version of wxWidgets. Using an installed, binary or compiled version of wxWidgets using find_package().If you are using CMake with your own application there are various ways to use wxWidgets: Windows: Visual Studio (any supported version)ĬMake 3.10 or newer is recommended.While CMake in wxWidgets aims to support most generators available in CMake the following generators are recommended: Option NameĪ complete list of options and advanced options can be found when using the CMake GUI. The following list of build options can either be configured in the CMake UI or specified via the -D command line option when running the cmake command. Various build options can be specified using -D see available options. On Windows it is recommended to use Visual Studio and on macOS Xcode is recommended. These can than be specified using the -G command line option. Run cmake -help to see a list of available generators on your platform. to start the build process or directly use your chosen build system. Run cmake -G "Unix Makefiles" path_to_wxWidgets_root.Create a folder where the build/project files should be created.Open the wxWidgets project with your preferred IDE.Optionally: Customize any of the options.Press the Configure button and you will be asked which IDE or build system you wish to use.It's recommended to use a path outside the wxWidgets root folder. Specify a path where the build files should be created.Specify the wxWidgets root as your source folder.Most linux distributions contain CMake as a package on Windows and macOS you can download an installer at the CMake Page. Passed 0.CMake allows building wxWidgets on various platforms with your preferred build system. my_project/buildġ/1 Test #1: HelloTest.BasicAssertions. The CXX compiler identification is GNU 10.2.1 The C compiler identification is GNU 10.2.1 Now you can build and run your test: my_project$ cmake -S. Last two lines enable CMake’s test runner to discover the tests included in the You want to build ( hello_test), and links it to GoogleTest ( gtest_main). The above configuration enables testing in CMake, declares the C++ test binary ) include (GoogleTest ) gtest_discover_tests (hello_test ) With GoogleTest declared as a dependency, you can use GoogleTest code withinĪs an example, create a file named hello_ in your my_project Hash often to point to the latest version.įor more information about how to create CMakeLists.txt files, see the The Git commit hash of the GoogleTest version to use we recommend updating the The above configuration declares a dependency on GoogleTest which is downloadedįrom GitHub. ) # For Windows: Prevent overriding the parent project's compiler/linker settings set (gtest_force_shared_crt ON CACHE BOOL "" FORCE ) FetchContent_MakeAvailable (googletest ) You’ll use this file to set up your project and declare a dependency onįirst, create a directory for your project:Ĭmake_minimum_required (VERSION 3.14 ) project (my_project ) # GoogleTest requires at least C++14 set (CMAKE_CXX_STANDARD 14 ) set (CMAKE_CXX_STANDARD_REQUIRED ON ) include (FetchContent ) FetchContent_Declare ( Set up a projectĬMake uses a file named CMakeLists.txt to configure the build system for a Note: The terminal commands in this tutorial show a Unix shell prompt, but theĬommands work on the Windows command line as well. If you don’t already have CMake installed, see the See Supported Platforms for more information about platforms
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |