Ignore:
Timestamp:
02/19/09 12:50:03 (11 years ago)
Author:
curtis
Message:

Better build system for Bio-Formats C++ bindings on Linux.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/components/bio-formats-jace/CMakeLists.txt

    r4766 r4822  
    33# 
    44 
    5 # CMake build file for bfjace, the Bio-Formats Jace C++ bindings. 
     5# CMake build file for bfjace, the Bio-Formats C++ bindings. 
    66 
    77cmake_minimum_required(VERSION 2.6) 
    88 
    9 project(bio-formats-jace) 
     9project(bfjace) 
    1010 
    1111### determine configuration ### 
    1212 
    13 find_package(JNI) 
     13message("") 
     14 
     15#find_package(Java REQUIRED) 
     16#message("-- Java Runtime:") 
     17#message("java             : ${JAVA_RUNTIME}") 
     18#message("javac            : ${JAVA_COMPILE}") 
     19#message("jar              : ${JAVA_ARCHIVE}") 
     20#message("") 
     21 
     22find_package(JNI REQUIRED) 
     23message("-- Java Native Interface:") 
     24message("jawt lib         : ${JAVA_AWT_LIBRARY}") 
     25message("jvm lib          : ${JAVA_JVM_LIBRARY}") 
     26message("jni.h            : ${JAVA_INCLUDE_PATH}") 
     27message("jni_md.h         : ${JAVA_INCLUDE_PATH2}") 
     28message("jawt.h           : ${JAVA_AWT_INCLUDE_PATH}") 
     29message("") 
    1430 
    1531set(Boost_USE_STATIC_LIBS OFF) 
    1632set(Boost_USE_MULTITHREAD ON) 
    17 find_package(Boost COMPONENTS thread) 
     33find_package(Boost COMPONENTS thread REQUIRED) 
     34message("-- Boost:") 
     35if(EXISTS ${Boost_LIBRARIES}) 
     36message("boost/thread.hpp : ${Boost_INCLUDE_DIR}") 
     37message("boost libs       : ${Boost_LIBRARIES}") 
     38message("") 
     39else(EXISTS ${Boost_LIBRARIES}) 
     40  message(FATAL_ERROR "Cannot build without Boost Thread library. Please install libboost-thread-dev package or visit www.boost.org.") 
     41endif(EXISTS ${Boost_LIBRARIES}) 
    1842 
    19 include_directories(include jace/include proxies/include 
     43if(IS_DIRECTORY ${JACE_DIR}) 
     44else(IS_DIRECTORY ${JACE_DIR}) 
     45  message(FATAL_ERROR "Cannot build without Jace. Please set JACE_DIR.") 
     46endif(IS_DIRECTORY ${JACE_DIR}) 
     47 
     48include_directories(include ${JACE_DIR}/source/c++/include proxies/include 
    2049  ${JAVA_INCLUDE_PATH} ${JAVA_INCLUDE_PATH2} ${Boost_INCLUDE_DIR}) 
    2150 
    2251### build Jace C++ library ### 
    2352 
    24 add_subdirectory(jace) 
     53message("-- Jace source files:") 
     54message("jace directory   : ${JACE_DIR}") 
     55file(GLOB_RECURSE JACE_SRC ${JACE_DIR}/source/c++/source/*.cpp) 
     56#message("jace source      : ${JACE_SRC}") 
     57message("") 
    2558 
    26 ### build Bio-Formats Jace C++ bindings (bfjace) ### 
     59add_library(jace SHARED ${JACE_SRC}) 
    2760 
    28 message("-- Bio-Formats Jace source files:") 
     61set_target_properties(jace PROPERTIES 
     62  COMPILE_FLAGS "-pthread -Wall -fpermissive" 
     63  LINK_FLAGS "-pthread") 
     64 
     65### build Bio-Formats C++ bindings ### 
     66 
     67message("-- Bio-Formats C++ source files:") 
    2968file(GLOB_RECURSE BFJACE_SRC proxies/source/*.cpp) 
    30 message("  bfjace source : ${BFJACE_SRC}") 
    31  
     69#message("  bfjace source : ${BFJACE_SRC}") 
    3270message("") 
    3371 
     
    4785  ${JAVA_JVM_LIBRARY} ${Boost_LIBRARIES}) 
    4886 
    49 ### TEMP - build some Jace examples for testing ### 
     87### TEMP - build some examples for testing ### 
    5088 
    5189add_executable(example1 source/example1.cpp) 
Note: See TracChangeset for help on using the changeset viewer.