6/23/2023 0 Comments Cmake options![]() ![]() We also got a glimpse of conditional execution, for those cases where we have to use some nonportable bits and pieces.Īs always, you can find the current status of the project on GitHub. We have now some of the tools we need to fine-tune the compilation of our project: compiler features, definitions and compile options. Target_include_directories(catch INTERFACE $ //warning and error due to unused i # INTERFACE targets only have INTERFACE properties # Header only library, therefore INTERFACE Since we currently do not use C++11 features anywhere except those required by Catch, we should add those requirements to Catchâs CMakeLists.txt, using the target_compile_features command: project (Catch) With CMake, we have the possibility to require compiler features for our targets. So we can expect the compilation to fail with a bunch of errors on compilers that do not support those features. To be honest, I have not tested it myself, but Catch documents that it needs a bunch of C++11 features. If you still have access to some old compiler, you may have noticed that our little project does not compile. This post is part of a series about CMake: Weâll add a few options and a bit of fine-tuning to the compilation of our example project. You may need to make symlinks or copies to help it out if your binaries are named oddly for example on a RHEL5 system we need to force CMake to use /usr/bin/python2.6 rather than /usr/bin/python (which is Python 2.Today Iâll continue the little CMake tutorial series. usr/bin/swig and /usr/local/bin/swig) make sure the PATH variable is set correctly so that the right tool is found before you run CMake. Thus, if you have multiple versions of tools (e.g. Note also that CMake searches in the system path ( PATH environment variable) for command line tools such as python and swig.
0 Comments
Leave a Reply. |