Install without building unittests

classic Classic list List threaded Threaded
11 messages Options
Reply | Threaded
Open this post in threaded view
|

Install without building unittests

Scott Bloom

I asked this a couple of years ago, and the answer was “no”…

If you run tests, it doesn’t automatically build tests…  So why does an install?

 

I would never release something into the wild with out running the tests…

 

But, for developer builds, were we need to install all the packages in order to run the applications, sometimes I just want to test the GUI which requires an install of the core application into the correct location, without building the 1500+ (yes 1500) unittests, which can take 15-20 minutes to build on their own…

 

Is there anyway to break the dependency??

Scott


--

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
https://cmake.org/mailman/listinfo/cmake
Reply | Threaded
Open this post in threaded view
|

Re: Install without building unittests

Scott Bloom

Note, Im running from inside visual studio…  I do realize for a makefile based system, I can run make install from inside the executable’s build directory

 

From: CMake <[hidden email]> On Behalf Of Scott Bloom
Sent: Wednesday, March 27, 2019 7:23 PM
To: [hidden email]
Subject: [CMake] Install without building unittests

 

I asked this a couple of years ago, and the answer was “no”…

If you run tests, it doesn’t automatically build tests…  So why does an install?

 

I would never release something into the wild with out running the tests…

 

But, for developer builds, were we need to install all the packages in order to run the applications, sometimes I just want to test the GUI which requires an install of the core application into the correct location, without building the 1500+ (yes 1500) unittests, which can take 15-20 minutes to build on their own…

 

Is there anyway to break the dependency??

Scott


--

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
https://cmake.org/mailman/listinfo/cmake
Reply | Threaded
Open this post in threaded view
|

Re: Install without building unittests

CMake mailing list
You could build CMake with -DBUILD_TESTING=OFF. This will skip the unit tests altogether.

Kyle

On Thu, 2019-03-28 at 02:24 +0000, Scott Bloom wrote:

Note, Im running from inside visual studio…  I do realize for a makefile based system, I can run make install from inside the executable’s build directory

 

From: CMake <[hidden email]> On Behalf Of Scott Bloom
Sent: Wednesday, March 27, 2019 7:23 PM
To: [hidden email]
Subject: [CMake] Install without building unittests

 

I asked this a couple of years ago, and the answer was “no”…

If you run tests, it doesn’t automatically build tests…  So why does an install?

 

I would never release something into the wild with out running the tests…

 

But, for developer builds, were we need to install all the packages in order to run the applications, sometimes I just want to test the GUI which requires an install of the core application into the correct location, without building the 1500+ (yes 1500) unittests, which can take 15-20 minutes to build on their own…

 

Is there anyway to break the dependency??

Scott

-- 

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
https://cmake.org/mailman/listinfo/cmake

--

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
https://cmake.org/mailman/listinfo/cmake
Reply | Threaded
Open this post in threaded view
|

Re: Install without building unittests

Scott Bloom

That is really not what we want..  We simply don’t want the Install target to have a dependency on the unittests.  Essentially, the Install target should be have the same as the test target.

 

If you to a make test, or from VS, on RUN_TESTS, RMB->Build, it doesn’t build the tests if they are out of date (or non-existant)


Scott

 

From: Kyle Edwards <[hidden email]>
Sent: Thursday, March 28, 2019 7:48 AM
To: Scott Bloom <[hidden email]>; [hidden email]
Subject: Re: [CMake] Install without building unittests

 

You could build CMake with -DBUILD_TESTING=OFF. This will skip the unit tests altogether.

 

Kyle

 

On Thu, 2019-03-28 at 02:24 +0000, Scott Bloom wrote:

Note, Im running from inside visual studio…  I do realize for a makefile based system, I can run make install from inside the executable’s build directory

 

From: CMake <[hidden email]> On Behalf Of Scott Bloom
Sent: Wednesday, March 27, 2019 7:23 PM
To: [hidden email]
Subject: [CMake] Install without building unittests

 

I asked this a couple of years ago, and the answer was “no”…

If you run tests, it doesn’t automatically build tests…  So why does an install?

 

I would never release something into the wild with out running the tests…

 

But, for developer builds, were we need to install all the packages in order to run the applications, sometimes I just want to test the GUI which requires an install of the core application into the correct location, without building the 1500+ (yes 1500) unittests, which can take 15-20 minutes to build on their own…

 

Is there anyway to break the dependency??

Scott

-- 
 
Powered by www.kitware.com
 
Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ
 
Kitware offers various services to support the CMake community. For more information on each offering, please visit:
 
CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html
 
Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html
 
Follow this link to subscribe/unsubscribe:
https://cmake.org/mailman/listinfo/cmake

--

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
https://cmake.org/mailman/listinfo/cmake
Reply | Threaded
Open this post in threaded view
|

Re: Install without building unittests

frodak17


On Thu, Mar 28, 2019 at 11:07 AM Scott Bloom <[hidden email]> wrote:

That is really not what we want..  We simply don’t want the Install target to have a dependency on the unittests.  Essentially, the Install target should be have the same as the test target.

 

If you to a make test, or from VS, on RUN_TESTS, RMB->Build, it doesn’t build the tests if they are out of date (or non-existant)


Scott

 



I was under the impression that the global INSTALL target is only dependent on the ALL target unless you turn off the dependency.

--

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
https://cmake.org/mailman/listinfo/cmake
Reply | Threaded
Open this post in threaded view
|

Re: Install without building unittests

Scott Bloom

This variable looks very interesting.. Ill play with it and see if it solves my problems 😉

THANKS!! 


Scott

 

From: frodak17 <[hidden email]>
Sent: Thursday, March 28, 2019 10:03 AM
To: Scott Bloom <[hidden email]>
Cc: Kyle Edwards <[hidden email]>; [hidden email]
Subject: Re: [CMake] Install without building unittests

 

 

 

On Thu, Mar 28, 2019 at 11:07 AM Scott Bloom <[hidden email]> wrote:

That is really not what we want..  We simply don’t want the Install target to have a dependency on the unittests.  Essentially, the Install target should be have the same as the test target.

 

If you to a make test, or from VS, on RUN_TESTS, RMB->Build, it doesn’t build the tests if they are out of date (or non-existant)


Scott

 

 

 

I was under the impression that the global INSTALL target is only dependent on the ALL target unless you turn off the dependency.


--

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
https://cmake.org/mailman/listinfo/cmake
Reply | Threaded
Open this post in threaded view
|

Re: Install without building unittests

Scott Bloom

THANKS!!!! That was the exact variable I was looking for.

 

Scott

 

From: CMake <[hidden email]> On Behalf Of Scott Bloom
Sent: Thursday, March 28, 2019 10:05 AM
To: frodak17 <[hidden email]>
Cc: [hidden email]
Subject: Re: [CMake] Install without building unittests

 

This variable looks very interesting.. Ill play with it and see if it solves my problems 😉

THANKS!! 


Scott

 

From: frodak17 <[hidden email]>
Sent: Thursday, March 28, 2019 10:03 AM
To: Scott Bloom <[hidden email]>
Cc: Kyle Edwards <[hidden email]>; [hidden email]
Subject: Re: [CMake] Install without building unittests

 

 

 

On Thu, Mar 28, 2019 at 11:07 AM Scott Bloom <[hidden email]> wrote:

That is really not what we want..  We simply don’t want the Install target to have a dependency on the unittests.  Essentially, the Install target should be have the same as the test target.

 

If you to a make test, or from VS, on RUN_TESTS, RMB->Build, it doesn’t build the tests if they are out of date (or non-existant)


Scott

 

 

 

I was under the impression that the global INSTALL target is only dependent on the ALL target unless you turn off the dependency.


--

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
https://cmake.org/mailman/listinfo/cmake
Reply | Threaded
Open this post in threaded view
|

Re: Install without building unittests

Scott Bloom

Just a note, for google later on… 😊

The default appears to have the variable unset, so it doesn’t show up in the list of variables in ccmake or the cmake-gui.

 

I also added it to my system before any INSTALL command was called.  I don’t know if that is necessary, but it does work

 

SET( CMAKE_SKIP_INSTALL_ALL_DEPENDENCY TRUE )

 

Thanks again!

Scott

 

From: Scott Bloom <[hidden email]>
Sent: Thursday, March 28, 2019 10:20 AM
To: Scott Bloom <[hidden email]>; frodak17 <[hidden email]>
Cc: [hidden email]
Subject: RE: [CMake] Install without building unittests

 

THANKS!!!! That was the exact variable I was looking for.

 

Scott

 

From: CMake <[hidden email]> On Behalf Of Scott Bloom
Sent: Thursday, March 28, 2019 10:05 AM
To: frodak17 <[hidden email]>
Cc: [hidden email]
Subject: Re: [CMake] Install without building unittests

 

This variable looks very interesting.. Ill play with it and see if it solves my problems 😉

THANKS!! 


Scott

 

From: frodak17 <[hidden email]>
Sent: Thursday, March 28, 2019 10:03 AM
To: Scott Bloom <[hidden email]>
Cc: Kyle Edwards <[hidden email]>; [hidden email]
Subject: Re: [CMake] Install without building unittests

 

 

 

On Thu, Mar 28, 2019 at 11:07 AM Scott Bloom <[hidden email]> wrote:

That is really not what we want..  We simply don’t want the Install target to have a dependency on the unittests.  Essentially, the Install target should be have the same as the test target.

 

If you to a make test, or from VS, on RUN_TESTS, RMB->Build, it doesn’t build the tests if they are out of date (or non-existant)


Scott

 

 

 

I was under the impression that the global INSTALL target is only dependent on the ALL target unless you turn off the dependency.


--

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
https://cmake.org/mailman/listinfo/cmake
Reply | Threaded
Open this post in threaded view
|

Re: Install without building unittests

Alan W. Irwin-2
In reply to this post by Scott Bloom
On 2019-03-28 02:24-0000 Scott Bloom wrote:

> Note, Im running from inside visual studio...  I do realize for a makefile based system, I can run make install from inside the executable's build directory
>
> From: CMake <[hidden email]> On Behalf Of Scott Bloom
> Sent: Wednesday, March 27, 2019 7:23 PM
> To: [hidden email]
> Subject: [CMake] Install without building unittests
>
> I asked this a couple of years ago, and the answer was "no"...
>
> If you run tests, it doesn't automatically build tests...  So why does an install?
>
> I would never release something into the wild with out running the tests...
>
> But, for developer builds, were we need to install all the packages in order to run the applications, sometimes I just want to test the GUI which requires an install of the core application into the correct location, without building the 1500+ (yes 1500) unittests, which can take 15-20 minutes to build on their own...
>
> Is there anyway to break the dependency??

The "install" target depends on the "all" target, and the "all" target
depends on everything built with "add_executable".  And I and
presumably many other users of CMake would not be happy if the CMake
developers decided to change these fundamental characteristics of
CMake.  However, I think you can straightforwardly achieve exactly
what you want to do as follows:

option(BUILD_UNIT_TESTS "Build unit tests?" OFF)
if(BUILD_UNIT_TESTS)
.... loop over add_executable for your various unit tests
endif(BUILD_UNIT_TESTS)

Of course, it is not as simple as that, and likely your builds of unit tests are scattered
all over your build system, but the point is to protect all use of "add_executable" for
those tests with an if block as above.  Then you specify -DBUILD_UNIT_TESTS=ON cmake option
if you actually do want to build your unit tests, but otherwise the default is not to build them
(just like you apparently want).

We have used a similar option over the years with the CMake-based build system for PLplot
(in our case whether to build our standard examples in the build tree so we can test there in
addition to our normal build and test of those examples in the installed examples tree).
That method has worked well for us, and I think it would work well for your needs also.

Alan
__________________________
Alan W. Irwin

Programming affiliations with the FreeEOS equation-of-state
implementation for stellar interiors (freeeos.sf.net); the Time
Ephemerides project (timeephem.sf.net); PLplot scientific plotting
software package (plplot.sf.net); the libLASi project
(unifont.org/lasi); the Loads of Linux Links project (loll.sf.net);
and the Linux Brochure Project (lbproject.sf.net).
__________________________

Linux-powered Science
__________________________
--

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
https://cmake.org/mailman/listinfo/cmake
Reply | Threaded
Open this post in threaded view
|

Re: Install without building unittests

Scott Bloom

> Note, Im running from inside visual studio...  I do realize for a
> makefile based system, I can run make install from inside the
> executable's build directory
>
> From: CMake <[hidden email]> On Behalf Of Scott Bloom
> Sent: Wednesday, March 27, 2019 7:23 PM
> To: [hidden email]
> Subject: [CMake] Install without building unittests
>
> I asked this a couple of years ago, and the answer was "no"...
>
> If you run tests, it doesn't automatically build tests...  So why does an install?
>
> I would never release something into the wild with out running the tests...
>
> But, for developer builds, were we need to install all the packages in order to run the applications, sometimes I just want to test the GUI which requires an install of the core application into the correct location, without building the 1500+ (yes 1500) unittests, which can take 15-20 minutes to build on their own...
>
> Is there anyway to break the dependency??

The "install" target depends on the "all" target, and the "all" target depends on everything built with "add_executable".  And I and presumably many other users of CMake would not be happy if the CMake developers decided to change these fundamental characteristics of CMake.  However, I think you can straightforwardly achieve exactly what you want to do as follows:

option(BUILD_UNIT_TESTS "Build unit tests?" OFF)
if(BUILD_UNIT_TESTS)
.... loop over add_executable for your various unit tests
endif(BUILD_UNIT_TESTS)

Of course, it is not as simple as that, and likely your builds of unit tests are scattered all over your build system, but the point is to protect all use of "add_executable" for those tests with an if block as above.  Then you specify -DBUILD_UNIT_TESTS=ON cmake option if you actually do want to build your unit tests, but otherwise the default is not to build them (just like you apparently want).

We have used a similar option over the years with the CMake-based build system for PLplot (in our case whether to build our standard examples in the build tree so we can test there in addition to our normal build and test of those examples in the installed examples tree).
That method has worked well for us, and I think it would work well for your needs also.

Alan
__________________________

We have this exact style of setup... However, I want the Unit Tests as part of the project, I just don't want them built when running install.. I have no problem with them being built for " all" target...

The variable CMAKE_SKIP_INSTALL_ALL_DEPENDENCY is what I was looking for....

Thanks
Scott






--

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
https://cmake.org/mailman/listinfo/cmake
Reply | Threaded
Open this post in threaded view
|

Re: Install without building unittests

Alexander Neundorf
In reply to this post by Scott Bloom
On 2019 M03 28, Thu 18:22:03 CET Scott Bloom wrote:
> Just a note, for google later on… 😊
>
> The default appears to have the variable unset, so it doesn’t show up in the
> list of variables in ccmake or the cmake-gui.
 
> I also added it to my system before any INSTALL command was called.  I don’t
> know if that is necessary, but it does work
 
> SET( CMAKE_SKIP_INSTALL_ALL_DEPENDENCY TRUE )

I'm not sure how that applies to the MSVC generators, but when using
Makefiles, you can do
make install/fast
which just installs without building.

Alex



--

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
https://cmake.org/mailman/listinfo/cmake