-
Notifications
You must be signed in to change notification settings - Fork 490
[Static] Target "ociotest" links to target "sampleicc::sampleicc" and "utils::strings", but the target was not found. #1581
Copy link
Copy link
Closed
Description
Hi Guys,
Related to microsoft/vcpkg#21642, the user encountered the following failure when use opencoloio with static build, we noticed that target sampleicc::sampleicc and utils::strings exported in static build, but these looks private which can't be used and exported externally. we could repro this issue on windows. Could you please help take a look?
OpenColorIOTargets.cmake:
set_target_properties(OpenColorIO::OpenColorIO PROPERTIES
INTERFACE_COMPILE_FEATURES "cxx_std_11"
INTERFACE_LINK_LIBRARIES "OpenColorIO::OpenColorIOHeaders;\$<LINK_ONLY:expat::expat>;\$<LINK_ONLY:Imath::Imath>;\$<LINK_ONLY:pystring::pystring>;\$<LINK_ONLY:sampleicc::sampleicc>;\$<LINK_ONLY:utils::strings>;\$<LINK_ONLY:yaml-cpp>"
)
Failures:
CMake Error at /Users/matt/vcpkg/scripts/buildsystems/vcpkg.cmake:540 (_add_executable):
Target "ociotest" links to target "sampleicc::sampleicc" but the target was
not found. Perhaps a find_package() call is missing for an IMPORTED
target, or an ALIAS target is missing?
Call Stack (most recent call first):
CMakeLists.txt:11 (add_executable)
CMake Error at /Users/matt/vcpkg/scripts/buildsystems/vcpkg.cmake:540 (_add_executable):
Target "ociotest" links to target "utils::strings" but the target was not
found. Perhaps a find_package() call is missing for an IMPORTED target, or
an ALIAS target is missing?
Call Stack (most recent call first):
CMakeLists.txt:11 (add_executable)
Repro steps:
- git clone https://github.com/PhoebeHui/vcpkg
- cd vcpkg
- git checkout dev/Phoebe/opencolorio
- ./bootstrap-vcpkg.bat
- ./vcpkg install opencolorio:x64-windows-static
- ./vcpkg integrate install, copy the '-DCMAKE_TOOLCHAIN_FILE=xxxx', it will be used in test steps.
- Create a test project that will link with OpenColorIO:
test\CMakeLists.txtcmake_minimum_required(VERSION 3.22) project(ocio-test LANGUAGES CXX) set(CMAKE_CXX_STANDARD 14) set(CMAKE_CXX_STANDARD_REQUIRED ON) set(CMAKE_CXX_EXTENSIONS OFF) find_package(OpenColorIO REQUIRED) add_executable(ociotest main.cpp) target_link_libraries(ociotest PRIVATE OpenColorIO::OpenColorIO OpenColorIO::OpenColorIOHeaders)
test\main.cpp
```
#include <OpenColorIO/OpenColorIO.h>
int main()
{
OCIO_NAMESPACE::Config::CreateFromEnv();
return 0;
}
```
- Create test\build folder, replace the '-DCMAKE_TOOLCHAIN_FILE=E:/vcpkg/PhoebeHui/vcpkg/scripts/buildsystems/vcpkg.cmake' with your actual path. Then execute the command:
cmake.exe -DCMAKE_TOOLCHAIN_FILE=E:/vcpkg/PhoebeHui/vcpkg/scripts/buildsystems/vcpkg.cmake -DVCPKG_TARGET_TRIPLET=x64-windows-static -DVCPKG_BUILD_TYPE=debug -G "Visual Studio 16 2019" ..
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels