diff --git a/hurricane/CMakeLists.txt b/hurricane/CMakeLists.txt index 65242362..4b85ff62 100644 --- a/hurricane/CMakeLists.txt +++ b/hurricane/CMakeLists.txt @@ -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) diff --git a/hurricane/cmake_modules/CMakeLists.txt b/hurricane/cmake_modules/CMakeLists.txt new file mode 100644 index 00000000..ca263e1e --- /dev/null +++ b/hurricane/cmake_modules/CMakeLists.txt @@ -0,0 +1 @@ +install(FILES FindHURRICANE.cmake DESTINATION /share/cmake_modules) diff --git a/hurricane/cmake_modules/FindHURRICANE.cmake b/hurricane/cmake_modules/FindHURRICANE.cmake new file mode 100644 index 00000000..e0622258 --- /dev/null +++ b/hurricane/cmake_modules/FindHURRICANE.cmake @@ -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) diff --git a/hurricane/hurricane.pc.cmake b/hurricane/hurricane.pc.cmake deleted file mode 100644 index 71968dcd..00000000 --- a/hurricane/hurricane.pc.cmake +++ /dev/null @@ -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 diff --git a/hurricane/src/analogic/CMakeLists.txt b/hurricane/src/analogic/CMakeLists.txt index abb86de6..504c1313 100644 --- a/hurricane/src/analogic/CMakeLists.txt +++ b/hurricane/src/analogic/CMakeLists.txt @@ -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) diff --git a/hurricane/src/editor/CMakeLists.txt b/hurricane/src/editor/CMakeLists.txt index 6f86f0aa..1c8a0e28 100644 --- a/hurricane/src/editor/CMakeLists.txt +++ b/hurricane/src/editor/CMakeLists.txt @@ -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) diff --git a/hurricane/src/hurricane/CMakeLists.txt b/hurricane/src/hurricane/CMakeLists.txt index 157f62e5..d181e0ff 100644 --- a/hurricane/src/hurricane/CMakeLists.txt +++ b/hurricane/src/hurricane/CMakeLists.txt @@ -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) diff --git a/hurricane/src/viewer/CMakeLists.txt b/hurricane/src/viewer/CMakeLists.txt index 2ca4670a..021b690c 100644 --- a/hurricane/src/viewer/CMakeLists.txt +++ b/hurricane/src/viewer/CMakeLists.txt @@ -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)