aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Bühler <stbuehler@web.de>2009-02-03 17:57:18 +0100
committerStefan Bühler <stbuehler@web.de>2009-02-03 17:57:18 +0100
commit735b63c7f7018f191ff412f72b44e6a13f1a6076 (patch)
treed87328f501d66a6da886f133ccc6926c12aeaf75
parent62dbd731f68c1cb1b8c41d222fa9cb60bb52b546 (diff)
downloadspawn-fcgi2-735b63c7f7018f191ff412f72b44e6a13f1a6076.tar.gz
spawn-fcgi2-735b63c7f7018f191ff412f72b44e6a13f1a6076.zip
Fix cmake
-rw-r--r--CMakeLists.txt22
-rw-r--r--config.h.cmake7
2 files changed, 17 insertions, 12 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 2368cfe..3724ecc 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -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}")
+ 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)
diff --git a/config.h.cmake b/config.h.cmake
new file mode 100644
index 0000000..27b5ec8
--- /dev/null
+++ b/config.h.cmake
@@ -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}"