![]() I prefer this approach, since you could decide to go with C++20 during configuration. Is not an exact equivalent for setting the C++ standard, but rather provides a lower bound that could be overwritten by setting CMAKE_CXX_STANDARD as a cache variable during configuration. target_compile_features(untitled1 PRIVATE cxx_std_17) link_libraries(untitled1 aa_lib) only applies to cmake targets created specified after the cmake command and it would also try to link untitled1 to such a target. Target_link_libraries(untitled1 PRIVATE aa) # add the following list of libraries to the libraries linked to target untitled1: Target_compile_features(untitled1 PRIVATE cxx_std_17) # specify a target specific minimum here instead of globablly specifying the choice This means you should be able to link the library using the following CMakeLists.txt file: cmake_minimum_required(VERSION 3.25) Furthermore based on this we can tell that the name of the library to provide to the linker is aa. usr/lib/x86_64-linux-gnu is searched by default by the linker for libraries, so specifying the full library path or additional link directories is not necessary. ![]() When I use targetlinklibraries it says that A also need to be INTERFACE. P uses A and B and I also need to make B using A. I just have a project P, libary A and header-only library B. The shared library is installed at /usr/lib/x86_64-linux-gnu/libaa.so. How to include non-interface library to interface library Usage. The header file is installed at /usr/include/aalib.h /usr/include should be part of the default include dirs, so we don't need to adjust the include dirs. This prevents the use of find_package, at least without writing one on your own find script/package configuration file. Given the list of files in the libaa1 package we can make the following observations: Provides a separate development package or SDK, be sure it has been ![]() such as GNU Make, BSD Make, or CMake, or an IDE, where you will specify the. ![]() "aa_lib_DIR" to a directory containing one of the above files. If both dynamic and static libraries are available, the linker will choose. Returns CMake Error at CMakeLists.txt:8 (find_package):īy not providing "Findaa_lib.cmake" in CMAKE_MODULE_PATH this project hasĪsked CMake to find a package configuration file provided by "aa_lib", butĬould not find a package configuration file provided by "aa_lib" with anyĪdd the installation prefix of "aa_lib" to CMAKE_PREFIX_PATH or set I installed aalib through add-apt-repository ppa:aalib & apt install libaa1 libaa1-dev libaa-bin. This is my first time using CMake, and I can't get aalib working. I'm trying to link aalib to my cmake executable, and can't get it working. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |