29,345 questions
1
vote
1
answer
102
views
cuda & cpp - compilation and linking using cmake
I want to create a skeleton for a project in which there are multiple cuda and cpp files. They will be compiled individually and then linked together to form a single executable.
Currently I have the ...
2
votes
1
answer
3k
views
Some (but not all) targets in this export set were already defined - for libhdf5 targets when using VTK
I create a CMakeLists.txt and the content is as followed
cmake_minimum_required (VERSION 3.8)
project(CTP_dll)
add_library(CTPdll SHARED CTPdll.cpp)
add_executable(CTPTest CTPTest.cpp)
...
-4
votes
0
answers
31
views
How do I include cgal v6.1.1 to my cmake/c++ project? [closed]
I tried to add CGAL v 6.1.1 to my my C++ project. I'm using cmake and (for all other libraries) CPM.
So I tried to do the same for CGAL. Meaning, I added:
CPMAddPackage(
NAME CGAL
...
-1
votes
1
answer
81
views
Problems compiling code with cmake and Boost / OpenCV
I'm having some problems compiling a simple piece of code. I'm just starting to use cmake (before I only used handcrafted Makefile) and compiling this piece of code in my PC works normally.
Code:
#...
4
votes
3
answers
350
views
VTK project report "undefined reference" errors
I want to run a simple VTK8.1.2 demo on Centos7.9-2009 to test the VTK package for my project. Here is the demo:
#include <vtkSmartPointer.h>
#include <vtkRenderer.h>
#include <...
1
vote
1
answer
42
views
What explains the strange behavior of arguments in CMake macros (as opposed to functions)?
Here is a piece of cmake code:
macro(my_macro p)
message("--my_macro--")
message("p is: ${p}")
if(p) # <========================= (1)
message("\"if(...
0
votes
1
answer
48
views
GCC+CMake, static lib changes size_t footprint
While refactoring some legacy code I ran into some strange behaviour of CMake+GCC that I can not explain or correct.
This is what I have:
Debian Trixie with GCC 14.2.0 and CMake 3.31.6
A test project ...
4
votes
1
answer
1k
views
Is there a continuous compilation plugin for Visual Studio Code like Godbolt's Compiler Explorer? [closed]
I wanted something that would compile automatically after a given number of (milli)seconds and display the results in the "Problems" tab.
The current behavior is to statically analyze every ...
116
votes
6
answers
65k
views
In CMake, does parameter replacement behave the same in Functions and in Macros?
The official document of CMake 2.8.12 says about macro
When it is invoked, the commands recorded in the macro are first
modified by replacing formal parameters (${arg1}) with the arguments
passed, ...
0
votes
0
answers
41
views
Disassembly code of building with flag “-s” not the same as building without "-s" by cmake
The stripped binary was built with set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -s"), and I generated both stripped binary and none stripped binary, and use ndk toolchain objdump to ...
2
votes
1
answer
6k
views
Building an OpenCV Application with Static Libraries
Edit:
Problem solved after a few steps. You can take a look at my post on the OpenCV Q&A page.
http://answers.opencv.org/question/152366/build-application-with-static-libraries/
I'm trying to ...
2
votes
1
answer
578
views
which libraries should I link to build opencv 3.2
Building opencv with contributions using this guide:
http://docs.opencv.org/trunk/d3/d52/tutorial_windows_install.html
instead of cmake gui, i use:
cmake -DOPENCV_EXTRA_MODULES_PATH=E:\work\...
0
votes
0
answers
28
views
CMake remove build directory [duplicate]
I have a CMake project in which I'm creating a creating a build directory to generate CMake related files when cmake .. command is given from the build directory. After compilation, I execute cmake --...
4
votes
0
answers
150
views
Why executable can use module when respective library is linked only by excutable dependency not by executable itself
There's an implementation of the foo module that uses only the standard library:
module;
#include <iostream>
export module foo;
export void foo() {
std::cout << "foo" <&...
8
votes
3
answers
8k
views
Trouble building the Open Asset Import Library (Assimp)
I have just downloaded the Open Asset Import Library (Assimp) which is an API used to import 3D file formats such as .3DS and .Obj into source code. Doing so allows for much easier rendering of meshes ...