gabyx / ApproxMVBB

Fast algorithms to compute an approximation of the minimal volume oriented bounding box of a point cloud in 3D.
Mozilla Public License 2.0
441 stars 93 forks source link

Cmake fails on Windows 10 with VS2017 (64-bit) #23

Closed adam-hartshorne closed 6 years ago

adam-hartshorne commented 6 years ago

I get the following error when I try and use cmake (3.10.2) to setup the project for VS2017,

CMake Error at cmake/SetTargetCompileOptions.cmake:47 (message): Could not set compile flags for compiler id: MSVC Call Stack (most recent call first): lib/CMakeLists.txt:14 (setTargetCompileOptions) lib/CMakeLists.txt:40 (add_approxmvbb_lib)

gabyx commented 6 years ago

MSVC is not yet supported (it was probably with version v2.0.2)
I will look into it tomorrow, I have no windows build so far for which I can test. I will add Windows builds tomorrow, but you need to report back if it builds or not, and maybe send a pull request which fixes some stuff.

gabyx commented 6 years ago

Try the current master build. I had some error in checking the "MSCC" -> should have been "MSVC" compiler

adam-hartshorne commented 6 years ago

Still getting the same error message, just with a different line #,

CMake Error at cmake/SetTargetCompileOptions.cmake:35 (message): Could not set compile flags for compiler id: MSVC Call Stack (most recent call first): lib/CMakeLists.txt:14 (setTargetCompileOptions) lib/CMakeLists.txt:40 (add_approxmvbb_lib)

adam-hartshorne commented 6 years ago

On #26 of SetTargetCompileOptions.cmake the strequals has definitely been updated i.e.

26 elseif( ${CMAKE_CXX_COMPILER_ID} STREQUAL "MSVC" )

, but for some reason cmake isn't matching it.

gabyx commented 6 years ago

I Know the reason: ${CMAKE_CXX_COMPILER_ID}expands to MSVC which expands to 1. Shitty cmake legacy...! I will try to change it

gabyx commented 6 years ago

try now :-) lol

adam-hartshorne commented 6 years ago

Progress, but more errors,

CMake Warning at cmake/SetTargetCompileOptions.cmake:27 (message): MSVC is partially supported (Visual Studio 2013 Update 5), trying to set compiler flags anyway! Call Stack (most recent call first): tests/CMakeLists.txt:65 (setTargetCompileOptions) tests/CMakeLists.txt:89 (defineTarget)

CMake Error at cmake/SetTargetCompileOptions.cmake:39 (target_compile_features): target_compile_features called with invalid arguments Call Stack (most recent call first): tests/CMakeLists.txt:65 (setTargetCompileOptions) tests/CMakeLists.txt:89 (defineTarget)

CMake Warning at cmake/SetTargetCompileOptions.cmake:27 (message): MSVC is partially supported (Visual Studio 2013 Update 5), trying to set compiler flags anyway! Call Stack (most recent call first): tests/CMakeLists.txt:65 (setTargetCompileOptions) tests/CMakeLists.txt:93 (defineTarget)

CMake Error at cmake/SetTargetCompileOptions.cmake:39 (target_compile_features): target_compile_features called with invalid arguments Call Stack (most recent call first): tests/CMakeLists.txt:65 (setTargetCompileOptions) tests/CMakeLists.txt:93 (defineTarget)

CMake Warning at cmake/SetTargetCompileOptions.cmake:27 (message): MSVC is partially supported (Visual Studio 2013 Update 5), trying to set compiler flags anyway! Call Stack (most recent call first): tests/CMakeLists.txt:65 (setTargetCompileOptions) tests/CMakeLists.txt:96 (defineTarget)

CMake Error at cmake/SetTargetCompileOptions.cmake:39 (target_compile_features): target_compile_features called with invalid arguments Call Stack (most recent call first): tests/CMakeLists.txt:65 (setTargetCompileOptions) tests/CMakeLists.txt:96 (defineTarget)

CMake Warning at cmake/SetTargetCompileOptions.cmake:27 (message): MSVC is partially supported (Visual Studio 2013 Update 5), trying to set compiler flags anyway! Call Stack (most recent call first): tests/CMakeLists.txt:65 (setTargetCompileOptions) tests/CMakeLists.txt:100 (defineTarget)

CMake Error at cmake/SetTargetCompileOptions.cmake:39 (target_compile_features): target_compile_features called with invalid arguments Call Stack (most recent call first): tests/CMakeLists.txt:65 (setTargetCompileOptions) tests/CMakeLists.txt:100 (defineTarget)

CMake Warning at cmake/SetTargetCompileOptions.cmake:27 (message): MSVC is partially supported (Visual Studio 2013 Update 5), trying to set compiler flags anyway! Call Stack (most recent call first): tests/CMakeLists.txt:65 (setTargetCompileOptions) tests/CMakeLists.txt:104 (defineTarget)

CMake Error at cmake/SetTargetCompileOptions.cmake:39 (target_compile_features): target_compile_features called with invalid arguments Call Stack (most recent call first): tests/CMakeLists.txt:65 (setTargetCompileOptions) tests/CMakeLists.txt:104 (defineTarget)

gabyx commented 6 years ago

fixed, will look tomorrow, sorry for the inconvenience

adam-hartshorne commented 6 years ago

No need to be sorry, no inconvenience at all. Thank you for spending the time trying to address this issue.

gabyx commented 6 years ago

Did that issue resolve?

adam-hartshorne commented 6 years ago

With the latest update, I now receive the following error.

CMake Error at CMakeLists.txt:182 (message): Could not set install folders for this platform!

gabyx commented 6 years ago

On which platform are you? Mingw? or Cygwin ?? or pure Windows?

adam-hartshorne commented 6 years ago

"Pure" Windows, Windows 10 to be precise.

gabyx commented 6 years ago

but running cmake from a mingw console? or from where?

adam-hartshorne commented 6 years ago

Cmake gui.

gabyx commented 6 years ago

hmm... strange, the WIN32 variable should be True in cmake, why that?

elseif(WIN32)
...
endif()
adam-hartshorne commented 6 years ago

In the version of cmakelist I had it was elseif(WINDOWS), not elseif(WIN32).

Have changed locally and now works (other than the warnings relating to MSVC being partially supported).

gabyx commented 6 years ago

correct but this is wrong I think, I have to double check :-) WIN32 should be the correct, strange, maybe there were some changes...

gabyx commented 6 years ago

yes, WIN32 is correct. strange. I dont get it why it doesnt work...?

gabyx commented 6 years ago

Can you test: ${WIN32}

adam-hartshorne commented 6 years ago

Yes that works.

gabyx commented 6 years ago

Changed it to this, dont ask me why UNIX works for me but WIN32 doesnt on windows...

adam-hartshorne commented 6 years ago

Thank you for all your help.