sakra / FindMathematica

CMake module for Mathematica.
MIT License
60 stars 12 forks source link

Variable Mathematica_uuid_LIBRARY is not checked #6

Open Expander opened 4 years ago

Expander commented 4 years ago

Dear @sakra ,

a colleague of mine stumbled upon the issue with missing libuuid again.

He has an Ubuntu machine with Mathematica 12. On this machine the package uuid-dev is not installed, so libuuid is not installed on the system.

When he calls find_package(Mathematica COMPONENTS MathLink), he gets an error message of the form:

CMake Error: The following variables are used in this project, but they are set to NOTFOUND.

Please set them or make sure they are set and tested correctly in the CMake files:
Mathematica_uuid_LIBRARY (ADVANCED)
    linked by target "gm2calc.mx" in directory /home/pathron/software/GM2Calc/src 

If I interpret the error message correctly, it seems that the command

find_library (Mathematica_uuid_LIBRARY uuid)

inside FindMathematica.cmake fails to find libuuid on his system. In this case the variable Mathematica_uuid_LIBRARY is set to NOTFOUND. However, the script just continues without checking if libuuid has been found.

If my interpretation is correct, then a possible fix would be to raise an error if libuuid has not been found.

Many thanks in advance and best regards, Alexander Voigt

P.S.: This issue has been found when running cmake in https://github.com/GM2Calc/GM2Calc