benikabocha / saba

OpenGL Viewer (OBJ PMD PMX)
MIT License
442 stars 60 forks source link

how to build it with vcpkg install lib #35

Closed mingyEx closed 1 year ago

mingyEx commented 1 year ago

for this part https://github.com/benikabocha/saba#required-libraries I install OpenGL/Bullet Physics/GLFW with vcpkg:

vcpkg install glfw3
vcpkg install OpenGL
vcpkg install bullet3

and execute the follow cmake .. -G "Visual Studio 17 2022" -DCMAKE_TOOLCHAIN_FILE=C:/dev/vcpkg/scripts/buildsystems/vcpkg.cmake

get the error:

mingy@DESKTOP-BR5BKAC  ~\source\repos\saba\build   master ≣ +2 ~1 -0 !                           [01:09]
❯ cmake .. -G "Visual Studio 17 2022" -DCMAKE_TOOLCHAIN_FILE=C:/dev/vcpkg/scripts/buildsystems/vcpkg.cmake
-- Selecting Windows SDK version 10.0.19041.0 to target Windows 10.0.22621.
-- BULLET_ROOT=
CMake Error at C:/Program Files/CMake/share/cmake-3.23/Modules/FindPackageHandleStandardArgs.cmake:230 (message):
  Could NOT find Bullet (missing: BULLET_DYNAMICS_LIBRARY
  BULLET_COLLISION_LIBRARY BULLET_MATH_LIBRARY BULLET_SOFTBODY_LIBRARY
  BULLET_INCLUDE_DIR)
Call Stack (most recent call first):
  C:/Program Files/CMake/share/cmake-3.23/Modules/FindPackageHandleStandardArgs.cmake:594 (_FPHSA_FAILURE_MESSAGE)
  C:/Program Files/CMake/share/cmake-3.23/Modules/FindBullet.cmake:83 (FIND_PACKAGE_HANDLE_STANDARD_ARGS)
  C:/dev/vcpkg/scripts/buildsystems/vcpkg.cmake:833 (_find_package)
  CMakeLists.txt:23 (find_package)

-- Configuring incomplete, errors occurred!
See also "C:/Users/mingy/source/repos/saba/build/CMakeFiles/CMakeOutput.log".

How can I pass vcpkg installed libraries to cmake Correctly ?

Also, does the cmake command here need to add two ., because there is no CMakeLists.txt file in mkdir/cd build , an error will be reported.

mingyEx commented 1 year ago

It was my fault, I needed to install the above three libraries + suffix ":x64-windows" I shed tears of not understanding cmake