Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Documentation / Example needed for find_program #3070

Closed
mizvekov opened this issue Mar 19, 2018 · 2 comments
Closed

Documentation / Example needed for find_program #3070

mizvekov opened this issue Mar 19, 2018 · 2 comments
Labels
category:documentation To resolve the issue, documentation will need to be updated

Comments

@mizvekov
Copy link

So, currently, installing tools with vcpkg and then trying to find them with 'find_program' isn't as straightforward as on traditional unix packaging systems.

For example, installing 'glslang' package on a typical system would put wherever 'glslangValidator' is in 'PATH', and then 'find_program(glsval glslangValidator)' would work with no additional setup.

Not so with vcpkg as far as I could find out.

The examples here are all about using libraries, not tools, so that is a problem as well.

@miurahr
Copy link
Contributor

miurahr commented Mar 30, 2018

It seems be not only a documentation issue but a issue on vcpkg tweaks for cmake, that is good for find_package but not enough for find_program.

Here is a tweak for cmake, https://github.com/Microsoft/vcpkg/blob/master/scripts/buildsystems/vcpkg.cmake

It defines CMAKE_PREFIX_PATH, CMAKE_FIND_ROOT_PATH, and CMAKE_FIND_ROOT_PATH for find_package to find vcpkg ports.
Also for find_program

list(APPEND CMAKE_PROGRAM_PATH ${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/tools)
file(GLOB _VCPKG_TOOLS_DIRS ${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/tools/*)
foreach(_VCPKG_TOOLS_DIR ${_VCPKG_TOOLS_DIRS})
    if(IS_DIRECTORY ${_VCPKG_TOOLS_DIR})
        list(APPEND CMAKE_PROGRAM_PATH ${_VCPKG_TOOLS_DIR})
    endif()
endforeach()

It looks fine.

@JackBoosY JackBoosY added the category:question This issue is a question label Feb 27, 2019
@JackBoosY JackBoosY added category:documentation To resolve the issue, documentation will need to be updated and removed category:question This issue is a question labels May 10, 2019
@JackBoosY
Copy link
Contributor

This issue hasn’t been updated in a year; if it is still an issue, please reopen this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category:documentation To resolve the issue, documentation will need to be updated
Projects
None yet
Development

No branches or pull requests

3 participants