cmake

CMake does not produce .exe file

你说的曾经没有我的故事 提交于 2020-07-05 11:19:35
问题 I have built a CERN's ROOT script which based on c++ and i write(edit an example) CMakeList.txt. I am so rokie at CMake btw. When I command to compile with cmake .. , it done correctly -i think- with no errors. But .exe file what i want to produce does not appear. My directory orders /Project ../TLV.cpp ../CMakeLists.txt ../build There is my CMakeLists.txt cmake_minimum_required(VERSION 2.8) project(TLV) #Set CXX flags to compile with c++11 and error warnings quiet set(CMAKE_CXX_FLAGS "-O3

CMAKE_PREFIX_PATH doesn't help CMake in finding Qt5

依然范特西╮ 提交于 2020-07-04 13:49:26
问题 From here: https://stackoverflow.com/a/28327499/462608 I tried this: cmake_minimum_required(VERSION 2.8.12) project(qtquick_hello_cmake) set(CMAKE_PREFIX_PATH "/opt/Qt5.9.1/5.9.1/") set(CMAKE_INCLUDE_CURRENT_DIR ON) set(CMAKE_AUTOMOC ON) set(CMAKE_AUTORCC ON) find_package(Qt5 COMPONENTS Quick Core REQUIRED) qt5_add_resources(RESOURCES qml.qrc) add_executable(${PROJECT_NAME} "main.cpp" "qml.qrc") qt5_use_modules(${PROJECT_NAME} Quick Core) target_link_libraries(${PROJECT_NAME} Qt5::Core Qt5:

Target Boost::<library> already has an imported location + link errors

谁说我不能喝 提交于 2020-07-04 08:56:08
问题 I'm using Homebrew to install LLVM, Boost, and CMake on MacOS Mojave. After upgrading my LLVM to version 9.0.0 and Boost to 1.71.0, CMake (v3.15.3) started complaining about various libraries already having an imported location, such as: CMake Warning at /usr/local/lib/cmake/boost_system-1.71.0/libboost_system-variant-shared.cmake:59 (message): Target Boost::system already has an imported location '/usr/local/lib/libboost_system-mt.dylib', which will be overwritten with '/usr/local/lib

What is the use case for generator expression on target_include_directories?

扶醉桌前 提交于 2020-07-03 04:20:30
问题 I've seen in multiple places references to using generator expressions when defining include directories, so you can define different places for the includes during compilation and during installation. For example: # Define headers for this library. PUBLIC headers are used for # compiling the library, and will be added to consumers' build # paths. target_include_directories(lib PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include> $<INSTALL_INTERFACE:include> PRIVATE src) I'm building

Android C++ NDK : some shared libraries refuses to link in runtime

旧巷老猫 提交于 2020-06-29 04:40:49
问题 I'm trying to use a C/C++ TensorFlow Lite shared library for my project, and it succeeds. So I added a few more libraries, but lib_nnapi.so fails to link in runtime( System.loadLibrary ). If I remove that specific library, everything works fine. Using fetchelf to rename SONAME failed with cannot locate symbol error. Wrote CMakeLists.txt using Official Android ndk example. All library is located in the same directories. CMakeLists.txt cmake_minimum_required(VERSION 3.4.1) option(BUILD_WITH

How to add new source file in CMakeLists.txt?

不羁岁月 提交于 2020-06-29 03:55:47
问题 I am creating a demo to read and write files through android NDK. I am using CMake and have CMakeLists.txt in my project with following content: # For more information about using CMake with Android Studio, read the # documentation: https://d.android.com/studio/projects/add-native-code.html # Sets the minimum version of CMake required to build the native library. cmake_minimum_required(VERSION 3.4.1) # Creates and names a library, sets it as either STATIC # or SHARED, and provides the

Getting “cl_version.h: CL_TARGET_OPENCL_VERSION is not defined. Defaulting to 220 (OpenCL 2.2)” warning during runtime

做~自己de王妃 提交于 2020-06-29 03:40:37
问题 Following this and this posts, I'm compiling the main.c code on this GitHub Gist. Running CMake command find_package(OpenCL REQUIRED) I get this: -- Looking for CL_VERSION_2_2 - found -- Found OpenCL: C:/Program Files (x86)/IntelSWTools/system_studio_2020/OpenCL/sdk/lib/x86/OpenCL.lib (found version "2.2") indicating that an OpenCL SDK version 2.2 was found. This is in contradiction with what I get from clinfo tool, detecting a 1.2 OpenCL for Intel's SDK/platforms. Now when running the

Why doesn't “CMAKE_MAKE_PROGRAM” variable take effect?

戏子无情 提交于 2020-06-28 12:03:31
问题 I try to use gmake instead of make as the build command. So I modify the CMakeList.txt as following: ...... set(CMAKE_MAKE_PROGRAM /usr/local/bin/gmake) ...... While in CMakeCache.txt , CMAKE_MAKE_PROGRAM is still /usr/bin/make : //Path to a program. CMAKE_MAKE_PROGRAM:FILEPATH=/usr/bin/make How to make " CMAKE_MAKE_PROGRAM " variable take effect? 回答1: You have two options: 1: Set the make command when you call CMake : cmake -DCMAKE_MAKE_PROGRAM=gmake <the rest of your arguments> 2: Do as

cmake not finding a configuration file for pdal

此生再无相见时 提交于 2020-06-28 07:06:54
问题 I am trying to configure the Point Data Abstraction Library in Windows using CMake. I am following a tutorial that can be found here: I am using the following command in the command prompt: C:\Users\name\PDALe\build> cmake .. -DCMAKE_PREFIX_PATH=C:\OSGeo4W64\lib\pdal\cmake However, the following warning appears: CMake Warning at CMakeLists.txt:3 (find_package): Could not find a configuration file for package "PDAL" that is compatible with requested version "1.6.0". The following configuration

Copy out plain .o files with cmake

主宰稳场 提交于 2020-06-28 05:53:38
问题 I'm trying to get cmake (on linux) to create some static object (.o) files and install them to an external directory. To that end I have a list, object_sources , containing the project path of the sources, and put this in the top level CMakeLists.txt : set(local_objects "") foreach(file ${object_sources}) get_filename_component(cur ${file} NAME_WE) add_library("${cur}.o" OBJECT ${file}) list(APPEND local_objects "${cur}.o") # To confirm these variables are what I think they are: message("--->