Restructure for camke build

This commit is contained in:
Mario Fetka
2011-11-13 17:37:22 +01:00
parent 79813c691a
commit 0fbc9baf41
102 changed files with 771 additions and 201 deletions

View File

@@ -0,0 +1,23 @@
# - Find libcrypt
# Find libcrypt that is provided by GNU C Library
# This module defines
# CRYPT_LIBRARIES, the libraries needed to use Crypt.
# CRYPT_FOUND, If false, do not try to use Crypt.
#
IF(CRYPT_LIBRARIES)
SET(CRYPT_FOUND TRUE)
ELSE(CRYPT_LIBRARIES)
find_library(CRYPT_LIBRARIES NAMES crypt PATHS
/usr/lib
/usr/local/lib
)
IF(CRYPT_LIBRARIES)
SET(CRYPT_FOUND TRUE)
MESSAGE(STATUS "Found Crypt: ${CRYPT_LIBRARIES}")
ELSE(CRYPT_LIBRARIES)
SET(CRYPT_FOUND FALSE)
ENDIF(CRYPT_LIBRARIES)
mark_as_advanced(CRYPT_LIBRARIES)
ENDIF(CRYPT_LIBRARIES)

View File

@@ -0,0 +1,48 @@
# - Find gdbm
# Find the native GDBM includes and library
#
# GDBM_INCLUDE_DIR - where to find gdbm.h, etc.
# GDBM_LIBRARIES - List of libraries when using gdbm.
# GDBM_FOUND - True if gdbm found.
IF (GDBM_INCLUDE_DIR)
# Already in cache, be silent
SET(GDBM_FIND_QUIETLY TRUE)
ENDIF (GDBM_INCLUDE_DIR)
FIND_PATH(GDBM_INCLUDE_DIR gdbm.h
/usr/local/include
/usr/include
/opt/local/include
)
SET(GDBM_NAMES gdbm)
FIND_LIBRARY(GDBM_LIBRARY
NAMES ${GDBM_NAMES}
PATHS /usr/lib /usr/local/lib /opt/local/lib
)
IF (GDBM_INCLUDE_DIR AND GDBM_LIBRARY)
SET(GDBM_FOUND TRUE)
SET( GDBM_LIBRARIES ${GDBM_LIBRARY} )
ELSE (GDBM_INCLUDE_DIR AND GDBM_LIBRARY)
SET(GDBM_FOUND FALSE)
SET( GDBM_LIBRARIES )
ENDIF (GDBM_INCLUDE_DIR AND GDBM_LIBRARY)
IF (GDBM_FOUND)
IF (NOT GDBM_FIND_QUIETLY)
MESSAGE(STATUS "Found GDBM: ${GDBM_LIBRARY}")
ENDIF (NOT GDBM_FIND_QUIETLY)
ELSE (GDBM_FOUND)
IF (GDBM_FIND_REQUIRED)
MESSAGE(STATUS "Looked for gdbm libraries named ${GDBMS_NAMES}.")
MESSAGE(FATAL_ERROR "Could NOT find gdbm library")
ENDIF (GDBM_FIND_REQUIRED)
ENDIF (GDBM_FOUND)
MARK_AS_ADVANCED(
GDBM_LIBRARY
GDBM_INCLUDE_DIR
)

View File

@@ -0,0 +1,100 @@
# - Define mars_nwe standard installation directories
# Inclusion of this module defines the following variables:
# MARS_NWE_INSTALL_<dir> - destination for files of a given type
# MARS_NWE_INSTALL_FULL_<dir> - corresponding absolute path
# where <dir> is one of:
# WEBDIR - user executables (bin)
# WEBBINDIR - user executables (bin)
# MODULESDIR - system admin executables (sbin)
# WEBACCESSDIR - read-only single-machine data (etc)
# ADMINDIR - modifiable single-machine data (var)
# CONFDIR - object code libraries (lib or lib64)
# BOOTSTRAPDIR - C header files for non-gcc (/usr/include)
# Each MARS_NWE_INSTALL_<dir> value may be passed to the DESTINATION options of
# install() commands for the corresponding file type. If the includer does
# not define a value the above-shown default will be used and the value will
# appear in the cache for editing by the user.
# Each MARS_NWE_INSTALL_FULL_<dir> value contains an absolute path constructed
# from the corresponding destination by prepending (if necessary) the value
# of MARS_NWE_INSTALL_PREFIX.
#=============================================================================
# Copyright 2011 Nikita Krupen'ko <krnekit@gmail.com>
# Copyright 2011 Kitware, Inc.
#
# Distributed under the OSI-approved BSD License (the "License");
# see accompanying file Copyright.txt for details.
#
# This software is distributed WITHOUT ANY WARRANTY; without even the
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
# Values whose defaults are relative to WEBDIR. Store empty values in
# the cache and store the defaults in local variables if the cache values are
# not set explicitly. This auto-updates the defaults as WEBDIRDIR changes.
if(NOT MARS_NWE_INSTALL_LIBEXECDIR)
set(MARS_NWE_INSTALL_LIBEXECDIR "" CACHE PATH "Shared libs (LIBDIR/mars_nwe)")
set(MARS_NWE_INSTALL_LIBEXECDIR "${CMAKE_INSTALL_LIBDIR}/mars_nwe")
endif()
if(NOT MARS_NWE_INSTALL_CONFDIR)
set(MARS_NWE_INSTALL_CONFDIR "" CACHE PATH "Mars Nwe config (SYSCONFDIR/mars_nwe)")
set(MARS_NWE_INSTALL_CONFDIR "${CMAKE_INSTALL_SYSCONFDIR}/mars_nwe")
endif()
if(NOT MARS_NWE_INSTALL_FILEDIR)
set(MARS_NWE_INSTALL_FILEDIR "" CACHE PATH "Mars Nwe file (LOCALSTATEDIR/mars_nwe)")
set(MARS_NWE_INSTALL_FILEDIR "/${CMAKE_INSTALL_LOCALSTATEDIR}/mars_nwe")
endif()
if(NOT MARS_NWE_INSTALL_SPOOLDIR)
set(MARS_NWE_INSTALL_SPOOLDIR "" CACHE PATH "Mars Nwe spool (LOCALSTATEDIR/spool/mars_nwe)")
set(MARS_NWE_INSTALL_SPOOLDIR "/${CMAKE_INSTALL_LOCALSTATEDIR}/spool/mars_nwe")
endif()
if(NOT MARS_NWE_DATA_DIR)
set(MARS_NWE_DATA_DIR "" CACHE PATH "Mars Nwe data (LOCALSTATEDIR/lib/mars_nwe)")
set(MARS_NWE_DATA_DIR "/${CMAKE_INSTALL_LOCALSTATEDIR}/lib/mars_nwe")
endif()
if(NOT MARS_NWE_LOG_DIR)
set(MARS_NWE_LOG_DIR "" CACHE PATH "Mars Nwe log (LOCALSTATEDIR/log/mars_nwe)")
set(MARS_NWE_LOG_DIR "/${CMAKE_INSTALL_LOCALSTATEDIR}/log/mars_nwe")
endif()
if(NOT MARS_NWE_PID_DIR)
set(MARS_NWE_PID_DIR "" CACHE PATH "Mars Nwe pid (LOCALSTATEDIR/run/mars_nwe)")
set(MARS_NWE_PID_DIR "/${CMAKE_INSTALL_LOCALSTATEDIR}/run/mars_nwe")
endif()
#-----------------------------------------------------------------------------
mark_as_advanced(
MARS_NWE_INSTALL_LIBEXEC
MARS_NWE_INSTALL_CONFDIR
MARS_NWE_INSTALL_FILEDIR
MARS_NWE_INSTALL_SPOOLDIR
MARS_NWE_DATA_DIR
MARS_NWE_LOG_DIR
MARS_NWE_PID_DIR
)
# Result directories
#
foreach(dir
LIBEXECDIR
CONFDIR
FILEDIR
SPOOLDIR
)
if(NOT IS_ABSOLUTE ${MARS_NWE_INSTALL_${dir}})
set(MARS_NWE_INSTALL_FULL_${dir} "${CMAKE_INSTALL_PREFIX}/${MARS_NWE_INSTALL_${dir}}")
else()
set(MARS_NWE_INSTALL_FULL_${dir} "${MARS_NWE_INSTALL_${dir}}")
endif()
endforeach()

View File

@@ -0,0 +1,22 @@
IF(NOT EXISTS "@CMAKE_BINARY_DIR@/install_manifest.txt")
MESSAGE(FATAL_ERROR "Cannot find install manifest: \"@CMAKE_BINARY_DIR@/install_manifest.txt\"")
ENDIF(NOT EXISTS "@CMAKE_BINARY_DIR@/install_manifest.txt")
FILE(READ "@CMAKE_BINARY_DIR@/install_manifest.txt" files)
STRING(REGEX REPLACE "\n" ";" files "${files}")
FOREACH(file ${files})
MESSAGE(STATUS "Uninstalling \"${file}\"")
IF(EXISTS "${file}")
EXEC_PROGRAM(
"@CMAKE_COMMAND@" ARGS "-E remove \"${file}\""
OUTPUT_VARIABLE rm_out
RETURN_VALUE rm_retval
)
IF("${rm_retval}" STREQUAL 0)
ELSE("${rm_retval}" STREQUAL 0)
MESSAGE(FATAL_ERROR "Problem when removing \"${file}\"")
ENDIF("${rm_retval}" STREQUAL 0)
ELSE(EXISTS "${file}")
MESSAGE(STATUS "File \"${file}\" does not exist.")
ENDIF(EXISTS "${file}")
ENDFOREACH(file)