Changeset 7312


Ignore:
Timestamp:
08/30/11 13:29:27 (3 years ago)
Author:
briadam
Message:

Syncing acro-coliny with CMake changes from r7306 and r7309.

Location:
acro-coliny/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • acro-coliny/trunk/CMakeLists.txt

    r7251 r7312  
    44set(ExportTarget ${CMAKE_PROJECT_NAME}-targets CACHE STRING  
    55  "Name for the export target for ${CMAKE_PROJECT_NAME}") 
     6 
     7function(AcroCheckDirExists dirPath) 
     8  get_filename_component(dirName ${dirPath} NAME) 
     9  if(EXISTS ${dirPath}) 
     10    string(TOUPPER "${dirName}" DIRNAME) 
     11    option(HAVE_${DIRNAME} "Build with ${dirName} enabled?" ON) 
     12  endif() 
     13endfunction() 
    614 
    715add_subdirectory(tpl) 
  • acro-coliny/trunk/packages/CMakeLists.txt

    r7222 r7312  
    1111# generate acro_config.h 
    1212function(FindOptionalLibrary library) 
    13   option(ACRO_USING_${library} "Should Acro use ${library}?" OFF) 
     13  option(HAVE_${library} "Should Acro use ${library}?" OFF) 
    1414  if(${library}_LIB OR ${library}_LIBS) 
    15     set(ACRO_USING_${library} ON CACHE BOOL "Should Acro use ${library}?" FORCE) 
     15    set(HAVE_${library} ON CACHE BOOL "Should Acro use ${library}?" FORCE) 
    1616  endif() 
    17   if(ACRO_USING_${library}) 
     17  if(HAVE_${library}) 
    1818    string(TOLOWER ${library} library_lower) 
    1919    find_library(${library}_LIB ${library_lower}) 
     
    3131CHECK_INCLUDE_FILES("values.h" HAVE_VALUES_H) 
    3232 
    33 option(ACRO_USING_APPSPACK "Build with appspack enabled?" OFF) 
    34 option(ACRO_USING_BOOST "Should Acro use BOOST?" OFF) 
    35 option(ACRO_USING_CLP "Build with clp enabled?" OFF) 
    36 option(ACRO_USING_COBYLA "Build with cobyla enabled?" ON) 
    37 option(ACRO_USING_COLIN "Build COLIN?" OFF) 
    38 option(ACRO_USING_GLPK "Build with glpk enabled?" OFF) 
    39 option(ACRO_USING_MPI "Should Acro use MPI?" OFF) 
    40 option(ACRO_USING_NPSOL "Build with npsol enabled?" OFF) 
    41 option(ACRO_USING_OPTPP "Build with optpp enabled?" OFF) 
    42 option(ACRO_USING_PEBBL "Build with pebbl enabled?" OFF) 
    43 option(ACRO_USING_PICO "Build with Pico enabled?" OFF) 
    44 option(ACRO_USING_PLGO "Build with plgo enabled?" OFF) 
    45 option(ACRO_USING_SCOLIB "Build with scolib enabled?" OFF) 
    46 option(ACRO_USING_SOPLEX "Build with soplex enabled?" OFF) 
    47 option(ACRO_USING_SUNDRY "Build with Sundry enabled?" OFF) 
    48 option(ACRO_USING_UTILIB "Build with UTILIB enabled?" OFF) 
     33set(packages  
     34  "${CMAKE_CURRENT_SOURCE_DIR}/colin" 
     35  "${CMAKE_CURRENT_SOURCE_DIR}/interfaces" 
     36  "${CMAKE_CURRENT_SOURCE_DIR}/jega" 
     37  "${CMAKE_CURRENT_SOURCE_DIR}/optpp" 
     38  "${CMAKE_CURRENT_SOURCE_DIR}/pebbl" 
     39  "${CMAKE_CURRENT_SOURCE_DIR}/pico" 
     40  "${CMAKE_CURRENT_SOURCE_DIR}/scolib" 
     41  "${CMAKE_CURRENT_SOURCE_DIR}/sundry" 
     42  "${CMAKE_CURRENT_SOURCE_DIR}/utilib") 
     43 
     44foreach(package ${packages}) 
     45  AcroCheckDirExists("${package}") 
     46endforeach() 
     47 
     48option(HAVE_BOOST "Should Acro use BOOST?" OFF) 
     49option(HAVE_MPI "Should Acro use MPI?" OFF) 
    4950option(VALIDATING "Turn on code validation tests?" OFF) 
    5051 
    5152#enable some required packages if acro is being built as a subproject of dakota 
    5253if(Dakota_SOURCE_DIR) 
    53   set(ACRO_USING_BOOST ON CACHE BOOL "Should Acro use BOOST?" FORCE) 
    54   set(ACRO_USING_COLIN ON CACHE BOOL "Build with COLIN enabled?" FORCE) 
    55   set(ACRO_USING_UTILIB ON CACHE BOOL "Build with UTILIB enabled?" FORCE) 
    56   set(ACRO_USING_SCOLIB ON CACHE BOOL "Build with SCOLIB enabled?" FORCE) 
    57   set(ACRO_USING_INTERFACES ON CACHE BOOL "Build with INTERFACES enabled?" FORCE) 
    58   set(ACRO_USING_PEBBL ON CACHE BOOL "Build with PEBBL enabled?" FORCE) 
     54  set(HAVE_BOOST ON CACHE BOOL "Should Acro use BOOST?" FORCE) 
     55  set(HAVE_COLIN ON CACHE BOOL "Build with COLIN enabled?" FORCE) 
     56  set(HAVE_UTILIB ON CACHE BOOL "Build with UTILIB enabled?" FORCE) 
     57  set(HAVE_SCOLIB ON CACHE BOOL "Build with SCOLIB enabled?" FORCE) 
     58  set(HAVE_INTERFACES ON CACHE BOOL "Build with INTERFACES enabled?" FORCE) 
     59  set(HAVE_PEBBL ON CACHE BOOL "Build with PEBBL enabled?" FORCE) 
    5960endif() 
    6061 
     
    6566include_directories(${Acro-Packages_BINARY_DIR}) 
    6667 
    67 if(ACRO_USING_BOOST) 
     68if(HAVE_BOOST) 
    6869  if(BUILD_SHARED_LIBS) 
    6970    set(Boost_USE_STATIC_LIBS OFF) 
     
    7677endif() 
    7778 
    78 if(ACRO_USING_MOMHLIB) 
     79if(HAVE_MOMHLIB) 
    7980  find_path(MOMHLIB_DIR libmomh-config.h DOC "Path to directory containing libmomh-config.h") 
    8081  find_path(SIGCPP_DIR sigc++/sigc++.h DOC "Path to directory containing sigc++.h") 
    8182  find_path(SIGCPPCONFIG_DIR sigc++config.h DOC "Path to directory containing sigc++config.h") 
    8283  if(NOT MOMHLIB_DIR) 
    83     message(SEND_ERROR "ACRO_USING_MOMHLIB is ON, but MOMHLIB_DIR is not found.  Please set MOMHLIB_DIR to the location of libmomh-config.h") 
     84    message(SEND_ERROR "HAVE_MOMHLIB is ON, but MOMHLIB_DIR is not found.  Please set MOMHLIB_DIR to the location of libmomh-config.h") 
    8485  endif() 
    8586  if(NOT SIGCPP_DIR) 
    86     message(SEND_ERROR "ACRO_USING_MOMHLIB is ON, but SIGCPP_DIR is not found.  Please set SIGCPP_DIR to the location of sigc++/sigc++.h") 
     87    message(SEND_ERROR "HAVE_MOMHLIB is ON, but SIGCPP_DIR is not found.  Please set SIGCPP_DIR to the location of sigc++/sigc++.h") 
    8788  endif() 
    8889  if(NOT SIGCPPCONFIG_DIR) 
    89     message(SEND_ERROR "ACRO_USING_MOMHLIB is ON, but SIGCPPCONFIG_DIR is not found.  Please set SIGCPPCONFIG_DIR to the location of sigc++config.h") 
     90    message(SEND_ERROR "HAVE_MOMHLIB is ON, but SIGCPPCONFIG_DIR is not found.  Please set SIGCPPCONFIG_DIR to the location of sigc++config.h") 
    9091  endif() 
    9192  set(MOMHLIB_INCLUDE_DIRS ${MOMHLIB_DIR} ${SIGCPP_DIR} ${SIGCPPCONFIG_DIR}) 
    9293endif() 
    9394 
    94 if(ACRO_USING_MPI) 
     95if(HAVE_MPI) 
    9596  find_package(MPI) 
    9697endif() 
    9798 
    9899 
    99 if(ACRO_USING_TINYXML) 
     100if(HAVE_TINYXML) 
    100101  find_path(TINYXML_DIR tinyxml.h DOC "Path to directory containing tinyxml.h") 
    101102  if(NOT TINYXML_DIR) 
    102     message(SEND_ERROR "ACRO_USING_TINYXML is ON, but TINYXML_DIR is not found.  Please set TINYXML_DIR to the location of tinyxml/tinyxml.h") 
     103    message(SEND_ERROR "HAVE_TINYXML is ON, but TINYXML_DIR is not found.  Please set TINYXML_DIR to the location of tinyxml/tinyxml.h") 
    103104  endif() 
    104105endif() 
    105106 
    106107if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/optpp) 
    107   if(ACRO_USING_OPTPP) 
     108  if(HAVE_OPTPP) 
    108109    add_subdirectory(optpp) 
    109110  endif() 
    110111else() 
    111112  if(HAVE_OPTPP AND OPTPP_INCLUDE_DIRS)  
    112     set(ACRO_USING_OPTPP ON CACHE BOOL "Build with optpp enabled?" FORCE) 
     113    set(HAVE_OPTPP ON CACHE BOOL "Build with optpp enabled?" FORCE) 
    113114  else() 
    114     set(ACRO_USING_OPTPP OFF CACHE BOOL "Build with optpp enabled?" FORCE) 
    115     mark_as_advanced(FORCE ACRO_USING_OPTPP) 
     115    set(HAVE_OPTPP OFF CACHE BOOL "Build with optpp enabled?" FORCE) 
     116    mark_as_advanced(FORCE HAVE_OPTPP) 
    116117  endif() 
    117118endif() 
    118119 
    119 if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/sundry) 
    120   if(ACRO_USING_SUNDRY) 
    121     add_subdirectory(sundry) 
    122   endif() 
    123 else() 
    124   set(ACRO_USING_SUNDRY OFF CACHE BOOL "Build with Sundry enabled?" FORCE) 
    125   mark_as_advanced(FORCE ACRO_USING_SUNDRY) 
     120if(HAVE_SUNDRY) 
     121  add_subdirectory(sundry) 
    126122endif() 
    127123 
    128 if(ACRO_USING_UTILIB) 
    129   if(ACRO_USING_BOOST) 
    130     set(UTILIB_HAVE_BOOST ON) 
    131     set(UTILIB_USE_BOOST ON) 
    132   endif() 
    133   if(NOT ACRO_USING_TINYXML) 
    134     set(ACRO_USING_TINYXML ON CACHE BOOL "Build with tinyxml enabled?" FORCE) 
    135   endif() 
     124if(HAVE_UTILIB) 
    136125  add_subdirectory(utilib) 
    137126endif() 
    138127 
    139 if(ACRO_USING_COLIN) 
    140   if(NOT ACRO_USING_UTILIB) 
    141     message(SEND_ERROR " ACRO_USING_COLIN requires ACRO_USING_UTILIB to be turned ON") 
     128if(HAVE_COLIN) 
     129  if(NOT HAVE_UTILIB) 
     130    message(SEND_ERROR " HAVE_COLIN requires HAVE_UTILIB to be turned ON") 
    142131  endif() 
    143   if(NOT ACRO_USING_BOOST) 
    144     message(SEND_ERROR " ACRO_USING_COLIN requires ACRO_USING_BOOST to be turned ON") 
     132  if(NOT HAVE_BOOST) 
     133    message(SEND_ERROR " HAVE_COLIN requires HAVE_BOOST to be turned ON") 
    145134  endif() 
    146135  add_subdirectory(colin) 
    147136endif() 
    148137 
    149 if(ACRO_USING_PEBBL) 
    150   if(NOT ACRO_USING_UTILIB) 
    151     message(ERROR " ACRO_USING_PEBBL requires ACRO_USING_UTILIB to be turned ON") 
     138if(HAVE_PEBBL) 
     139  if(NOT HAVE_UTILIB) 
     140    message(ERROR " HAVE_PEBBL requires HAVE_UTILIB to be turned ON") 
    152141  endif() 
    153142  include_directories(${CMAKE_CURRENT_SOURCE_DIR}/utilib/src 
     
    156145endif() 
    157146 
    158 if(ACRO_USING_SCOLIB) 
    159   if(NOT ACRO_USING_PEBBL) 
    160     message(ERROR " ACRO_USING_SCOLIB requires ACRO_USING_PEBBL to be turned ON") 
     147if(HAVE_SCOLIB) 
     148  if(NOT HAVE_PEBBL) 
     149    message(ERROR " HAVE_SCOLIB requires HAVE_PEBBL to be turned ON") 
    161150  endif() 
    162   if(NOT ACRO_USING_UTILIB) 
    163     message(ERROR " ACRO_USING_SCOLIB requires ACRO_USING_UTILIB to be turned ON") 
     151  if(NOT HAVE_UTILIB) 
     152    message(ERROR " HAVE_SCOLIB requires HAVE_UTILIB to be turned ON") 
    164153  endif() 
    165   if(NOT ACRO_USING_COLIN) 
    166       message(ERROR " ACRO_USING_SCOLIB requires ACRO_USING_COLIN to be turned ON") 
     154  if(NOT HAVE_COLIN) 
     155      message(ERROR " HAVE_SCOLIB requires HAVE_COLIN to be turned ON") 
    167156  endif() 
    168157  include_directories(${CMAKE_CURRENT_SOURCE_DIR}/pebbl/src 
     
    178167endif() 
    179168 
    180 if(ACRO_USING_INTERFACES) 
    181   if(NOT ACRO_USING_OPTPP) 
    182     message(SEND_ERROR " ACRO_USING_INTERFACES requires ACRO_USING_OPTPP to be turned ON") 
     169if(HAVE_INTERFACES) 
     170  if(NOT HAVE_OPTPP) 
     171    message(SEND_ERROR " HAVE_INTERFACES requires HAVE_OPTPP to be turned ON") 
    183172  endif() 
    184   if(NOT ACRO_USING_SCOLIB) 
    185     message(SEND_ERROR " ACRO_USING_INTERFACES requires ACRO_USING_SCOLIB to be turned ON") 
     173  if(NOT HAVE_SCOLIB) 
     174    message(SEND_ERROR " HAVE_INTERFACES requires HAVE_SCOLIB to be turned ON") 
    186175  endif() 
    187   if(NOT ACRO_USING_COLIN) 
    188     message(SEND_ERROR " ACRO_USING_INTERFACES requires ACRO_USING_COLIN to be turned ON") 
     176  if(NOT HAVE_COLIN) 
     177    message(SEND_ERROR " HAVE_INTERFACES requires HAVE_COLIN to be turned ON") 
    189178  endif() 
    190179  include_directories( 
     
    198187endif() 
    199188 
    200 if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/pico) 
    201   if(ACRO_USING_PICO) 
    202     if(NOT ACRO_USING_PEBBL) 
    203       message(SEND_ERROR " ACRO_USING_PICO requires ACRO_USING_PEBBL to be turned ON") 
    204     endif() 
    205     add_subdirectory(pico) 
     189if(HAVE_PICO) 
     190  if(NOT HAVE_PEBBL) 
     191    message(SEND_ERROR " HAVE_PICO requires HAVE_PEBBL to be turned ON") 
    206192  endif() 
    207 else() 
    208   set(ACRO_USING_PICO OFF CACHE BOOL "Build with Pico enabled?" FORCE) 
    209   mark_as_advanced(FORCE ACRO_USING_PICO) 
     193  add_subdirectory(pico) 
    210194endif() 
    211  
    212 #and the rest are docs... 
    213 #don't ignore them, but concentrate on the meat first. 
    214  
    215 #if BUILD_INTERFACES 
    216 #   MAKE_INTERFACES_DOC=cd interfaces/doc && $(MAKE) docs 
    217 #endif 
    218 #if BUILD_COLIN 
    219 #   MAKE_COLIN_DOC=cd colin/doc && $(MAKE) docs 
    220 #endif 
    221 #if BUILD_SCOLIB 
    222 #   MAKE_SCOLIB_DOC=cd scolib/doc && $(MAKE) docs 
    223 #endif 
    224 #if BUILD_PEBBL 
    225 #   MAKE_PEBBL_DOC=cd pebbl/doc && $(MAKE) docs 
    226 #endif 
    227 #if BUILD_PICO 
    228 #   MAKE_PICO_DOC=cd pico/doc && $(MAKE) docs 
    229 #endif 
    230 #if BUILD_PARPCX 
    231 #   MAKE_PARPCX_DOC=cd parpcx/doc && $(MAKE) docs 
    232 #endif 
    233 #if BUILD_GNLP 
    234 #   MAKE_GNLP_DOC=cd gnlp/doc && $(MAKE) docs 
    235 #endif 
    236 #if BUILD_TMF 
    237 #   MAKE_TMF_DOC=cd tmf/doc && $(MAKE) docs 
    238 #endif 
    239 #if BUILD_SACACHE 
    240 #   MAKE_SACACHE_DOC=cd sacache/doc && $(MAKE) docs 
    241 #endif 
  • acro-coliny/trunk/tpl/CMakeLists.txt

    r7222 r7312  
    1 option(ACRO_USING_AMPL "Build with ampl enabled?" OFF) 
    2 option(ACRO_USING_MOMHLIB "Build with momhlib enabled?" OFF) 
    3 option(ACRO_USING_THREEPO "Build with 3po enabled?" ON) 
    4 option(ACRO_USING_TINYXML "Build with tinyxml enabled?" ON) 
     1set(TPLs  
     2  "${CMAKE_CURRENT_SOURCE_DIR}/3po" 
     3  "${CMAKE_CURRENT_SOURCE_DIR}/ampl" 
     4  "${CMAKE_CURRENT_SOURCE_DIR}/appspack" 
     5  "${CMAKE_CURRENT_SOURCE_DIR}/glpk" 
     6  "${CMAKE_CURRENT_SOURCE_DIR}/soplex" 
     7  "${CMAKE_CURRENT_SOURCE_DIR}/tinyxml") 
    58 
    6 if(HAVE_AMPL) 
    7   set(ACRO_USING_AMPL ON CACHE BOOL "Build with ampl enabled?" FORCE) 
     9foreach(TPL ${TPLs}) 
     10  AcroCheckDirExists("${TPL}") 
     11endforeach() 
     12 
     13if(HAVE_AMPL AND NOT AMPL_INCLUDE_DIRS) 
     14  add_subdirectory(ampl) 
    815endif() 
    916 
    10 if(ACRO_USING_THREEPO) 
     17if(HAVE_THREEPO) 
    1118  add_subdirectory(3po) 
    1219endif() 
    1320 
    14 if(ACRO_USING_AMPL) 
    15   if (NOT AMPL_INCLUDE_DIRS) 
    16     add_subdirectory(ampl) 
    17   endif() 
    18 endif() 
    19  
    20 if(ACRO_USING_TINYXML) 
     21if(HAVE_TINYXML) 
    2122  add_subdirectory(tinyxml) 
    2223endif() 
    2324 
    24 if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/appspack) 
    25   if(ACRO_USING_APPSPACK) 
    26     add_subdirectory(appspack) 
    27   endif() 
    28 else() 
    29   set(ACRO_USING_APPSPACK OFF CACHE BOOL "Build with appspack enabled?" FORCE) 
    30   mark_as_advanced(FORCE ACRO_USING_APPSPACK) 
     25if(HAVE_APPSPACK) 
     26  add_subdirectory(appspack) 
    3127endif() 
    3228 
    33 if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/glpk) 
    34   if(ACRO_USING_GLPK) 
    35     add_subdirectory(glpk) 
    36   endif() 
    37 else() 
    38   set(ACRO_USING_GLPK OFF CACHE BOOL "Build with glpk enabled?" FORCE) 
    39   mark_as_advanced(FORCE ACRO_USING_APPSPACK) 
     29if(HAVE_GLPK) 
     30  add_subdirectory(glpk) 
    4031endif() 
    4132 
    42 if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/soplex) 
    43   if(ACRO_USING_SOPLEX) 
    44     add_subdirectory(soplex) 
    45   endif() 
    46 else() 
    47   set(ACRO_USING_SOPLEX OFF CACHE BOOL "Build with soplex enabled?" FORCE) 
    48   mark_as_advanced(FORCE ACRO_USING_APPSPACK) 
     33if(HAVE_SOPLEX) 
     34  add_subdirectory(soplex) 
    4935endif() 
    50  
    51 #build coin-cbc as an external project 
    52 #include(ExternalProject) 
    53 # 
    54 #let cmake know about coin's dependencies 
    55 #set(coin_depends) 
    56 #if(ACRO_USING_GLPK) 
    57 #  list(APPEND coin_depends glpk) 
    58 #  get_target_property(glpk-lib glpk LOCATION) 
    59 #endif() 
    60 #if(ACRO_USING_SOPLEX) 
    61 #  list(APPEND coin_depends soplex) 
    62 #endif() 
    63 #if(ACRO_USING_AMPL) 
    64 #  list(APPEND coin_depends amplsolver) 
    65 #endif() 
    66 # 
    67 #ExternalProject_Add( 
    68 #  coin-cbc 
    69 #  PATCH_COMMAND ${CMAKE_COMMAND} 
    70 #    -D cmake-dir:STRING=${CMAKE_CURRENT_SOURCE_DIR}/coin-cmake-files 
    71 #    -D coin-dir:STRING=${CMAKE_CURRENT_SOURCE_DIR}/coin-cbc/cbc 
    72 #    -P ${CMAKE_CURRENT_SOURCE_DIR}/CMakeifyCoin.cmake 
    73 #  SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/coin-cbc/cbc 
    74 #  CMAKE_ARGS 
    75 #    -DAcro_SOURCE_DIR:PATH=${Acro_SOURCE_DIR} 
    76 #    -DAcro_BINARY_DIR:PATH=${Acro_BINARY_DIR} 
    77 #    -DACRO_USING_SOPLEX:BOOL=${ACRO_USING_SOPLEX} 
    78 #    -DACRO_USING_AMPL:BOOL=${ACRO_USING_AMPL} 
    79 #    -Dglpk-lib:PATH=${glpk-lib} 
    80 #  BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/coin-cbc/cbc 
    81 #  INSTALL_COMMAND "" 
    82 #) 
    83 #if(coin_depends) 
    84 #  add_dependencies(coin-cbc ${coin_depends}) 
    85 #endif() 
Note: See TracChangeset for help on using the changeset viewer.