Text archives Help
- From: "James Bigler" <
>
- Cc:
- Subject: [Manta] Re: Re: Re: Make install
- Date: Sat, 7 Jun 2008 23:51:46 -0600
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:subject:cc:in-reply-to:mime-version :content-type:content-transfer-encoding:content-disposition :references; b=gXWCBHBV1GZ1x4nmmnsvVUK2xuZX/mNdXOfclI6UrrsKJdc1hR80mz2vNKn3CpmK/J G886Wty17vxPOjr7jJiuqfcreON+dxy/mnV8WD3qW1RzTZbtRTBWQ65J8VhO7PY71kI5 TvHH5urCNoHmyO3AZrzhY07TivwxvUgm7p1aA=
>
> 2. You need to be more specific as to what files are extra.
>
>
>
>
I use the INSTALL(DIRECTORY ...) to install the include directory. I
>
can't find a regex/pattern to not install files like CMakeFiles and
>
cmake_install.cmake.
Read the documentation for INSTALL (cmake --help-full | less). There
is an option to use a regular expression pattern to only install the
files you want.
INSTALL(DIRECTORY dirs... DESTINATION <dir>
[FILE_PERMISSIONS permissions...]
[DIRECTORY_PERMISSIONS permissions...]
[USE_SOURCE_PERMISSIONS]
[CONFIGURATIONS [Debug|Release|...]]
[COMPONENT <component>]
[[PATTERN <pattern> | REGEX <regex>]
[EXCLUDE] [PERMISSIONS permissions...]] [...])
...
A PATTERN will match only complete file names: the
portion of the full path matching the pattern must occur at the end of
the file name and be preceded by a slash. A REGEX will match any
portion of the full path but it may use '/' and '$' to simulate the
PATTERN behavior. Options following one of these matching expressions
are applied only to files or directories matching them. The EXCLUDE
option will skip the matched file or directory.
...
For CMake questions, you should also check out the CMake mailing list
(
http://www.cmake.org/mailman/listinfo/cmake). It is a really helpful
list.
James
On Fri, Jun 6, 2008 at 11:31 AM, Li-Ta Lo
<
>
wrote:
>
>
On Thu, 2008-06-05 at 22:08 -0600, James Bigler wrote:
>
> 1. Look at the logic of your macro:
>
>
>
> # install for .h files
>
> MACRO(InstallHeaders sources)
>
> SET(__files.h)
>
> FOREACH(__file ${ARGV})
>
> GET_FILENAME_COMPONENT(__fname ${__file} ABSOLUTE)
>
> GET_FILENAME_COMPONENT(__fname.path ${__fname} PATH)
>
> GET_FILENAME_COMPONENT(__fname.name ${__fname} NAME_WE)
>
> # IF ( EXISTS "${__fname.path}/${__fname.name}.h" )
>
>
>
> # Right here you are asking if ${__fname.name}.h exists. The
>
> problem is that this will be true for both file.cc and file.h,
>
> # because you stripped the extension off. You need a better
>
> check to see if it is a header file or not (if this is in fact
>
> # what you are trying to test):
>
> IF ( ${__fname} STREQUAL ${__fname.name}.h )
>
>
>
> STRING(REPLACE "${CMAKE_SOURCE_DIR}/" "" __rel.path ${__fname.path})
>
> SET(__files.h "${__fname.path}/${__fname.name}.h")
>
> INSTALL(FILES ${__files.h} DESTINATION include/${__rel.path})
>
> ENDIF ( EXISTS "${__fname.path}/${__fname.name}.h" )
>
> ENDFOREACH(__file)
>
> ENDMACRO(InstallHeaders)
>
>
>
>
Thanks a lot. I am trying it now.
>
>
> 2. You need to be more specific as to what files are extra.
>
>
>
>
I use the INSTALL(DIRECTORY ...) to install the include directory. I
>
can't find a regex/pattern to not install files like CMakeFiles and
>
cmake_install.cmake.
>
>
Ollie
>
>
Archive powered by MHonArc 2.6.16.