cmake

Visual Studio - Cmake Project - Add NetCDF

大憨熊 提交于 2021-02-10 16:50:40
问题 I have a project that I was able to compile in Linux, but was also hoping to compile in a windows environment, namely, visual studio. I installed netcdf, but when I build using cmake, I get this error: Could NOT find PkgConfig (missing: PKG_CONFIG_EXECUTABLE) 1> -- Checking for one of the modules 'netcdf' 1> CMake Error at C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.11/Modules/FindPkgConfig.cmake:641 (message):

Configuring CMake with graphviz library

和自甴很熟 提交于 2021-02-10 15:14:18
问题 I'm trying to make a function which will generate an image with graph from .dot file, so i have to use graphviz library, here is this function: #include <fstream> #include <gvc.h> bool draw_image(const string& path) { GVC_t *gvc; Agraph_t *gr; FILE *fp; gvc = gvContext(); fp = fopen((path + ".dot").c_str(), "r"); gr = agread(fp, nullptr); gvLayout(gvc, gr, "dot"); gvRender(gvc, gr, "png", fopen((path + ".png").c_str(), "w")); gvFreeLayout(gvc, gr); agclose(gr); return (gvFreeContext(gvc)); }

Create config file for CMake project

大城市里の小女人 提交于 2021-02-10 15:10:19
问题 I am trying to generate a config CMake file for a sample project I have. My example is made of two CMake projects: a library, which uses spdlog internally and eigen in its interface and an application, which uses the library. The idea is to learn how to create a Config.cmake file so the application can find the library. This is what I have: cmake_minimum_required(VERSION 3.16) project(tutorial-4 CXX) set(CMAKE_CXX_STANDARD 14) find_package(Eigen3 REQUIRED) set(LIBRARY_SOURCES Lib/lib.cpp) set

Create config file for CMake project

流过昼夜 提交于 2021-02-10 15:07:11
问题 I am trying to generate a config CMake file for a sample project I have. My example is made of two CMake projects: a library, which uses spdlog internally and eigen in its interface and an application, which uses the library. The idea is to learn how to create a Config.cmake file so the application can find the library. This is what I have: cmake_minimum_required(VERSION 3.16) project(tutorial-4 CXX) set(CMAKE_CXX_STANDARD 14) find_package(Eigen3 REQUIRED) set(LIBRARY_SOURCES Lib/lib.cpp) set

Create config file for CMake project

孤街醉人 提交于 2021-02-10 15:05:11
问题 I am trying to generate a config CMake file for a sample project I have. My example is made of two CMake projects: a library, which uses spdlog internally and eigen in its interface and an application, which uses the library. The idea is to learn how to create a Config.cmake file so the application can find the library. This is what I have: cmake_minimum_required(VERSION 3.16) project(tutorial-4 CXX) set(CMAKE_CXX_STANDARD 14) find_package(Eigen3 REQUIRED) set(LIBRARY_SOURCES Lib/lib.cpp) set

CMAKE_USE_SYSTEM_CURL is ON but a curl is not found

痞子三分冷 提交于 2021-02-10 13:26:32
问题 I was trying to install cmake with the system-curl, with ./bootstrap --system-curl , as seen here. Doing that, I got: -- Could NOT find CURL (missing: CURL_LIBRARY CURL_INCLUDE_DIR) CMake Error at CMakeLists.txt:413 (message): CMAKE_USE_SYSTEM_CURL is ON but a curl is not found! Call Stack (most recent call first): CMakeLists.txt:682 (CMAKE_BUILD_UTILITIES) -- Configuring incomplete, errors occurred! See also "/root/temp/cmake-3.14.5/CMakeFiles/CMakeOutput.log". See also "/root/temp/cmake-3

CMake 64-bit with SFML 64-bit

两盒软妹~` 提交于 2021-02-10 12:34:24
问题 I'm trying to build a C++ project with CMake 64-bit for Windows and SFML 2.5.1 64-bit. When I run cmake on the project I'm getting an error message. The only way I can get it to work is to change the CMAKE_PREFIX_PATH to point to a 32-bit version of SFML but that's not what I want. CMakeLists.txt: cmake_minimum_required (VERSION 3.8) #project(GameOfLife) set(CMAKE_PREFIX_PATH "D:\\Program Files\\SFML-2.5.1\\lib\\cmake\\SFML") find_package(SFML 2.5 COMPONENTS graphics window REQUIRED) # Add

CMake 64-bit with SFML 64-bit

情到浓时终转凉″ 提交于 2021-02-10 12:34:10
问题 I'm trying to build a C++ project with CMake 64-bit for Windows and SFML 2.5.1 64-bit. When I run cmake on the project I'm getting an error message. The only way I can get it to work is to change the CMAKE_PREFIX_PATH to point to a 32-bit version of SFML but that's not what I want. CMakeLists.txt: cmake_minimum_required (VERSION 3.8) #project(GameOfLife) set(CMAKE_PREFIX_PATH "D:\\Program Files\\SFML-2.5.1\\lib\\cmake\\SFML") find_package(SFML 2.5 COMPONENTS graphics window REQUIRED) # Add

Can I use CMAKE_SYSTEM_PROCESSOR, defined in a toolchain file, in CMakeLists?

隐身守侯 提交于 2021-02-10 12:12:21
问题 I'd like to add Raspberry Pi as a cross compilation target to a C++ project which uses CMake. Following the accepted answer to this question, I've set up the environment successfully. The project has many build targets already, all of them defined in the main CMakeLists.txt in a quite ugly way (it's an old project). In this file, there are some compiler flags set, depending on the CMAKE_SYSTEM_PROCESSOR variable, for example: if (${CMAKE_SYSTEM_PROCESSOR} MATCHES "^arm") # do something endif

Can I use CMAKE_SYSTEM_PROCESSOR, defined in a toolchain file, in CMakeLists?

江枫思渺然 提交于 2021-02-10 12:12:02
问题 I'd like to add Raspberry Pi as a cross compilation target to a C++ project which uses CMake. Following the accepted answer to this question, I've set up the environment successfully. The project has many build targets already, all of them defined in the main CMakeLists.txt in a quite ugly way (it's an old project). In this file, there are some compiler flags set, depending on the CMAKE_SYSTEM_PROCESSOR variable, for example: if (${CMAKE_SYSTEM_PROCESSOR} MATCHES "^arm") # do something endif