Changeset 5588 for trunk


Ignore:
Timestamp:
10/13/09 15:49:57 (11 years ago)
Author:
curtis
Message:
  • Better separation of Jace and bf-cpp components.
  • Draft of minimum_writer.cpp (does not work yet).
Location:
trunk/components/native/bf-cpp
Files:
3 added
2 deleted
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/components/native/bf-cpp/CMakeLists.txt

    r5373 r5588  
    3030project(bfcpp) 
    3131 
    32 ### search for prerequisite libraries ### 
     32add_subdirectory(jace) 
    3333 
    34 message(STATUS "") 
    35  
    36 #message("-- Java Runtime:") 
    37 #find_package(Java REQUIRED) 
    38 #message("java          : ${JAVA_RUNTIME}") 
    39 #message("javac         : ${JAVA_COMPILE}") 
    40 #message("jar           : ${JAVA_ARCHIVE}") 
    41 #message("") 
    42  
    43 message(STATUS "-- Java Native Interface:") 
    44 find_package(JNI REQUIRED) 
    45 message(STATUS "jawt lib      : ${JAVA_AWT_LIBRARY}") 
    46 message(STATUS "jvm lib       : ${JAVA_JVM_LIBRARY}") 
    47 message(STATUS "jni.h         : ${JAVA_INCLUDE_PATH}") 
    48 message(STATUS "jni_md.h      : ${JAVA_INCLUDE_PATH2}") 
    49 message(STATUS "jawt.h        : ${JAVA_AWT_INCLUDE_PATH}") 
    50 message(STATUS "") 
    51  
    52 # HACK - CMake on Windows refuses to find the thread library unless BOOST_ROOT 
    53 #        is set, even though it can locate the Boost directory tree. 
    54 #        So we first look for base Boost, then set BOOST_ROOT and look again 
    55 #        for Boost Thread specifically. 
    56  
    57 message(STATUS "-- Boost:") 
    58 set(Boost_USE_STATIC_LIBS OFF) 
    59 set(Boost_USE_MULTITHREADED ON) 
    60 set(Boost_ADDITIONAL_VERSIONS "1.37" "1.37.0" "1.37.1" "1.38" "1.38.0" "1.38.1" 
    61   "1.39" "1.39.0" "1.39.1" "1.40" "1.40.0" "1.40.1" "1.41" "1.41.0" "1.41.1" 
    62   "1.42" "1.42.0" "1.42.1" "1.43" "1.43.0" "1.43.1" "1.44" "1.44.0" "1.44.1") 
    63 #set(Boost_FIND_QUIETLY ON) 
    64 find_package(Boost) 
    65 if(IS_DIRECTORY "${Boost_INCLUDE_DIR}") 
    66   message(STATUS "boost headers : ${Boost_INCLUDE_DIR}") 
    67 else(IS_DIRECTORY "${Boost_INCLUDE_DIR}") 
    68   if(UNIX) 
    69     message(FATAL_ERROR "Cannot build without Boost Thread library. Please install libboost-thread-dev package or visit www.boost.org.") 
    70   else(UNIX) 
    71     message(FATAL_ERROR "Cannot build without Boost Thread library. Please install Boost from www.boost.org.") 
    72   endif(UNIX) 
    73 endif(IS_DIRECTORY "${Boost_INCLUDE_DIR}") 
    74 #set(Boost_FIND_QUIETLY OFF) 
    75 if(WIN32) 
    76   set(BOOST_ROOT ${Boost_INCLUDE_DIR}) 
    77 endif(WIN32) 
    78 find_package(Boost COMPONENTS thread REQUIRED) 
    79  
    80 # HACK: Make linking to Boost work on Windows systems. 
    81 string(REGEX REPLACE "/[^/]*$" "" 
    82   Boost_STRIPPED_LIB_DIR "${Boost_THREAD_LIBRARY_DEBUG}") 
    83  
    84 if(EXISTS "${Boost_THREAD_LIBRARY_DEBUG}") 
    85   message(STATUS "boost lib dir : ${Boost_STRIPPED_LIB_DIR}") 
    86   message(STATUS "thread lib    : ${Boost_THREAD_LIBRARY_DEBUG}") 
    87 else(EXISTS "${Boost_THREAD_LIBRARY_DEBUG}") 
    88   message(FATAL_ERROR "Cannot build without Boost Thread library. Please install libboost-thread-dev package or visit www.boost.org.") 
    89 endif(EXISTS "${Boost_THREAD_LIBRARY_DEBUG}") 
    90 message(STATUS "") 
    91  
    92 message(STATUS "-- Jace:") 
    93 set(JACE_DIR NOTFOUND CACHE PATH "The path to toplevel directory of your Jace checkout") 
    94 if(IS_DIRECTORY "${JACE_DIR}") 
    95   message(STATUS "jace root     : ${JACE_DIR}") 
    96 else(IS_DIRECTORY "${JACE_DIR}") 
    97   message(FATAL_ERROR "Cannot build without Jace. Please set JACE_DIR.") 
    98 endif(IS_DIRECTORY "${JACE_DIR}") 
     34### build Bio-Formats C++ bindings ### 
    9935 
    10036include_directories(include 
    101   "${JACE_DIR}/source/c++/include" "proxies/include" 
    102   "${JAVA_INCLUDE_PATH}" "${JAVA_INCLUDE_PATH2}" 
    103   "${Boost_INCLUDE_DIR}") 
    104  
    105 # HACK: Make linking to Boost work on Windows systems. 
    106 if(WIN32) 
    107   link_directories(${Boost_STRIPPED_LIB_DIR}) 
    108 endif(WIN32) 
    109  
    110 ### build Jace C++ library ### 
    111  
    112 file(GLOB_RECURSE JACE_SRC "${JACE_DIR}/source/c++/source/*.cpp") 
    113 #message("jace source   : ${JACE_SRC}") 
    114 message(STATUS "") 
    115  
    116 add_library(jace SHARED ${JACE_SRC}) 
    117  
    118 # HACK: Make linking to Boost work on Windows systems. 
    119 if(WIN32) 
    120   target_link_libraries(jace "${JAVA_JVM_LIBRARY}") 
    121 else(WIN32) 
    122   target_link_libraries(jace "${JAVA_JVM_LIBRARY}" ${Boost_THREAD_LIBRARY_DEBUG}) 
    123 endif(WIN32) 
    124  
    125 if(CMAKE_COMPILER_IS_GNUCXX) 
    126   set_target_properties(jace PROPERTIES 
    127     COMPILE_FLAGS "-fpermissive") 
    128 else(CMAKE_COMPILER_IS_GNUCXX) 
    129   set_target_properties(jace PROPERTIES 
    130     DEFINE_SYMBOL JACE_EXPORTS) 
    131 endif(CMAKE_COMPILER_IS_GNUCXX) 
    132  
    133 # NB: Mac OS X 10.4 and earlier requires .jnilib extension rather than 
    134 #     .dylib when loading native code with System.loadLibrary(String). 
    135 if(APPLE) 
    136   set_target_properties(jace PROPERTIES SUFFIX ".jnilib") 
    137 endif(APPLE) 
    138  
    139 ### build Bio-Formats C++ bindings ### 
     37  "proxies/include" "${JACE_DIR}/source/c++/include" "${Boost_INCLUDE_DIR}") 
    14038 
    14139#message("-- Bio-Formats C++ bindings:") 
     
    15856target_link_libraries(bfcpp jace) 
    15957 
    160 ### build showinf example for testing bfcpp ### 
     58### build some examples for testing bfcpp ### 
    16159 
    16260add_executable(showinf source/showinf.cpp) 
     
    16462target_link_libraries(showinf bfcpp jace "${JAVA_JVM_LIBRARY}") 
    16563 
    166 ### TEMP - build some examples for testing ### 
     64#add_executable(minimum_writer source/minimum_writer.cpp) 
    16765 
    168 add_executable(example1 source/example1.cpp) 
    169  
    170 target_link_libraries(example1 bfcpp jace "${JAVA_JVM_LIBRARY}") 
    171  
    172 add_executable(array_example source/array_example.cpp) 
    173  
    174 target_link_libraries(array_example bfcpp jace "${JAVA_JVM_LIBRARY}") 
     66#target_link_libraries(minimum_writer bfcpp jace "${JAVA_JVM_LIBRARY}") 
  • trunk/components/native/bf-cpp/build.xml

    r5551 r5588  
    176176      <else> 
    177177        <exec executable="make" dir="${build.dir}" failonerror="true"/> 
     178        <copy todir="${build.dir}" preservelastmodified="true"> 
     179          <fileset dir="${build.dir}/jace" includes="*jace*"/> 
     180        </copy> 
     181        <chmod file="${build.dir}/libjace.jnilib" perm="ugo+x"/> 
    178182        <if> 
    179183          <isset property="isMac"/> 
Note: See TracChangeset for help on using the changeset viewer.