![]() If you set your build directory to another directory other than current directory, let say, /build, then you should specify it as cmake -build build -target help. in dir1/CMakeLists.txt add: add_sources(file1.cpp file2.cpp)Īnd in dir2/CMakeLists.txt add: add_sources(file3.cpp file4. target help is assuming your build directory is at current directory, as indicated by the 'dot'. /setvars.sh For private installations.In the sub directories, you can simply add a macro call, e.g. If you did not complete the steps in One time set up for setvars.sh in the Configure Your System section, set system variables by sourcing setvars: For system wide installations (requires root or sudo privileges). If the macro is invoked from inside a project sub directory the new value of the variable SRCS needs to be propagated to the parent folder by using the PARENT_SCOPE option. The macro first computes the path of the source file relative to the project root for each argument. craig. In the CMakeLists.txt in the project root folder, add the following macro definition: macro (add_sources)įile (RELATIVE_PATH _relPath "$") shows cmake ending up with a list with 6 elements instead of a list with 2 elements with each element being a list with 3 elements set(fooa 1 2 3) set(foob. debug (Linux)fverbose-asmgsplit-dwarfZi, Z7, ZI. The macro can then be called in all the project CMake list files to add sources. device-math-libfintelfpgafsycl-helpfsycl-linkfsycl-rdcnolibsyclqopenmp, Qopenmpqopenmp-linkreuse-exeXopenmp-targetXsycl-target. It's best to hide all the details of setting up the variable SRCS in a CMake macro. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |