Skip to content

/MP not added to CMAKE_CXX_FLAGS for Visual Studio #2030

Closed
@kaikai2

Description

@kaikai2

In commit 1355b98 CMAKE_CXX_FLAGS is compared against a default value, however, the default value starts with a space which is not what you have when you run cmake to generate project files for visual studio.

Your Environment

  • Operating System and version: Windows 10
  • Compiler: VS2013
  • PCL Version: 1.8.1, 1.8.0
  • CMake: 3.8.1

Expected Behavior

When CMAKE_CXX_FLAGS is not specified explicitly from cmake, the /MP option should be added for Visual Studio to enable parallel compile.

Remove the leading space in that commit, and the /MP option is added as expected.

Current Behavior

Possible Solution

- if("${CMAKE_CXX_FLAGS}" STREQUAL " /DWIN32 /D_WINDOWS /W3 /GR /EHsc") ## Check against default flags
+ if("${CMAKE_CXX_FLAGS}" STREQUAL "/DWIN32 /D_WINDOWS /W3 /GR /EHsc") ## Check against default flags

Code to Reproduce

Context

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions