Fix cmake

This commit is contained in:
Stefan Bühler 2009-02-03 17:57:18 +01:00
parent 62dbd731f6
commit 735b63c7f7
2 changed files with 17 additions and 12 deletions

View File

@ -11,14 +11,15 @@ MACRO(ADD_TARGET_PROPERTIES _target _name _properties)
IF(NOT _old_properties)
# in case it's NOTFOUND
SET(_old_properties)
ELSE(NOT _old_properties)
SET(_old_properties "${_old_properties} ")
ENDIF(NOT _old_properties)
SET_TARGET_PROPERTIES(${_target} PROPERTIES ${_name} "${_old_properties}${_properties}")
ENDMACRO(ADD_TARGET_PROPERTIES)
PROJECT(spawn-fcgi)
SET(PACKAGE_VERSION 1.0)
SET(PACKAGE_VERSION 1.3)
EXEC_PROGRAM(date ARGS "'+%b %d %Y %H:%M:%S UTC'" OUTPUT_VARIABLE PACKAGE_BUILD_DATE)
OPTION(USE_LIMITS "Enable /etc/security/limits.conf support" ON)
IF("${CMAKE_BUILD_TYPE}" STREQUAL "")
SET(CMAKE_BUILD_TYPE RelWithDebInfo CACHE STRING "Choose the type of build, options are: None(CMAKE_CXX_FLAGS or CMAKE_C_FLAGS used) Debug Release RelWithDebInfo MinSizeRel." FORCE)
@ -37,21 +38,18 @@ SET(MAIN_SOURCE ${MAIN_SOURCE} pam_limits.c)
ADD_DEFINITIONS(-DUSE_LIMITS)
ENDIF(USE_LIMITS)
SET(PACKAGE_NAME ${CMAKE_PROJECT_NAME})
SET(PACKAGE_VERSION ${PACKAGE_VERSION})
CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/config.h.cmake ${CMAKE_BINARY_DIR}/config.h ESCAPE_QUOTES)
ADD_DEFINITIONS(-DHAVE_CONFIG_H)
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR})
add_executable(spawn-fcgi ${MAIN_SOURCE})
ADD_TARGET_PROPERTIES(spawn-fcgi COMPILE_FLAGS "-std=gnu99 -Wall -g -Wshadow -W -pedantic -fPIC -D_GNU_SOURCE")
# GLIB 2
ADD_TARGET_PROPERTIES(spawn-fcgi LINK_FLAGS "${GLIB2_LDFLAGS}")
ADD_TARGET_PROPERTIES(spawn-fcgi COMPILE_FLAGS "${GLIB2_CFLAGS_OTHER}")
ADD_TARGET_PROPERTIES(spawn-fcgi COMPILE_DEFINITIONS "PACKAGE_NAME=${CMAKE_PROJECT_NAME}" PACKAGE_VERSION="${PACKAGE_VERSION}" PACKAGE_BUILD_DATE="${PACKAGE_BUILD_DATE}")
#ADD_DEFINITIONS(
# -DPACKAGE_NAME="\\"${CMAKE_PROJECT_NAME}\\""
# -DPACKAGE_VERSION="\\"${PACKAGE_VERSION}\\""
# -DPACKAGE_BUILD_DATE="\\"${PACKAGE_BUILD_DATE}\\""
# )
INSTALL(TARGETS spawn-fcgi DESTINATION bin)

7
config.h.cmake Normal file
View File

@ -0,0 +1,7 @@
/*
CMake autogenerated config.h file. Do not edit!
*/
#define PACKAGE_NAME "${PACKAGE_NAME}"
#define PACKAGE_VERSION "${PACKAGE_VERSION}"
#define PACKAGE_BUILD_DATE "${PACKAGE_BUILD_DATE}"