cmake

CMake and Code Signing in XCode 8 for iOS projects

北城余情 提交于 2020-12-28 07:35:09
问题 CMake was able to configure automatic code signing for XCode <=7 and iOS projects with a target property setting like set_target_properties(app PROPERTIES XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY "PROPER IDENTIFIER") XCode 8 changed the signing process. It now is required that the option "Automatically manage signing" in the project settings "General tab -> Signing" is checked. If I check this options manually for a cmake generated project, signing works well. But I did not find a way to enable

Can one add further source files to an executable once defined?

杀马特。学长 韩版系。学妹 提交于 2020-12-27 12:01:24
问题 Given I have defined an executable with its main source file in a CMakeList.txt file: ADD_EXECUTABLE(MyExampleApp main.cpp) Can I add further source files to this executable after this line but in the same or an included CMakeList.txt file? 回答1: Use target_sources , available since cmake 3.1 eg. target_sources(MyExampleApp PRIVATE ${extra_file}) https://cmake.org/cmake/help/v3.1/command/target_sources.html 回答2: I think you may use: add_executable(MyExampleApp main.cpp) add_library(library

Difference between Cmake, gnu make and manually compiling

纵饮孤独 提交于 2020-12-27 07:52:06
问题 I'm new to programming so this is a more of a abstract question than a technical one. I've been using IDE's to learn but I heard they tend to oversimplify the act of compiling,assembling and linking when creating an executable file. I'm trying to download and compile a library without relying on an IDE (in this case librocket). I first had to use Cmake to create the binaries. After configuring and generating, I didn't see any object files or .cpp files in the output directory. I then had to

Compile PahoMqttCpp sample as standalone with cmake on Linux

柔情痞子 提交于 2020-12-27 06:54:07
问题 My goal ... is to use the sample code async_subscribe.cpp from the PahoMqttCpp project (https://github.com/eclipse/paho.mqtt.cpp) as a standalone application to then modify it for my needs. My approach Preliminaries On the newest model of Raspberry pi ( uname -a --> 4.14.98-v7+ #1200 SMP Tue Feb 12 20:27:48 GMT 2019 armv7l GNU/Linux ) I have followed the description in the PahoMqttCpp README.md file. I compiled successfully the C-library (v1.2.1) and then compiled successfuly the Cpp part,

Understanding “requests linking to directory” cmake warning

梦想与她 提交于 2020-12-26 08:27:24
问题 I am compiling an enormous code (100,000+ lines) on an Ubuntu 16.04 machine. In the process of doing so, during the cmake (v3.5.1) build process (before running make), I generate a raft of WARNINGS. E.g. WARNING: Target "gadgetron_moco" requests linking to directory "/usr/lib". Targets may link only to libraries. CMake is dropping the item. Obviously, I can't repost the code here, but within the source code I found a moco/CMakeLists.txt . Here is a code fragment from that file: if(CUDA_FOUND)

Understanding “requests linking to directory” cmake warning

岁酱吖の 提交于 2020-12-26 08:27:00
问题 I am compiling an enormous code (100,000+ lines) on an Ubuntu 16.04 machine. In the process of doing so, during the cmake (v3.5.1) build process (before running make), I generate a raft of WARNINGS. E.g. WARNING: Target "gadgetron_moco" requests linking to directory "/usr/lib". Targets may link only to libraries. CMake is dropping the item. Obviously, I can't repost the code here, but within the source code I found a moco/CMakeLists.txt . Here is a code fragment from that file: if(CUDA_FOUND)

Cmake error: Could NOT find Boost (missing: Boost_INCLUDE_DIR)

纵然是瞬间 提交于 2020-12-26 07:12:39
问题 I am new to Cmake and Boost. I am now working on a program using cmake and need help. System: windows 7 Cmake version: 3.16.0-rc1 Boost version: boost_1_71_0. And boost is installed through .exe file. Gcc version: 4.8.1(rev5, Built by MinGW-W64 project) Visual studio: vs 2015 When I run cmake .. in build dir, no error occurs. The output is: The C compiler identification is MSVC 19.0.24215.1 The CXX compiler identification is MSVC 19.0.24215.1 Check for working C compiler: C:/Program Files

CMake variable with limited valid values

老子叫甜甜 提交于 2020-12-25 03:50:25
问题 In my CMake based project I have a variable in my CMakeLists.txt that enables what backend to target. The valid values for this variable are limited, say 6. I want to cache a list of the valid values so that the user can select which feature to enable. CMake should validate the variable. Is this possible and if so, how? 回答1: If you want to validate the allowable values, you'll need to do that yourself in your CMakeLists.txt file. You can, however, provide a list of values for CMake to present

CMake variable with limited valid values

大憨熊 提交于 2020-12-25 03:49:04
问题 In my CMake based project I have a variable in my CMakeLists.txt that enables what backend to target. The valid values for this variable are limited, say 6. I want to cache a list of the valid values so that the user can select which feature to enable. CMake should validate the variable. Is this possible and if so, how? 回答1: If you want to validate the allowable values, you'll need to do that yourself in your CMakeLists.txt file. You can, however, provide a list of values for CMake to present

How to use c++20 modules with CMake?

我怕爱的太早我们不能终老 提交于 2020-12-25 01:41:40
问题 Clang and MSVC already supports Modules TS from unfinished C++20 standard. Can I build my modules based project with CMake or other build system and how? I tried build2, it supports modules and it works very well, but i have a question about it's dependency management (UPD: question is closed). 回答1: This works on Linux Manjaro (same as Arch), but should work on any Unix OS. Of course, you need to build with new clang (tested with clang-10). helloworld.cpp: export module helloworld; import