The following part looks suspicious:
-L/usr/lib64/libCg.so -L/usr/lib64/libCgGL.so
-L
should be followed by a path to a directory which will be searched by the linker when looking for subsequent libs specified via -l
.
I would expect this to be -L/usr/lib64
in this case.
Are you sure you're including ${CG_LIBRARY}
and ${CG_GL_LIBRARY}
in a target_link_libraries
call and not a link_directories
call by mistake?
Edit
Based on the comments below, you can do the following to get things working:
get_filename_component(CgLibPath ${CG_LIBRARY} PATH)
get_filename_component(CgGlLibPath ${CG_GL_LIBRARY} PATH)
link_directories(${CgLibPath} ${CgGlLibPath})
This should work, but note that the use of link_directories
is not recommended, even in its own documentation.