Skip to content

Commit

Permalink
Production of FijeeMesh library using CMake
Browse files Browse the repository at this point in the history
  • Loading branch information
YannCobigo committed Sep 19, 2014
1 parent 5a3ace8 commit 2c5452d
Show file tree
Hide file tree
Showing 47 changed files with 800 additions and 1,039 deletions.
115 changes: 81 additions & 34 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,54 @@ set(Fijee_VERSION "${Fijee_VERSION_MAJOR}.${Fijee_VERSION_MINOR}.${Fijee_VERSION
set( LIBRARY_VERSION "0.0.1" )
set( LIBRARY_SOVERSION "0" )


#
#
set( Fijee_CXX_DEFINITIONS "" )
set( Fijee_LINK_FLAGS "" )
set( Fijee_Utils_TARGET_LINK_LIBRARIES "" )
set( Fijee_Biophysics_TARGET_LINK_LIBRARIES "" )
set( Fijee_Mesh_TARGET_LINK_LIBRARIES "" )
set( Fijee_FEM_TARGET_LINK_LIBRARIES "" )
#
# TRACE:
# 1, 2, 3, ... printout
# 100 R statistical software studies
# 200 VTK visualization
if( NOT DEFINED Fijee_TRACE )
set( Fijee_TRACE 0 )
endif()
#
add_definitions( -DTRACE=${Fijee_TRACE} )
#
# CUDA:
if( NOT DEFINED Fijee_CUDA )
set( Fijee_CUDA "OFF" )
else()
if(Fijee_CUDA)
add_definitions( -DCUDA )
endif()
endif()
#
#
# This needs to be changed to use cmake scripts to determine correct flag
# c standard and remove deprecation warnings (caused by vtk) that clutter compile output
add_definitions( -std=c++0x -Wno-deprecated )

#
# Setup files
#

#
# Fijee data set
set( Fijee_DATA_SET ${Fijee_SOURCE_DIR}/share/fijee.xml )
#
install( FILES ${Fijee_DATA_SET} DESTINATION ${CMAKE_INSTALL_PREFIX}/share )

#
# Electrodes
set( Fijee_ELECTRODES_STANDARD_10_20_CAP81 ${Fijee_SOURCE_DIR}/share/electrodes/electrodes-Standard-10-20-Cap81.xml )
#
install( FILES ${Fijee_ELECTRODES_STANDARD_10_20_CAP81} DESTINATION ${CMAKE_INSTALL_PREFIX}/share/electrodes/ )


#
# Find required packages
Expand All @@ -43,6 +86,16 @@ set(LIBS)

#set(DOLFIN_DIR "/usr/share/dolfin/cmake") # Dolfin installs UseDolfin.cmake scripts, dummy findDolfin script in cmake/modules doesn't look here properly yet

#
# General libraries
find_package( PkgConfig REQUIRED)
# CUDA
#pkg_check_modules( CUDA REQUIRED CUDA )
#
#pkg_check_modules( gsl REQUIRED gsl )
#pkg_check_modules( zlib REQUIRED zlib )


#
# FEniCS
find_package(DOLFIN REQUIRED CONFIG)
Expand All @@ -57,10 +110,20 @@ endif()

#
# VTK
find_package(VTK REQUIRED NO_MODULE)
find_package(VTK 5.10 REQUIRED NO_MODULE)
if(VTK_FOUND)
message(STATUS "VTK found")
include(${VTK_USE_FILE})
list(APPEND LIBS ${VTK_LIBRARIES})
# list(APPEND LIBS ${VTK_LIBRARIES})
endif()

#
# CUDA
if( Fijee_CUDA )
find_package( CUDA REQUIRED )
if(CUDA_FOUND)
set( CUDA_NVCC_FLAGS "-O3 -gencode arch=compute_20,code=sm_20" )
endif()
endif()


Expand Down Expand Up @@ -92,14 +155,14 @@ if(MPI_FOUND)
include_directories(${MPI_INCLUDE_PATH})
endif()

##
## NIFTI
#find_package(NIFTI REQUIRED)
##
#if(NIFTI_FOUND)
# message(STATUS "FOUND NIFTI")
# include_directories(${NIFTI_INCLUDE_DIR})
#endif()
#
# NIFTI
find_package(NIFTI REQUIRED)
#
if(NIFTI_FOUND)
message(STATUS "nifti found")
include_directories(${NIFTI_INCLUDE_DIR})
endif()

#
# CGAL
Expand All @@ -111,10 +174,13 @@ if(CGAL_FOUND)
include( ${CGAL_USE_FILE} )
endif()

#
include_directories( SYSTEM )

#
# Build
#
message("\n== Generating build files ==\n")
message( "\n== Generating build files ==\n" )

#
# Env
Expand All @@ -123,42 +189,23 @@ set(Fijee_INCLUDE_DIR ${CMAKE_INSTALL_PREFIX}/include)
set(Fijee_BIN_DIR ${CMAKE_INSTALL_PREFIX}/bin)
set(Fijee_CMAKE_DIR ${CMAKE_INSTALL_PREFIX}/lib/cmake/Fijee-${Fijee_VERSION})


#
include_directories( SYSTEM )

#
#
set(Fijee_CXX_DEFINITIONS "")
set(Fijee_LINK_FLAGS "")
set(Fijee_TARGET_LINK_LIBRARIES "")
#
IF (NOT DEFINED Fijee_TRACE)
SET(Fijee_TRACE 0)
ENDIF()
#
ADD_DEFINITIONS(-DTRACE=${Fijee_TRACE})
#


#
# Import all the source
add_subdirectory(Fijee)

#
# Fijee configuration
#
message( "\n== Configuration files ==\n" )

#set( Find_Fijee ${Fijee_SOURCE_DIR}/cmake/modules/FindFijee.cmake )
#install( FILES ${Find_Fijee} DESTINATION ${CMAKE_INSTALL_PREFIX}/lib/cmake/Fijee.${Fijee_VERSION} )

# Add all targets to the build-tree export set
export( TARGETS FijeeUtils FijeeBiophysics
export( TARGETS FijeeUtils FijeeBiophysics FijeeMesh
FILE "${PROJECT_BINARY_DIR}/FijeeTargets.cmake" )
#
include_directories( "${Fijee_INCLUDE_DIR}" )
message("${INCLUDE_DIRECTORIES}")
message("${}")
# Create the FijeeConfig.cmake and FijeeConfigVersion files
file( RELATIVE_PATH REL_INCLUDE_DIR
"${Fijee_CMAKE_DIR}"
Expand Down
2 changes: 1 addition & 1 deletion Fijee/Biophysics/Fijee_biophysics.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
#ifndef FIJEE_BIOPHYSICS_H
#define FIJEE_BIOPHYSICS_H
/*!
* \file Fijee_utils.h
* \file Fijee_biophysics.h
* \brief brief describe
* \author Yann Cobigo
* \version 0.1
Expand Down
1 change: 1 addition & 0 deletions Fijee/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,4 @@ install( FILES ${HEADERS_} DESTINATION ${CMAKE_INSTALL_PREFIX}/include/Fijee/ )
#
add_subdirectory( Utils )
add_subdirectory( Biophysics )
add_subdirectory( Mesh_rendering )
26 changes: 16 additions & 10 deletions Fijee/Fijee_environment.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,20 +38,26 @@
#include <sys/stat.h> /* mkdir */
#include <cstring> /* strerror */
#include <exception>

// the configured options and settings for Tutorial
#define Fijee_VERSION_MAJOR @${Fijee_VERSION_MAJOR}@
#define Fijee_VERSION_MINOR @${Fijee_VERSION_MINOR}@
#define Fijee_VERSION_PATCH @${Fijee_VERSION_PATCH}@

//
// Get built-in type. Creates member get_"name"() (e.g., get_visibility());
//
#define ucsf_get_macro(name,type) \
inline type get_##name()const { \
return this->name; \
#define ucsf_get_macro(name,type) \
inline type get_##name()const { \
return this->name; \
}
//
// Get character string. Creates member get_"name"()
// (e.g., char *GetFilename());
//
#define ucsf_get_string_macro(name) \
const char* get_##name() const { \
return this->name.c_str(); \
#define ucsf_get_string_macro(name) \
const char* get_##name() const { \
return this->name.c_str(); \
}
//
//
Expand Down Expand Up @@ -241,7 +247,7 @@ namespace Fijee
*
*/
ucsf_get_macro(subject_, std::string);
/*!
/*!
* \brief Get subjects_dir_
*
* This method return the subjects directory
Expand All @@ -255,21 +261,21 @@ namespace Fijee
*
*/
ucsf_get_macro(fem_path_, std::string);
/*!
/*!
* \brief Get fem_output_path_
*
* This method return the finite element method output directory path.
*
*/
ucsf_get_macro(fem_output_path_, std::string);
/*!
/*!
* \brief Get fem_result_path_
*
* This method return the finite element method result directory path.
*
*/
ucsf_get_macro(fem_result_path_, std::string);
/*!
/*!
* \brief Get fem_measure_path_
*
* This method return the finite element method measure directory path.
Expand Down
Loading

0 comments on commit 2c5452d

Please sign in to comment.