[CMake] CMake install doesn't find binary that CMake built?

2019-05-30 Thread Benjamin Shadwick
Using CMake 3.12.2.

Consider the following project:

project(myproject)
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
set(CMAKE_INSTALL_PREFIX "${CMAKE_BINARY_DIR}" CACHE PATH "" FORCE)
add_executable(myprog hello.cpp)
install(TARGETS myprog
   ARCHIVE DESTINATION lib
   LIBRARY DESTINATION lib
   RUNTIME DESTINATION bin)

'make install' builds 'myprog', then it disappears, then CMake reports an
error that it cannot find it ("file INSTALL cannot find
"path_to_build_directory/bin/myprog"").

Seems like a bug/oversight. Possibly CMake is trying to move the file to
where it already exists, destroying it in the process.

And since someone will be horrified at what I'm doing with paths, the
reason is that I've got subprojects that generate hundreds of libraries and
multiple executables, and I'd like to avoid both of the following:
- Forcing developers to run 'make install' instead of 'make' before they
can run
- Setting up massive PATH and LD_LIBRARY_PATH variables so that everything
can be found when it's scattered all over the build tree

I suppose my current setup will work fine as long as nobody uses 'make
install', but I was hoping to leverage that to help with release packaging.
-- 

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


[CMake] CMAke install files using cmake-generator-expression

2018-01-15 Thread Lars
Hello,


Using CMake 3.8.1 on Windows 7 SP1.


The following cmake expression will produce an error.

INSTALL(

  FILES

$<$${COMP_PATH}/win32/bin/comp.dll>

  DESTINATION "${install_dir}")


"CMake error: Error evaluating generator expression: $.

$ may only be used with binary targets. It may not be used 
with add_custom_command

or add_custom_target."


Tried using "GNU" instead of "MSVC" but did not help.

Tried using "PROGRAMS" instead of "FILES" but did not help.

Replacing $ with $ works, so it appears 
cmake-generator-expression work just not using compiler as key.


What does binary target mean in this context?


Why does this fail?


Kind regards,

Lars
-- 

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


Re: [CMake] cmake install

2017-09-12 Thread Adam Getchell
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. ;-)

-- 
Adam Getchell
https://keybase.io/adamgetchell

> On Sep 10, 2017, at 5:42 AM, Michael Jackson <mike.jack...@bluequartz.net> 
> wrote:
> 
> You should explicitly set the installation location of your package using 
> –DCMAKE_INSTALL_PREFIX=/xxx///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 <cmake-boun...@cmake.org> on behalf of Adam Getchell 
> <adam.getch...@gmail.com>
> Date: Friday, September 8, 2017 at 9:20 PM
> To: Craig Scott <craig.sc...@crascit.com>
> Cc: CMake <cmake@cmake.org>
> Subject: Re: [CMake] cmake install
>  
>  
>> On Sep 8, 2017, at 6:11 PM, Craig Scott <craig.sc...@crascit.com 
>> <mailto:craig.sc...@crascit.com>> wrote:
>>>  
>>> I tried:
>>>  
>>> # cmake -G Ninja .
>>> # cmake --build .
>>> # cmake --build . --target install
>>  
>> This should be correct. Did this not work for you?
>  
> No.
>  
> https://travis-ci.org/acgetchell/CDT-plusplus/jobs/273498700 
> <https://travis-ci.org/acgetchell/CDT-plusplus/jobs/273498700>
>  
> 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 
>> <https://cmake.org/cmake/help/git-master/manual/cmake.1.html#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
>> https://crascit.com <https://crascit.com/> 
> -- 
> Adam Getchell
> https://keybase.io/adamgetchell <https://keybase.io/adamgetchell>
> 
> -- Powered by www.kitware.com <http://www.kitware.com/> Please keep messages 
> on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ 
> <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 
> <http://cmake.org/cmake/help/support.html> CMake Consulting: 
> http://cmake.org/cmake/help/consulting.html 
> <http://cmake.org/cmake/help/consulting.html> CMake Training Courses: 
> http://cmake.org/cmake/help/training.html 
> <http://cmake.org/cmake/help/training.html> Visit other Kitware open-source 
> projects at http://www.kitware.com/opensource/opensource.html 
> <http://www.kitware.com/opensource/opensource.html> Follow this link to 
> subscribe/unsubscribe: http://public.kitware.com/mailman/listinfo/cmake 
> <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

Re: [CMake] cmake install

2017-09-10 Thread Michael Jackson
You should explicitly set the installation location of your package using 
–DCMAKE_INSTALL_PREFIX=/xxx///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 <cmake-boun...@cmake.org> on behalf of Adam Getchell 
<adam.getch...@gmail.com>
Date: Friday, September 8, 2017 at 9:20 PM
To: Craig Scott <craig.sc...@crascit.com>
Cc: CMake <cmake@cmake.org>
Subject: Re: [CMake] cmake install

 

 

On Sep 8, 2017, at 6:11 PM, Craig Scott <craig.sc...@crascit.com> wrote:

 

I tried:

 

# cmake -G Ninja .

# cmake --build .

# cmake --build . --target install

 

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

 

No.

 

https://travis-ci.org/acgetchell/CDT-plusplus/jobs/273498700

 

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

https://crascit.com

 

-- 

Adam Getchell
https://keybase.io/adamgetchell


-- 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

Re: [CMake] cmake install

2017-09-08 Thread Craig Scott
On Sat, Sep 9, 2017 at 11:25 AM, Craig Scott 
wrote:

>
>
> On Sat, Sep 9, 2017 at 11:19 AM, Adam Getchell 
> wrote:
>
>>
>> On Sep 8, 2017, at 6:11 PM, Craig Scott  wrote:
>>
>>>
>>> I tried:
>>>
>>> # cmake -G Ninja .
>>> # cmake --build .
>>> # cmake --build . --target install
>>>
>>
>> This should be correct. Did this not work for you?
>>
>>
>> No.
>>
>> https://travis-ci.org/acgetchell/CDT-plusplus/jobs/273498700
>>
>> 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
https://crascit.com
-- 

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

Re: [CMake] cmake install

2017-09-08 Thread Craig Scott
On Sat, Sep 9, 2017 at 11:19 AM, Adam Getchell 
wrote:

>
> On Sep 8, 2017, at 6:11 PM, Craig Scott  wrote:
>
>>
>> I tried:
>>
>> # cmake -G Ninja .
>> # cmake --build .
>> # cmake --build . --target install
>>
>
> This should be correct. Did this not work for you?
>
>
> No.
>
> https://travis-ci.org/acgetchell/CDT-plusplus/jobs/273498700
>
> 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
https://crascit.com
-- 

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

Re: [CMake] cmake install

2017-09-08 Thread Adam Getchell

> On Sep 8, 2017, at 6:11 PM, Craig Scott  wrote:
> 
> I tried:
> 
> # cmake -G Ninja .
> # cmake --build .
> # cmake --build . --target install
> 
> This should be correct. Did this not work for you?

No.

https://travis-ci.org/acgetchell/CDT-plusplus/jobs/273498700

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
> https://crascit.com 
-- 
Adam Getchell
https://keybase.io/adamgetchell

-- 

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

Re: [CMake] cmake install

2017-09-08 Thread Craig Scott
On Sat, Sep 9, 2017 at 9:56 AM, Adam Getchell 
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
https://crascit.com
-- 

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

[CMake] cmake install

2017-09-08 Thread Adam Getchell
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
-- 
Adam Getchell
https://keybase.io/adamgetchell

-- 

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

Re: [CMake] cmake install script

2017-05-29 Thread Craig Scott
Try the tarball rather than the self-extracting script. The contents are
the same, but the tarball won't require a license acceptance.


On Tue, May 30, 2017 at 5:26 AM, tonka tonka  wrote:

> Hey@everybody,
>
> I have a little problem with the cmake installer script on Ubuntu. I need
> the latest cmake,so that's the only way. The script works fine but now I
> want to automate the cmake install on my ci server, but the license accept
> prompt block me. The default answer is no, so the script abort.
> Does anybody know how I can automatically accept the license?
>
> Greetings
> Tonka
>
> --
>
> 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
>



-- 
Craig Scott
Melbourne, Australia
https://crascit.com
-- 

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

[CMake] cmake install script

2017-05-29 Thread tonka tonka
Hey@everybody,

I have a little problem with the cmake installer script on Ubuntu. I need
the latest cmake,so that's the only way. The script works fine but now I
want to automate the cmake install on my ci server, but the license accept
prompt block me. The default answer is no, so the script abort.
Does anybody know how I can automatically accept the license?

Greetings
Tonka
-- 

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

Re: [CMake] CMake install imported target using WIX

2017-02-21 Thread Nils Gladitz

On 02/21/2017 02:48 PM, Lars wrote:


Hello,


We are using the "config" mode of Find_Package that locates 
CompConfig.cmake which create IMPORTED targets.



CMakeLists.txt

Find_Package(some_comp ${some_comp_path})


CompConfig.cmake;

add_executable(app IMPORTED)

add_library(lib SHARED IMPORTED)


This works fine and once I read 
https://public.kitware.com/Bug/view.php?id=14311 
 I managed to get 
'make install' to include the IMPORTED targets.




What exactly did you take from the issue report?
What are your install() commands?

Everything installed by "make install" should also land in the package 
assuming what ever install logic you used honors the install time 
CMAKE_INSTALL_PREFIX as set up by CPack.


Nils
-- 

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

[CMake] CMake install imported target using WIX

2017-02-21 Thread Lars
Hello,


We are using the "config" mode of Find_Package that locates CompConfig.cmake 
which create IMPORTED targets.


CMakeLists.txt

Find_Package(some_comp ${some_comp_path})


CompConfig.cmake;

add_executable(app IMPORTED)

add_library(lib SHARED IMPORTED)


This works fine and once I read 
https://public.kitware.com/Bug/view.php?id=14311 I managed to get 'make 
install' to include the IMPORTED targets.


However, it seems CPack -G WIX does not include the imported executables and 
libraries in its msi.


There is no trace of 'app' or 'lib' in the files.wxs file produced by CPack.


I wanted to check whether this is the expected behaviour or a known issue? If 
this is a bug, appreciate any input on how to proceed to debug this issue.


Using CMake 3.5.2 and Windows 7
-- 

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

[CMake] cmake install ends with error code 0xC0000022

2017-02-01 Thread Benjamin Ballet via CMake
Hi,

I'm using install(CODE"... to run windeployqt.exe during installation

It works fine for a few exe or dll then it fails the installation with
error code 0xC022 because of the last execute_process(...
If I remove the incriminating dll, it fails with the next one.

Any hints ?


-- 
*Benjamin BALLET*
Ingénieur R

*ACTIVISU*
19, rue Klock - 92110 Clichy
*> Standard Tél* :  01 44 69 37 37
*>* www.activisu.com
-- 

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

[CMake] cmake install multiple artifacts

2016-10-05 Thread Tom Gwozdz
Hello,

I'm using CMake to cross compile some code using Emscripten.  Emscripten
generates html/javascript files from c++ input files.  In my case, my
generated binary output is an html file that loads in a javascript file.
Both files are generated from the final link step.

When I do the following:

install(TARGETS target
EXPORT export
ARCHIVE DESTINATION lib
LIBRARY DESTINATION lib
RUNTIME DESTINATION bin
)

The bin directory contains the html file, but not the js file.  Is there
some way of telling CMake that the final link step actually generated
multiple files, and that all of them should be installed to the final bin
directory?

Thanks!
Tom
-- 

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

Re: [CMake] cmake install target doesn't run ldconfig after installing library

2016-06-19 Thread Young Yang
Thanks :)

I think there should be better solutions. But It's the best solution I know
so far.

On Fri, Jun 17, 2016 at 9:07 PM, Matthew Keeler  wrote:

> So I did some experimenting. It would seem there are a few rules to the
> order installs are executed
>
> 1 - installs are processed in the order the containing CMakeLists.txt
> files are
> 2 - within a CMakeLists.txt they seem to be ordered based on which comes
> first in the file.
>
> So a not so elegant workaround would be to create a post-install directory
> in your source tree and have the last line of your main CMakeLists.txt be
> to add_subdirectory(post-install). Then all your post-install logic can
> live in there.
>
> --
> Matt Keeler
>
>
> On June 16, 2016 at 21:01:46, Young Yang (afe.yo...@gmail.com) wrote:
>
> Thanks!
> This command really solve my problem.
>
> But I still get a problem about the command order now.
>
> I have some sub directories.
> For e.g. One of them is called "src" and there is also a CMakeLists.txt in
> it. And the shared library installation instructions are in it.
> So I have `ADD_SUBDIRECTORY(src)` in my main CMakeLists.txt.
>
> I put the command `install(CODE "execute_process(COMMAND ldconfig)")`
>  after `ADD_SUBDIRECTORY(src)` . But It still  run ldconfig before the
> installation of shared libraries in src sub folder.
>
>
>
> On Thu, Jun 16, 2016 at 9:02 PM, Matthew Keeler 
> wrote:
>
>> CMake won’t and in my opinion shouldn’t implicitly invoke ldconfig for
>> you. There are many scenarios and platforms where this is incorrect
>> behavior and some such as running install to prepare for packaging that
>> CMake wouldn’t reliably be able to detect.
>>
>> If you want to provide the functionality for your users you could add
>> something like the following to your CMakeLists.txt:
>>
>> install(CODE “execute_process(COMMAND ldconfig)”)
>>
>> This will need to run after your other installed targets. I can’t find
>> any way in the CMake documentation to force install ordering but it seems
>> like as long as CMake processes that install command last it will perform
>> it last. So at the very end of your top level CMakeLists.txt file should do
>> the trick.
>>
>> --
>> Matt Keeler
>>
>>
>> On June 15, 2016 at 22:12:09, Young Yang (afe.yo...@gmail.com) wrote:
>>
>> Hi,
>> I've encountered some problem when writing install target with cmake.
>>
>> I use `install (TARGETS  DESTINATION lib)` to install
>> my shared_library.
>> However, when I run `make install`. It just install the .so to
>> /usr/local/lib and didn't run the ldconfig.
>>
>> I think it is strange and inconvenient to tell the user he should run
>> ldconfig by himself or herself.
>>
>> What is the best way to make the ldconfig run automatically?
>>
>>
>> Thanks in advance :)
>>
>> --
>> Best wishes,
>> Young Yang
>> --
>>
>> 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
>>
>>
>
>
> --
> Best wishes,
> Young Yang
>
>


-- 
Best wishes,
Young Yang
-- 

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

Re: [CMake] cmake install target doesn't run ldconfig after installing library

2016-06-17 Thread Matthew Keeler
So I did some experimenting. It would seem there are a few rules to the
order installs are executed

1 - installs are processed in the order the containing CMakeLists.txt files
are
2 - within a CMakeLists.txt they seem to be ordered based on which comes
first in the file.

So a not so elegant workaround would be to create a post-install directory
in your source tree and have the last line of your main CMakeLists.txt be
to add_subdirectory(post-install). Then all your post-install logic can
live in there.

-- 
Matt Keeler


On June 16, 2016 at 21:01:46, Young Yang (afe.yo...@gmail.com) wrote:

Thanks!
This command really solve my problem.

But I still get a problem about the command order now.

I have some sub directories.
For e.g. One of them is called "src" and there is also a CMakeLists.txt in
it. And the shared library installation instructions are in it.
So I have `ADD_SUBDIRECTORY(src)` in my main CMakeLists.txt.

I put the command `install(CODE "execute_process(COMMAND ldconfig)")`
 after `ADD_SUBDIRECTORY(src)` . But It still  run ldconfig before the
installation of shared libraries in src sub folder.



On Thu, Jun 16, 2016 at 9:02 PM, Matthew Keeler  wrote:

> CMake won’t and in my opinion shouldn’t implicitly invoke ldconfig for
> you. There are many scenarios and platforms where this is incorrect
> behavior and some such as running install to prepare for packaging that
> CMake wouldn’t reliably be able to detect.
>
> If you want to provide the functionality for your users you could add
> something like the following to your CMakeLists.txt:
>
> install(CODE “execute_process(COMMAND ldconfig)”)
>
> This will need to run after your other installed targets. I can’t find any
> way in the CMake documentation to force install ordering but it seems like
> as long as CMake processes that install command last it will perform it
> last. So at the very end of your top level CMakeLists.txt file should do
> the trick.
>
> --
> Matt Keeler
>
>
> On June 15, 2016 at 22:12:09, Young Yang (afe.yo...@gmail.com) wrote:
>
> Hi,
> I've encountered some problem when writing install target with cmake.
>
> I use `install (TARGETS  DESTINATION lib)` to install
> my shared_library.
> However, when I run `make install`. It just install the .so to
> /usr/local/lib and didn't run the ldconfig.
>
> I think it is strange and inconvenient to tell the user he should run
> ldconfig by himself or herself.
>
> What is the best way to make the ldconfig run automatically?
>
>
> Thanks in advance :)
>
> --
> Best wishes,
> Young Yang
> --
>
> 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
>
>


--
Best wishes,
Young Yang
-- 

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

Re: [CMake] cmake install target doesn't run ldconfig after installing library

2016-06-16 Thread Young Yang
Thanks!
This command really solve my problem.

But I still get a problem about the command order now.

I have some sub directories.
For e.g. One of them is called "src" and there is also a CMakeLists.txt in
it. And the shared library installation instructions are in it.
So I have `ADD_SUBDIRECTORY(src)` in my main CMakeLists.txt.

I put the command `install(CODE "execute_process(COMMAND ldconfig)")`
 after `ADD_SUBDIRECTORY(src)` . But It still  run ldconfig before the
installation of shared libraries in src sub folder.



On Thu, Jun 16, 2016 at 9:02 PM, Matthew Keeler  wrote:

> CMake won’t and in my opinion shouldn’t implicitly invoke ldconfig for
> you. There are many scenarios and platforms where this is incorrect
> behavior and some such as running install to prepare for packaging that
> CMake wouldn’t reliably be able to detect.
>
> If you want to provide the functionality for your users you could add
> something like the following to your CMakeLists.txt:
>
> install(CODE “execute_process(COMMAND ldconfig)”)
>
> This will need to run after your other installed targets. I can’t find any
> way in the CMake documentation to force install ordering but it seems like
> as long as CMake processes that install command last it will perform it
> last. So at the very end of your top level CMakeLists.txt file should do
> the trick.
>
> --
> Matt Keeler
>
>
> On June 15, 2016 at 22:12:09, Young Yang (afe.yo...@gmail.com) wrote:
>
> Hi,
> I've encountered some problem when writing install target with cmake.
>
> I use `install (TARGETS  DESTINATION lib)` to install
> my shared_library.
> However, when I run `make install`. It just install the .so to
> /usr/local/lib and didn't run the ldconfig.
>
> I think it is strange and inconvenient to tell the user he should run
> ldconfig by himself or herself.
>
> What is the best way to make the ldconfig run automatically?
>
>
> Thanks in advance :)
>
> --
> Best wishes,
> Young Yang
> --
>
> 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
>
>


-- 
Best wishes,
Young Yang
-- 

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

Re: [CMake] cmake install target doesn't run ldconfig after installing library

2016-06-16 Thread Matthew Keeler
CMake won’t and in my opinion shouldn’t implicitly invoke ldconfig for you.
There are many scenarios and platforms where this is incorrect behavior and
some such as running install to prepare for packaging that CMake wouldn’t
reliably be able to detect.

If you want to provide the functionality for your users you could add
something like the following to your CMakeLists.txt:

install(CODE “execute_process(COMMAND ldconfig)”)

This will need to run after your other installed targets. I can’t find any
way in the CMake documentation to force install ordering but it seems like
as long as CMake processes that install command last it will perform it
last. So at the very end of your top level CMakeLists.txt file should do
the trick.

-- 
Matt Keeler


On June 15, 2016 at 22:12:09, Young Yang (afe.yo...@gmail.com) wrote:

Hi,
I've encountered some problem when writing install target with cmake.

I use `install (TARGETS  DESTINATION lib)` to install my
shared_library.
However, when I run `make install`. It just install the .so to
/usr/local/lib and didn't run the ldconfig.

I think it is strange and inconvenient to tell the user he should run
ldconfig by himself or herself.

What is the best way to make the ldconfig run automatically?


Thanks in advance :)

--
Best wishes,
Young Yang
-- 

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

[CMake] cmake install target doesn't run ldconfig after installing library

2016-06-15 Thread Young Yang
Hi,
I've encountered some problem when writing install target with cmake.

I use `install (TARGETS  DESTINATION lib)` to install my
shared_library.
However, when I run `make install`. It just install the .so to
/usr/local/lib and didn't run the ldconfig.

I think it is strange and inconvenient to tell the user he should run
ldconfig by himself or herself.

What is the best way to make the ldconfig run automatically?


Thanks in advance :)

-- 
Best wishes,
Young Yang
-- 

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

Re: [CMake] cmake install behaviour with git

2015-10-01 Thread Nils Gladitz

On 10/01/2015 08:35 AM, Jörg Kreuzberger wrote:

This comes from installs, there we install some configuration files with the 
builded targets.
e.g. you install a builded executable, together with an config xml file from 
SCM.
If you make a product install, you want to "overwrite" the original config xml with an 
"product" xml config
file, also from the SCM.

So there are two install steps, the second "configure/modify" some files of the 
first. This worked cause the file
timestamps differed. Now not, cause the second install gets "Up-to-date" 
message and has to use CMAKE_ALWAYS_INSTALL.


I don't comprehend this at all.
Why would the two instances of the config file with distinct content 
have the same modification time in this scenario?


Could you provide a minimal, self-contained test case that reproduces 
this issue?



I do agree with you, except for this scenario of non-builded files. So the 
question is ok, why not consider the file size in up-to-date check.
Should be not to expensive to get this information together with the file time 
from the os.


I don't think that makes much sense.

A modified file is much more likely to retain its size than its 
modification time.


So if modification times really stay the same for some reason the file 
size on its own would be a very error prone change indicator.


Nils
--

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


Re: [CMake] cmake install behaviour with git

2015-10-01 Thread Jörg Kreuzberger
-Ursprüngliche Nachricht-
Von:Nils Gladitz <nilsglad...@gmail.com>
Gesendet:   Do 01.10.2015 09:40
Betreff:    Re: [CMake] cmake install behaviour with git
An: Jörg Kreuzberger <j.kreuzber...@procitec.de>; cmake@cmake.org; 
> On 10/01/2015 08:35 AM, Jörg Kreuzberger wrote:
> > This comes from installs, there we install some configuration files with 
> > the 
> builded targets.
> > e.g. you install a builded executable, together with an config xml file 
> > from 
> SCM.
> > If you make a product install, you want to "overwrite" the original config 
> xml with an "product" xml config
> > file, also from the SCM.
> >
> > So there are two install steps, the second "configure/modify" some files of 
> the first. This worked cause the file
> > timestamps differed. Now not, cause the second install gets "Up-to-date" 
> message and has to use CMAKE_ALWAYS_INSTALL.
> 
> I don't comprehend this at all.
> Why would the two instances of the config file with distinct content 
> have the same modification time in this scenario?

cause they come from git clone and git sets the timestamp of the files to the 
time of the clone,
not of the "original" modification time. So after a clone all files(!) have the 
same timestamp.

> Could you provide a minimal, self-contained test case that reproduces 
> this issue?
should be now problem, i send it later to you.

> I don't think that makes much sense.
> 
> A modified file is much more likely to retain its size than its 
> modification time.
i sense of "builded files" yes, in sense of files only coming from SCM not

> So if modification times really stay the same for some reason the file 
> size on its own would be a very error prone change indicator.
But better than noting. best would be a hash to detect modified content, but 
this will take some time to prove...

Ok, as i now understood nobody has a similar scenario and i will try to get it 
workaround by myself

Thanks all for support!

-- 

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

Re: [CMake] cmake install behaviour with git

2015-10-01 Thread Jörg Kreuzberger
> > 
> > Now install behaves differnt, cause cmake checks only file time difference. 
> Files previously overwritten are now
> > considered Up-to-date
> 
> Why would you want to overwrite files that have not changed? 

This comes from installs, there we install some configuration files with the 
builded targets.
e.g. you install a builded executable, together with an config xml file from 
SCM.
If you make a product install, you want to "overwrite" the original config xml 
with an "product" xml config
file, also from the SCM.

So there are two install steps, the second "configure/modify" some files of the 
first. This worked cause the file
timestamps differed. Now not, cause the second install gets "Up-to-date" 
message and has to use CMAKE_ALWAYS_INSTALL.

The same "application install" is used in "product install" there we bundle 
several applications to an "product" and then apply product specific 
configuration, modifying some xml files (same name, different size, normaly 
different timestamp :-) )

The idea behind this install overwrite is that we could provide an install for 
an application with "default" configuration, so that any developer could use 
the application without further need to add additonal files (all files to run 
the application like config files, shared libraries and so on).

> We?re using CMake with git without any trouble - no solution to be found. The 
> install target works flawlessly and as expected.

I do agree with you, except for this scenario of non-builded files. So the 
question is ok, why not consider the file size in up-to-date check.
Should be not to expensive to get this information together with the file time 
from the os.

> I think you?ll need to provide some more details about what you?re doing. Are 
> you by any chance doing in-source builds? Why are you so focussed on 'git 
> clone?? That is the kind of thing you would do once, and then almost never 
> again, so I don?t see how that can be related to running an install target.

We do not make an in-source-builds. i am focused on git clone cause we do it on 
our SOFTWARE RELEASE systems.
These are virtual machines, upstarting for any release build, cloning (with 
depth=1) the software and start builds,
install, and package creation (rpm and msi). For those builds the "former" 
behaviour is broken.

I do also not want to start a discussion about this git clone behaviour, i 
accepted this as is. I think the solutions provided in groups, aplying the 
timestamps after checkout from any meta data is also no good idea. The concept 
of the
modified timestamps is also still good for the builded install files.

Thanks for your patience, if you read this mail to the end :-)
Joerg

-- 

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


Re: [CMake] cmake install behaviour with git

2015-10-01 Thread Jörg Kreuzberger
> What was unclear to me is that it now sounds like you are installing two 
> distinct files from your repository to the same destination file rather 
> than re-installing a modified version of the same file.
Yes, your are right i am doing exactly this

> I think that is conceptually an error prone thing to do irregardless of 
> the SCM in use.
yes you are right, but it worked until the git change :-)
i will fix it in your CMakeLists.txt

-- 

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


Re: [CMake] cmake install behaviour with git

2015-10-01 Thread Nils Gladitz

On 10/01/2015 10:12 AM, Jörg Kreuzberger wrote:

-Ursprüngliche Nachricht-
Von:Nils Gladitz <nilsglad...@gmail.com>
Gesendet:   Do 01.10.2015 09:40
Betreff:    Re: [CMake] cmake install behaviour with git
An: Jörg Kreuzberger <j.kreuzber...@procitec.de>; cmake@cmake.org;

On 10/01/2015 08:35 AM, Jörg Kreuzberger wrote:

This comes from installs, there we install some configuration files with the

builded targets.

e.g. you install a builded executable, together with an config xml file from

SCM.

If you make a product install, you want to "overwrite" the original config

xml with an "product" xml config

file, also from the SCM.

So there are two install steps, the second "configure/modify" some files of

the first. This worked cause the file

timestamps differed. Now not, cause the second install gets "Up-to-date"

message and has to use CMAKE_ALWAYS_INSTALL.

I don't comprehend this at all.
Why would the two instances of the config file with distinct content
have the same modification time in this scenario?


cause they come from git clone and git sets the timestamp of the files to the 
time of the clone,
not of the "original" modification time. So after a clone all files(!) have the 
same timestamp.


Subversion does not restore "original" modification times either (unless 
you use the non-default 'use-commit-times' option which likely breaks 
timestamp logic in the build).


When you do a fresh checkout with subversion all files will have 
modification times close to each other as well.


I guess the only difference with git is that git might be a bit faster 
when creating files to a degree where creation time differences might 
fall below the modification time precision(?)


What was unclear to me is that it now sounds like you are installing two 
distinct files from your repository to the same destination file rather 
than re-installing a modified version of the same file.


I think that is conceptually an error prone thing to do irregardless of 
the SCM in use.


Nils


--

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

Re: [CMake] cmake install behaviour with git

2015-09-30 Thread Jakob van Bethlehem
Hej,

> 
> Now install behaves differnt, cause cmake checks only file time difference. 
> Files previously overwritten are now
> considered Up-to-date

Why would you want to overwrite files that have not changed? 

> Has anyone found a solution for this after a git migration?

We’re using CMake with git without any trouble - no solution to be found. The 
install target works flawlessly and as expected.

I think you’ll need to provide some more details about what you’re doing. Are 
you by any chance doing in-source builds? Why are you so focussed on 'git 
clone’? That is the kind of thing you would do once, and then almost never 
again, so I don’t see how that can be related to running an install target.

Sincerely, Jakob



-- 

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

[CMake] cmake install behaviour with git

2015-09-30 Thread Jörg Kreuzberger
Hi!

the cmake install behaviour of files was ok for me, as long as we used svn.
Now we changed to git and i have a problem now with the install behaviour.

On git the timestamps of all files get the time of the clone. So files not build
(e.g. configuration files, xml files etc) from the repository have the same 
timestamp.

Now install behaves differnt, cause cmake checks only file time difference. 
Files previously overwritten are now
considered Up-to-date

I am forcing now overwrite with CMAKE_ALWAYS_INSTALL, but this takes then a 
long time, cause now all
binary files (with differnt timestamps) get installed (e.g. huge qt dlls, 
executables etc :-) )

Has anyone found a solution for this after a git migration?
Adapting the file timestamps after clone seems not the thing i want to do :-)
Or should i post a feature-request to check also the file size for Up-to-date 
checking?

Thanks for any hints,
Joerg

-- 

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


[CMake] cmake install qt5 library to Specified directory?

2015-03-11 Thread kl222
Hello all:
I thank to install qt5(=5.3.0) library to sepcified directory. I write:


get_target_property(QtCore_location Qt5::Core LOCATION)
install(files ${QtCore_location} DESTINATION .)

Ok, it is copy /usr/local/Qt-5.5.0/lib/libQt5Core.so.5.5.0 to destination 
directory, but it don't create libQt5Core.so.5 link. so the programe don't find 
the library. 

What do I?



-- 

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

[CMake] CMAKE Install Configurations

2014-12-17 Thread Eddy Ilg

Hi,


I am trying to set up a project that has fine-grained installation 
control. The hierarchy is like this:


Project
Group
Component

There should be three install variants:
1. make install should install the whole project.
2. make Group1-install should install everything that is in group 1
3. make Component1-install should install component 1 only

I created custom targets for Group1-install:
install( TARGETS ${component} DESTINATION bin COMPONENT ${group} )
add_custom_target( ${group}-install
DEPENDS ${group}
COMMAND
${CMAKE_COMMAND} -DCOMPONENT=${group}
-P ${CMAKE_BINARY_DIR}/cmake_install.cmake
)

and  Component1-install:
install( TARGETS ${component} DESTINATION bin COMPONENT ${component} )
add_custom_target( ${component}-install
DEPENDS ${component}
COMMAND
${CMAKE_COMMAND} -DCOMPONENT=${component}
-P ${CMAKE_BINARY_DIR}/cmake_install.cmake
)

Variants 2 and 3 work, 3 also works but installs everything twice 
(because of the two install commands). I tried to make one OPTIONAL, but 
no luck. When leaving the second install command out, make 
Component1-install does nothing.


Any hints how I could solve the duplicate installation problem with 
make install?



Cheers,



Eddy

--

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


[CMake] CMAKE install command post process the file

2011-12-28 Thread vivek goel
I am installing static file using cmake INSTALL command

I want to post process the output file using cmake

example

Static files are having string like v={{VERSION}}

I want to replace {{VERSION}} in the output files.

Is it possible with cmake ? using utility like sed.
-- 
regards
Vivek Goel
--

Powered by www.kitware.com

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

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

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


Re: [CMake] CMAKE install command post process the file

2011-12-28 Thread Eric Noulard
2011/12/28 vivek goel goelvivek2...@gmail.com:
 I am installing static file using cmake INSTALL command

 I want to post process the output file using cmake

 example

 Static files are having string like v={{VERSION}}

 I want to replace {{VERSION}} in the output files.

 Is it possible with cmake ? using utility like sed.

You should try to use
configure_file
cmake command.

You'll need to replace {{VERSION}} in your static files with @VERSION@.
You may then

configure_file(${CMAKE_CURRENT_SOURCE_DIR}/static_file.in
${CMAKE_CURRENT_BINARY_DIR}/static_file @ONLY)
install(${CMAKE_CURRENT_BINARY_DIR}/static_file DESTINATION ...)


-- 
Erk
Membre de l'April - « promouvoir et défendre le logiciel libre » -
http://www.april.org
--

Powered by www.kitware.com

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

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

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


Re: [CMake] cmake install overrode my PATH instead of appending to it

2009-12-18 Thread Mark Jones
Hi David,

My path at work is 1907 characters long right now.  If I have some spare
time soon, I'll try it again to see what happens.  I don't know if PATH
length is the key, it is just something I wondered about since that is a
definite difference between home and work (though there are many other
differences too).

Mark


On Mon, Dec 14, 2009 at 3:38 PM, David Cole david.c...@kitware.com wrote:

 FWIW:
 I made my user PATH value 302 characters long... as in:

 C:\a;C:\b;C:\c;C:\dd;C:\dd;C:\dd;C:\dd;C:\dd;C:\dd;C:\dd;C:\dd;C:\dd;C:\dd;C:\dd;C:\dd;C:\dd;C:\dd;C:\dd;C:\dd;C:\dd;C:\dd;C:\dd;C:\dd;C:\

 ...then I installed CMake 2.8.0 from this installer:
 http://www.cmake.org/files/v2.8/cmake-2.8.0-win32-x86.exe

 And it worked. It appended the CMake installation path at the end of my big
 long path, and then when I uninstalled it, it removed it and put my PATH
 back to its original value.

 If anybody has any additional details that would help me reproduce this
 problem, I would really be grateful. The installer should NEVER destroy any
 part of your PATH other than the component it adds itself for the CMake bin
 directory...

 If you can reproduce it, please add a note to this issue in the bug
 tracker:
 http://public.kitware.com/Bug/view.php?id=9878


 Thanks,
 David


 On Sun, Dec 13, 2009 at 10:04 AM, David Cole david.c...@kitware.comwrote:

 Can you give exact steps to reproduce and tell me exactly how you are
 observing the replacement?

 i.e.:
 - set your user PATH to something that is N characters long with M
 semi-colon separated components
 - look at My Computer  Properties  Advanced  Environment Variables 
 user PATH value to see the new PATH value

 I will try this again on Monday with the installer you've pointed out. Any
 additional details you can provide would be helpful.


 Thanks,
 David


 On Sun, Dec 13, 2009 at 8:28 AM, Mark Jones mark.jones1...@gmail.comwrote:

 Hi David,

 I was using the latest installer that I downloaded from the cmake page:

 http://www.cmake.org/files/v2.8/cmake-2.8.0-win32-x86.exe

 I am using Windows XP SP3.

 I have a relatively long PATH already.  Is your PATH very long on the
 system that you tried to reproduce this on?  I wonder if that has anything
 to do with it (maybe Windows tells it that it cannot append to the PATH and
 so it replaces the PATH completely?).

 Mark



 On Sat, Dec 12, 2009 at 9:28 AM, David Cole david.c...@kitware.comwrote:

 There are bug reports about that, but I cannot reproduce that bug
 here... What CMake installer were you running? Where did you get it from?

 See these bugs for more details:
 http://public.kitware.com/Bug/view.php?id=9878
 http://public.kitware.com/Bug/view.php?id=8959

 If you have steps to reproduce this problem, please re-open one of these
 bugs and attach details. (Exactly what steps you took that produced the
 problem...)


 Thanks,
 David


 On Sat, Dec 12, 2009 at 7:31 AM, Mark Jones 
 mark.jones1...@gmail.comwrote:

 I chose to add cmake to my PATH (on Win XP 32) during the
 installation.  After it finished I noticed that it completely overrode my
 PATH instead of appending to it.  Is this a known bug?

 Thanks,
 Mark


 ___
 Powered by www.kitware.com

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

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

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






___
Powered by www.kitware.com

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

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

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

Re: [CMake] cmake install overrode my PATH instead of appending to it

2009-12-13 Thread Mark Jones
Hi David,

I was using the latest installer that I downloaded from the cmake page:

http://www.cmake.org/files/v2.8/cmake-2.8.0-win32-x86.exe

I am using Windows XP SP3.

I have a relatively long PATH already.  Is your PATH very long on the system
that you tried to reproduce this on?  I wonder if that has anything to do
with it (maybe Windows tells it that it cannot append to the PATH and so it
replaces the PATH completely?).

Mark


On Sat, Dec 12, 2009 at 9:28 AM, David Cole david.c...@kitware.com wrote:

 There are bug reports about that, but I cannot reproduce that bug here...
 What CMake installer were you running? Where did you get it from?

 See these bugs for more details:
 http://public.kitware.com/Bug/view.php?id=9878
 http://public.kitware.com/Bug/view.php?id=8959

 If you have steps to reproduce this problem, please re-open one of these
 bugs and attach details. (Exactly what steps you took that produced the
 problem...)


 Thanks,
 David


 On Sat, Dec 12, 2009 at 7:31 AM, Mark Jones mark.jones1...@gmail.comwrote:

 I chose to add cmake to my PATH (on Win XP 32) during the installation.
 After it finished I noticed that it completely overrode my PATH instead of
 appending to it.  Is this a known bug?

 Thanks,
 Mark


 ___
 Powered by www.kitware.com

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

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

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



___
Powered by www.kitware.com

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

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

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

Re: [CMake] cmake install overrode my PATH instead of appending to it

2009-12-13 Thread David Cole
Can you give exact steps to reproduce and tell me exactly how you are
observing the replacement?

i.e.:
- set your user PATH to something that is N characters long with M
semi-colon separated components
- look at My Computer  Properties  Advanced  Environment Variables 
user PATH value to see the new PATH value

I will try this again on Monday with the installer you've pointed out. Any
additional details you can provide would be helpful.


Thanks,
David


On Sun, Dec 13, 2009 at 8:28 AM, Mark Jones mark.jones1...@gmail.comwrote:

 Hi David,

 I was using the latest installer that I downloaded from the cmake page:

 http://www.cmake.org/files/v2.8/cmake-2.8.0-win32-x86.exe

 I am using Windows XP SP3.

 I have a relatively long PATH already.  Is your PATH very long on the
 system that you tried to reproduce this on?  I wonder if that has anything
 to do with it (maybe Windows tells it that it cannot append to the PATH and
 so it replaces the PATH completely?).

 Mark



 On Sat, Dec 12, 2009 at 9:28 AM, David Cole david.c...@kitware.comwrote:

 There are bug reports about that, but I cannot reproduce that bug here...
 What CMake installer were you running? Where did you get it from?

 See these bugs for more details:
 http://public.kitware.com/Bug/view.php?id=9878
 http://public.kitware.com/Bug/view.php?id=8959

 If you have steps to reproduce this problem, please re-open one of these
 bugs and attach details. (Exactly what steps you took that produced the
 problem...)


 Thanks,
 David


 On Sat, Dec 12, 2009 at 7:31 AM, Mark Jones mark.jones1...@gmail.comwrote:

 I chose to add cmake to my PATH (on Win XP 32) during the installation.
 After it finished I noticed that it completely overrode my PATH instead of
 appending to it.  Is this a known bug?

 Thanks,
 Mark


 ___
 Powered by www.kitware.com

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

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

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




___
Powered by www.kitware.com

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

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

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

[CMake] cmake install overrode my PATH instead of appending to it

2009-12-12 Thread Mark Jones
I chose to add cmake to my PATH (on Win XP 32) during the installation.
After it finished I noticed that it completely overrode my PATH instead of
appending to it.  Is this a known bug?

Thanks,
Mark
___
Powered by www.kitware.com

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

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

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

Re: [CMake] cmake install overrode my PATH instead of appending to it

2009-12-12 Thread David Cole
There are bug reports about that, but I cannot reproduce that bug here...
What CMake installer were you running? Where did you get it from?

See these bugs for more details:
http://public.kitware.com/Bug/view.php?id=9878
http://public.kitware.com/Bug/view.php?id=8959

If you have steps to reproduce this problem, please re-open one of these
bugs and attach details. (Exactly what steps you took that produced the
problem...)


Thanks,
David


On Sat, Dec 12, 2009 at 7:31 AM, Mark Jones mark.jones1...@gmail.comwrote:

 I chose to add cmake to my PATH (on Win XP 32) during the installation.
 After it finished I noticed that it completely overrode my PATH instead of
 appending to it.  Is this a known bug?

 Thanks,
 Mark


 ___
 Powered by www.kitware.com

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

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

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

___
Powered by www.kitware.com

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

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

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

[CMake] CMake install and CPack

2008-11-07 Thread KSpam
My project has hundreds of individual install components.  The various 
components are needed for my CPack scripts; however most (all but 1) 
components should not be installed as part of a normal make install.  
Unfortunately, make install installs all of the components.

Ideally, I would like a way to specify a different set of components for CPack 
and CMake.  Any of the following would suit my particular needs:

1) set a variable to specify a single component to be used during make 
install
2) set a variable to a list of components to be used during make install
3) Ability to flag an INSTALL macro for use in CPack, CMake, or both

Is there a way to achieve any of the above solutions?

Thanks,
Justin
___
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake


Re: [CMake] CMake install and CPack

2008-11-07 Thread Timothy M. Shead

KSpam wrote:

My project has hundreds of individual install components.  The various
components are needed for my CPack scripts; however most (all but 1)
components should not be installed as part of a normal make install.
Unfortunately, make install installs all of the components.

Ideally, I would like a way to specify a different set of components for CPack
and CMake.  Any of the following would suit my particular needs:

1) set a variable to specify a single component to be used during make
install
2) set a variable to a list of components to be used during make install
3) Ability to flag an INSTALL macro for use in CPack, CMake, or both

Is there a way to achieve any of the above solutions?


I don't know of a way to control what gets installed by make install, 
but you can use custom targets to provide your own alternative behaviors 
- for example, I used the following to install debug and release 
versions of a single component (out of many) on a Win32 project where I 
was doing a lot of debugging:


ADD_CUSTOM_TARGET(Install-Foo-Debug
  ${CMAKE_COMMAND}
  -D BUILD_TYPE=Debug
  -D CMAKE_INSTALL_COMPONENT=Foo
  -D CMAKE_INSTALL_PREFIX=C:/Program Files/Foo-Debug
  -P ${Foo_BINARY_DIR}/cmake_install.cmake
  )

ADD_CUSTOM_TARGET(Install-Foo-Release
  ${CMAKE_COMMAND}
  -D BUILD_TYPE=Release
  -D CMAKE_INSTALL_COMPONENT=Foo
  -D CMAKE_INSTALL_PREFIX=C:/Program Files/Foo
  -P ${Foo_BINARY_DIR}/cmake_install.cmake
  )

Cheers,
Tim

--
Timothy M. Shead
Data Analysis  Visualization (1424)
Sandia National Laboratories
505-284-0139

___
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake


[CMake] cmake install and rpath

2007-10-17 Thread James Bigler
I tried digging through through the mailing list and experimenting on  
my own, but I don't seem to be able to figure this out.


I have a toy project that has a shared library and an executable.   
I've set it up, so that it can be installed to what ever the  
CMAKE_INTALL_PREFIX is which works fine.  The installed executable is  
relinked before installing to have the correct RPATH.


I tried to use CPack with the TGZ target and it created a tar ball  
with bin and lib, but the executable still had $ 
{CMAKE_INSTALL_PREFIX}/lib linked.  I would have assumed that  
something would have relinked my executable to contain a relative  
path to the library based on the CMAKE_INSTALL_PREFIX.


I'm using CMake 2.4.6 on Linux.

Thanks,
James

This is the CMakeLists.txt file I'm using:

PROJECT (Narf)

SET(BUILD_SHARED_LIBS ON CACHE BOOL Building shared or static  
libraries)


MESSAGE(CMAKE_INSTALL_PREFIX = ${CMAKE_INSTALL_PREFIX})
MESSAGE(INSTALL_RPATH = ${INSTALL_RPATH})

INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR})

ADD_LIBRARY(narfencode encode.cc encode.h)

ADD_EXECUTABLE(narf main.cc)
TARGET_LINK_LIBRARIES(narf narfencode)

SET_TARGET_PROPERTIES(narf
  PROPERTIES BUILD_WITH_INSTALL_RPATH OFF
  INSTALL_RPATH ${CMAKE_INSTALL_PREFIX}/lib
  INSTALL_NAME_DIR ${CMAKE_INSTALL_PREFIX}/bin
  )

INSTALL(TARGETS narf narfencode
  RUNTIME DESTINATION bin
  LIBRARY DESTINATION lib
  ARCHIVE DESTINATION lib
  )

INCLUDE(CPack)

___
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake


Re: [CMake] cmake install and rpath

2007-10-17 Thread a . neundorf-work
On Wednesday 17 October 2007 15:57, James Bigler wrote:
 I tried digging through through the mailing list and experimenting on
 my own, but I don't seem to be able to figure this out.

 I have a toy project that has a shared library and an executable.
 I've set it up, so that it can be installed to what ever the
 CMAKE_INTALL_PREFIX is which works fine.  The installed executable is
 relinked before installing to have the correct RPATH.

 I tried to use CPack with the TGZ target and it created a tar ball
 with bin and lib, but the executable still had $
 {CMAKE_INSTALL_PREFIX}/lib linked.  I would have assumed that
 something would have relinked my executable to contain a relative
 path to the library based on the CMAKE_INSTALL_PREFIX.

You mean you expected a relative path as RPATH ? I think this isn't supported 
by the linker.

Alex
___
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake


Re: [CMake] cmake install and rpath

2007-10-17 Thread James Bigler

Does anyone have any examples of creating relative rpaths for installation?

James

James Bigler wrote:
I tried digging through through the mailing list and experimenting on my 
own, but I don't seem to be able to figure this out.


I have a toy project that has a shared library and an executable.  I've 
set it up, so that it can be installed to what ever the 
CMAKE_INTALL_PREFIX is which works fine.  The installed executable is 
relinked before installing to have the correct RPATH.


I tried to use CPack with the TGZ target and it created a tar ball with 
bin and lib, but the executable still had ${CMAKE_INSTALL_PREFIX}/lib 
linked.  I would have assumed that something would have relinked my 
executable to contain a relative path to the library based on the 
CMAKE_INSTALL_PREFIX.


I'm using CMake 2.4.6 on Linux.

Thanks,
James

This is the CMakeLists.txt file I'm using:

PROJECT (Narf)

SET(BUILD_SHARED_LIBS ON CACHE BOOL Building shared or static libraries)

MESSAGE(CMAKE_INSTALL_PREFIX = ${CMAKE_INSTALL_PREFIX})
MESSAGE(INSTALL_RPATH = ${INSTALL_RPATH})

INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR})

ADD_LIBRARY(narfencode encode.cc encode.h)

ADD_EXECUTABLE(narf main.cc)
TARGET_LINK_LIBRARIES(narf narfencode)

SET_TARGET_PROPERTIES(narf
  PROPERTIES BUILD_WITH_INSTALL_RPATH OFF
  INSTALL_RPATH ${CMAKE_INSTALL_PREFIX}/lib
  INSTALL_NAME_DIR ${CMAKE_INSTALL_PREFIX}/bin
  )

INSTALL(TARGETS narf narfencode
  RUNTIME DESTINATION bin
  LIBRARY DESTINATION lib
  ARCHIVE DESTINATION lib
  )

INCLUDE(CPack)

___
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake

___
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake


Re: [CMake] cmake install - problem at copy

2007-07-10 Thread B. Carrupt

It's working now, thanks. I had to add /usr/local/lib in ld.so.conf 
(don't know why it's not there by default) so that the wx libraries 
could be found.

What I don't understand is why it was working when I ran the binary 
from the build/bin directory of cmake directly (or when I copied it 
manually to the location).

Thank you for the ldd command, it's really useful !

B. Carrupt

On 07/09/2007 04:37:08 PM, Alan W. Irwin wrote:
 On 2007-07-09 14:37+0200 digicapt - cmake wrote:
 
  Hi,
 
  I'm using the version 2.4-patch 6 of cmake on a Fedora core 6 and I
 have a problem with the INSTALL : the generated target works fine (in
 the build directory) but the copy in the destination is changed so
 that some libraries are not found anymore.
 
  When I check them, the size of the copied file is different. And an
 nm on the files shows me that all is there but the addresses have
 changed.
 
  I have all the needed permissions in /usr/bin/mybin.
 
  Here is my INSTALL command in my CMakeLists.txt :
 
  INSTALL(TARGETS mytarget
 RUNTIME
 DESTINATION /usr/bin/mybin
 PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE
 GROUP_READ GROUP_EXECUTE
 WORLD_READ WORLD_EXECUTE)
 
  Thank you for your help.
 
 Do you install your libraries in a non-standard location similar to
 your above
 executable install?  If so, then you need to set LD_LIBRARY_PATH to
 the
 non-standard library directory in order for your executables to find
 the
 libraries at run time.
 
 If LD_LIBRARY_PATH doesn't work try ldd -r to help diagnose the
 problem.
 
 Alan
 __
 Alan W. Irwin
 
 Astronomical research affiliation with Department of Physics and
 Astronomy,
 University of Victoria (astrowww.phys.uvic.ca).
 
 Programming affiliations with the FreeEOS equation-of-state
 implementation
 for stellar interiors (freeeos.sf.net); PLplot scientific plotting
 software
 package (plplot.org); 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
 __
 
 



___
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake


Re: [CMake] cmake install - problem at copy

2007-07-10 Thread Clark J. Wang

On 7/10/07, B. Carrupt [EMAIL PROTECTED] wrote:



It's working now, thanks. I had to add /usr/local/lib in ld.so.conf
(don't know why it's not there by default) so that the wx libraries
could be found.

What I don't understand is why it was working when I ran the binary
from the build/bin directory of cmake directly (or when I copied it
manually to the location).



When linking the executable in your build directory, cmake explicitly passes
a `-rpath'  option to the compiler/linker. On my system the gcc command
looks like this:

/usr/bin/gcc -fPIC CMakeFiles/main.dir/main.o -o bin/main -rdynamic
-L/xxx/build/lib -lhello -Wl,-rpath,/xxx/build/lib

You can run ldd on the executable in the build directory and see exactly
which library it depends on. It should be the library in the build directory
other than `/usr/local/lib'.

Thank you for the ldd command, it's really useful !


B. Carrupt
___
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake

[CMake] cmake install - problem at copy

2007-07-09 Thread digicapt - cmake
Hi,

I'm using the version 2.4-patch 6 of cmake on a Fedora core 6 and I have a 
problem with the INSTALL : the generated target works fine (in the build 
directory) but the copy in the destination is changed so that some libraries 
are not found anymore.

When I check them, the size of the copied file is different. And an nm on the 
files shows me that all is there but the addresses have changed.

I have all the needed permissions in /usr/bin/mybin.

Here is my INSTALL command in my CMakeLists.txt :

INSTALL(TARGETS mytarget
RUNTIME
DESTINATION /usr/bin/mybin
PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE 
GROUP_READ GROUP_EXECUTE
WORLD_READ WORLD_EXECUTE)

Thank you for your help.

___
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake


Re: [CMake] cmake install - problem at copy

2007-07-09 Thread Alan W. Irwin

On 2007-07-09 14:37+0200 digicapt - cmake wrote:


Hi,

I'm using the version 2.4-patch 6 of cmake on a Fedora core 6 and I have a 
problem with the INSTALL : the generated target works fine (in the build 
directory) but the copy in the destination is changed so that some libraries 
are not found anymore.

When I check them, the size of the copied file is different. And an nm on the 
files shows me that all is there but the addresses have changed.

I have all the needed permissions in /usr/bin/mybin.

Here is my INSTALL command in my CMakeLists.txt :

INSTALL(TARGETS mytarget
   RUNTIME
   DESTINATION /usr/bin/mybin
   PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE
   GROUP_READ GROUP_EXECUTE
   WORLD_READ WORLD_EXECUTE)

Thank you for your help.


Do you install your libraries in a non-standard location similar to your above
executable install?  If so, then you need to set LD_LIBRARY_PATH to the
non-standard library directory in order for your executables to find the
libraries at run time.

If LD_LIBRARY_PATH doesn't work try ldd -r to help diagnose the problem.

Alan
__
Alan W. Irwin

Astronomical research affiliation with Department of Physics and Astronomy,
University of Victoria (astrowww.phys.uvic.ca).

Programming affiliations with the FreeEOS equation-of-state implementation
for stellar interiors (freeeos.sf.net); PLplot scientific plotting software
package (plplot.org); 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
__
___
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake


Re: [CMake] cmake install - problem at copy

2007-07-09 Thread Clark J. Wang

On 7/9/07, digicapt - cmake [EMAIL PROTECTED] wrote:


Hi,

I'm using the version 2.4-patch 6 of cmake on a Fedora core 6 and I have a
problem with the INSTALL : the generated target works fine (in the build
directory) but the copy in the destination is changed so that some libraries
are not found anymore.



Maybe you can set INSTALL_RPATH property for your target.

When I check them, the size of the copied file is different.


INSTALL may relink your executables so the size may be different.

And an nm on the files shows me that all is there but the addresses have

changed.

I have all the needed permissions in /usr/bin/mybin.

Here is my INSTALL command in my CMakeLists.txt :

INSTALL(TARGETS mytarget
RUNTIME
DESTINATION /usr/bin/mybin
PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE
GROUP_READ GROUP_EXECUTE
WORLD_READ WORLD_EXECUTE)

Thank you for your help.

___
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake

___
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake

Re: [CMake] Cmake: INSTALL not working with subdirectories

2007-01-17 Thread Axel Roebel
On Wednesday 17 January 2007 12:18, Otavio Rodolfo Piske wrote:
 Hi Eric,

 On 1/17/07, Eric Noulard [EMAIL PROTECTED] wrote:
  2007/1/16, Otavio Rodolfo Piske [EMAIL PROTECTED]:
   Hi,
  
   I almost solve the problem! I took a closer look at my top-level
   CMakeLists.txt and could find it referencing to a directory that it
   shouldn't. After I commented it, it now installs the files of the last
   one of the processed modules in the top-level CMakeLists.txt. If you
   take a look at it (available at
   http://svn.angusyoung.org/nus/CMakeLists.txt ) you'll notice the last
   module to be added is MODULE_XML ... so now I have the following
   output of make install:
 
  [..]
 
   What I could note in the file cmake_install.cmake is the following
   comment:
  
   #  Install script for directory: /home/otavio/projects/nus/./src/xml
  
   The directory /home/otavio/projects/nus/./src/xml is where is the
   CMakeLists.txt file for the XML module.
  
   Any ideas? Thanks in advance!
 
  Could you explain us why you
 
  ADD_SUBDIRECTORY(
  src/network
  .
  )
 
  instead of
  ADD_SUBDIRECTORY(
  src/network
  )
 
  do you really want . (dot) to be the binary_dir for the specified
  subdir?

 When I was originally moving from the old build tree to this one, I
 received a messaged about not having defined a binary_dir (or, at
 least, something very similar to that).
 Since you noted that I removed the 'binary_dir' option from
 ADD_SUBDIRECTORY and everything seems to be fine. I still have to test
 this on windows, though.

  I don't know if it is related to your problem but it seems an odd choice
  to me.
 
  Moreover I don't really understand what are your remaining problems?
  What should be installed and is not?

 Eric, my problem is that if I do this:

 ADD_SUBDIRECTORY(
src/a
 )

 ADD_SUBDIRECTORY(
src/b
 )

 ADD_SUBDIRECTORY(
src/c
 )

 only the contents of the directory src/c will be installed.

 I temporally solved the problem by doing the following :

 1) I created a deploy directory with 2 files:
  - a CMakeLists.txt that will include any module that should be
 installed. So, each module has a CMakeInstall.txt file that is
 included by this one. You can see what I'm talking about here:
 http://svn.angusyoung.org/nus/deploy/CMakeLists.txt

 - a CMakeInstall.txt with the macros that will install the files:
 http://svn.angusyoung.org/nus/deploy/CMakeInstall.txt

 2) Then, for each module I created a CMakeInstall.txt file that calls
 the installation macros to install its files. Again, you can see it
 here: http://svn.angusyoung.org/nus/src/network/CMakeInstall.txt

 3) On the top-level CMakeLists.txt file I added the deploy directory
 to end of the file.

 So, to make it short: my problem seems to be that CMake overwrites
 cmake_install.cmake each time it runs ADD_SUBDIRECTORY, so making it
 generate installation scripts for only the last of the added
 directories.

For many of the projects I have I have exactly the same structure

src/a
src/b
src/c

and installing from some or all of these sub-directories
using the install command in the CMakeLists.txt of the
sub directories does not pose any problem with cmake.

If the install from a certain subdirectory is missing (src/xml
in your case) I would suggest you carefully check the CMakeLists.txt
of that directory. Chances are you made an error there.

Cheers,


 P.S.: sorry I'm not clear enough, english isn't my primary language.

 Thanks in advance

-- 
Axel Roebel
IRCAM Analysis/Synthesis Team
Phone: ++33-1-4478 4845 | Fax: ++33-1-4478 1540
___
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake


Re: [CMake] Cmake: INSTALL not working with subdirectories

2007-01-16 Thread Eric Noulard

Your files looks good to me.
Provider you have properly defined
${N_LIBRARY_DIR}
${N_ARCHIVE_DIR}
*
in your specific include files which seems to be the case for
http://svn.angusyoung.org/nus/CMakeLists.txt.linux

May be you can try a

make VERBOSE=1 install
in order to see a little more what happen during make install step.



2007/1/16, Otavio Rodolfo Piske [EMAIL PROTECTED]:

Hi all,

I have been using cmake for my soon-to-be-born project, however I'm
having problems during the install part.
Even though I add a target to be installed, it is not installed when I
run 'make install'.

Let me provide some details: my project is separated in modules, with
each module having its own CMakeLists.txt file.

This is the top-level CMakeLists.txt file:
http://svn.angusyoung.org/nus/CMakeLists.txt

And, this is the CMakeLists for one of the modules:
http://svn.angusyoung.org/nus/src/base/CMakeLists.txt

So, when I ran 'make install' it does not install libnbase-0.1.so on
linux neither nbase-0.1.dll on windows.
Currently, my CMAKE_INSTALL_PREFIX is set to /home/otavio/software

Am I missing something?
--
Otavio R. Piske - AngusYoung
 www.angusyoung.org
___
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake




--
Erk
___
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake


Re: [CMake] Cmake: INSTALL not working with subdirectories

2007-01-16 Thread Otavio Rodolfo Piske

Hi,

I almost solve the problem! I took a closer look at my top-level
CMakeLists.txt and could find it referencing to a directory that it
shouldn't. After I commented it, it now installs the files of the last
one of the processed modules in the top-level CMakeLists.txt. If you
take a look at it (available at
http://svn.angusyoung.org/nus/CMakeLists.txt ) you'll notice the last
module to be added is MODULE_XML ... so now I have the following
output of make install:

Install the project...
cd /home/otavio/projects/nus/.  /usr/bin/cmake -P cmake_install.cmake
-- Install configuration: Debug
-- Installing /home/otavio/software/usr/share/example/ex_nxmlwrite-1
-- Installing /home/otavio/software/usr/share/example/ex_nxmlwrite-2
-- Installing /home/otavio/software/usr/share/example/ex_nxmlwrite-3
-- Installing /home/otavio/software/usr/share/example/ex_nxmlreader-1
-- Installing /home/otavio/software/usr/share/example/ex_nxmlreader-2
-- Installing /home/otavio/software/usr/share/example/ex_nxmlreader-3
-- Installing /home/otavio/software/usr/lib/libnxml-0.1.so

What I could note in the file cmake_install.cmake is the following comment:

#  Install script for directory: /home/otavio/projects/nus/./src/xml

The directory /home/otavio/projects/nus/./src/xml is where is the
CMakeLists.txt file for the XML module.

Any ideas? Thanks in advance!

On 1/16/07, Eric Noulard [EMAIL PROTECTED] wrote:

Your files looks good to me.
Provider you have properly defined
${N_LIBRARY_DIR}
${N_ARCHIVE_DIR}
*
in your specific include files which seems to be the case for
http://svn.angusyoung.org/nus/CMakeLists.txt.linux

May be you can try a

make VERBOSE=1 install
in order to see a little more what happen during make install step.



2007/1/16, Otavio Rodolfo Piske [EMAIL PROTECTED]:
 Hi all,

 I have been using cmake for my soon-to-be-born project, however I'm
 having problems during the install part.
 Even though I add a target to be installed, it is not installed when I
 run 'make install'.

 Let me provide some details: my project is separated in modules, with
 each module having its own CMakeLists.txt file.

 This is the top-level CMakeLists.txt file:
 http://svn.angusyoung.org/nus/CMakeLists.txt

 And, this is the CMakeLists for one of the modules:
 http://svn.angusyoung.org/nus/src/base/CMakeLists.txt

 So, when I ran 'make install' it does not install libnbase-0.1.so on
 linux neither nbase-0.1.dll on windows.
 Currently, my CMAKE_INSTALL_PREFIX is set to /home/otavio/software

 Am I missing something?
 --
 Otavio R. Piske - AngusYoung
  www.angusyoung.org
 ___
 CMake mailing list
 CMake@cmake.org
 http://www.cmake.org/mailman/listinfo/cmake



--
Erk
___
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake




--
Otavio R. Piske - AngusYoung
www.angusyoung.org
___
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake


Re: [CMake] Cmake: INSTALL not working with subdirectories

2007-01-16 Thread Eric Noulard

2007/1/16, Otavio Rodolfo Piske [EMAIL PROTECTED]:

Hi,

I almost solve the problem! I took a closer look at my top-level
CMakeLists.txt and could find it referencing to a directory that it
shouldn't. After I commented it, it now installs the files of the last
one of the processed modules in the top-level CMakeLists.txt. If you
take a look at it (available at
http://svn.angusyoung.org/nus/CMakeLists.txt ) you'll notice the last
module to be added is MODULE_XML ... so now I have the following
output of make install:



[..]



What I could note in the file cmake_install.cmake is the following comment:

#  Install script for directory: /home/otavio/projects/nus/./src/xml

The directory /home/otavio/projects/nus/./src/xml is where is the
CMakeLists.txt file for the XML module.

Any ideas? Thanks in advance!



Could you explain us why you

ADD_SUBDIRECTORY(
src/network
.
)

instead of
ADD_SUBDIRECTORY(
src/network 
)

do you really want . (dot) to be the binary_dir for the specified
subdir?

I don't know if it is related to your problem but it seems an odd choice to me.

Moreover I don't really understand what are your remaining problems?
What should be installed and is not?



--
Erk
___
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake


[CMake] Cmake: INSTALL not working with subdirectories

2007-01-15 Thread Otavio Rodolfo Piske

Hi all,

I have been using cmake for my soon-to-be-born project, however I'm
having problems during the install part.
Even though I add a target to be installed, it is not installed when I
run 'make install'.

Let me provide some details: my project is separated in modules, with
each module having its own CMakeLists.txt file.

This is the top-level CMakeLists.txt file:
http://svn.angusyoung.org/nus/CMakeLists.txt

And, this is the CMakeLists for one of the modules:
http://svn.angusyoung.org/nus/src/base/CMakeLists.txt

So, when I ran 'make install' it does not install libnbase-0.1.so on
linux neither nbase-0.1.dll on windows.
Currently, my CMAKE_INSTALL_PREFIX is set to /home/otavio/software

Am I missing something?
--
Otavio R. Piske - AngusYoung
www.angusyoung.org
___
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake


Re: [CMake] Cmake Install problems

2006-06-21 Thread Gaetan Lehmann
On Wed, 21 Jun 2006 16:44:17 +0200, Mike Wells [EMAIL PROTECTED]  
wrote:


I am a total newbie in the Linux installation world. I am trying to  
install
cmake under fedora core 5. When I run ./bootstrap in Cmake directory I  
get:

loading initial cache file
/root/ITK/itksnap_build/cmake/CMake/Bootstrap.cmk/InitialCacheFlags.cmake
-- Check for working C compiler: /usr/bin/cc -- works
-- Check for working CXX compiler: /usr/bin/g++ -- works
-- Using Buildname: Linux-g++
CMake Error: This project requires some variables to be set,
and cmake can not find them.
Please set the following variables:
CURSES_INCLUDE_PATH

-- Configuring done
-
CMake has bootstrapped.  Now run make.

I am using bash shell. Now my question is how and were do I set the
CURSES_INCLUDE_PATH?

Thank you for the help in advance.
Mike



Fedora core 5 seems to have a rpm package for cmake.
running yum install cmake as root should do the job.

If you can't log as root, try to run ./configure  make. I build the  
package that way for mandriva.


Gaetan



--
Gaëtan Lehmann
Biologie du Développement et de la Reproduction
INRA de Jouy-en-Josas (France)
tel: +33 1 34 65 29 66fax: 01 34 65 29 09
http://voxel.jouy.inra.fr
___
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake


Re: [CMake] Cmake Install problems

2006-06-21 Thread Alexander Neundorf

 Original-Nachricht 
Datum: Wed, 21 Jun 2006 10:44:17 -0400
Von: Mike Wells [EMAIL PROTECTED]
An: cmake@cmake.org
Betreff: [CMake] Cmake Install problems

 I am a total newbie in the Linux installation world. I am trying to
 install
 cmake under fedora core 5. When I run ./bootstrap in Cmake directory I
 get:
 loading initial cache file
 /root/ITK/itksnap_build/cmake/CMake/Bootstrap.cmk/InitialCacheFlags.cmake
 -- Check for working C compiler: /usr/bin/cc -- works
 -- Check for working CXX compiler: /usr/bin/g++ -- works
 -- Using Buildname: Linux-g++
 CMake Error: This project requires some variables to be set,
 and cmake can not find them.
 Please set the following variables:
 CURSES_INCLUDE_PATH
 
 -- Configuring done
 -
 CMake has bootstrapped.  Now run make.
 
 I am using bash shell. Now my question is how and were do I set the
 CURSES_INCLUDE_PATH?

I'd say the curses or ncurses development package is not installed on your 
system. Install it (at least on SUSE this would be an extra pacjage) and then 
run bootstrap again.

Bye
Alex

-- 


Der GMX SmartSurfer hilft bis zu 70% Ihrer Onlinekosten zu sparen!
Ideal für Modem und ISDN: http://www.gmx.net/de/go/smartsurfer
___
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake