Skip to content

Use cmake.exe from path, if it is found there#211

Merged
BrunoLevy merged 1 commit intoBrunoLevy:mainfrom
tksuoran:cmake-in-path
Jan 31, 2025
Merged

Use cmake.exe from path, if it is found there#211
BrunoLevy merged 1 commit intoBrunoLevy:mainfrom
tksuoran:cmake-in-path

Conversation

@tksuoran
Copy link
Copy Markdown
Contributor

This change makes configure.bat to use cmake.exe from path, if it is found there. This makes the script to work on systems that have Visual Studio installed, but no separate installation for CMake for Windows. Opening Developer Command Prompt for VS 2022 brings cmake bundled with Visual Studio into path.

I am not proficient with bat scripts, so someone else should verify this is a good change. It works on my machine, but I've only tested the path where cmake.exe is found from path.

@BrunoLevy
Copy link
Copy Markdown
Owner

Oh that's interesting !
Does it mean that VSCode's bundled CMake can compile geogram ? (last time I tried it did not work, it did not support some CMake functions that geogram is using, but it was long time ago).

@tksuoran
Copy link
Copy Markdown
Contributor Author

Works for me:

C:\git\tksuoran\geogram>where cmake
C:\Program Files\Microsoft Visual Studio\2022\Professional\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin\cmake.exe

C:\git\tksuoran\geogram>cmake --version
cmake version 3.29.5-msvc4

CMake suite maintained and supported by Kitware (kitware.com/cmake).

C:\git\tksuoran\geogram>configure.bat
Configuring Geogram build
Starting CMake...
 (NOTE: it may complain about missing VULKAN, you can safely ignore)
-- Building for: Visual Studio 17 2022
-- Selecting Windows SDK version 10.0.22621.0 to target Windows 10.0.26100.
-- The C compiler identification is MSVC 19.42.34433.0
-- The CXX compiler identification is MSVC 19.42.34433.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: C:/Program Files/Microsoft Visual Studio/2022/Professional/VC/Tools/MSVC/14.42.34433/bin/Hostx64/x64/cl.exe - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: C:/Program Files/Microsoft Visual Studio/2022/Professional/VC/Tools/MSVC/14.42.34433/bin/Hostx64/x64/cl.exe - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Configuring 64 bits build
-- Did not find GLFW3 in the system, using built-in GLFW3.
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Failed
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - not found
-- Found Threads: TRUE
-- Including Win32 support
-- Doxygen >= 1.7.0 not found, cannot generate documentation
-- Configuring done (14.0s)
-- Generating done (2.2s)
-- Build files have been written to: C:/git/tksuoran/geogram/build/Windows
----------------------------------------------------------------
Geogram build is configured
Visual Studio solution is in GraphiteThree\build\Windows""\Geogram.sln
----------------------------------------------------------------

C:\git\tksuoran\geogram>

@tksuoran
Copy link
Copy Markdown
Contributor Author

Also note that these are conflicting:

-- Build files have been written to: C:/git/tksuoran/geogram/build/Windows
vs.
Visual Studio solution is in GraphiteThree\build\Windows""\Geogram.sln

@BrunoLevy BrunoLevy merged commit 11421be into BrunoLevy:main Jan 31, 2025
PlathC added a commit to PlathC/GraphiteThree that referenced this pull request Feb 13, 2025
BrunoLevy added a commit to BrunoLevy/GraphiteThree that referenced this pull request Feb 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants