In my project I have some libraries that I have prebuilt in a seperate directory that I would like to link with the object files of the current project. In the IDE, project settings, linker, Libraries Search Path contains the path to the .lib files.
However, when I generate the CMakeLists.txt file the section under "# Library path" only contains a line like this:
Code: Select all
...
# Library path
set(CMAKE_LDFLAGS "${CMAKE_LDFLAGS} /LIBPATH:some-path /LIBPATH: ........... ")
...
When I change the CMakeLists.txt file like this, the build works fine.
Code: Select all
...
# Library path
link_directories(
some-path
.......
)
...
Why was the CMAKE_LDFLAGS syntax chosen over the link_directories syntax and how is it supposed to work? What does it tie into?