cmake

Problem with including Eigen library in Clion CMake

不羁的心 提交于 2021-02-07 10:03:51
问题 I have a problem with the Eigen library. I use Clion on Linux and my project can't find the Eigen library (I have it in a folder on my desktop). I have CMake in two configurations: First: cmake_minimum_required(VERSION 3.15) project(TestFEM) set(CMAKE_CXX_STANDARD 17) set(EIGEN_DIR "~/Desktop/eigen-3.3.7") include_directories(${EIGEN_DIR}) add_executable(TestFEM main.cpp FEM/FEM.cpp FEM/FEM.h) And second: cmake_minimum_required(VERSION 3.15) project(TestFEM) set(CMAKE_CXX_STANDARD 17) list

Generated Dependency Files in CMake

ε祈祈猫儿з 提交于 2021-02-07 09:47:41
问题 We have some source processing tools that generate things like raw assembly files from multiple 'snippets'. When using these tools from make we can ensure up-to-date builds by having the source processing tools emit 'dependency files', just like gcc would with its -MD flag. For example, let's say I have a assembly template file Frob.asmtmpl , and a templating engine called asm_templater that acts like a beefed up C pre-processor. We run asm_templater -d Frob.asmtmpl which produces Frob.s and

Generated Dependency Files in CMake

廉价感情. 提交于 2021-02-07 09:44:54
问题 We have some source processing tools that generate things like raw assembly files from multiple 'snippets'. When using these tools from make we can ensure up-to-date builds by having the source processing tools emit 'dependency files', just like gcc would with its -MD flag. For example, let's say I have a assembly template file Frob.asmtmpl , and a templating engine called asm_templater that acts like a beefed up C pre-processor. We run asm_templater -d Frob.asmtmpl which produces Frob.s and

What is the proper way to document a CMake module?

只愿长相守 提交于 2021-02-07 08:55:58
问题 A quick Google search (...actually many rather extensive Google searches) have not been able to explain how to properly document a CMake module. What I'm looking for is a way to document custom CMake modules so that they work with the cmake --help-module <module_name> command. Is there any standard way of doing this? Can anyone point me to some good examples? The documentation process seems oddly.... not well documented. Haha. How are modules that work with cmake --help-module documented? Any

What is the proper way to document a CMake module?

和自甴很熟 提交于 2021-02-07 08:53:47
问题 A quick Google search (...actually many rather extensive Google searches) have not been able to explain how to properly document a CMake module. What I'm looking for is a way to document custom CMake modules so that they work with the cmake --help-module <module_name> command. Is there any standard way of doing this? Can anyone point me to some good examples? The documentation process seems oddly.... not well documented. Haha. How are modules that work with cmake --help-module documented? Any

How can I specify library path when using Meson?

流过昼夜 提交于 2021-02-07 06:16:25
问题 I'm trying to build a c++ project with Meson. The thing is, I have some libraries under /opt/conda but can't figure out how to link the project when running meson build . It seems to be only searching through /usr/lib directory. As far as I understood, meson uses cmake and pkg-config to look for libraries. Then would setting something like CMAKE_PREFIX_PATH be a feasible solution? and if so, how can I do that? Thanks in advance. 回答1: I see two possible approaches to solve your problem. the

Can't use fixup_bundle() to create a portable bundle with Qt

ⅰ亾dé卋堺 提交于 2021-02-07 02:48:28
问题 I already searched this issue on other posts, but nothing so far. So here I am. I'd like to create a bundle that is portable. Portable as in "I can run it on any OS X machine, even if my required libs (Qt) are not installed". Unfortunately, I can't figure out how to use fixup_bundle() (which seems the right tool for it) to achieve this goal. Here is my minimal CMake generated C++ project : main.cpp #include <QString> #include <iostream> int main() { QString s("Hello, world!"); std::cout << s

How to invoke cmake from powershell using MinGW generator

家住魔仙堡 提交于 2021-02-06 14:01:00
问题 I am trying to invoke cmake from powershell so that I can build project with MinGW compiler. It works fine for Visual Studio generator, and it also work when I use cmake-gui, however from powershell I get this error: cmake ..\..\huggle -G "MinGW Makefiles" -DCMAKE_MAKE_PROGRAM=C:\Qt\Tools\mingw491_32\bin\mingw32-make.exe -- The C compiler identification is unknown -- Check for working C compiler: C:/Qt/Tools/mingw491_32/bin/gcc.exe -- Check for working C compiler: C:/Qt/Tools/mingw491_32/bin

How to invoke cmake from powershell using MinGW generator

岁酱吖の 提交于 2021-02-06 13:58:37
问题 I am trying to invoke cmake from powershell so that I can build project with MinGW compiler. It works fine for Visual Studio generator, and it also work when I use cmake-gui, however from powershell I get this error: cmake ..\..\huggle -G "MinGW Makefiles" -DCMAKE_MAKE_PROGRAM=C:\Qt\Tools\mingw491_32\bin\mingw32-make.exe -- The C compiler identification is unknown -- Check for working C compiler: C:/Qt/Tools/mingw491_32/bin/gcc.exe -- Check for working C compiler: C:/Qt/Tools/mingw491_32/bin

How to stop CMake from linking against libstdc++

随声附和 提交于 2021-02-06 08:51:18
问题 I have a very simple CMakeLists.txt for a C++ project, which builds a shared library: add_library(foo SHARED ${HDR_PUBLIC} ${SOURCES}) When linking the library, CMake automatically uses -lstdc++. How can I stop it from doing this? 回答1: set(CMAKE_CXX_IMPLICIT_LINK_LIBRARIES "") set(CMAKE_CXX_IMPLICIT_LINK_DIRECTORIES "") set_target_properties(yourtarget PROPERTIES LINKER_LANGUAGE C) Source: http://cmake.3232098.n2.nabble.com/setting-LINKER-LANGUAGE-still-adds-lstdc-td7581940.html 回答2: You can