Questions tagged [cmake]

0

votes
1

answer
15

Views

I want to Integrate ODBC in my Code for both linux and windows using CMakeLists.txt but its only working in windows

I am currently working on a project which requires SQL database. I want to make project platform independent so i am writing CMakeLists.txt but unfortunately its not working with linux currrently I have this part in CmakeLists.txt find_package(ODBC) TARGET_LINK_LIBRARIES(${PROJECT_NAME}_component $...
user1993504
1

votes
1

answer
1.2k

Views

What this CMake Error means? My variables are set to NOTFOUND

I am trying to run some code from my university, but when I do 'cmake ..' inside 'build' I get the following error: CMake Error: The following variables are used in this project, but they are set to NOTFOUND. Please set them or make sure they are set and tested correctly in the CMake files: iceutil_...
Carasandia
1

votes
1

answer
203

Views

What is default target_link_libraries privacy setting?

I wonder what is the default target_link_libraries privacy. I added line in CMake: target_link_libraries(myTarget libraryA libraryB ) But I don't know if it is PRIVATE or PUBLIC or maybe INTERFACE. I check documentation, but I don't see answer for my question :( Edit: I found sth: As a final note, i...
BartekPL
1

votes
1

answer
613

Views

Code coverage analysis using CodeCoverage.cmake with multiple targets

I have unit-test in my project implemented using Boost Unit Test Framework and organized into several modules, i.e.: #define BOOST_TEST_MODULE Connection_test #ifndef BOOST_TEST_DYN_LINK #define BOOST_TEST_DYN_LINK #endif #ifndef BOOST_TEST_NO_MAIN #define BOOST_TEST_NO_MAIN #endif #include #includ...
Eenoku
1

votes
1

answer
19

Views

What is a way to simplify linking multiple libraries in CMake?

I'm new to CMake and trying to learn to use it for a simple project. If I have a CMakeLists.txt file that looks like this: add_executable(alpha alpha.cpp) add_executable(beta beta.cpp) add_library(one STATIC one.cpp) add_library(two STATIC two.cpp) target_link_libraries(alpha one) target_link_librar...
Okarin
0

votes
0

answer
4

Views

How to write totally single configuration instead multiple configuration on VC++ generator

Summary I'm writting cmake script for libraries at multiple platforms (Win32 VC++/mingw/linux/embedded systems, will generate *.lib and *.a files). How to write cmake script for force override single configuration at the VC++ generator and get same results for single configuration generator? Backgro...
Kouji Matsui
0

votes
0

answer
4

Views

Problem installing SCIP 6.0.1 on Windows (CMake based build)

I was not able to install SCIP 6.0.1 on my windows VM, (needed to test the integration against google/or-tools) Protocol download SCIPoptsuite and extract it... cmake configure with: cd C:\Users\...\scipoptsuite-6.0.1 cmake -H. -Bbuild -DSHARED=OFF -DGMP=OFF -DGCG=OFF -DSYM=none -DIPOPT=OFF -DREADLI...
Mizux
1

votes
1

answer
1.4k

Views

win32 GetConsoleMode() error code 6

I'm following the example from a another post here Reading a password from std::cin where you grab the handle to standard input, get the current console mode, change the mode to stifle echo on input. For some reason, when i call GetStdHandle() it returns a valid handle, but when I invoke GetConsoleM...
FatalCatharsis
0

votes
0

answer
5

Views

What's CUDA_HOST_COMPILER's value when using cmake find_package in CUDA demo

I tested a little demo of CUDA10 demo,and built the project by cmake in vs code, the CMakeLists is: project(helloworld) cmake_minimum_required(VERSION 2.8) find_package(CUDA REQUIRED) if(CUDA_FOUND) message(STATUS '${CUDA_INCLUDE_DIRS}') message(STATUS '${CUDA_LIBRARIES}') message(STATUS '${CUDA_HOS...
XiaXuehai
1

votes
1

answer
3.1k

Views

C++11 activation with <target_compile_feature> or <set (CMAKE_CXX_STANDARD)>

I'm using a Python library, named PyPHS, specialized in physical modeling. To save computation during the simulation, it implements a C++ code generation feature. It uses CMake to generate an executable of a particular simulation. It is implemented in C++ 11. Issue In the CMakeLists.txt file, the C+...
Vic Tor
1

votes
1

answer
145

Views

Why does link_libraries(stdc++fs) work but not -lstdc++fs?

I was trying to compile a C++17 program on Ubuntu using CMake/g++ 8.1 which contained #include When I used this set(CMAKE_CXX_FLAGS '-lstdc++fs') I got a weird linker error undefined reference to `std::filesystem::__cxx11::recursive_directory_iterator::~recursive_directory_iterator()' This error al...
Vincent La
1

votes
1

answer
48

Views

How to keep assembly files with --save-temps when multiple targets use the same source file?

If I compile the C++ program /tmp/src/main.cc #include int main() { #ifdef demo1 std::cout
Erik Sjölund
1

votes
1

answer
96

Views

How to compare files in CMake

Is there a way to compare files using cmake? I've checked all parameters from https://cmake.org/cmake/help/latest/command/file.html
amit
1

votes
2

answer
165

Views

Unable to generate makefile from CMake

I'm interested in CMake, so decided to learn about it. I followed the CMake Tutorial until the point where it states 'That is all there is to it. At this point you should be able to build the tutorial', so I thought, let's try it! Alas, it seems it wasn't all so simple. I initially attempted to run...
Newbyte
1

votes
2

answer
26

Views

How to “hook” into Cmake command add_executable or add_library to run something extra?

We build with CMake and normal Unix makefiles. There are some static analysis checks, e.g. Cppcheck, we run at every C/C++ file in the project to catch errors at compile time. I have created a custom target for cppcheck and attached it into 'all' target. This checks all the *.c and *.cpp files in th...
Mikko Koivunalho
1

votes
1

answer
932

Views

Renaming cpack automatic target

When you INCLUDE(CPack) in a CMakeLists.txt file, it adds a target named package to the generated build files. You can configure a lot of things about that generated target and how it operates, but I can't seem to find a way to change the name of the target itself; i.e., instead of a generated Makef...
Ernest Friedman-Hill
1

votes
0

answer
178

Views

Error with compiling dlib to Xcode

I had compiled dlib to Xcode with reference the site of 'http://prabhu.xyz/2017/05/29/getting-started-with-dlib-on-ios.html' I followed the steps just like the site has mentioned, but I received the error messages: https://github.com/hsmlee/dlip-error/blob/master/README.md I have tried to find the r...
Hsmlee
1

votes
0

answer
126

Views

How to make CLion automatically build on save

I remember when I program Java in Eclipse, Eclipse can automatically build the project whenever I change a java file. Is it possible for CLion to automatically build my C++ project as well? I'm asking this because compilation in my project (depending on ROS) is slow, and I often realize that I shoul...
draw
1

votes
1

answer
638

Views

CMake Error at cmake/Modules/FindPackageHandleStandardArgs.cmake:108 (message):Could NOT find MPI_C (missing: MPI_C_LIBRARIES)

I have a project .When I want to configure it in CMAKE3.9.6 with Visual Studio 2010 and support of Intel Parallel Studio 2015 with this command in command line : cmake -G 'Visual Studio 10' I get this error: CMake Error at cmake/Modules/FindPackageHandleStandardArgs.cmake:108 (message): Could NO...
Taylor Johnson
1

votes
1

answer
213

Views

Tips for reducing size of .dylib and .so

I'm trying to compile the SDK manually, but the generated .dylibs and .so are over 70mb in size: ➜ lib ✗ pwd /Users/gond/opencv/build/lib ➜ lib ✗ du -h . 71M This is the command I'm using: cmake -D CMAKE_BUILD_WITH_INSTALL_RPATH=ON \ -D CMAKE_INSTALL_PREFIX=/usr/local .. Is there any way t...
John M.
1

votes
0

answer
258

Views

How To Use Shared GTK+ and GLIB Libraries in a CMake Project

I've got a project which was originally using a makefile which i'm now converting to a Cmake project to use with CLion. I need to import gtk+1.2.10 and glib-1.2.10 both of which are located in /usr/local. I have attempted to include them but all attempts have resulted in messagees saying it cannot f...
Root0x
1

votes
0

answer
235

Views

caffe2 build android Failed to configure test project build system

I want to build caffe2 on macOS. build caffe2 is every thing OK, but when I build android, use caffe2/scripts/build_android.sh the processing is to 100% and then occurred: CMake Error at /usr/local/Cellar/cmake/3.10.1/share/cmake/Modules/CheckCXXSourceCompiles.cmake:97 (try_compile): Failed to confi...
nick zhou
1

votes
0

answer
152

Views

Travis-CI - Linux - missing libdl.so after install

Actions: Using travis-ci to build C++/C code via gcc compiler under linux x64. Using libdl functions requires linking via -ldl. Expected behaviour: libdl beind successfuly linked. Actual behaviour: libdl linking fails (DSO missing from command line). But when using clang it links successfuly. Both j...
Sasha Knorre
1

votes
0

answer
179

Views

OpenCV_Contrib builds in java with empty modules

I have cross-compiled the opencv_contrib modules with opencv (contrib github, opencv github) from c++ to java using cmake and the mingw cross compiler, but some of the built modules (line_descriptors and DPM) built as empty classes or classes with no usable methods. I could not find anyone else with...
Frank
1

votes
1

answer
207

Views

CMake unit structure with many tests

I would like to set up cmake to run on a project with unit testing. The project structure is as follows: |---CMakeLists.txt |---build |---source | |---CMakeLists.txt | |---many .cpp and .h files |---tests | |---CMakeLists.txt | |---many .cpp files The source files in tests use Boost unit_tes...
J. D.
1

votes
0

answer
154

Views

BLAS should automatically detected by CMake-GUI 3.10.1

I have a project running via CMake-GUI 3.10.1 with MinGW ,But When I try to configure that I got this error.I think something wrong with my CMake-GUI.Maybe BLAS should automatically detected by CMake-GUI.So what should I do. The Fortran compiler identification is GNU 7.2.0 The C compiler identificat...
Taylor Johnson
1

votes
0

answer
843

Views

Building gradle with cmake

I'm getting the error 'Unable to get the CMake version located at C:\Users\Mujtaba Faizi\Downloads\cmake-3.10.1\bin' but I gave the version 3.10.1 in build.gradle and the path in local.properties. I've been at it for so long. Thanks in advance. build.gradle: apply plugin: 'com.android.application' a...
Mujtaba Faizi
1

votes
0

answer
155

Views

CMake ExternalProject superbuild isn't executed with Android NDK

Related to: build cmake ExternalProject with gradle I'm trying to port an existing C++ project to Android (using Android Studio 3.0.1). The C++ project depends on a few other C++ packages. Since they all need to be cross-compiled for Android, I'm trying to execute a superbuild using CMake's External...
tac-eibmoz
1

votes
0

answer
194

Views

Install BLAS DLLs separately or there is a full package or another soloution

I am configuring a project via CMAKE 3.10.1 with MinGW.also I installed BLAS from sources(compiled with CMAKE) .I got Two DLL files. libblas.dll and liblapack.dll.I see only BLAS_blas_LIBRARY is pointed to C:/Windows/System32/libblas.dll. others not.such as : BLAS_Accelerate_LIBRARY-NOTFOUND BLAS_ac...
Taylor Johnson
1

votes
1

answer
882

Views

Not found Eigen3_DIR when configuring a cmake project in Windows

I want to compile an open project, it needs Eigen3, I followed its guideline but stuck in this step: 'Set environment variable Eigen3_DIR to {YOUR_EIGEN3_DIRECTORY}/eigen3/cmake.' I have installed CMake gui and it printed following errors after configuration Make Error at src/CMakeLists.txt:15 (fin...
Finley
1

votes
0

answer
1.8k

Views

How to build a stm32 with cmake

I want to build a stm32 project with cmake. The host is Linux ubuntu 4.4.0-98-generic. This is my CMakeLists.txt script file. I wrote this file refer to my Makefile. The Makefile works well. cmake_minimum_required (VERSION 3.5) set (CMAKE_SYSTEM_NAME Generic) set (CMAKE_SYSTEM_PROCESSOR arm) set (CM...
HoYa
1

votes
1

answer
798

Views

How to use an external library for C++ in VS2017

I've been programming in Python for over a year now but am just learning C++ and am unfamiliar with how to go about using external libraries, CMake and github for that matter. I'm trying to use an external library called cpr - https://github.com/whoshuu/cpr. So far I've followed the instructions in...
jp94
1

votes
0

answer
81

Views

cmake: remove /fast and OBJECT targets from makefile

For every target xxxx cmake creates in addition target xxxx/fast (which does not recompile all dependencies). Is there a way to switch-off this behavior? Also is there a way how to force cmake not to generate independent build targets for object libraries ( i.e. those generated like add_library( Bo...
Prokop Hapala
1

votes
1

answer
490

Views

CMake and pugixml

I am new to CMake and having trouble understanding how to use it. I have a cross-platform c++ project. It builds using CMake and my CMakeLists.txt lives in a folder called MyProject along with the project. I checked out a pugixml git submodule and it now lives under MyProject/pugixml, with its sourc...
Valentin
1

votes
0

answer
133

Views

CMAKE dont find the libmpdclient-2.13 library

I´m new to cmake and i need help to build the ympd https://github.com/notandy/ympd project on windows 1. Install libmpdclient I installed the libmpdclient-2.13 library from https://www.musicpd.org/libs/libmpdclient/ i did the steps to build the libmpdclient from the github repo https://github.com/...
bierschi
1

votes
0

answer
275

Views

C - configure cmake to propely link ncursesw

I'm building a school project application which requires the use of ncurses library. While trying to use mvwaddwstr() function, I get the following error: undefined reference to `mvwaddwstr'. My CMake configuration file is as follows: cmake_minimum_required(VERSION 3.0) set(CMAKE_C_STANDARD 11) proj...
EpaXapate
1

votes
1

answer
59

Views

qmake to Cmake transition: syntax for external librairies

For a specific project I am moving out of qmake and now have to use cmake. My path are the following: Source : ~/Projects/Project External static library (OSVR in this instance) paths : ~/osvr/lib/ , ~/osvr/include/osvr /osvr/include/jsoncpp Using qmake, the linking part to that library used to be:...
plc66
1

votes
1

answer
101

Views

Why does the code coverage report say my library isn't being covered?

I am attempting to generate code coverage for a small test library. The library only consists of two files. calculator.cpp: #include 'calculator.h' Calculator::Calculator() { } Calculator::~Calculator() { } void Calculator::addNumbers(int x, int y) { this->result = x + y; } calculator.h: #ifndef CAL...
technicaltim
1

votes
0

answer
167

Views

CMake: Don't add header files of dependency library to the project (Visual Studio)

I'm using CMake for a project (lets call it 'LibMain'). In the CMakeLists.txt (root directory) I include a dependency library ('LibDependency') that uses CMake as well: add_subdirectory('${CMAKE_CURRENT_LIST_DIR}/dependencies/libdep') target_link_libraries('LibMain' PRIVATE 'LibDependency') The resu...
Zacherl
1

votes
0

answer
90

Views

QT - Cmakelist - CLion - vtable doesn't compile

I'm learning CPP and this weekend I learn more about QT, I'm using CLion and Cmakelist. I try to compile a project but when I add the macro Q_OBJECT it's say me : undefined reference to `vtable for DigitalClock' I'm looking for solved my problm and add AUTOMOC but it still doesn't work. Is my CMake...
Benjamin Sx

View additional questions