compilation modulaire

This commit is contained in:
The Coriolis Project 2008-02-05 18:34:32 +00:00
parent 1b45c3b7c2
commit 716aa724f7
8 changed files with 102 additions and 18 deletions

View File

@ -9,7 +9,4 @@ find_package(BISON REQUIRED)
find_package(FLEX REQUIRED)
add_subdirectory(src)
set(DEST_DIR "$ENV{DESTDIR}")
configure_file(${HURRICANE_SOURCE_DIR}/hurricane.pc.cmake hurricane.pc @ONLY)
install(FILES ${HURRICANE_BINARY_DIR}/hurricane.pc DESTINATION /share/pkgconfig)
add_subdirectory(cmake_modules)

View File

@ -0,0 +1 @@
install(FILES FindHURRICANE.cmake DESTINATION /share/cmake_modules)

View File

@ -0,0 +1,96 @@
# - Find the Hurricane includes and libraries.
# The following variables are set if Hurricane is found. If HURRICANE is not
# found, Hurricane_FOUND is set to false.
# HURRICANE_FOUND - True when the Hurricane include directory is found.
# HURRICANE_INCLUDE_DIRS - the path to where the Hurricane include files are.
# HURRICANE_LIBRARY_DIRS - The path to where the Hurricane library files are.
SET(HURRICANE_INCLUDE_PATH_DESCRIPTION "directory containing the Hurricane include files. E.g /usr/local/include/hurricane or /asim/coriolis/include/hurricane")
SET(HURRICANE_DIR_MESSAGE "Set the HURRICANE_INCLUDE_DIR cmake cache entry to the ${HURRICANE_INCLUDE_PATH_DESCRIPTION}")
# don't even bother under WIN32
IF(UNIX)
SET(HURRICANE_DIR_SEARCH $ENV{HURRICANE_TOP})
IF(HURRICANE_DIR_SEARCH)
FILE(TO_CMAKE_PATH ${HURRICANE_DIR_SEARCH} HURRICANE_DIR_SEARCH)
ENDIF(HURRICANE_DIR_SEARCH)
#
# Look for an installation.
#
FIND_PATH(HURRICANE_INCLUDE_PATH NAMES Cell.h PATHS
# Look in other places.
${HURRICANE_DIR_SEARCH}
PATH_SUFFIXES include/hurricane
# Help the user find it if we cannot.
DOC "The ${HURRICANE_INCLUDE_PATH_DESCRIPTION}"
)
FIND_LIBRARY(HURRICANE_LIBRARY_PATH
NAMES hurricane
PATHS ${HURRICANE_DIR_SEARCH}
PATH_SUFFIXES lib
# Help the user find it if we cannot.
DOC "The ${HURRICANE_INCLUDE_PATH_DESCRIPTION}"
)
#MESSAGE("HURRICANE_DIR_SEARCH : ${HURRICANE_DIR_SEARCH}")
#MESSAGE("HURRICANE_LIBRARY_PATH : ${HURRICANE_LIBRARY_PATH}")
FIND_PATH(HURRICANE_GRAPHICAL_INCLUDE_PATH
NAMES CellViewer.h
PATHS ${HURRICANE_DIR_SEARCH}
PATH_SUFFIXES include/hurricane
# Help the user find it if we cannot.
DOC "The ${HURRICANE_INCLUDE_PATH_DESCRIPTION}"
)
FIND_LIBRARY(HURRICANE_GRAPHICAL_LIBRARY_PATH
NAMES hurricaneviewer
PATHS ${HURRICANE_DIR_SEARCH}
PATH_SUFFIXES lib
# Help the user find it if we cannot.
DOC "The ${HURRICANE_INCLUDE_PATH_DESCRIPTION}"
)
# Assume we didn't find it.
SET(HURRICANE_FOUND 0)
SET(HURRICANE_GRAPHICAL_FOUND 0)
IF(HURRICANE_INCLUDE_PATH)
IF (HURRICANE_LIBRARY_PATH)
SET(HURRICANE_FOUND "YES")
SET(HURRICANE_INCLUDE_DIR ${HURRICANE_INCLUDE_PATH})
SET(HURRICANE_LIBRARIES ${HURRICANE_LIBRARY_PATH} -lanalogic)
ENDIF(HURRICANE_LIBRARY_PATH)
ENDIF(HURRICANE_INCLUDE_PATH)
IF(HURRICANE_GRAPHICAL_INCLUDE_PATH)
IF (HURRICANE_GRAPHICAL_LIBRARY_PATH)
SET(HURRICANE_GRAPHICAL_FOUND "YES")
SET(HURRICANE_GRAPHICAL_INCLUDE_DIR ${HURRICANE_GRAPHICAL_INCLUDE_PATH})
SET(HURRICANE_GRAPHICAL_LIBRARIES ${HURRICANE_GRAPHICAL_LIBRARY_PATH} -lhurricaneeditor)
ENDIF(HURRICANE_GRAPHICAL_LIBRARY_PATH)
ENDIF(HURRICANE_GRAPHICAL_INCLUDE_PATH)
IF(NOT HURRICANE_FOUND)
IF(NOT HURRICANE_FIND_QUIETLY)
MESSAGE(STATUS "HURRICANE was not found. ${HURRICANE_DIR_MESSAGE}")
ELSE(NOT HURRICANE_FIND_QUIETLY)
IF(HURRICANE_FIND_REQUIRED)
MESSAGE(FATAL_ERROR "HURRICANE was not found. ${HURRICANE_DIR_MESSAGE}")
ENDIF(HURRICANE_FIND_REQUIRED)
ENDIF(NOT HURRICANE_FIND_QUIETLY)
ENDIF(NOT HURRICANE_FOUND)
MARK_AS_ADVANCED(
HURRICANE_INCLUDE_PATH
HURRICANE_LIBRARY_PATH
HURRICANE_GRAPHICAL_INCLUDE_PATH
HURRICANE_GRAPHICAL_LIBRARY_PATH
)
ENDIF(UNIX)

View File

@ -1,10 +0,0 @@
prefix=@DEST_DIR@
exec_prefix=${prefix}
libdir=${exec_prefix}/lib
includedir=${exec_prefix}/include
Name: hurricane
Description: Hurricane Libs
Version: 2.0.b
Libs: -L${libdir} -lanalogic -lhurricaneviewer -lhurricaneeditor -lhurricane
Cflags: -I${includedir}/coriolis/hurricane

View File

@ -45,5 +45,5 @@ TwoSpaces.cpp)
target_link_libraries(analogic hurricane)
install(FILES ${includes} DESTINATION /include/coriolis/hurricane)
install(FILES ${includes} DESTINATION /include/hurricane)
install(TARGETS analogic DESTINATION /lib)

View File

@ -12,5 +12,5 @@ QT4_WRAP_CPP(MOC_SRCS ${includes})
add_library(hurricaneeditor SHARED ${cpps} ${MOC_SRCS})
target_link_libraries(hurricaneeditor ${QT_LIBRARIES} hurricane)
install(FILES ${exports} DESTINATION /include/coriolis/hurricane)
install(FILES ${exports} DESTINATION /include/hurricane)
install(TARGETS hurricaneeditor DESTINATION /lib)

View File

@ -32,5 +32,5 @@ UserGo.cpp Vertical.cpp Warning.cpp)
add_library(hurricane SHARED ${cpps})
install(FILES ${includes} DESTINATION /include/coriolis/hurricane)
install(FILES ${includes} DESTINATION /include/hurricane)
install(TARGETS hurricane DESTINATION /lib)

View File

@ -11,5 +11,5 @@ QT4_WRAP_CPP(MOC_SRCS ${includes})
add_library(hurricaneviewer SHARED ${cpps} ${MOC_SRCS})
target_link_libraries(hurricaneviewer ${QT_LIBRARIES} hurricane)
install(FILES ${exports} DESTINATION /include/coriolis/hurricane)
install(FILES ${exports} DESTINATION /include/hurricane)
install(TARGETS hurricaneviewer DESTINATION /lib)