Changeset 7743 for trunk/projects


Ignore:
Timestamp:
08/31/11 10:34:02 (8 years ago)
Author:
hinerm
Message:

Improved control flow of platform specific installation

Previously, platform-specific installation was controlled
by three separate, specific if statements. After learning
that there can be fallthrough on some platforms with multiple
paths being executed, it was revised to an if-then-else pattern
which seems to be much cleaner in execution.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/projects/jar2lib/src/main/resources/CMakeLists.vm

    r7733 r7743  
    332332 
    333333# ---HACK--- install(TARGETS ...) destroys linking on Linux but allows portability on OSX 
    334 if(UNIX) 
     334 
     335if(APPLE) 
     336# install targets 
     337install(TARGETS 
     338  jtools 
     339  ${projectId} 
     340#foreach ($sourceFile in $sourceFiles) 
     341#set ($execName = $q.simpleName($sourceFile)) 
     342  ${execName} 
     343#end##foreach $sourceFile 
     344  RUNTIME DESTINATION . 
     345  LIBRARY DESTINATION . 
     346  ARCHIVE DESTINATION . 
     347) 
     348elseif(WIN32 OR WIN64) 
     349# install targets 
     350install(TARGETS 
     351  jtools 
     352  ${projectId} 
     353#foreach ($sourceFile in $sourceFiles) 
     354#set ($execName = $q.simpleName($sourceFile)) 
     355  ${execName} 
     356#end##foreach $sourceFile 
     357  RUNTIME DESTINATION . 
     358  LIBRARY DESTINATION . 
     359  ARCHIVE DESTINATION . 
     360) 
     361else(APPLE) 
    335362install(FILES 
    336363  "${CMAKE_BINARY_DIR}/${Jar2Lib_DIST_DIR}/${J2L_LIB_PREFIX}jtools${J2L_SUFFIX}" 
     
    347374) 
    348375#end##foreach $sourceFile 
    349 endif(UNIX) 
    350  
    351 if(APPLE) 
    352 # install targets 
    353 install(TARGETS 
    354   jtools 
    355   ${projectId} 
    356 #foreach ($sourceFile in $sourceFiles) 
    357 #set ($execName = $q.simpleName($sourceFile)) 
    358   ${execName} 
    359 #end##foreach $sourceFile 
    360   RUNTIME DESTINATION . 
    361   LIBRARY DESTINATION . 
    362   ARCHIVE DESTINATION . 
    363 ) 
    364376endif(APPLE) 
    365377 
    366 if(WIN32) 
    367 # install targets 
    368 install(TARGETS 
    369   jtools 
    370   ${projectId} 
    371 #foreach ($sourceFile in $sourceFiles) 
    372 #set ($execName = $q.simpleName($sourceFile)) 
    373   ${execName} 
    374 #end##foreach $sourceFile 
    375   RUNTIME DESTINATION . 
    376   LIBRARY DESTINATION . 
    377   ARCHIVE DESTINATION . 
    378 ) 
    379 endif(WIN32) 
    380378 
    381379SET(CPACK_PACKAGE_FILE_NAME "${projectId}") 
Note: See TracChangeset for help on using the changeset viewer.