CMake

A place to discuss everything related to Newton Dynamics.

Moderators: Sascha Willems, walaber

CMake

Postby Slick » Thu Oct 25, 2018 4:00 pm

I thought I'd start another thread. Hopefully it is clearer that way.

So from a fresh pull on Newton and running CMake in Windows I got a nice solution. I built the solution and then built install (which I thinks copies build files into in theory a nice folder structure).

This is what I got in the build result:
Image

It is missing dNewton, dScene and dVehicle maybe some others.

They did get built here for example:
Image

Also, the .pdb's aren't in with the .lib files which I think is the normal plan. I found the .pdb here:
Image
Slick
 
Posts: 330
Joined: Sat Feb 07, 2004 7:24 pm
Location: LA last and France now

Re: CMake

Postby Julio Jerez » Thu Oct 25, 2018 4:11 pm

when I click config in cmake It list all the project

    build visual studio projects
    link to static runtime libraries
    build 64 bit
    CMAKE_CXX_FLAGS_DEBUG is /MTd /Zi /W4 /Od
    CMAKE_CXX_FLAGS_RELEASE is /MT /Zi /W4 /Ox /Oi /Ot /Ob2 /fp:fast
    dMath
    dgCore
    dScene
    dNewton
    dVehicle
    newton
    dgPhysics
    dTimeTracker
    dAnimation
    dContainers
    dCustomJoints
    tinyxml
    glfw
    imgui
    dgNewtonAvx
    demosSandbox
    DebugRelease

they are all there.
Julio Jerez
Moderator
Moderator
 
Posts: 12249
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: CMake

Postby Slick » Thu Oct 25, 2018 4:13 pm

On a fresh run of CMake do you get all the libraries and .pdb's in the correct places in the directory structures?
Slick
 
Posts: 330
Joined: Sat Feb 07, 2004 7:24 pm
Location: LA last and France now

Re: CMake

Postby Slick » Thu Oct 25, 2018 4:19 pm

It seems to be the install project that copies the libraries to:
S:\Newton\Build\build\lib
If I delete all those files and just build the install project I get the files back but missing some.
Slick
 
Posts: 330
Joined: Sat Feb 07, 2004 7:24 pm
Location: LA last and France now

Re: CMake

Postby Julio Jerez » Thu Oct 25, 2018 4:35 pm

you are right they aren't in the build folder I will check that tonight.
Julio Jerez
Moderator
Moderator
 
Posts: 12249
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: CMake

Postby arpio » Thu Oct 25, 2018 4:48 pm

I think the affected libs are missing this part in the cmake files:

if (MSVC)
install(TARGETS ${projectName} ARCHIVE DESTINATION ${libraryPath})
endif(MSVC)
arpio
 
Posts: 23
Joined: Wed Oct 24, 2018 4:33 pm

Re: CMake

Postby Julio Jerez » Thu Oct 25, 2018 5:00 pm

ok is fixed now.
please check again
Julio Jerez
Moderator
Moderator
 
Posts: 12249
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: CMake

Postby Slick » Fri Oct 26, 2018 4:29 am

Ok just checked. It is a bit better. I deleted my entire directory and started over to be sure it is all fresh.

After running CMake with default settings building static runtime libraries I still feel there are some problems. I prefer to use static but just left it on default and ended up with some static and some dll projects. So some of the scripts don't properly define the build type based upon chosen settings.

Also, dgCore_d.lib and dgPhysics_d.lib don't end up in the final library path.

Shouldn't all except the .exe projects show in Visual Studio as dll instead of static? Mine shows:
dAnimation-static
dContainers-dll
dCustomJoints-dll
dgCore-static
dgPhysics-static
dMath-static
dNewton-dll
dScene-dll
dVehicle-dll
newton-dll

I'm happy to try and do a pull request if I just knew what the correct thing was. I would imagine these should all be lib if you are doing static builds.
Last edited by Slick on Fri Oct 26, 2018 5:57 am, edited 1 time in total.
Slick
 
Posts: 330
Joined: Sat Feb 07, 2004 7:24 pm
Location: LA last and France now

Re: CMake

Postby Slick » Fri Oct 26, 2018 5:33 am

I created a pull request for a few fixes. Please review. I don't think everything is fixed yet. The project types based upon options chosen probably needs some more work.
Slick
 
Posts: 330
Joined: Sat Feb 07, 2004 7:24 pm
Location: LA last and France now

Re: CMake

Postby arpio » Fri Oct 26, 2018 8:05 am

Ok. I would try to clean that Cmake stuff up. I'm just checking the Cmake docs. Will try to make it work on all platforms.

LIBRARY DESTINATION ${path}
#Module libraries are always treated as library targets. For non-DLL platforms shared libraries are treated as library targets

ARCHIVE DESTINATION ${path}
#Static libraries are always treated as archive targets

RUNTIME DESTINATION ${path})
Executables are always treated as runtime targets.
For DLL platforms the DLL part of a shared library is treated as a runtime target and the corresponding import library is treated as an archive target

Please let me know which paths for which destination.
arpio
 
Posts: 23
Joined: Wed Oct 24, 2018 4:33 pm

Re: CMake

Postby Julio Jerez » Fri Oct 26, 2018 9:14 am

before I try that pull request please sync and see If is ok now.
I made the profiler optional, and off by default.
when build static libraries only teh plugin are still generated ass dll, because that's what plugin are.

I tested and it seems to work, I still need to fix the install so the it copies the plugin dll to the bin,
now it only does it when building dlls but other than that, it should work for all configurations.

Please synce and try again,
make sure you clean the forder before so that ther are not legacy builds.
Julio Jerez
Moderator
Moderator
 
Posts: 12249
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: CMake

Postby Slick » Fri Oct 26, 2018 9:23 am

OK doing it now. Because I committed my request I don't know how to pull a clean copy so just downloading all again and will try.
Slick
 
Posts: 330
Joined: Sat Feb 07, 2004 7:24 pm
Location: LA last and France now

Re: CMake

Postby Slick » Fri Oct 26, 2018 9:36 am

dg_Core_d.lib wasn't copied. Also the headers weren't copied.
dg_Physics_d.lib wasn't copied. Also the headers weren't copied.
I think but they should still be done the same way.

d_Animation looks ok for both headers and lib in your update.
d_Newton looks ok for both headers and lib in your update.

I think my pull request might still be valid (at least part).
Last edited by Slick on Fri Oct 26, 2018 10:08 am, edited 1 time in total.
Slick
 
Posts: 330
Joined: Sat Feb 07, 2004 7:24 pm
Location: LA last and France now

Re: CMake

Postby Julio Jerez » Fri Oct 26, 2018 9:59 am

what options are you choosing? when I buidl I see all the libraries.

I rather link a new pull request, GitHub become a banana when merge change on the same files.
I want you to do it using the command line tool whi I do not like.
I was already change all the cmakelist.txt when you made that pull request.
Julio Jerez
Moderator
Moderator
 
Posts: 12249
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: CMake

Postby Slick » Fri Oct 26, 2018 10:07 am

The only option I change in CMake is to not build with windows static libraries. I add /MP to cmake flags.

For instance in S:\Newton\Build\build\lib there is no dgCore_d.lib or dg_Physics_d.lib but there is when I changed the script.
Slick
 
Posts: 330
Joined: Sat Feb 07, 2004 7:24 pm
Location: LA last and France now

Next

Return to General Discussion

Who is online

Users browsing this forum: No registered users and 17 guests

cron