OCCT cMake on MSYS2

Having trouble installing or compiling FreeCAD? Get help here.
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Post Reply
User avatar
chennes
Veteran
Posts: 3911
Joined: Fri Dec 23, 2016 3:38 pm
Location: Norman, OK, USA
Contact:

OCCT cMake on MSYS2

Post by chennes »

I'm trying to update the compilation instructions on the FreeCAD wiki to allow compilation on MSYS2 on Windows and I've run into a snag with a cMake command I don't understand. I'm hoping someone with more experience can help me out here. The error generated by cmake is:

Code: Select all

CMake Error at /mingw64/lib/cmake/opencascade/OpenCASCADEModelingDataTargets.cmake:99 (message):
  The imported target "TKernel" references the file

     "/mingw64/lib${OCCT_INSTALL_BIN_LETTER}/libTKernel.dll.a"

If I look into the cMake files in this MSYS2 install, I see the following:

Code: Select all

list(APPEND _IMPORT_CHECK_FILES_FOR_TKernel "${_IMPORT_PREFIX}/lib\${OCCT_INSTALL_BIN_LETTER}/libTKernel.dll.a" "${_IMPORT_PREFIX}/bin\${OCCT_INSTALL_BIN_LETTER}/libTKernel.dll" )
I'm particularly perplexed by backslash in "${_IMPORT_PREFIX}/lib\${OCCT_INSTALL_BIN_LETTER}/libTKernel.dll.a" -- why is the "$" being escaped there?! It seems completely wrong to me, and indeed if I remove it this error goes away (replaced by the next in a long line of basically identical cMake errors relating to different OCCT lines). Am I missing some cMake command related to escape characters? The variable OCCT_INSTALL_BIN_LETTER itself is unset, but that's correct in this case, so it should be evaluating to "".
Chris Hennes
Pioneer Library System
GitHub profile, LinkedIn profile, chrishennes.com
openBrain
Veteran
Posts: 9041
Joined: Fri Nov 09, 2018 5:38 pm
Contact:

Re: OCCT cMake on MSYS2

Post by openBrain »

Not a CMake specialist but I agree that this escaping backslash has to be removed.
User avatar
easyw-fc
Veteran
Posts: 3633
Joined: Thu Jul 09, 2015 9:34 am

Re: OCCT cMake on MSYS2

Post by easyw-fc »

chennes wrote: Fri Sep 10, 2021 4:29 am I'm trying to update the compilation instructions on the FreeCAD wiki to allow compilation on MSYS2 on Windows
do you have a mini description? I would like to try to build FC in MSYS2 too
User avatar
chennes
Veteran
Posts: 3911
Joined: Fri Dec 23, 2016 3:38 pm
Location: Norman, OK, USA
Contact:

Re: OCCT cMake on MSYS2

Post by chennes »

easyw-fc wrote: Sat Sep 11, 2021 3:23 pm do you have a mini description?
What I'm doing right now is repeatedly invoking cmake and letting it fail, then installing the next dependency it complains about. So I don't really have anything to report yet, I have to figure out a way around this OCCT problem. I could do a sed/awk thing on my system to fix all these borked cmake files for OCCT, but that doesn't really seem like a good step to have to put on the wiki. So I guess now I have to track down the maintainer of that package and see if they know why that backslash is in there.

ETA: Here's the wiki page I'm working on... https://wiki.freecadweb.org/Compile_on_MinGW
Last edited by chennes on Sat Sep 11, 2021 8:19 pm, edited 1 time in total.
Chris Hennes
Pioneer Library System
GitHub profile, LinkedIn profile, chrishennes.com
User avatar
chennes
Veteran
Posts: 3911
Joined: Fri Dec 23, 2016 3:38 pm
Location: Norman, OK, USA
Contact:

Re: OCCT cMake on MSYS2

Post by chennes »

Poking around my normal (non-MSYS2) Windows installation, it appears that when OpenCASCADE is installed, it's doing that variable substitution then, so that variable shouldn't be showing up in the final installed cmake files for OCCT. I've submitted a bug report over at the MSYS2 github page, I'll see if someone over there knows what's going on.
Chris Hennes
Pioneer Library System
GitHub profile, LinkedIn profile, chrishennes.com
B0Hr
Posts: 2
Joined: Tue Sep 14, 2021 11:25 pm

Re: OCCT cMake on MSYS2

Post by B0Hr »

Hi,

I'm stumbled upon the same problem! Glad I found someone who was having the same problems.
First, I thought it was me, that I forgot to define this additional variable.

I've made a small project which compiles on Linux, Windows and MacOS. It relies on MSYS2 on windows.
https://github.com/rebot/OCCTSandbox

Their is room for improvement of course (My CMakeLists.txt is a WIP). For for now, it works and Open Cascade can be used without any problems :)

Kind regards,

Gilles
User avatar
chennes
Veteran
Posts: 3911
Joined: Fri Dec 23, 2016 3:38 pm
Location: Norman, OK, USA
Contact:

Re: OCCT cMake on MSYS2

Post by chennes »

Thanks for posting, @B0Hr -- a project like that might be a useful testbed for my work on MSYS2. I have running into a whole sequence of problems getting FreeCAD compiling, having a simpler testbed seems like a great idea.
Chris Hennes
Pioneer Library System
GitHub profile, LinkedIn profile, chrishennes.com
Post Reply