cmake

How to use cpplint code style checking with CMake?

为君一笑 提交于 2021-02-18 19:19:48
问题 The only online resources I have found are the CMake documentation on CMAKE_<LANG>_CPPLINT (link here) and this example (link here), but I cannot figure out how to actually use it inside a CMakeLists.txt file. I tried the example provided, but I can't make it work. FYI, I installed cpplint as explained here. As of now, I can run the cpplint python script inside CMakeLists.txt using this CMake command: execute_process(COMMAND cpplint path/To/File/To/Analyse.cpp) However, I am pretty sure that

How to use cpplint code style checking with CMake?

橙三吉。 提交于 2021-02-18 19:18:13
问题 The only online resources I have found are the CMake documentation on CMAKE_<LANG>_CPPLINT (link here) and this example (link here), but I cannot figure out how to actually use it inside a CMakeLists.txt file. I tried the example provided, but I can't make it work. FYI, I installed cpplint as explained here. As of now, I can run the cpplint python script inside CMakeLists.txt using this CMake command: execute_process(COMMAND cpplint path/To/File/To/Analyse.cpp) However, I am pretty sure that

cmake find_package cannot locate glfw after build and install

柔情痞子 提交于 2021-02-18 19:01:25
问题 I'm trying to use cmake's find_package function to find the installation of glfw3 and I'm not quite sure I'm understanding the instructions. I've download glfw3 and followed the instructions for building. downloaded the src, went to the root, and ran cmake .. Then I open the main solution glfw.sln in visual studio. I built the solution and everything seemed to build fine. I can see where the lib was created and everything. In my own cmake project, when I use find_package(glfw3 REQUIRED) I

Cmake Could NOT find PythonLibs

北城以北 提交于 2021-02-18 17:58:26
问题 I'm trying to download YouCompleteMe for Vim on Windows following this tutorial. When calling CMake: cmake -G "Visual Studio 14 Win64" -DPATH_TO_LLVM_ROOT=%USERPROFILE%/ycm_temp/llvm_root_dir . %USERPROFILE%/vimfiles/bundle/YouCompleteMe/third_party/ycmd/cpp It throws the following exception: CMake Error at C:/Program Files/CMake/share/cmake-3.9/Modules/FindPackageHandleStandardArgs.cmake:137 (message): Could NOT find PythonLibs (missing: PYTHON_LIBRARIES PYTHON_INCLUDE_DIRS) (Required is at

Cmake Could NOT find PythonLibs

為{幸葍}努か 提交于 2021-02-18 17:58:18
问题 I'm trying to download YouCompleteMe for Vim on Windows following this tutorial. When calling CMake: cmake -G "Visual Studio 14 Win64" -DPATH_TO_LLVM_ROOT=%USERPROFILE%/ycm_temp/llvm_root_dir . %USERPROFILE%/vimfiles/bundle/YouCompleteMe/third_party/ycmd/cpp It throws the following exception: CMake Error at C:/Program Files/CMake/share/cmake-3.9/Modules/FindPackageHandleStandardArgs.cmake:137 (message): Could NOT find PythonLibs (missing: PYTHON_LIBRARIES PYTHON_INCLUDE_DIRS) (Required is at

Different CMAKE_BUILD_TYPE per target

久未见 提交于 2021-02-18 17:10:07
问题 I am working on a really large project, which I'm in the process of moving from using custom Makefiles to using cmake instead, but I'm still missing a functionality that was implemented with the Makefiles. The project has many sub-directories, each one of which is compiled into a static library, and then linked into the final executable. Here is a small example src/ lib1/ lib2/ lib3/ main.cpp CMakeLists.txt and in CMakeLists.txt might be something like this: add_subdirectory(lib1) add

Different CMAKE_BUILD_TYPE per target

假装没事ソ 提交于 2021-02-18 17:09:53
问题 I am working on a really large project, which I'm in the process of moving from using custom Makefiles to using cmake instead, but I'm still missing a functionality that was implemented with the Makefiles. The project has many sub-directories, each one of which is compiled into a static library, and then linked into the final executable. Here is a small example src/ lib1/ lib2/ lib3/ main.cpp CMakeLists.txt and in CMakeLists.txt might be something like this: add_subdirectory(lib1) add

CMake and Qt5 AUTOMOC error

折月煮酒 提交于 2021-02-18 15:51:41
问题 I have a project which uses Qt5 and I have a CMakeLists.txt file that I use for creating the Visual Studio Solution. This is an excerpt of my CMakeLists.txt cmake_policy(SET CMP0020 NEW) set(CMAKE_AUTOMOC ON) find_package(Qt5 REQUIRED COMPONENTS core widgets) set(COMMON_INCLUDE_DIR ${PROJECT_SOURCE_DIR}/src) include_directories( ${Boost_INCLUDE_DIRS} ${COMMON_INCLUDE_DIR} ) file(GLOB_RECURSE COMMON_SOURCE "*.hpp" "*.cpp") add_library(${PROJECT_NAME} ${COMMON_SOURCE}) qt5_use_modules(${PROJECT

how do i create a custom (widget) plugin for qt designer with cmake ( and visual studio )

怎甘沉沦 提交于 2021-02-18 12:11:28
问题 The amount of tutorials, how to create a qt designer plugin is very thin..and the ones i found always use qt creator ( like this one : http://qt-project.org/doc/qt-4.8/designer-customwidgetplugin.html ). Where i have to add some qt definitions in the .pro file CONFIG += designer plugin I use CMake and Visual Studio for coding, so it would be really awesome if someone could tell me how i successfully create a .dll that i can put in the plugins/designer folder to have the custom widget show up

cannot find boost_process cmake find_package

跟風遠走 提交于 2021-02-18 11:17:05
问题 I'm trying to import boost libraries into my C++ project, and for some reason it cannot find Boost.Process, although it finds the others. My CMakeLists.txt file: cmake_minimum_required(VERSION 3.9 FATAL_ERROR) set (PROJECT_NAME "test-stuff" CXX) project (${PROJECT_NAME}) set(Boost_USE_MULTITHREADED ON) find_package(Boost 1.64.0 REQUIRED system filesystem process) if(Boost_FOUND) include_directories (SYSTEM ${Boost_INCLUDE_DIR}) endif() include_directories(include) file(GLOB SOURCES "src/*.cpp