Discussion:
[CMake] Copying Files on Windows
Mike Jackson
2006-12-12 16:46:43 UTC
Permalink
I have been trying to copy some files using CMake and not having much luck. Note that basically the same code works fine on OS X and Linux..

#-- If we are on MinGW then copy the required libraries
IF (MINGW)
#=== Copy in the Qt Libs===
SET (QTLIBS
libQtCore.dylib
libQtGui.dylib
)
FOREACH (depLib ${QTLIBS})
ADD_CUSTOM_COMMAND (
TARGET A2BinGui
POST_BUILD
COMMAND ${CMAKE_COMMAND}
ARGS -E copy ${QT_LIBRARY_DIR}/${depLib} "${EXECUTABLE_OUTPUT_PATH}/${depLib}"
)
ENDFOREACH (depLib)
ENDIF (MINGW)


So is there something I am missing? I get the following error when mingw32-make is run:
Error copying file "C:/Developer/SDKs/qt-4.2.2/lib/libQtCore.dylib" to "C:/Workspace/a2bin/Build/Bin".

Could someone have pity on my and let me know what I am doing wrong?

Thanks
Mike Jackson
IMTS
Sean McBride
2006-12-12 16:56:08 UTC
Permalink
Post by Mike Jackson
Error copying file "C:/Developer/SDKs/qt-4.2.2/lib/libQtCore.dylib" to
"C:/Workspace/a2bin/Build/Bin".
Could someone have pity on my and let me know what I am doing wrong?
Could it be as simple as changing those '/' to '\'? The path separator
on Windows is a /, right?
--
____________________________________________________________
Sean McBride, B. Eng ***@rogue-research.com
Rogue Research www.rogue-research.com
Mac Software Developer Montréal, Québec, Canada
Mike Jackson
2006-12-12 17:00:54 UTC
Permalink
I don't have any control over what the slashes are. CMake is doing all that for me .. or at least I thought.. it seem kinda strange that CMake was throwing / instead of \ for the paths..

Mike


-----Original Message-----
From: Sean McBride [mailto:***@rogue-research.com]
Sent: Tue 12/12/2006 11:56 AM
To: Mike Jackson; ***@cmake.org
Cc:
Subject: Re: [CMake] Copying Files on Windows
Post by Mike Jackson
Error copying file "C:/Developer/SDKs/qt-4.2.2/lib/libQtCore.dylib" to
"C:/Workspace/a2bin/Build/Bin".
Could someone have pity on my and let me know what I am doing wrong?
Could it be as simple as changing those '/' to '\'? The path separator
on Windows is a /, right?
--
____________________________________________________________
Sean McBride, B. Eng ***@rogue-research.com
Rogue Research www.rogue-research.com
Mac Software Developer Montréal, Québec, Canada
Christian Ehrlicher
2006-12-12 17:10:56 UTC
Permalink
Post by Mike Jackson
I have been trying to copy some files using CMake and not having much luck. Note that basically the same code works fine on OS X and Linux..
#-- If we are on MinGW then copy the required libraries
IF (MINGW)
#=== Copy in the Qt Libs===
SET (QTLIBS
libQtCore.dylib
libQtGui.dylib
)
FOREACH (depLib ${QTLIBS})
ADD_CUSTOM_COMMAND (
TARGET A2BinGui
POST_BUILD
COMMAND ${CMAKE_COMMAND}
ARGS -E copy ${QT_LIBRARY_DIR}/${depLib} "${EXECUTABLE_OUTPUT_PATH}/${depLib}"
)
ENDFOREACH (depLib)
ENDIF (MINGW)
Error copying file "C:/Developer/SDKs/qt-4.2.2/lib/libQtCore.dylib" to "C:/Workspace/a2bin/Build/Bin".
Could someone have pity on my and let me know what I am doing wrong?
Did you thought about that there is no libQtCore.dylib and
libQtGui.dylib on windows? And why do you need to copy those libs??

Christian
Mike Jackson
2006-12-12 17:22:14 UTC
Permalink
There is if I BUILT them. And yes they are in the location specified.

I need to copy the libraries so I can have an operational Qt/MinGW based Application. The systems that I am deploying to are very tightly locked down windows XP systems. The users only have write permissions on a "D:" drive and they do not generally have the know how to change their environment variables. They just want an App where they double click the .exe file and go.

Qt provides me with my cross platform GUI toolkit so I need to copy the dlls from the location they were built at into the binary directory so I can just pack up the binary directory and be down with it.

Mike



-----Original Message-----
From: Christian Ehrlicher [mailto:***@gmx.de]
Sent: Tue 12/12/2006 12:10 PM
To: ***@cmake.org
Cc: Mike Jackson
Subject: Re: [CMake] Copying Files on Windows


Did you thought about that there is no libQtCore.dylib and
libQtGui.dylib on windows? And why do you need to copy those libs??
Christian Ehrlicher
2006-12-12 17:25:57 UTC
Permalink
Post by Mike Jackson
There is if I BUILT them. And yes they are in the location specified.
I need to copy the libraries so I can have an operational Qt/MinGW based Application. The systems that I am deploying to are very tightly locked down windows XP systems. The users only have write permissions on a "D:" drive and they do not generally have the know how to change their environment variables. They just want an App where they double click the .exe file and go.
Qt provides me with my cross platform GUI toolkit so I need to copy the dlls from the location they were built at into the binary directory so I can just pack up the binary directory and be down with it.
Sounds like a task for cpack...

Christian
David Cole
2006-12-12 17:36:17 UTC
Permalink
Are they really named ".dylib"...? They shouldn't be under a mingw build...
.dylib is a Mac specific file name extension, isn't it?
Post by Mike Jackson
Post by Mike Jackson
There is if I BUILT them. And yes they are in the location specified.
I need to copy the libraries so I can have an operational Qt/MinGW based
Application. The systems that I am deploying to are very tightly locked down
windows XP systems. The users only have write permissions on a "D:" drive
and they do not generally have the know how to change their environment
variables. They just want an App where they double click the .exe file and
go.
Post by Mike Jackson
Qt provides me with my cross platform GUI toolkit so I need to copy the
dlls from the location they were built at into the binary directory so I can
just pack up the binary directory and be down with it.
Sounds like a task for cpack...
Christian
_______________________________________________
CMake mailing list
http://www.cmake.org/mailman/listinfo/cmake
Mike Jackson
2006-12-12 17:54:39 UTC
Permalink
Wow.. couldn't see the forest for the trees on that one.. So I changed the Cmake code a bit..
#-- If we are on MinGW then copy the required libraries
IF (MINGW)
#=== Copy in the Qt Libs===
SET (QTLIBS
libQtCore4.dll
libQtGui4.dll
)
FOREACH (depLib ${QTLIBS})
ADD_CUSTOM_COMMAND (
TARGET A2BinGui
POST_BUILD
COMMAND ${CMAKE_COMMAND}
ARGS -E copy ${QT_LIBRARY_DIR}/${depLib} "${EXECUTABLE_OUTPUT_PATH}/"
)
ENDFOREACH (depLib)
ENDIF (MINGW)

but I still get the same error.
Error copying file "C:/Developer/SDKs/qt-4.2.2/lib/libQtCore4.dll" to "C:/Workspace/a2bin/Build/Bin/"

I have verified that the initial file is where the path says it is..

Any more ideas?

Mike



-----Original Message-----
From: cmake-bounces+mike.jackson=***@cmake.org on behalf of David Cole
Sent: Tue 12/12/2006 12:36 PM
To: Christian Ehrlicher
Cc: ***@cmake.org
Subject: Re: [CMake] Copying Files on Windows

Are they really named ".dylib"...? They shouldn't be under a mingw build...
.dylib is a Mac specific file name extension, isn't it?
Post by Mike Jackson
Post by Mike Jackson
There is if I BUILT them. And yes they are in the location specified.
I need to copy the libraries so I can have an operational Qt/MinGW based
Application. The systems that I am deploying to are very tightly locked down
windows XP systems. The users only have write permissions on a "D:" drive
and they do not generally have the know how to change their environment
variables. They just want an App where they double click the .exe file and
go.
Post by Mike Jackson
Qt provides me with my cross platform GUI toolkit so I need to copy the
dlls from the location they were built at into the binary directory so I can
just pack up the binary directory and be down with it.
Sounds like a task for cpack...
Christian
_______________________________________________
CMake mailing list
http://www.cmake.org/mailman/listinfo/cmake
Christian Ehrlicher
2006-12-12 17:55:19 UTC
Permalink
Post by Mike Jackson
Wow.. couldn't see the forest for the trees on that one.. So I changed the Cmake code a bit..
#-- If we are on MinGW then copy the required libraries
IF (MINGW)
#=== Copy in the Qt Libs===
SET (QTLIBS
libQtCore4.dll
libQtGui4.dll
)
FOREACH (depLib ${QTLIBS})
ADD_CUSTOM_COMMAND (
TARGET A2BinGui
POST_BUILD
COMMAND ${CMAKE_COMMAND}
ARGS -E copy ${QT_LIBRARY_DIR}/${depLib} "${EXECUTABLE_OUTPUT_PATH}/"
)
ENDFOREACH (depLib)
ENDIF (MINGW)
but I still get the same error.
Error copying file "C:/Developer/SDKs/qt-4.2.2/lib/libQtCore4.dll" to "C:/Workspace/a2bin/Build/Bin/"
I have verified that the initial file is where the path says it is..
No - there is also no libQtCore4.dll on windows... why don't you use the
cmake vars for this as I asked earlier?

Christian
Mike Jackson
2006-12-12 18:08:14 UTC
Permalink
OK.. I guess I am just new to this whole software development thing and computer thing.. those 8 years are just NOT paying off..

I built Qt.. All of Qt.. Every Single Bit of Qt. this INCLUDES the libQt*.dll files. The files are there. I built them. I installed them. I can see them from Windows Explorer. The files are there.. Granted I did not have the naming correct in the first post but now everything except the "/" seems correct. I have NO control over how CMake puts the path separators in.

Let's take a step back from this for a sec. I re-read the "Mastering CMake" book section that deals with this.
David Cole
2006-12-12 18:11:12 UTC
Permalink
All of the dll files in your listing begin with "Qt" -- all of the .a files
begin with "libQt" -- if you want to copy the dll files, use the exact name
of the dll files as input... So. Begin them with "Qt" and not "libQt"...

Is it Monday?
;)
Post by Mike Jackson
OK.. I guess I am just new to this whole software development thing and
computer thing.. those 8 years are just NOT paying off..
I built Qt.. All of Qt.. Every Single Bit of Qt. this INCLUDES the
libQt*.dll files. The files are there. I built them. I installed them. I can
see them from Windows Explorer. The files are there.. Granted I did not have
the naming correct in the first post but now everything except the "/" seems
correct. I have NO control over how CMake puts the path separators in.
Let's take a step back from this for a sec. I re-read the "Mastering
Mike Jackson
2006-12-12 18:48:23 UTC
Permalink
I'm an idiot.. that solved it.. Thanks.. Just used to a different naming scheme and the eye sees one thing and the mind sees something else..

Thanks for being the extra set of eyes that I needed. You guys rock.

Mike Jackson



-----Original Message-----
From: David Cole [mailto:***@kitware.com]
Sent: Tue 12/12/2006 1:11 PM
To: Mike Jackson
Cc: Christian Ehrlicher; ***@cmake.org
Subject: Re: [CMake] Copying Files on Windows

All of the dll files in your listing begin with "Qt" -- all of the .a files
begin with "libQt" -- if you want to copy the dll files, use the exact name
of the dll files as input... So. Begin them with "Qt" and not "libQt"...

Is it Monday?
;)
Post by Mike Jackson
OK.. I guess I am just new to this whole software development thing and
computer thing.. those 8 years are just NOT paying off..
I built Qt.. All of Qt.. Every Single Bit of Qt. this INCLUDES the
libQt*.dll files. The files are there. I built them. I installed them. I can
see them from Windows Explorer. The files are there.. Granted I did not have
the naming correct in the first post but now everything except the "/" seems
correct. I have NO control over how CMake puts the path separators in.
Let's take a step back from this for a sec. I re-read the "Mastering
CMake" book section that deals with this.
Christian Ehrlicher
2006-12-12 18:17:16 UTC
Permalink
Post by Mike Jackson
OK.. I guess I am just new to this whole software development thing and computer thing.. those 8 years are just NOT paying off..
I built Qt.. All of Qt.. Every Single Bit of Qt. this INCLUDES the libQt*.dll files. The files are there. I built them. I installed them. I can see them from Windows Explorer. The files are there.. Granted I did not have the naming correct in the first post but now everything except the "/" seems correct. I have NO control over how CMake puts the path separators in.
Let's take a step back from this for a sec. I re-read the "Mastering CM
Alan W. Irwin
2006-12-12 18:32:20 UTC
Permalink
Mike, the bottom line is cmake -E copy should just work on any platform, and
you may have found a bug in it for some MinGW variation and/or cmake
back-end generator.

So as not to get distracted by all the special details of your project,
I suggest you give a really simple example which anybody with access to
MinGW can replicate, and also give all the details for your MinGW platform.
For example, is it pure MinGW or MinGW/MSYS? What version of cmake are
you using and what cmake back-end generator?

I don't have access to MinGW myself, but our PLplot cmake build system uses
cmake -E copy, and our MinGW users have not reported any problems with it.

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 Yorick front-end to PLplot (yplot.sf.net); the
Loads of Linux Links project (loll.sf.net); and the Linux Brochure Project
(lbproject.sf.net).
__________________________

Linux-powered Science
__________________________
Bill Hoffman
2006-12-12 18:35:21 UTC
Permalink
Post by Mike Jackson
but I still get the same error.
Error copying file "C:/Developer/SDKs/qt-4.2.2/lib/libQtCore4.dll" to "C:/Workspace/a2bin/Build/Bin/"
I have verified that the initial file is where the path says it is..
You might want to try running cmake -E copy by hand from the command
prompt to see if you can get it to work. The direction of the \ should
not matter to CMake, internally it uses posix / even on windows as c++
does as well. I would experiment with cmake -E copy on the command
line trying several combinations. Did you build this cmake with mingw
or is it the standard windows cmake?
Try some stuff like this:

cmake -E copy C:/Developer/SDKs/qt-4.2.2/lib/libQtCore4.dll c:/foo.dll
cmake -E copy C:/Developer/SDKs/qt-4.2.2/lib/libQtCore4.dll c:/
Bill Hoffman
2006-12-12 18:38:07 UTC
Permalink
Post by Mike Jackson
but I still get the same error.
Error copying file "C:/Developer/SDKs/qt-4.2.2/lib/libQtCore4.dll" to "C:/Workspace/a
Actually, from your previous directory listing the file is called:

QtCore4.dll

and not libQtCore4.dll, note the missing lib...

-Bill
Christian Ehrlicher [mailto:]
1970-01-01 00:00:00 UTC
Permalink
I am wrong and I still don't have a clue (Most likely)
CMake doesn't support the copying under mingw makefiles. (Least likely)

Here is the directory listing for my Qt Build. Which was built with =
MinGW.
Directory: =
Microsoft.PowerShell.Core\FileSystem::C:\Developer\SDKs\qt-4.2.2\lib


Mode LastWriteTime Length Name =
=20
---- ------------- ------ ---- =
=20
-a--- 12/11/2006 2:04 PM 18700 libQtAssistantClient4.a =
=20
-a--- 12/11/2006 1:53 PM 1728682 libQtCore4.a =
=20
-a--- 12/11/2006 2:08 PM 2018498 libQtDesigner4.a =
=20
-a--- 12/11/2006 2:10 PM 12636 libQtDesignerComponents4.a =
=20
-a--- 12/11/2006 2:01 PM 6324386 libQtGui4.a =
=20
-a--- 12/11/2006 1:49 PM 4622 libqtmain.a =
=20
-a--- 12/11/2006 2:02 PM 304072 libQtNetwork4.a =
=20
-a--- 12/11/2006 2:03 PM 153046 libQtOpenGL4.a =
=20
-a--- 12/11/2006 2:01 PM 290158 libQtSql4.a =
=20
-a--- 12/11/2006 2:02 PM 77426 libQtSvg4.a =
=20
-a--- 12/11/2006 2:05 PM 40066 libQtTest4.a =
=20
-a--- 12/11/2006 2:06 PM 1010752 libQtUiTools.a =
=20
-a--- 12/11/2006 2:06 PM 6821400 libQtUiToolsd.a =
=20
-a--- 12/11/2006 1:54 PM 342170 libQtXml4.a =
=20
-a--- 12/12/2006 1:06 PM 4060 more.txt =
=20
-a--- 12/11/2006 2:04 PM 696 QtAssistantClient.prl =
=20
-a--- 12/11/2006 2:04 PM 43008 QtAssistantClient4.dll =
=20
-a--- 12/11/2006 2:04 PM 661 QtAssistantClientd.prl =
=20
-a--- 12/11/2006 1:52 PM 775 QtCore.prl =
=20
-a--- 12/11/2006 1:53 PM 1889792 QtCore4.dll =
=20
-a--- 12/11/2006 1:52 PM 740 QtCored.prl =
=20
-a--- 12/11/2006 2:06 PM 706 QtDesigner.prl =
=20
-a--- 12/11/2006 2:08 PM 1823232 QtDesigner4.dll =
=20
-a--- 12/11/2006 2:08 PM 738 QtDesignerComponents.prl =
=20
-a--- 12/11/2006 2:10 PM 1785344 QtDesignerComponents4.dll =
=20
-a--- 12/11/2006 2:08 PM 703 QtDesignerComponentsd.prl =
=20
-a--- 12/11/2006 2:06 PM 671 QtDesignerd.prl =
=20
-a--- 12/11/2006 1:54 PM 766 QtGui.prl =
=20
-a--- 12/11/2006 2:01 PM 7656960 QtGui4.dll =
=20
-a--- 12/11/2006 1:54 PM 731 QtGuid.prl =
=20
-a--- 12/11/2006 1:49 PM 817 qtmain.prl =
=20
-a--- 12/11/2006 1:49 PM 782 qtmaind.prl =
=20
-a--- 12/11/2006 2:01 PM 778 QtNetwork.prl =
=20
-a--- 12/11/2006 2:02 PM 463872 QtNetwork4.dll =
=20
-a--- 12/11/2006 2:01 PM 743 QtNetworkd.prl =
=20
-a--- 12/11/2006 2:02 PM 782 QtOpenGL.prl =
=20
-a--- 12/11/2006 2:03 PM 242688 QtOpenGL4.dll =
=20
-a--- 12/11/2006 2:02 PM 747 QtOpenGLd.prl =
=20
-a--- 12/11/2006 2:01 PM 766 QtSql.prl =
=20
-a--- 12/11/2006 2:01 PM 605696 QtSql4.dll =
=20
-a--- 12/11/2006 2:01 PM 731 QtSqld.prl =
=20
-a--- 12/11/2006 2:02 PM 766 QtSvg.prl =
=20
-a--- 12/11/2006 2:02 PM 353280 QtSvg4.dll =
=20
-a--- 12/11/2006 2:02 PM 731 QtSvgd.prl =
=20
-a--- 12/11/2006 2:05 PM 677 QtTest.prl =
=20
-a--- 12/11/2006 2:05 PM 74240 QtTest4.dll =
=20
-a--- 12/11/2006 2:05 PM 642 QtTestd.prl =
=20
-a--- 12/11/2006 2:05 PM 740 QtUiTools.prl =
=20
-a--- 12/11/2006 2:05 PM 708 QtUiToolsd.prl =
=20
-a--- 12/11/2006 1:53 PM 766 QtXml.prl =
=20
-a--- 12/11/2006 1:54 PM 319488 QtXml4.dll =
=20
-a--- 12/11/2006 1:53 PM 731 QtXmld.prl =
=20
-a--- 11/27/2006 6:11 PM 76 README =
=20

I hope that helps clear up what I have on my system.

Mike

-----Original Message-----
From: Christian Ehrlicher [mailto:***@gmx.de]
Sent: Tue 12/12/2006 12:55 PM
To: ***@cmake.org
Cc: Mike Jackson
Subject: Re: [CMake] Copying Files on Windows
Wow.. couldn't see the forest for the trees on that one.. So I changed =
the Cmake code a bit..
#-- If we are on MinGW then copy the required libraries
IF (MINGW)
#=3D=3D=3D Copy in the Qt Libs=3D=3D=3D
SET (QTLIBS
libQtCore4.dll
libQtGui4.dll
)
FOREACH (depLib ${QTLIBS})
ADD_CUSTOM_COMMAND (
TARGET A2BinGui
POST_BUILD
COMMAND ${CMAKE_COMMAND}
ARGS -E copy ${QT_LIBRARY_DIR}/${depLib} =
"${EXECUTABLE_OUTPUT_PATH}/"
)
ENDFOREACH (depLib)
ENDIF (MINGW)
but I still get the same error.
Error copying file "C:/Developer/SDKs/qt-4.2.2/lib/libQtCore4.dll" to =
"C:/Workspace/a2bin/Build/Bin/"
I have verified that the initial file is where the path says it is..
No - there is also no libQtCore4.dll on windows... why don't you use the
cmake vars for this as I asked earlier?

Christian
Continue reading on narkive:
Loading...