cmake fixes

This commit is contained in:
Sears Russell 2011-05-14 03:52:09 +00:00
parent 801fb6de26
commit 88d9ce157a
2 changed files with 6 additions and 4 deletions

View file

@ -4,7 +4,7 @@ cmake_minimum_required(VERSION 2.4) # For all I know, 2.0 works too...
# The new behavior seems preferable, though it shouldn't affect us either way.
if(COMMAND cmake_policy)
cmake_policy(SET CMP0014 OLD)
cmake_policy(SET CMP0014 OLD) ## This breaks builds on older cmake...
cmake_policy(SET CMP0003 NEW)
endif(COMMAND cmake_policy)
@ -70,8 +70,10 @@ CHECK_FUNCTION_EXISTS(tdestroy HAVE_TDESTROY)
FIND_LIBRARY(DBUG_TEST dbug-stubs /home/sears/local/dbug/lib/)
if(NOT DBUG_TEST)
message(STATUS "dbug not found. proceeding with normal build")
SET(DBUG "")
else(NOT DBUG_TEST)
message(STATUS "found dbug ${DBUG_TEST}")
SET(DBUG ${DBUG_TEST})
endif(NOT DBUG_TEST)
SET(CMAKE_REQUIRED_FLAGS "-lm")
@ -141,7 +143,7 @@ INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}
LINK_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}/src/stasis)
IF ( "${CMAKE_C_COMPILER_ID}" STREQUAL "GNU" )
SET(COMMON_LIBRARIES stasis m pthread stdc++ ${DBUG_TEST})
SET(COMMON_LIBRARIES stasis m pthread stdc++ ${DBUG})
SET(CMAKE_C_FLAGS "-g -Wall -pedantic -std=gnu99 -DPBL_COMPAT -D_FILE_OFFSET_BITS=64 ${CMAKE_C_FLAGS}")
SET(CMAKE_CXX_FLAGS "-g -Wall -Wno-long-long -pedantic -DPBL_COMPAT -D_FILE_OFFSET_BITS=64 ${CMAKE_CXX_FLAGS}")
ELSEIF ( "${CMAKE_C_COMPILER_ID}" STREQUAL "SunPro" )
@ -151,7 +153,7 @@ ELSEIF ( "${CMAKE_C_COMPILER_ID}" STREQUAL "SunPro" )
ELSE( "${CMAKE_C_COMPILER_ID}" STREQUAL "GNU" )
# TODO: how to detect compilers correctly on old cmake??? This is a huge hack; it uses old gcc
# options, since cmake is old...
SET(COMMON_LIBRARIES stasis m pthread stdc++ ${DBUG_TEST})
SET(COMMON_LIBRARIES stasis m pthread stdc++ ${DBUG})
SET(CMAKE_C_FLAGS "-g -Wall -pedantic -std=gnu99 -DPBL_COMPAT -D_FILE_OFFSET_BITS=64 ${CMAKE_C_FLAGS}")
SET(CMAKE_CXX_FLAGS "-g -Wall -Wno-long-long -pedantic -DPBL_COMPAT -D_FILE_OFFSET_BITS=64 ${CMAKE_CXX_FLAGS}")
ENDIF ( "${CMAKE_C_COMPILER_ID}" STREQUAL "GNU" )

View file

@ -8,7 +8,7 @@
#cmakedefine HAVE_ALLOCA_H
#cmakedefine HAVE_TDESTROY
#cmakedefine HAVE_POWL
#cmakedefine DBUG_TEST
#cmakedefine DBUG
//#ifndef HAVE_PTHREAD_STACK_MIN
//#define PTHREAD_STACK_MIN 32768 // wild guess.
//#endif