code_fodder
code_fodder

Reputation: 16391

cmake: You have called ADD_LIBRARY for library cryptopp without any source files

Windows 64bit using cmake to compile c++ project: github.com/iHateInventNames/synergy-through-usb

I fixed a previous issue in this post: Compile issues: LIBUSB_1 with cmake project on Windows

So when I hit cmake now I get the following error:

> cmake .
-- Found libusb-1.0:
--  - Includes: C:/local/libs/libusbx
--  - Libraries: C:/local/libs/libusbx/libusb-1.0.lib
You have called ADD_LIBRARY for library cryptopp without any source files. This typically indicates a problem with your CMakeLists.txt file

-- Configuring done
CMake Error: CMake can not determine linker language for target: cryptopp
CMake Error: CMake can not determine linker language for target: cryptopp
CMake Error: CMake can not determine linker language for target: cryptopp
CMake Error: CMake can not determine linker language for target: cryptopp
-- Generating done
-- Build files have been written to: C:/local/projects/synergy-usb/synergy-through-usb-master

What does this mean? how can I solve it / move on?

Links to the install instructions

both goto 404 errors...

Upvotes: 2

Views: 3278

Answers (1)

Based on a quick browse through the project's CMakeLists, it would seem you're supposed to unpack tools/cryptopp562.zip into a directory called tools/cryptopp562 before running CMake. This should definitely have been mentioned in the projects' installation instructions, if any.

More precisely, the file tools/CMakeLists.txt contains this code:

set(cpp_dir cryptopp562)

file(GLOB cpp_src ${cpp_dir}/*.cpp)

# ...

add_library(cryptopp STATIC ${cpp_src})

This means that the variable cpp_src is filled with source files taken from directory cryptopp562 (relative to the CMakeList's directory, i.e. tools), and is then used to define the source files of library cryptopp. However, the project's distribution only contains tools/cryptopp562.zip. Unpacking that into directory tools/cryptopp562 should provide the missing files.

Upvotes: 2

Related Questions