Changeset 5718


Ignore:
Timestamp:
11/23/09 15:49:50 (10 years ago)
Author:
curtis
Message:

Fixes for compiling Bio-Formats ITK plugin on Windows.

Location:
trunk/components/native
Files:
3 edited

Legend:

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

    r5692 r5718  
    3737# CMake build file for the Bio-Formats C++ bindings. 
    3838 
    39 cmake_minimum_required(VERSION 2.6.4) 
     39if(WIN32) 
     40  cmake_minimum_required(VERSION 2.8) 
     41else(WIN32) 
     42  cmake_minimum_required(VERSION 2.6) 
     43endif(WIN32) 
    4044 
    4145project(bfcpp) 
     
    4448 
    4549add_subdirectory(jace) 
     50 
     51message(STATUS "-- Jace:") 
     52set(JACE_DIR NOTFOUND CACHE PATH 
     53  "The path to toplevel directory of your Jace checkout") 
     54if(IS_DIRECTORY "${JACE_DIR}") 
     55  message(STATUS "jace root     : ${JACE_DIR}") 
     56else(IS_DIRECTORY "${JACE_DIR}") 
     57  message(FATAL_ERROR "Cannot build without Jace. Please set JACE_DIR.") 
     58endif(IS_DIRECTORY "${JACE_DIR}") 
    4659 
    4760### build Bio-Formats C++ bindings ### 
  • trunk/components/native/bf-cpp/jace/CMakeLists.txt

    r5692 r5718  
    2323 
    2424if(WIN32) 
    25 cmake_minimum_required(VERSION 2.8) 
     25  cmake_minimum_required(VERSION 2.8) 
    2626else(WIN32) 
    27 cmake_minimum_required(VERSION 2.6) 
     27  cmake_minimum_required(VERSION 2.6) 
    2828endif(WIN32) 
    2929 
  • trunk/components/native/itk-plugin/CMakeLists.txt

    r5682 r5718  
    4545project(BioFormatsImageIO) 
    4646 
    47 cmake_minimum_required(VERSION 2.6.4) 
     47if(WIN32) 
     48  cmake_minimum_required(VERSION 2.8) 
     49else(WIN32) 
     50  cmake_minimum_required(VERSION 2.6) 
     51endif(WIN32) 
     52 
    4853if(COMMAND cmake_policy) 
    4954 cmake_policy(SET CMP0003 NEW) 
     
    6065# Include dirs 
    6166 
    62 find_package(JNI REQUIRED) 
    63 message(STATUS "-- Java Native Interface:") 
    64 message(STATUS "jawt lib         : ${JAVA_AWT_LIBRARY}") 
    65 message(STATUS "jvm lib          : ${JAVA_JVM_LIBRARY}") 
    66 message(STATUS "jni.h            : ${JAVA_INCLUDE_PATH}") 
    67 message(STATUS "jni_md.h         : ${JAVA_INCLUDE_PATH2}") 
    68 message(STATUS "jawt.h           : ${JAVA_AWT_INCLUDE_PATH}") 
    69 message(STATUS "") 
     67set(BF_CPP_DIR ${PROJECT_SOURCE_DIR}/../bf-cpp) 
    7068 
    71 # HACK - CMake on Windows refuses to find the thread library unless BOOST_ROOT 
    72 #        is set, even though it can locate the Boost directory tree. 
    73 #        So we first look for base Boost, then set BOOST_ROOT and look again 
    74 #        for Boost Thread specifically. 
    75  
    76 message(STATUS "-- Boost:") 
    77 set(Boost_USE_STATIC_LIBS OFF) 
    78 set(Boost_USE_MULTITHREADED ON) 
    79 set(Boost_ADDITIONAL_VERSIONS "1.37" "1.37.0" "1.37.1" "1.38" "1.38.0" "1.38.1" 
    80   "1.39" "1.39.0" "1.39.1" "1.40" "1.40.0" "1.40.1" "1.41" "1.41.0" "1.41.1" 
    81   "1.42" "1.42.0" "1.42.1" "1.43" "1.43.0" "1.43.1" "1.44" "1.44.0" "1.44.1") 
    82 #set(Boost_FIND_QUIETLY ON) 
    83 find_package(Boost) 
    84 if(IS_DIRECTORY "${Boost_INCLUDE_DIR}") 
    85   message(STATUS "boost headers : ${Boost_INCLUDE_DIR}") 
    86 else(IS_DIRECTORY "${Boost_INCLUDE_DIR}") 
    87   if(UNIX) 
    88     message(FATAL_ERROR "Cannot build without Boost Thread library. Please install libboost-thread-dev package or visit www.boost.org.") 
    89   else(UNIX) 
    90     message(FATAL_ERROR "Cannot build without Boost Thread library. Please install Boost from www.boost.org.") 
    91   endif(UNIX) 
    92 endif(IS_DIRECTORY "${Boost_INCLUDE_DIR}") 
    93 #set(Boost_FIND_QUIETLY OFF) 
    94 if(WIN32) 
    95   set(BOOST_ROOT ${Boost_INCLUDE_DIR}) 
    96 endif(WIN32) 
    97 find_package(Boost COMPONENTS thread REQUIRED) 
    98  
    99 # NB: Necessary on Windows to test for Boost Thread when 
    100 #     multiple semicolon-separated files are identified. 
    101 string(REGEX REPLACE "/[^/]*$" "" 
    102   Boost_STRIPPED_LIB_DIR "${Boost_THREAD_LIBRARY_DEBUG}") 
    103  
    104 if(EXISTS "${Boost_THREAD_LIBRARY_DEBUG}") 
    105   message(STATUS "boost lib dir : ${Boost_STRIPPED_LIB_DIR}") 
    106   message(STATUS "thread lib    : ${Boost_THREAD_LIBRARY}") 
    107 else(EXISTS "${Boost_THREAD_LIBRARY_DEBUG}") 
    108   message(FATAL_ERROR "Cannot build without Boost Thread library. Please install libboost-thread-dev package or visit www.boost.org.") 
    109 endif(EXISTS "${Boost_THREAD_LIBRARY_DEBUG}") 
    110 message(STATUS "") 
     69include(${BF_CPP_DIR}/jace/Prerequisites.cmake) 
    11170 
    11271message(STATUS "-- Jace:") 
    113 set(JACE_DIR NOTFOUND CACHE PATH "The path to toplevel directory of your Jace checkout") 
     72set(JACE_DIR NOTFOUND CACHE PATH 
     73  "The path to toplevel directory of your Jace checkout") 
    11474if(IS_DIRECTORY "${JACE_DIR}") 
    11575  message(STATUS "jace root     : ${JACE_DIR}") 
     
    11878endif(IS_DIRECTORY "${JACE_DIR}") 
    11979 
    120 set(BF_JACE_DIR ${PROJECT_SOURCE_DIR}/../bf-cpp) 
    121  
    12280set(include_dirs 
    12381  ${CMAKE_CURRENT_SOURCE_DIR} 
     
    12583  ${JAVA_INCLUDE_PATH} ${JAVA_INCLUDE_PATH2} ${Boost_INCLUDE_DIR} 
    12684  ${JACE_DIR}/source/c++/include 
    127   ${BF_JACE_DIR}/include 
    128   ${BF_JACE_DIR}/proxies/include 
     85  ${BF_CPP_DIR}/include 
     86  ${BF_CPP_DIR}/proxies/include 
    12987) 
    13088 
     
    13694include_directories(${include_dirs}) 
    13795 
    138 link_directories(${BF_JACE_DIR}/build) 
     96link_directories(${BF_CPP_DIR}/build ${BF_CPP_DIR}/build/jace) 
    13997 
    14098configure_file( 
     
    168126target_link_libraries(${lib_name} 
    169127  ITKIO 
     128  bfcpp 
    170129  jace 
    171   bfcpp 
    172   ${JAVA_JVM_LIBRARY} ${Boost_LIBRARIES} 
     130  ${JAVA_JVM_LIBRARY} 
    173131) 
    174132 
     
    203161target_link_libraries(BioFormatsIOPlugin 
    204162  ${lib_name} 
     163  bfcpp 
    205164  jace 
    206   bfcpp 
    207   ${JAVA_JVM_LIBRARY} ${Boost_LIBRARIES} 
     165  ${JAVA_JVM_LIBRARY} 
    208166) 
    209167 
Note: See TracChangeset for help on using the changeset viewer.