CMake (cmake) input files are written in the “CMake Language” in source files named CMakeLists.txt
or ending in a .cmake
file name extension.
Questions tagged [cmake-language]
67 questions
1
vote
1 answer
How can I remove the file extension from the object name in the build step?
CMAKE__COMPILE_OBJECT is a variable to set compile rules.
set(" -o
![](../../users/profiles/10636865.webp)
linuxUser123
- 393
- 2
- 14
0
votes
0 answers
cmake install not waits on the target to be build
I am using cmake 3.18.5 and ninja.
I have a library target called lib1. if I give ninja lib1 install, it is giving error that not able to install lib1 because lib1 is not available.(i.e install is not depends on the target to be build)
But if i give…
![](../../users/profiles/15370168.webp)
Deepan Muthusamy
- 3
- 3
0
votes
1 answer
CMake add_custom_command() POST_BUILD generator expression expansion not working
I want to run a POST_BUILD action after the build (but only in the Debug configuration).
After reading add_custom_command docs and a possible solution I understood that I can "wrap" my COMMAND into $ generator expression (to be sure…
![](../../users/profiles/335597.webp)
sthlm58
- 922
- 1
- 6
- 22
0
votes
1 answer
Ninja Make system not accepting GENERATED command
I have a set of assembly files which should be compiled by a special compiler. After this it should be added to the library created by the compiler i have set in CMAKE_C_COMPILER. it was working fine with Mingw Makefile system but not working with…
![](../../users/profiles/15370168.webp)
Deepan Muthusamy
- 3
- 3
0
votes
0 answers
Printing Interface library in cmake
How to print the interface library in cmake. Actually i want to do this for a debugging purpose.
so want to know how to print what are all the include directories in that interface library
I have a interface library A which is linked to 2 interface…
![](../../users/profiles/15370168.webp)
Deepan Muthusamy
- 3
- 3
0
votes
0 answers
Maximum limit on number of Interface libraries in cmake
does anyone know is there any maximum limit on the number of interface libraries
we can link to a executable target in cmake
![](../../users/profiles/15370168.webp)
Deepan Muthusamy
- 3
- 3
0
votes
1 answer
CMake: set_target_properties fails with target defined by generator expression
I'm having a problem with the cmake Generator Expression TARGET_NAME_IF_EXISTS. With this CMakeLists.txt:
cmake_minimum_required(VERSION 3.13.0)
option(SLIB_BUILD_STATIC "" ON)
project(slib VERSION 1.0)
add_library(slibObjects OBJECT…
![](../../users/profiles/1723954.webp)
Stewart
- 3,028
- 1
- 18
- 40
0
votes
0 answers
Individual log file for each target in cmake
How to create a individual log file for each executable target in cmake?
For example, if I have three executable targets named A, B and C. I want three log files A.log, B.log and C.log
![](../../users/profiles/15370168.webp)
Deepan Muthusamy
- 3
- 3
0
votes
1 answer
cmake find_library() not finding library specified by PATHS
I have a find_library() statement that matches below (this is based on the amazon kinesis project):
find_library(SRTP_LIBRARIES NAMES srtp2 REQUIRED PATHS ${OPEN_SRC_INSTALL_LIB_PREFIX})
The OPEN_SRC_INSTALL_LIB_PREFIX correctly points to the…
![](../../users/profiles/2533386.webp)
ryeager
- 781
- 1
- 9
- 18
0
votes
0 answers
How to tell my CMake script to place .lib files in output/lib
Currently, when I build my windows project (dynamic library) using CMake, my .dll files go in ./output/bin, my .h files go in ./output/include, but my .lib files go only to ./lib.
Is there anything I can do to make my .lib files go to ./output/lib…
0
votes
1 answer
installing only one target in cmake
I have totally 5 targets. one of them is static library. other 4 are executables.
I don't want the library to be build for every time. so i just want to compile the library keep it in a particular location so that other executables can refer this…
![](../../users/profiles/15370168.webp)
Deepan Muthusamy
- 3
- 3
0
votes
1 answer
Not able to generate Mingw Makfile
cmake version : 3.18.5
I was using cmake-gui, it is working smoothly.
Now i have switched to command-line. it was working for some days and suddenly from no where i am getting the below error.
The cmake command i am running,
cmake -G "MinGW…
![](../../users/profiles/15370168.webp)
Deepan Muthusamy
- 3
- 3
0
votes
1 answer
How to compile only some set of targets during make
I am using cmake as build generator. version : 3.18.5
I have 5 targets in my project.
I want to compile only particular set of targets depends upon the option i give during make.
How to do this?
for example, if i run
gmake -j4 foo=set2
I want…
![](../../users/profiles/15370168.webp)
Deepan Muthusamy
- 3
- 3
0
votes
1 answer
how to overwrite/append CMAKE_C_CFLAG
cmake version : 3.18.5 MinGW Makefiles
Host : windows
target : ppc
compiler : windriver
I want to create two different executables with different flags.
for execample i want to create one executable with flag(-tPPCE) and another with flag(-tPPCEV),…
![](../../users/profiles/9321944.webp)
deepan muthusamy
- 99
- 7
0
votes
0 answers
Include path is not visible to the assembler
cmake version : 3.18.5 MinGW Makefiles
Host : windows
target : ppc
compiler : windriver
I have a assembly file file.s which includes a header header.h( .include "header.h").
I have added the path of the header to the…
![](../../users/profiles/9321944.webp)
deepan muthusamy
- 99
- 7