> Also, you should install to 'lib${LIB_SUFFIX}', not 'lib'. This will allow
> you (and distros packaging your software) to set LIB_SUFFIX to separate
> arch-specific components of 32- and 64-bit builds. E.g. on Linux,
> lib_suffix is usually ''/'64' or '32'/'', and on Windows might be
> ''/'/amd64'.



if you're mentioning ${LIB_SUFFIX} you might as well mention ${LIB_PREFIX}
which is the 'lib' prepended on gnuish systems.


>
>
>  That is only part of the problem. Now in RepoB, I want to import the
>> libraries. CMake documentation here:
>> http://www.cmake.org/Wiki/**CMake/Tutorials/Exporting_and_**
>> Importing_Targets<http://www.cmake.org/Wiki/CMake/Tutorials/Exporting_and_Importing_Targets>
>>
>> states that I can do something like this:
>> include(${PATH_OF_REPO_A_**BUILD}/repoA-targets.cmake)
>>
>
> You can, but I wouldn't recommend it. Instead, you should create a
> 'repoAConfig.cmake' that is installed by repoA, which does this for you.
> Then use repoA with 'find_package(repoA)'.
>
> Usually I generate (with @ONLY) a FooConfig.cmake and
> FooConfig-install.cmake with each containing an appropriate
> Foo_INCLUDE_DIRS. The first, intended for using your package from the build
> directory, will set its include directories to locations in your source
> and/or build. The second usually uses @CMAKE_INSTALL_PREFIX@/**include,
> and is installed with the RENAME option to rename it 'back' to
> FooConfig.cmake.
>
> Besides setting the INCLUDE_DIRS, it should include the line:
>
> include("${CMAKE_CURRENT_LIST_**DIR}/FooTargets.cmake")
>
>  target_link_libraries(**repoBExecutable myLib)
>>
>
> ...and then you can do this.
>
> Some things to check if it is not working:
>
> - Open repoATargets.cmake and verify that it is declaring an imported
> 'myLib' target.
> - if(NOT TARGET myLib)
>     message(SEND_ERROR "myLib not a target?!")
>   endif()
>
> It may also be beneficial to look at an existing CMake project...
>
> --
> Matthew
>
>
> --
>
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at http://www.kitware.com/**
> opensource/opensource.html<http://www.kitware.com/opensource/opensource.html>
>
> Please keep messages on-topic and check the CMake FAQ at:
> http://www.cmake.org/Wiki/**CMake_FAQ<http://www.cmake.org/Wiki/CMake_FAQ>
>
> Follow this link to subscribe/unsubscribe:
> http://www.cmake.org/mailman/**listinfo/cmake<http://www.cmake.org/mailman/listinfo/cmake>
>
--

Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake

Reply via email to