cmake

Visual Studio调试Linux平台的C++程序(CMake)

别等时光非礼了梦想. 提交于 2020-01-30 10:24:57
CMake是一个跨平台编译工具,可以生成各平台的makefile,非常方便。 关于“Visual Studio调试Linux平台的C++程序”,请参照我的另一篇文章, https://blog.csdn.net/liudi_ly/article/details/104110079 构建CMake工程: 打开Visual Studio,新建CMake Project,配置CMake settings for Linux, 选择Manage Configurations,新建一个configuration: 自动生成的CMakeSettings.json文件如下: { "configurations" : [ { "name" : "x64-Debug" , "generator" : "Ninja" , "configurationType" : "Debug" , "inheritEnvironments" : [ "msvc_x64_x64" ] , "buildRoot" : " ${projectDir} \\out\\build\\ ${name} " , "installRoot" : " ${projectDir} \\out\\install\\ ${name} " , "cmakeCommandArgs" : "" , "buildCommandArgs" : "

LearnOpenGL-第一课:创建窗口

巧了我就是萌 提交于 2020-01-30 07:14:49
创建窗口 在我们画出出色的效果之前,首先要做的就是创建一个OpenGL上下文(Context)和一个用于显示的窗口。然而,这些操作在每个系统上都是不一样的,OpenGL有目的地从这些操作抽象(Abstract)出去。这意味着我们不得不自己处理创建窗口,定义OpenGL上下文以及处理用户输入。 幸运的是,有一些库已经提供了我们所需的功能,其中一部分是特别针对OpenGL的。这些库节省了我们书写操作系统相关代码的时间,提供给我们一个窗口和上下文用来渲染。最流行的几个库有GLUT,SDL,SFML和GLFW。在教程里我们将使用GLFW。 GLFW是一个专门针对OpenGL的C语言库,它提供了一些渲染物体所需的最低限度的接口。它允许用户创建OpenGL上下文,定义窗口参数以及处理用户输入,这正是我们需要的。本节和下一节的目标是建立GLFW环境,并保证它恰当地创建OpenGL上下文并显示窗口。这篇教程会一步步从获取、编译、链接GLFW库讲起。我们使用的是Microsoft Visual Studio 2015 IDE(操作过程在新版的Visual Studio都是相同的)。如果你用的不是Visual Studio(或者用的是它的旧版本)请不要担心,大多数IDE上的操作都是类似的。 构建GLFW GLFW可以从它官方网站的 下载页 上获取。GLFW已经有针对Visual Studio 2013

Regular expression for hidden files under unix

自作多情 提交于 2020-01-30 06:51:09
问题 I'm looking for a regex to match every file begining with a "." in a directory. I'm using CMake (from CMake doc : "CMake expects regular expressions, not globs") and want to ignore every file begining with a dot (hidden files) BUT "\..*" or "^\..*" doesn't work :( The strange thing : this works (thanks to rq's answer) and remove every hidden files and temp files ("~" terminated files) file(GLOB DOT ".*") file(GLOB TILD "*~") set (CPACK_SOURCE_IGNORE_FILES "${DOT};${TILD}") But I can't find

Regular expression for hidden files under unix

让人想犯罪 __ 提交于 2020-01-30 06:51:04
问题 I'm looking for a regex to match every file begining with a "." in a directory. I'm using CMake (from CMake doc : "CMake expects regular expressions, not globs") and want to ignore every file begining with a dot (hidden files) BUT "\..*" or "^\..*" doesn't work :( The strange thing : this works (thanks to rq's answer) and remove every hidden files and temp files ("~" terminated files) file(GLOB DOT ".*") file(GLOB TILD "*~") set (CPACK_SOURCE_IGNORE_FILES "${DOT};${TILD}") But I can't find

dyld: lazy symbol binding failed: Symbol not found - nm reports symbol found

旧时模样 提交于 2020-01-30 06:40:25
问题 Fairly abstract question here, as I don't know quite where to start my own investigations. I have a C package constructed with CMake that produces librpdb.so; I have a Ruby Gem set up for the same library, which produces rpdb.bundle. When used in Ruby, I get this: dyld: lazy symbol binding failed: Symbol not found: _RPDB_RuntimeStorageController_sharedInstance Referenced from: /usr/local/lib/ruby/gems/1.9.1/gems/rpdb-0.1.0/lib/rpdb/rpdb.bundle Expected in: flat namespace When I look into the

dyld: lazy symbol binding failed: Symbol not found - nm reports symbol found

守給你的承諾、 提交于 2020-01-30 06:40:06
问题 Fairly abstract question here, as I don't know quite where to start my own investigations. I have a C package constructed with CMake that produces librpdb.so; I have a Ruby Gem set up for the same library, which produces rpdb.bundle. When used in Ruby, I get this: dyld: lazy symbol binding failed: Symbol not found: _RPDB_RuntimeStorageController_sharedInstance Referenced from: /usr/local/lib/ruby/gems/1.9.1/gems/rpdb-0.1.0/lib/rpdb/rpdb.bundle Expected in: flat namespace When I look into the

CMake/MinGW unknown compilers, gcc.exe broken

半世苍凉 提交于 2020-01-30 06:35:48
问题 I am trying to install on my windows desktop, a software suite called NUPACK which is used to design nucleic acid reaction pathways. http://www.nupack.org/ This software requires CMake to install, and from my understanding, CMake does not have compilers by itself, and requires us to have compilers separately installed. As such, I downloaded MinGW to use as a C++ compiler. Prior to running, I have set the environment variables of both CMake and MinGW's bin. I am running CMake (version 3.11.1)

CMake file properties per-target

核能气质少年 提交于 2020-01-30 05:44:10
问题 I previously asked: How to compile C++ as CUDA using CMake which was super helpful. But then realised I had a follow-on question. What I want to do is compile one file twice, using different compilers. eg: cmake_minimum_required(VERSION 3.9) project(cuda_test LANGUAGES CUDA CXX) add_executable(cuda_test_host test.cpp) # build with GCC for host set_source_files_properties(test.cpp PROPERTIES LANGUAGE CUDA) add_executable(cuda_test_cuda test.cpp) # build with NVCC for CUDA But of course, the

CMP0002 error when compiling different subproject with same target

删除回忆录丶 提交于 2020-01-30 05:14:32
问题 I've many sub-folders home | |-library1 |-library2 | |-libraryn Every subfolder contains a complete library that can compile by itself (every library has a different mantainer). Until now it works correctly and I compile them using a script. Now I need to create another library, that depends on existing one. In order to do so, I've created a CMakeLists.txt under home folder, using add_subdirectory command that allows me to compile all libraries. I've something like cmake_minimum_required

Cmake Qt5 | undefined reference to `QPrinter::QPrinter(QPrinter::PrinterMode)

孤人 提交于 2020-01-30 00:21:49
问题 I am preparing cmake build for qt application. where I am using following structure .. libMyApp which uses SET(QT5_MODULES Widgets PrintSupport Network XmlPatterns) FIND_PACKAGE(Qt5 REQUIRED COMPONENTS ${QT5_MODULES}) and TARGET_LINK_LIBRARIES( ${TARGET_NAME} Qt5::Widgets Qt5::PrintSupport Qt5::Network Qt5::XmlPatterns ) libMyApp build successfully and generated libMyApp.a (static library) Now I am using this library in my application MyApp which uses SET(QT5_MODULES Widgets PrintSupport