Ignore:
Timestamp:
08/03/11 11:13:58 (8 years ago)
Author:
hinerm
Message:

Fixes for ticket #298 and #654

Ticket #298 fixes:

  • search for a /jar subdirectory in working directory or provided classpath
  • all files in /jar are added to the classpath of the instantiated JVM

Ticket #654 fixes:

  • copying of project headers
  • copying of proxy headers
  • copying of jar dependencies to /jar
  • removal of loci_tool dependency
  • packaging improvements to remove full path references
File:
1 edited

Legend:

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

    r7727 r7731  
    4646endif(NOT DEFINED Jar2Lib_JACE_DIR) 
    4747 
     48if(NOT DEFINED Jar2Lib_PROXY_DIR) 
     49  set(Jar2Lib_PROXY_DIR ../proxies) 
     50endif(NOT DEFINED Jar2Lib_PROXY_DIR) 
     51 
     52if(NOT DEFINED Jar2Lib_INCLDE_DIR) 
     53  set(Jar2Lib_INCLDE_DIR ../include) 
     54endif(NOT DEFINED Jar2Lib_INCLDE_DIR) 
     55 
     56if(NOT DEFINED Jar2Lib_DEPS_DIR) 
     57  set(Jar2Lib_DEPS_DIR jar) 
     58endif(NOT DEFINED Jar2Lib_DEPS_DIR) 
     59 
    4860if(NOT DEFINED Jar2Lib_DIST_DIR) 
    4961  set(Jar2Lib_DIST_DIR dist/${projectId}) 
    5062endif(NOT DEFINED Jar2Lib_DIST_DIR) 
     63 
     64if(NOT DEFINED Jar2Lib_DEPS_SRC) 
     65  set(Jar2Lib_DEPS_SRC ../../dependency) 
     66endif(NOT DEFINED Jar2Lib_DEPS_SRC) 
    5167 
    5268if(NOT DEFINED J2L_BUILD_TYPE) 
     
    150166  install(FILES 
    151167    "${CMAKE_BINARY_DIR}/${Jar2Lib_DIST_DIR}/${J2L_LIB_PREFIX}jace${J2L_JNI_SUFFIX}" 
    152     DESTINATION "${Jar2Lib_DIST_DIR}" 
     168    DESTINATION "." 
    153169  ) 
    154170 
     
    164180  install(FILES 
    165181    "${CMAKE_BINARY_DIR}/${Jar2Lib_DIST_DIR}/${J2L_LIB_PREFIX}jace${J2L_SUFFIX}" 
    166     DESTINATION "${Jar2Lib_DIST_DIR}" 
     182    DESTINATION "." 
    167183  ) 
    168184endif(APPLE) 
     
    180196install(FILES 
    181197  "${CMAKE_BINARY_DIR}/${Jar2Lib_DIST_DIR}/${J2L_LIB_PREFIX}jace${J2L_SUFFIX}" 
    182   DESTINATION "${Jar2Lib_DIST_DIR}" 
     198  DESTINATION "." 
    183199) 
    184200 
     
    193209  VERBATIM 
    194210) 
    195 install(FILES 
    196   "${CMAKE_BINARY_DIR}/${Jar2Lib_DIST_DIR}/${J2L_LIB_PREFIX}${projectId}${J2L_SUFFIX}" 
    197   DESTINATION "${Jar2Lib_DIST_DIR}" 
    198 ) 
    199211 
    200212#copy jtools 
     
    208220  VERBATIM 
    209221) 
     222 
     223# copy jace_runtime.jar 
     224add_custom_command( 
     225  TARGET ${projectId} 
     226  DEPENDS "${CMAKE_BINARY_DIR}/../jace-runtime.jar" 
     227  POST_BUILD 
     228  COMMAND ${CMAKE_COMMAND} -E copy 
     229  "${CMAKE_BINARY_DIR}/../jace-runtime.jar" 
     230  "${CMAKE_BINARY_DIR}/${Jar2Lib_DIST_DIR}/${Jar2Lib_DEPS_DIR}/jace-runtime.jar" 
     231  VERBATIM 
     232) 
    210233install(FILES 
    211   "${CMAKE_BINARY_DIR}/${Jar2Lib_DIST_DIR}/${J2L_LIB_PREFIX}jtools${J2L_SUFFIX}" 
    212   DESTINATION "${Jar2Lib_DIST_DIR}" 
    213 ) 
    214  
    215 # copy jace_runtime.jar 
    216 add_custom_command( 
    217   TARGET ${projectId} 
    218   DEPENDS "${CMAKE_BINARY_DIR}/../jace-runtime.jar" 
    219   POST_BUILD 
    220   COMMAND ${CMAKE_COMMAND} -E copy 
    221   "${CMAKE_BINARY_DIR}/../jace-runtime.jar" 
    222   "${CMAKE_BINARY_DIR}/${Jar2Lib_DIST_DIR}/jace-runtime.jar" 
    223   VERBATIM 
    224 ) 
    225 install(FILES 
    226   "${CMAKE_BINARY_DIR}/${Jar2Lib_DIST_DIR}/jace-runtime.jar" 
    227   DESTINATION "${Jar2Lib_DIST_DIR}" 
     234  "${CMAKE_BINARY_DIR}/${Jar2Lib_DIST_DIR}/${Jar2Lib_DEPS_DIR}/jace-runtime.jar" 
     235  DESTINATION "./${Jar2Lib_DEPS_DIR}" 
    228236) 
    229237 
     
    237245  COMMAND ${CMAKE_COMMAND} -E copy 
    238246  "${jarFile}" 
    239   "${CMAKE_BINARY_DIR}/${Jar2Lib_DIST_DIR}/${jarName}" 
     247  "${CMAKE_BINARY_DIR}/${Jar2Lib_DIST_DIR}/${Jar2Lib_DEPS_DIR}/${jarName}" 
    240248  VERBATIM 
    241249) 
    242250install(FILES 
    243   "${CMAKE_BINARY_DIR}/${Jar2Lib_DIST_DIR}/${jarName}" 
    244   DESTINATION "${Jar2Lib_DIST_DIR}" 
     251  "${CMAKE_BINARY_DIR}/${Jar2Lib_DIST_DIR}/${Jar2Lib_DEPS_DIR}/${jarName}" 
     252  DESTINATION "./${Jar2Lib_DEPS_DIR}/" 
    245253) 
    246254 
    247255#end##foreach $sourceJars 
     256 
     257# copy and install executables 
     258#foreach ($sourceFile in $sourceFiles) 
     259#set ($execName = $q.simpleName($sourceFile)) 
     260#set ($sourceName = $sourceFile.getName()) 
     261add_custom_command( 
     262  TARGET ${execName} 
     263  DEPENDS "${CMAKE_BINARY_DIR}/${execName}" 
     264  POST_BUILD 
     265  COMMAND ${CMAKE_COMMAND} -E copy 
     266  "${CMAKE_BINARY_DIR}/${execName}" 
     267  "${CMAKE_BINARY_DIR}/${Jar2Lib_DIST_DIR}/${execName}" 
     268  VERBATIM 
     269) 
     270#end##foreach $sourceFile 
     271 
     272# copy and install dependencies 
     273add_custom_command( 
     274  TARGET ${projectId} 
     275  DEPENDS "${CMAKE_BINARY_DIR}/${Jar2Lib_DEPS_SRC}" 
     276  POST_BUILD 
     277  COMMAND ${CMAKE_COMMAND} -E copy_directory 
     278  "${CMAKE_BINARY_DIR}/${Jar2Lib_DEPS_SRC}" 
     279  "${CMAKE_BINARY_DIR}/${Jar2Lib_DIST_DIR}/${Jar2Lib_DEPS_DIR}/" 
     280  VERBATIM 
     281) 
     282 
     283install(DIRECTORY 
     284  "${CMAKE_BINARY_DIR}/${Jar2Lib_DIST_DIR}/${Jar2Lib_DEPS_DIR}/" 
     285  DESTINATION "./${Jar2Lib_DEPS_DIR}/" 
     286) 
     287 
     288# copy dependency headers 
     289add_custom_command( 
     290  TARGET ${projectId} 
     291  DEPENDS "${Jar2Lib_INCLDE_DIR}" 
     292  COMMAND ${CMAKE_COMMAND} -E copy_directory 
     293  "${Jar2Lib_INCLDE_DIR}" 
     294  "${CMAKE_BINARY_DIR}/${Jar2Lib_DIST_DIR}/include" 
     295  VERBATIM 
     296) 
     297 
     298# copy and install proxies 
     299add_custom_command( 
     300  TARGET ${projectId} 
     301  DEPENDS "${CMAKE_BINARY_DIR}/${Jar2Lib_PROXY_DIR}" 
     302  POST_BUILD 
     303  COMMAND ${CMAKE_COMMAND} -E copy_directory 
     304  "${CMAKE_BINARY_DIR}/${Jar2Lib_PROXY_DIR}/include" 
     305  "${CMAKE_BINARY_DIR}/${Jar2Lib_DIST_DIR}/include" 
     306  VERBATIM 
     307) 
     308 
     309install(DIRECTORY 
     310  "${CMAKE_BINARY_DIR}/${Jar2Lib_DIST_DIR}/include/" 
     311  DESTINATION "./include" 
     312) 
     313 
     314# install targets 
     315install(TARGETS 
     316  jtools 
     317  ${projectId} 
     318#foreach ($sourceFile in $sourceFiles) 
     319#set ($execName = $q.simpleName($sourceFile)) 
     320  ${execName} 
     321#end##foreach $sourceFile 
     322  RUNTIME DESTINATION . 
     323  LIBRARY DESTINATION . 
     324  ARCHIVE DESTINATION . 
     325) 
    248326 
    249327SET(CPACK_PACKAGE_FILE_NAME "${projectId}") 
    250328SET(CPACK_GENERATOR "TGZ;ZIP") 
    251329INCLUDE( CPack ) 
     330 
Note: See TracChangeset for help on using the changeset viewer.