[CMake] string(TOUPPER ...) problems

Alexander Neundorf a.neundorf-work at gmx.net
Tue Aug 14 13:31:58 EDT 2007


On Tuesday 14 August 2007 13:17, ope wrote:
> Hi,
>
> I get the error
>
> CMake Error: Error in cmake code at
> .../CMakeLists.txt:295:
> STRING no output variable specified
>
> by this peace of code:
>
>
> set (requiredPackages
>   ZLIB
>   BZip2
>   XercesC
>   CURL
>   Log4cxx
> )
>
> foreach (package ${requiredPackages})
>   find_package(${package} REQUIRED)
>   include_directories(${${package}_INCLUDE_DIRS})
>   string(TOUPPER ${${package}_LIBRARIES} PACKAGE_LIBRARIES)
>   link_directories(${PACKAGE_LIBRARIES})
>   target_link_libraries(${app_name} ${PACKAGE_LIBRARIES})
> endforeach()

I guess not in every iteration of the loop ${${package}_LIBRARIES} will be 
empty. Putting quotes around it should help.

Remove the link_directories(), this is completely handled by 
target_link_libraries().

Bye
Alex


More information about the CMake mailing list