Changeset 1991 for trunk/cmake


Ignore:
Timestamp:
02/15/11 14:48:52 (14 years ago)
Author:
Takeshi Nakazato
Message:

New Development: No

JIRA Issue: No

Ready for Test: Yes

Interface Changes: No

What Interface Changed: Please list interface changes

Test Programs: List test programs

Put in Release Notes: Yes/No

Module(s): Module Names change impacts.

Description: Describe your changes here...

Reordering code.
The variable 'arch' must be set before CMAKE_INSTALL_PREFIX is examined.


File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/cmake/withcasa.cmake

    r1976 r1991  
    33###
    44
    5 
    6 # install directory
    7 # set casaroot
    8 # the regular expression means '../'
    9 #  [^ ] Matches any character(s) not inside the brackets
    10 #  +    Matches preceding pattern one or more times
    11 #  ?    Matches preceding pattern zero or once only
    12 #  $    Mathces at end of a line
    13 string( REGEX REPLACE /[^/]+/?$ "" casaroot ${CMAKE_SOURCE_DIR} )
    14 message( STATUS "casaroot = " ${casaroot} )
    15 
    16 # modules
    17 set( CMAKE_MODULE_PATH ${casaroot}/code/install )
    18 include( config )
    19 include( CASA )
    205
    216# environment dependent settings
     
    5742message( STATUS "arch = " ${arch} )
    5843
    59 # set root directory for installation
    60 set( CMAKE_INSTALL_PREFIX ${casaroot}/${arch} )
     44# install directory
     45#
     46# The layout of the source+install directory trees
     47# is rather hard-coded in much source code. However,
     48# with care CASA can be built and installed elsewhere...
     49#
     50IF(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
     51    # the regular expression means '../'
     52    #  [^ ] Matches any character(s) not inside the brackets
     53    #  +    Matches preceding pattern one or more times
     54    #  ?    Matches preceding pattern zero or once only
     55    #  $    Mathces at end of a line
     56    string( REGEX REPLACE /[^/]+/?$ "" casaroot ${CMAKE_SOURCE_DIR} )
     57    set( CMAKE_INSTALL_PREFIX ${casaroot}/${arch} )
     58ELSE()
     59    set( casaroot ${CMAKE_INSTALL_PREFIX}/.. )
     60ENDIF(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
    6161
     62message( STATUS "casaroot = " ${casaroot} )
     63
     64# modules
     65IF ( EXISTS ${casaroot}/code/install )
     66    set( CMAKE_MODULE_PATH ${casaroot}/code/install )
     67ELSE()
     68    set( CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/../code/install )
     69ENDIF()
     70
     71
     72include( config )
     73include( CASA )
    6274
    6375#
Note: See TracChangeset for help on using the changeset viewer.