sccn / lsl_archived

Multi-modal time-synched data transmission over local network
242 stars 134 forks source link

cmake doesn't work correctly on windows #276

Closed dmedine closed 6 years ago

dmedine commented 6 years ago

because, the dll is named liblsl.dll but the symbols are contained in a file called lsl.lib. Apparently this doesn't fly on Windows. The only way to make this work is to manually change both names to liblsl* and to change the files linked to in the Apps projects to liblsl.lib. I tried changing line 92 the lsl cmakelists file from set(target lsl) to

if(MSVC)
set(target liblsl)
elseif()
set(target lsl)
end()

but this causes further problems down the line:

Trying to find package LSL
CMake Error at cmake/LSLConfig.cmake:6 (message):
  You set LSL_ROOT to the labstreaminglayer root directory

  instead of an install tree.

  Please consult the 'Build instructions' part in 'INSTALL.md' to decide if
  you

  want to do an out of tree build (and set LSL_ROOT to a built LSL path) or

  unset LSL_ROOT and call CMake from the root directory to build LSL and some

  additional apps
Call Stack (most recent call first):
  cmake/LSLAppBoilerplate.cmake:15 (find_package)
  CMakeLists.txt:29 (include)
tstenner commented 6 years ago

The settings are in LSL/liblsl/CMakeLists.txt, lines 117 and 118:

PREFIX "lib"
OUTPUT_NAME "${target}${lslplatform}"

With the current settings (PREFIX "lib", OUTPUT_NAME lsl64) the library is named "liblsl64.dll/.so.dylib", but the .lib file on Windows is just called "lsl64.lib". I'll see if changing it to PREFIX "", OUTPUT_NAME "liblsl64" would work.

tstenner commented 6 years ago

Looks good to me (at least Linux an Windows), so I just committed it

dmedine commented 6 years ago

Thanks. It would have taken me hours to figure that out!

On 2/27/2018 9:34 AM, Tristan Stenner wrote:

Looks good to me (at least Linux an Windows), so I just committed it

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/sccn/labstreaminglayer/issues/276#issuecomment-368786868, or mute the thread https://github.com/notifications/unsubscribe-auth/ADch7ikyeDU6u0m3PvGeMBIEWslhQyS1ks5tY74xgaJpZM4SUgs-.