cmake

cmake check if Mac OS X, use APPLE or ${APPLE}

谁说我不能喝 提交于 2020-06-14 04:31:35
问题 I would like check whether I am in Mac OS X or not, and have the following code cmake_minimum_required (VERSION 3.0) project (test) set (FOO 1) if (${FOO} AND ${APPLE}) message ("MAC OS X") endif () It failed on non-OSX system with error message CMake Error at CMakeLists.txt:4 (if): if given arguments: "1" "AND" Unknown arguments specified If I replace ${APPLE} with APPLE , the error went away. But I am a little puzzled by this. When should we refer to a variable with ${VAR} and when should

cLion + Qt5 - exit code -1073741515 (0xC0000135)

对着背影说爱祢 提交于 2020-06-13 11:12:12
问题 I'm trying to run simple test using QT5 and cLion but I run in to the exit code wall... Here is my envi : cLion 2017.2 minGw 5.0 < according to cLion cMake 3.8.2 Qt 5.9.0 CMakeList.txt cmake_minimum_required(VERSION 3.8) project(testWindotQt) set(CMAKE_CXX_STANDARD 17) set(CMAKE_AUTOMOC ON) set(CMAKE_INCLUDE_CURRENT_DIR ON) set(CMAKE_AUTOUIC ON) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11") set(SOURCE_FILES main.cpp ) add_executable(testWindotQt ${SOURCE_FILES}) if (WIN32) # If you

PC-Lint needs a list of all include paths for the files to be scanned. How to get a list of all include paths recursively needed by a target in CMake?

爱⌒轻易说出口 提交于 2020-06-13 06:24:31
问题 I'm in a project where CMake is used for managing the build process. In the project there are several executables which depends on components and these components are built as static libraries. There are also dependencies between these components. For each executable or component, only their own local includes are specified and includes from dependencies are resolved by using target_link_libraries(<target> <dependencies>) . So far so good. The problem is when PC-Lint shall be integrated into

Dependency management using Conan with a CMake project under VS2017

送分小仙女□ 提交于 2020-06-12 15:38:37
问题 I'm trying to setup a development environment for C++ to compile under Linux x64 using CMake integration with VS2017. To better manage dependencies I choose to use Conan but I'm pretty new to this software and I'm wondering what's the best way to have VS2017 to recognize the dependencies of the project. For example, I've used Conan to install the POCO library for C++ but when I open the Main.cpp file it doesn't recognise the header files location and I'm not really sure where to add those

How to use Cmake to build binaries with NASM

孤者浪人 提交于 2020-06-12 12:17:34
问题 I'm learning x64 and I hate make, so I'm trying to get cmake to build binaries with NASM. This is roughly supported by cmake but the documentation is crap. This is what I have working right now by cobbling together stuff from stack overflow and then cutting out everything that doesn't break the build: cmake_minimum_required(VERSION 3.14) set(CMAKE_ASM_NASM_LINK_EXECUTABLE "ld <LINK_FLAGS> <OBJECTS> -o <TARGET> <LINK_LIBRARIES>") set(CMAKE_ASM_NASM_OBJECT_FORMAT elf64) project(test_project ASM

How to use Cmake to build binaries with NASM

こ雲淡風輕ζ 提交于 2020-06-12 12:16:35
问题 I'm learning x64 and I hate make, so I'm trying to get cmake to build binaries with NASM. This is roughly supported by cmake but the documentation is crap. This is what I have working right now by cobbling together stuff from stack overflow and then cutting out everything that doesn't break the build: cmake_minimum_required(VERSION 3.14) set(CMAKE_ASM_NASM_LINK_EXECUTABLE "ld <LINK_FLAGS> <OBJECTS> -o <TARGET> <LINK_LIBRARIES>") set(CMAKE_ASM_NASM_OBJECT_FORMAT elf64) project(test_project ASM

How to use Cmake to build binaries with NASM

假如想象 提交于 2020-06-12 12:15:12
问题 I'm learning x64 and I hate make, so I'm trying to get cmake to build binaries with NASM. This is roughly supported by cmake but the documentation is crap. This is what I have working right now by cobbling together stuff from stack overflow and then cutting out everything that doesn't break the build: cmake_minimum_required(VERSION 3.14) set(CMAKE_ASM_NASM_LINK_EXECUTABLE "ld <LINK_FLAGS> <OBJECTS> -o <TARGET> <LINK_LIBRARIES>") set(CMAKE_ASM_NASM_OBJECT_FORMAT elf64) project(test_project ASM

CMake add_executable in another directory

半腔热情 提交于 2020-06-12 08:15:20
问题 I am making a bunch of tests in order to verify that each library are correctly linked, and then some tests for the functionalities of my code. I would like to have X different executable in the directory project/build/tests and I want my program to be build in project/build cmake_minimum_required(VERSION 3.0) project(ProjectName) # Linking library ... add_executable(${PROJECT_NAME} ${SRC_LIST} ${INCLUDE_LIST}) until here, everything is fine and works as wanted but then I don't know how to

CMake add_executable in another directory

不问归期 提交于 2020-06-12 08:14:14
问题 I am making a bunch of tests in order to verify that each library are correctly linked, and then some tests for the functionalities of my code. I would like to have X different executable in the directory project/build/tests and I want my program to be build in project/build cmake_minimum_required(VERSION 3.0) project(ProjectName) # Linking library ... add_executable(${PROJECT_NAME} ${SRC_LIST} ${INCLUDE_LIST}) until here, everything is fine and works as wanted but then I don't know how to

Force linking against Python release library in debug mode in Windows/Visual Studio from CMake

被刻印的时光 ゝ 提交于 2020-06-12 07:32:10
问题 I'm developing a Python binding for a C++ library using Boost Python, for Linux and Windows (Visual Studio). In Windows, the static Boost Python library has a dependency against Python (this is motive for another thread, here), so, in my CMake config I need to do: if((${CMAKE_SYSTEM_NAME} STREQUAL "Linux") OR APPLE) target_link_libraries(my_python_module ${Boost_LIBRARIES}) elseif(WIN32 AND MSVC) add_definitions(/DBOOST_PYTHON_STATIC_LIB) target_link_libraries(my_python_module ${Boost