2008-02-05 12:34:32 -06:00
|
|
|
# - Find the Hurricane includes and libraries.
|
|
|
|
# The following variables are set if Hurricane is found. If HURRICANE is not
|
2008-02-05 14:22:01 -06:00
|
|
|
# found, HURRICANE_FOUND is set to false.
|
2008-02-05 12:34:32 -06:00
|
|
|
# HURRICANE_FOUND - True when the Hurricane include directory is found.
|
2008-02-05 14:22:01 -06:00
|
|
|
# HURRICANE_INCLUDE_DIR - the path to where the Hurricane include files are.
|
|
|
|
# HURRICANE_LIBRARIES - The path to where the Hurricane library files are.
|
2008-02-05 12:34:32 -06:00
|
|
|
|
|
|
|
|
2008-11-26 03:35:07 -06:00
|
|
|
MACRO(SET_LIBRARIES_PATH configname library)
|
2010-03-19 09:22:25 -05:00
|
|
|
SET(${configname}_FOUND "NOTFOUND")
|
2008-11-26 03:35:07 -06:00
|
|
|
|
|
|
|
IF(${library}_LIBRARY_PATH)
|
|
|
|
SET(${configname}_FOUND "YES")
|
|
|
|
SET(${configname}_INCLUDE_DIR ${${library}_INCLUDE_PATH})
|
|
|
|
SET(${configname}_LIBRARIES ${${library}_LIBRARY_PATH} ${${configname}_LIBRARIES})
|
|
|
|
MARK_AS_ADVANCED(${configname}_INCLUDE_DIR ${configname}_LIBRARIES)
|
|
|
|
ENDIF(${library}_LIBRARY_PATH)
|
|
|
|
|
|
|
|
IF(NOT ${library}_INCLUDE_PATH)
|
2010-03-19 09:22:25 -05:00
|
|
|
SET(${configname}_FOUND "NOTFOUND")
|
2008-11-26 03:35:07 -06:00
|
|
|
ENDIF(NOT ${library}_INCLUDE_PATH)
|
|
|
|
ENDMACRO ( SET_LIBRARIES_PATH )
|
|
|
|
|
2008-12-12 07:28:19 -06:00
|
|
|
MACRO(HURRICANE_CHECK_LIBRARIES)
|
|
|
|
IF(ARGC LESS 2)
|
2010-03-19 09:22:25 -05:00
|
|
|
SET(REQUIRED ${ARGV0}_FIND_REQUIRED)
|
2008-12-12 07:28:19 -06:00
|
|
|
ELSE(ARGC LESS 2)
|
2010-03-19 09:22:25 -05:00
|
|
|
SET(REQUIRED ${ARGV1})
|
2008-12-12 07:28:19 -06:00
|
|
|
ENDIF(ARGC LESS 2)
|
2010-03-19 09:22:25 -05:00
|
|
|
IF(${ARGV0}_FOUND)
|
|
|
|
IF(NOT ${ARGV0}_FIND_QUIETLY)
|
|
|
|
IF(${ARGV0}_FOUND)
|
|
|
|
MESSAGE(STATUS "Found ${ARGV0} : ${${ARGV0}_LIBRARIES}")
|
|
|
|
ENDIF(${ARGV0}_FOUND)
|
|
|
|
ENDIF(NOT ${ARGV0}_FIND_QUIETLY)
|
|
|
|
ELSE(${ARGV0}_FOUND)
|
2008-12-12 07:28:19 -06:00
|
|
|
IF(REQUIRED)
|
2010-03-19 09:22:25 -05:00
|
|
|
MESSAGE(FATAL_ERROR "${ARGV0} was not found. ${${ARGV0}_DIR_MESSAGE}")
|
2008-12-12 07:28:19 -06:00
|
|
|
ENDIF(REQUIRED)
|
2010-03-19 09:22:25 -05:00
|
|
|
ENDIF(${ARGV0}_FOUND)
|
2008-11-26 03:35:07 -06:00
|
|
|
ENDMACRO(HURRICANE_CHECK_LIBRARIES)
|
|
|
|
|
2010-03-08 10:33:57 -06:00
|
|
|
MACRO(SET_LIB_LINK_MODE)
|
2010-07-01 06:46:29 -05:00
|
|
|
SET(Boost_USE_STATIC_LIBS ON)
|
|
|
|
MESSAGE(STATUS "Always uses Boost static libraries.")
|
2010-03-08 10:33:57 -06:00
|
|
|
IF(NOT BUILD_SHARED_LIBS)
|
|
|
|
# check for qmake
|
|
|
|
FIND_PROGRAM(QT_QMAKE_EXECUTABLE NAMES qmake-qt4 qmake PATHS
|
|
|
|
/opt/qt4-static-4.3.2/bin
|
|
|
|
NO_DEFAULT_PATH
|
|
|
|
)
|
|
|
|
MESSAGE(STATUS "Building static libraries.")
|
|
|
|
ELSE(NOT BUILD_SHARED_LIBS)
|
|
|
|
MESSAGE(STATUS "Building dynamic libraries.")
|
|
|
|
ENDIF(NOT BUILD_SHARED_LIBS)
|
|
|
|
ENDMACRO(SET_LIB_LINK_MODE)
|
|
|
|
|
2008-09-08 03:46:18 -05:00
|
|
|
SET(HURRICANE_INCLUDE_PATH_DESCRIPTION "The directory containing the Hurricane include files. E.g /usr/local/include or /asim/coriolis/include")
|
|
|
|
SET(HURRICANE_LIBRARY_PATH_DESCRIPTION "The directory containing the Hurricane library files. E.g /usr/local/lib or /asim/coriolis/lib")
|
|
|
|
SET(HURRICANE_DIR_MESSAGE "Set the HURRICANE_INCLUDE_DIR cmake cache entry to the ${HURRICANE_INCLUDE_PATH_DESCRIPTION}")
|
2008-02-05 12:34:32 -06:00
|
|
|
|
|
|
|
# don't even bother under WIN32
|
|
|
|
IF(UNIX)
|
2010-03-19 09:22:25 -05:00
|
|
|
# Setup the DIR_SEARCH_PATH.
|
|
|
|
MACRO(SETUP_SEARCH_DIR project)
|
|
|
|
IF( NOT("$ENV{${project}_TOP}" STREQUAL "") )
|
|
|
|
MESSAGE("-- ${project}_TOP is set to $ENV{${project}_TOP}")
|
2010-05-22 08:46:56 -05:00
|
|
|
LIST(INSERT ${project}_DIR_SEARCH 0 "${DESTDIR}$ENV{${project}_TOP}")
|
2010-03-19 09:22:25 -05:00
|
|
|
ENDIF( NOT("$ENV{${project}_TOP}" STREQUAL "") )
|
2010-04-28 15:36:23 -05:00
|
|
|
|
|
|
|
IF( NOT("$ENV{${project}_USER_TOP}" STREQUAL "") )
|
|
|
|
MESSAGE("-- ${project}_USER_TOP is set to $ENV{${project}_USER_TOP}")
|
2010-05-22 08:46:56 -05:00
|
|
|
LIST(INSERT ${project}_DIR_SEARCH 0 "${DESTDIR}$ENV{${project}_USER_TOP}")
|
2010-04-28 15:36:23 -05:00
|
|
|
ENDIF( NOT("$ENV{${project}_USER_TOP}" STREQUAL "") )
|
|
|
|
|
|
|
|
LIST(REMOVE_DUPLICATES ${project}_DIR_SEARCH)
|
2010-04-28 16:54:54 -05:00
|
|
|
|
|
|
|
MESSAGE("-- Components of ${project}_DIR_SEARCH:")
|
|
|
|
FOREACH(PATH IN LISTS ${project}_DIR_SEARCH)
|
|
|
|
MESSAGE("-- ${PATH}")
|
|
|
|
ENDFOREACH(PATH)
|
2010-03-19 09:22:25 -05:00
|
|
|
ENDMACRO(SETUP_SEARCH_DIR project)
|
|
|
|
|
|
|
|
SETUP_SEARCH_DIR(CORIOLIS)
|
2010-04-28 16:54:54 -05:00
|
|
|
|
2008-02-05 12:34:32 -06:00
|
|
|
#
|
|
|
|
# Look for an installation.
|
|
|
|
#
|
2008-05-22 06:41:35 -05:00
|
|
|
FIND_PATH(HURRICANE_INCLUDE_PATH NAMES hurricane/Cell.h PATHS
|
2008-02-05 12:34:32 -06:00
|
|
|
# Look in other places.
|
2010-03-18 10:32:16 -05:00
|
|
|
${CORIOLIS_DIR_SEARCH}
|
2010-05-18 07:53:00 -05:00
|
|
|
PATH_SUFFIXES include/coriolis2 include
|
2008-02-05 12:34:32 -06:00
|
|
|
# Help the user find it if we cannot.
|
2008-09-08 03:46:18 -05:00
|
|
|
DOC "${HURRICANE_INCLUDE_PATH_DESCRIPTION}"
|
2008-02-05 12:34:32 -06:00
|
|
|
)
|
|
|
|
|
|
|
|
FIND_LIBRARY(HURRICANE_LIBRARY_PATH
|
|
|
|
NAMES hurricane
|
2010-03-18 10:32:16 -05:00
|
|
|
PATHS ${CORIOLIS_DIR_SEARCH}
|
2010-05-19 09:31:01 -05:00
|
|
|
PATH_SUFFIXES lib${LIB_SUFFIX}
|
2008-02-05 12:34:32 -06:00
|
|
|
# Help the user find it if we cannot.
|
2008-09-08 03:46:18 -05:00
|
|
|
DOC "${HURRICANE_LIBRARY_PATH_DESCRIPTION}"
|
|
|
|
)
|
|
|
|
|
2008-12-12 07:28:19 -06:00
|
|
|
FIND_PATH(HURRICANE_VIEWER_INCLUDE_PATH
|
|
|
|
NAMES hurricane/viewer/CellWidget.h
|
2010-03-18 10:32:16 -05:00
|
|
|
PATHS ${CORIOLIS_DIR_SEARCH}
|
2010-05-18 07:53:00 -05:00
|
|
|
PATH_SUFFIXES include/coriolis2 include
|
2008-05-22 06:36:13 -05:00
|
|
|
# Help the user find it if we cannot.
|
2008-09-08 03:46:18 -05:00
|
|
|
DOC "${HURRICANE_LIBRARY_PATH_DESCRIPTION}"
|
2008-05-22 06:36:13 -05:00
|
|
|
)
|
|
|
|
|
2008-12-12 07:28:19 -06:00
|
|
|
FIND_LIBRARY(HURRICANE_VIEWER_LIBRARY_PATH
|
2010-03-15 09:05:45 -05:00
|
|
|
NAMES viewer
|
2010-03-18 10:32:16 -05:00
|
|
|
PATHS ${CORIOLIS_DIR_SEARCH}
|
2010-05-19 09:31:01 -05:00
|
|
|
PATH_SUFFIXES lib${LIB_SUFFIX}
|
2008-05-22 06:36:13 -05:00
|
|
|
# Help the user find it if we cannot.
|
2008-09-08 03:46:18 -05:00
|
|
|
DOC "${HURRICANE_LIBRARY_PATH_DESCRIPTION}"
|
|
|
|
)
|
|
|
|
|
2008-10-24 04:11:47 -05:00
|
|
|
FIND_PATH(HURRICANE_PYTHON_INCLUDE_PATH
|
|
|
|
NAMES hurricane/isobar/PyCell.h
|
2010-03-18 10:32:16 -05:00
|
|
|
PATHS ${CORIOLIS_DIR_SEARCH}
|
2010-05-18 07:53:00 -05:00
|
|
|
PATH_SUFFIXES include/coriolis2 include
|
2008-10-24 04:11:47 -05:00
|
|
|
# Help the user find it if we cannot.
|
|
|
|
DOC "${HURRICANE_LIBRARY_PATH_DESCRIPTION}"
|
|
|
|
)
|
|
|
|
|
|
|
|
FIND_LIBRARY(HURRICANE_PYTHON_LIBRARY_PATH
|
|
|
|
NAMES isobar
|
2010-03-18 10:32:16 -05:00
|
|
|
PATHS ${CORIOLIS_DIR_SEARCH}
|
2010-05-19 09:31:01 -05:00
|
|
|
PATH_SUFFIXES lib${LIB_SUFFIX}
|
2008-10-24 04:11:47 -05:00
|
|
|
# Help the user find it if we cannot.
|
|
|
|
DOC "${HURRICANE_LIBRARY_PATH_DESCRIPTION}"
|
|
|
|
)
|
|
|
|
|
2008-11-26 03:35:07 -06:00
|
|
|
SET_LIBRARIES_PATH(HURRICANE HURRICANE)
|
|
|
|
SET_LIBRARIES_PATH(HURRICANE_GRAPHICAL HURRICANE_VIEWER)
|
2010-03-19 09:22:25 -05:00
|
|
|
SET_LIBRARIES_PATH(HURRICANE_PYTHON HURRICANE_PYTHON)
|
2008-11-26 03:35:07 -06:00
|
|
|
|
2008-12-12 07:28:19 -06:00
|
|
|
HURRICANE_CHECK_LIBRARIES(HURRICANE )
|
|
|
|
HURRICANE_CHECK_LIBRARIES(HURRICANE_GRAPHICAL ${HURRICANE_FIND_REQUIRED})
|
|
|
|
HURRICANE_CHECK_LIBRARIES(HURRICANE_PYTHON ${HURRICANE_FIND_REQUIRED})
|
2008-02-05 12:34:32 -06:00
|
|
|
|
2010-05-14 07:28:12 -05:00
|
|
|
#
|
|
|
|
# Adds -Wall to the C/C++ flags.
|
|
|
|
#
|
|
|
|
SET(CMAKE_C_FLAGS_DEBUG "-g -Wall" CACHE STRING "Debug options." FORCE)
|
|
|
|
SET(CMAKE_CXX_FLAGS_DEBUG "-g -Wall" CACHE STRING "Debug options." FORCE)
|
|
|
|
SET(CMAKE_C_FLAGS_RELEASE "-O3 -DNDEBUG -Wall" CACHE STRING "Release options." FORCE)
|
|
|
|
SET(CMAKE_CXX_FLAGS_RELEASE "-O3 -DNDEBUG -Wall" CACHE STRING "Release options." FORCE)
|
|
|
|
|
2008-02-05 12:34:32 -06:00
|
|
|
ENDIF(UNIX)
|