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]
112 questions
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…

Deepan Muthusamy
- 7
- 4
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…

Deepan Muthusamy
- 7
- 4
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…

Deepan Muthusamy
- 7
- 4
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),…

deepan muthusamy
- 321
- 2
- 14
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…

deepan muthusamy
- 321
- 2
- 14
0
votes
0 answers
.phony target alternative in cmake to create a custom target
suppose Makefile having a phony target like this
.PHONY : run_my_command
- - - - - - - - - -
- - - - - - - - - -
we can directly run only this .phony target in Makefile from command line by giving the below command
make -f Makefile…

deepan muthusamy
- 321
- 2
- 14
0
votes
0 answers
how to include directory based on condition in cmake
I am using windriver compile. I followed below steps
set(var_1)
if(var_1)
target_include_directories(cfar PRIVATE ${APP_DIR}/z7b/variant_1)
else
target_include_directories(cfar PRIVATE ${APP_DIR}/z7b/variant_2)
endif()
0
votes
1 answer
Why are files not found from parallel folders CMake
To have my .cpp and .h files a little bit sorted up pending on their responsibilitie I decided to put them into seperate folders
I used the following structure:
root
|
-CMakeLists.txt [rootCmakeList]
src
|
-main.cpp
.......|
....... …

Zaragesh
- 25
- 6
0
votes
2 answers
How to create cmake library that expects an external header file
I feel like I'm missing some key idea with this one.
I have a library that I'd like to create a CMakeLists.txt file for. I want to link against it with different applications.
This library expects a conf.h file to be defined. The application has to…

triplebig
- 422
- 1
- 7
- 20
0
votes
1 answer
How to add_dependencies between projects in cmake
include_directories(${CMAKE_CURRENT_SOURCE_DIR})
AUX_SOURCE_DIRECTORY(${CMAKE_CURRENT_SOURCE_DIR} source)
project(abc)
#a_certain_source_file.cpp is a generated file built by another project.
add_library(${PROJECT_NAME} STATIC ${source}…

badri
- 575
- 2
- 8
- 22
0
votes
0 answers
How can I force cmake to statically link a specific library even when BUILD_SHARED_LIBS is set to ON
How can I force a library to link statically even if I want other libraries to link dynamically. I want to link most of my libraries dynamically, but one of my libraries requires static linking. Is there a way that I can force any link to that…

user8869094
- 1
- 2
0
votes
0 answers
GLOB_RECURSE grabbing the wrong source file
My source project directory is something like this,
|── CMakeLists.txt
|
├── src
| |
| |
| |
| └── a
| | |
| | |__ a.cpp
| |
| |
| |
| └── b
| |
| |__ b.cpp
|
|___test
|
|__test.cpp
I need to make a…

Punit Salian
- 41
- 7
0
votes
1 answer
dynamic source list for CMake
I try to configire my CMake project so it can accept dynamic source list. But for some reason I get empty list from file function. So I've tried to execute the same operation in 2 ways:
[1] static list (the unwanted way)
set(VARIANT_A…

folibis
- 12,048
- 6
- 54
- 97
0
votes
0 answers
properties of custom target
I'm using add_cusmtom_target to do a custom build, but what properties of this target have? Perticually how can I get the list of dependencies listed in the target:
add_custom_target(exsdk COMMAND echo DEPENDS foo.jar bar.jar)
get_target_property(D…

fluter
- 13,238
- 8
- 62
- 100
0
votes
0 answers
Problem with CMake "Could not find cmake module file"
I'm making a library that overloads the operator new and delete to save the pointer into my vector-like class. When the program ends a class object frees the memory.
I'm new to CMake.
I used CMake but I get a CMake error. In CMakeOutput.log it…