cmake-modules

CMake incorrectly identifying valid C++ compiler options?

戏子无情 提交于 2021-02-11 18:16:48
问题 I have a set of C++ potential compiler flags stored in a variable and over it, I'm running the following test on CMake 3.14.5 , to see which ones applies and which doesn't to a certain version of the compiler (I'm using GCC , CLANG and ICC to compile the same project, hence the necessity to apply to each only the relevant flags): foreach (FLAG IN LISTS CXX_COMPILER_FLAGS_TO_USE) # Check if the compiler supports the flag. string(REGEX REPLACE "[-=+]" "" FLAG_NO_SIGNS ${FLAG}) # <- The variable

CMake incorrectly identifying valid C++ compiler options?

柔情痞子 提交于 2021-02-11 18:07:30
问题 I have a set of C++ potential compiler flags stored in a variable and over it, I'm running the following test on CMake 3.14.5 , to see which ones applies and which doesn't to a certain version of the compiler (I'm using GCC , CLANG and ICC to compile the same project, hence the necessity to apply to each only the relevant flags): foreach (FLAG IN LISTS CXX_COMPILER_FLAGS_TO_USE) # Check if the compiler supports the flag. string(REGEX REPLACE "[-=+]" "" FLAG_NO_SIGNS ${FLAG}) # <- The variable

Cmake FindBoost.cmake MinGW-W64: searching for library with incorrect name

狂风中的少年 提交于 2021-02-07 17:30:45
问题 I have built Boost 1.68 (using instructions from https://gist.github.com/sim642/29caef3cc8afaa273ce6, and adding link=static,shared to the b2 command line to also build shared libraries.) The libraries appear to build correctly, and I have set the BOOST_INCLUDEDIR and BOOST_LIBRARYDIR environment variables correctly. However, when I add the following to a CMakeLists.txt : find_package(Boost REQUIRED COMPONENTS system context coroutine thread random REQUIRED) and generate with MinGW Makefiles

Cmake FindBoost.cmake MinGW-W64: searching for library with incorrect name

房东的猫 提交于 2021-02-07 17:29:02
问题 I have built Boost 1.68 (using instructions from https://gist.github.com/sim642/29caef3cc8afaa273ce6, and adding link=static,shared to the b2 command line to also build shared libraries.) The libraries appear to build correctly, and I have set the BOOST_INCLUDEDIR and BOOST_LIBRARYDIR environment variables correctly. However, when I add the following to a CMakeLists.txt : find_package(Boost REQUIRED COMPONENTS system context coroutine thread random REQUIRED) and generate with MinGW Makefiles

What is the proper way to document a CMake module?

只愿长相守 提交于 2021-02-07 08:55:58
问题 A quick Google search (...actually many rather extensive Google searches) have not been able to explain how to properly document a CMake module. What I'm looking for is a way to document custom CMake modules so that they work with the cmake --help-module <module_name> command. Is there any standard way of doing this? Can anyone point me to some good examples? The documentation process seems oddly.... not well documented. Haha. How are modules that work with cmake --help-module documented? Any

What is the proper way to document a CMake module?

和自甴很熟 提交于 2021-02-07 08:53:47
问题 A quick Google search (...actually many rather extensive Google searches) have not been able to explain how to properly document a CMake module. What I'm looking for is a way to document custom CMake modules so that they work with the cmake --help-module <module_name> command. Is there any standard way of doing this? Can anyone point me to some good examples? The documentation process seems oddly.... not well documented. Haha. How are modules that work with cmake --help-module documented? Any

Cannot generate 32 bit configuration for Visual Studio 2019 with host=x86 or -A Win32

谁都会走 提交于 2020-07-22 06:13:11
问题 I am trying to configure cmake to build for 32bit and 64bit separately... So far 64bit is easy as I just need to add -A x64 cmake -G "Visual Studio 16 2019" -A x64 But I am not able to set 32bit arch. Official documentation suggest -A Win32 or -T host=x86 https://cmake.org/cmake/help/latest/generator/Visual%20Studio%2016%202019.html Even with them I am not able to set x86 host What I have tried: cmake -G "Visual Studio 16 2019" -DCMAKE_GENERATOR_PLATFORM=x86 cmake -G "Visual Studio 16 2019"

How to Create Packages with CMake

隐身守侯 提交于 2020-06-01 08:18:49
问题 . +-- MyPack | +-- Lib1 | | +-- include | | | +-- Lib1.h | | +-- src | | | +-- Lib2.cpp | | +-- CMakeLists.txt | +-- Lib2 | | +-- include | | | +-- Lib2.h | | +-- src | | | +-- Lib2.cpp | | +-- CMakeLists.txt | +-- CMakeLists.txt +-- SubProject1 | +-- CMakeLists.txt +-- SubProject2 | +-- CMakeLists.txt +-- CMakeLists.txt Hi all. I'm new to CMake and I'm trying to obtain something like the following. Considering the above directory tree of my C++ project: I have a directory (let's say "MyPack"

CMake: Using add_subproject with a library using Include ends up in wrong relative path

ε祈祈猫儿з 提交于 2020-04-17 21:51:34
问题 Global CMakeLists.txt This CMakeLists.txt compiles a few C++ files (Qt5/...) with MOC and is not 'special' in any regards. The code in question is this: add_subdirectory(third-party/libwebrtc) include_directories(third-party/libwebrtc) target_link_libraries(${PROJECT_NAME} libwebrtc) libwebrtc CMakeLists.txt cmake_minimum_required(VERSION 3.3) project(libwebrtc) # Allow the use of IN_LIST operand cmake_policy(SET CMP0057 NEW) set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_SOURCE_DIR}

CMake: Using add_subproject with a library using Include ends up in wrong relative path

和自甴很熟 提交于 2020-04-17 21:51:23
问题 Global CMakeLists.txt This CMakeLists.txt compiles a few C++ files (Qt5/...) with MOC and is not 'special' in any regards. The code in question is this: add_subdirectory(third-party/libwebrtc) include_directories(third-party/libwebrtc) target_link_libraries(${PROJECT_NAME} libwebrtc) libwebrtc CMakeLists.txt cmake_minimum_required(VERSION 3.3) project(libwebrtc) # Allow the use of IN_LIST operand cmake_policy(SET CMP0057 NEW) set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_SOURCE_DIR}