cmake install

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

cmake install

Adam Getchell-2
Hello all,

If I want to use CMake to invoke my build system, I can use:

# cmake -- build .

What’s the syntax for invoking the build system installer from cmake, i.e. the equivalent of:

# cmake -G Ninja .
# ninja
# ninja install

I tried:

# cmake -G Ninja .
# cmake --build .
# cmake --build . --target install

If its somewhere in the manual, I’d appreciate pointers.

Thanks,
Adam


--

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:
http://public.kitware.com/mailman/listinfo/cmake
Reply | Threaded
Open this post in threaded view
|

Re: cmake install

Craig Scott-3


On Sat, Sep 9, 2017 at 9:56 AM, Adam Getchell <[hidden email]> wrote:
Hello all,

If I want to use CMake to invoke my build system, I can use:

# cmake -- build .

What’s the syntax for invoking the build system installer from cmake, i.e. the equivalent of:

# cmake -G Ninja .
# ninja
# ninja install

I tried:

# cmake -G Ninja .
# cmake --build .
# cmake --build . --target install

This should be correct. Did this not work for you?
 

If its somewhere in the manual, I’d appreciate pointers.

Which part were you looking for? The use of --target is documented as part of the Build Tool Mode section, but it seems you've already figured out that part. There's nothing technically special about the install target as far as I'm aware, you should be able to refer to it as a build target like you've done above.
 

Craig Scott
Melbourne, Australia

--

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:
http://public.kitware.com/mailman/listinfo/cmake
Reply | Threaded
Open this post in threaded view
|

Re: cmake install

Adam Getchell-2

On Sep 8, 2017, at 6:11 PM, Craig Scott <[hidden email]> wrote:

I tried:

# cmake -G Ninja .
# cmake --build .
# cmake --build . --target install

This should be correct. Did this not work for you?

No.


Thanks for your help.

 

If its somewhere in the manual, I’d appreciate pointers.

Which part were you looking for? The use of --target is documented as part of the Build Tool Mode section, but it seems you've already figured out that part. There's nothing technically special about the install target as far as I'm aware, you should be able to refer to it as a build target like you've done above.
 

Craig Scott
Melbourne, Australia



--

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:
http://public.kitware.com/mailman/listinfo/cmake
Reply | Threaded
Open this post in threaded view
|

Re: cmake install

Craig Scott-3


On Sat, Sep 9, 2017 at 11:19 AM, Adam Getchell <[hidden email]> wrote:

On Sep 8, 2017, at 6:11 PM, Craig Scott <[hidden email]> wrote:

I tried:

# cmake -G Ninja .
# cmake --build .
# cmake --build . --target install

This should be correct. Did this not work for you?

No.


Thanks for your help.

That job uses sudo to do the install step and pipes the output to a file install.log. You will probably find the reason for the failure in that install.log file. It would also be unusual to do such an install step to a system-wide location as part of a CI job. Perhaps you might want to consider creating a package using CPack instead of doing a system-wide install.

--
Craig Scott
Melbourne, Australia

--

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:
http://public.kitware.com/mailman/listinfo/cmake
Reply | Threaded
Open this post in threaded view
|

Re: cmake install

Craig Scott-3


On Sat, Sep 9, 2017 at 11:25 AM, Craig Scott <[hidden email]> wrote:


On Sat, Sep 9, 2017 at 11:19 AM, Adam Getchell <[hidden email]> wrote:

On Sep 8, 2017, at 6:11 PM, Craig Scott <[hidden email]> wrote:

I tried:

# cmake -G Ninja .
# cmake --build .
# cmake --build . --target install

This should be correct. Did this not work for you?

No.


Thanks for your help.

That job uses sudo to do the install step and pipes the output to a file install.log. You will probably find the reason for the failure in that install.log file. It would also be unusual to do such an install step to a system-wide location as part of a CI job. Perhaps you might want to consider creating a package using CPack instead of doing a system-wide install.

And I just noticed that you did "target" rather than "--target" 


--
Craig Scott
Melbourne, Australia

--

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:
http://public.kitware.com/mailman/listinfo/cmake
Reply | Threaded
Open this post in threaded view
|

Re: cmake install

Michael Jackson
In reply to this post by Adam Getchell-2

You should explicitly set the installation location of your package using –DCMAKE_INSTALL_PREFIX=/xxx/xxxx/xxxx/xxx during the initial invocation of cmake.

 

This should be set to a location you KNOW you have normal write access to. Once this is set then you will no longer need to use “sudo” to run the commands and all _should_ work correctly. This is what we do on our dashboard builds.

 

-- 

Mike Jackson 

 

 

From: CMake <[hidden email]> on behalf of Adam Getchell <[hidden email]>
Date: Friday, September 8, 2017 at 9:20 PM
To: Craig Scott <[hidden email]>
Cc: CMake <[hidden email]>
Subject: Re: [CMake] cmake install

 

 

On Sep 8, 2017, at 6:11 PM, Craig Scott <[hidden email]> wrote:

 

I tried:

 

# cmake -G Ninja .

# cmake --build .

# cmake --build . --target install

 

This should be correct. Did this not work for you?

 

No.

 

 

Thanks for your help.

 

 

 

If its somewhere in the manual, I’d appreciate pointers.

 

Which part were you looking for? The use of --target is documented as part of the Build Tool Mode section, but it seems you've already figured out that part. There's nothing technically special about the install target as far as I'm aware, you should be able to refer to it as a build target like you've done above.

 

 

Craig Scott

Melbourne, Australia

 


-- 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: http://public.kitware.com/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:
http://public.kitware.com/mailman/listinfo/cmake
Reply | Threaded
Open this post in threaded view
|

Re: cmake install

Adam Getchell-2
Thanks for the catch, sudo cmake --build . --target install &> install.log worked.

Yes, I plan to use a package manager like Conan or conda rather than the horrible tangle of scripts I have now for Travis and Appveyor, just have a few other things to do first. ;-)


On Sep 10, 2017, at 5:42 AM, Michael Jackson <[hidden email]> wrote:

You should explicitly set the installation location of your package using –DCMAKE_INSTALL_PREFIX=/xxx/xxxx/xxxx/xxx during the initial invocation of cmake.
 
This should be set to a location you KNOW you have normal write access to. Once this is set then you will no longer need to use “sudo” to run the commands and all _should_ work correctly. This is what we do on our dashboard builds.
 
-- 
Mike Jackson  
 
 
From: CMake <[hidden email]> on behalf of Adam Getchell <[hidden email]>
Date: Friday, September 8, 2017 at 9:20 PM
To: Craig Scott <[hidden email]>
Cc: CMake <[hidden email]>
Subject: Re: [CMake] cmake install
 
 
On Sep 8, 2017, at 6:11 PM, Craig Scott <[hidden email]> wrote:
 
I tried:
 
# cmake -G Ninja .
# cmake --build .
# cmake --build . --target install
 
This should be correct. Did this not work for you?
 
No.
 
 
Thanks for your help.
 
 
 
If its somewhere in the manual, I’d appreciate pointers.
 
Which part were you looking for? The use of --target is documented as part of the Build Tool Mode section, but it seems you've already figured out that part. There's nothing technically special about the install target as far as I'm aware, you should be able to refer to it as a build target like you've done above.
 
 
Craig Scott
Melbourne, Australia
 

-- 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: http://public.kitware.com/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:
http://public.kitware.com/mailman/listinfo/cmake