![]() My use case is as follows: I've got a project whose primary target is a single library libproject. Dependencies between binary targets are expressed using the targetlinklibraries() command: addlibrary(archive archive.cpp zip.cpp lzma.cpp) addexecutable(. Of course, there are solutions ready for C&P on StackOverflow (e.g., ), but I'm kind of wondering: since this is such a hassle, does CMake even want me to do that or is there something wrong (non-idiomatic) with my setup? 3 Answers Sorted by: 35 In current CMake releases: After some error checking adddependencies results in a call to Target->AddUtility (). To me, this is kind of surprising, since it seems like a very common thing one might want to do. if your post does not appear in the new queue, just send a message to the moderators.ĪFAIK, CMake does not offer any (convenient) way to combine several static libraries into one (static or shared) library and doing so in a portable (generator, platform) way seems to be non-trivial.make your questions relevant to other readers. Compiler flags, definitions, source files, include folders, link libraries, and linker options are properties of a.give your post a meaningful title, i.e., NOT "I have a C++ problem" but, e.g., "Problem with nested for loops".In the first case, create a FindPower.cmake script file, make sure its location is part of the CMAKEMODULEPATH and write the code for finding the library and header files and constructing the imported target in there. 8 Linking with CMakeLists: ld cannot find library. You can either construct such an imported target manually in the find script, or have CMake do it for you. target link interface, Ill have to explicitly link against Foo. thoroughly research for an answer first. cmake/make: linker ld does not find library (missing path) 1 Linux, C++, Lua 5.3, CMake, undefined reference. needs to include headers from Bar, and use symbols from Bar.Tips for improving your chances of getting helpful answers: CMake Version This specifies the minimum required version of CMake. ![]() Read these guidelines for how to ask smart questions.įor learning books, check The Definitive C++ Book Guide and Listįlair your post as SOLVED if you got the help you were looking for! If you need help with flairs, check out ITEM 1 in our guidelines page. Any CMake-compliant package contains at least one CMakeLists. Hasty-sounding questions get hasty answers, or none at all. New to C++? Learn at READ BEFORE POSTINGīefore you post, please read our sticky on proper code formatting. ![]() This is a subreddit for c++ questions with answers.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |