mail[Wesnoth-commits] r34089 - in /branches/1.6: CMakeLists.txt cmake/SearchForStuff.cmake config.h.cmake


Others Months | Index by Date | Thread Index
>>   [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Header


Content

Posted by crazy-ivanovic on March 24, 2009 - 15:18:
Author: ivanovic
Date: Tue Mar 24 15:18:45 2009
New Revision: 34089

URL: http://svn.gna.org/viewcvs/wesnoth?rev=34089&view=rev
Log:
add the searching for sendfile/round to the cmake recipe
now a file for the defines is created automatically...

Added:
    branches/1.6/cmake/SearchForStuff.cmake
    branches/1.6/config.h.cmake
Modified:
    branches/1.6/CMakeLists.txt

Modified: branches/1.6/CMakeLists.txt
URL: 
http://svn.gna.org/viewcvs/wesnoth/branches/1.6/CMakeLists.txt?rev=34089&r1=34088&r2=34089&view=diff
==============================================================================
--- branches/1.6/CMakeLists.txt (original)
+++ branches/1.6/CMakeLists.txt Tue Mar 24 15:18:45 2009
@@ -2,8 +2,6 @@
 # what is not working so far:
 # * some other smaller stuff
 # * nice INSTALL howto
-# * check for poll(2) and select(2) as in SConstruct line 183 and if found, 
define same
-#   symbols as autoconf would.
 
 # set minimum version and make sure that things work with cmake 2.6, too
 cmake_minimum_required(VERSION 2.4.6)
@@ -34,6 +32,9 @@
 set(SDL_CONFIG "sdl-config" CACHE STRING "Path to sdl-config script")
 exec_program(${SDL_CONFIG} ARGS "--cflags" OUTPUT_VARIABLE SDL_CFLAGS)
 add_definitions(${SDL_CFLAGS})
+
+#check for some compiler/arch specific things and export defines 
accordingly...
+INCLUDE (SearchForStuff)
 
 #
 # Options

Added: branches/1.6/cmake/SearchForStuff.cmake
URL: 
http://svn.gna.org/viewcvs/wesnoth/branches/1.6/cmake/SearchForStuff.cmake?rev=34089&view=auto
==============================================================================
--- branches/1.6/cmake/SearchForStuff.cmake (added)
+++ branches/1.6/cmake/SearchForStuff.cmake Tue Mar 24 15:18:45 2009
@@ -1,0 +1,33 @@
+#check for some playtform specific things and export defines accordingly...
+#done basically the same was as AC_CHECK_HEADERS and AC_CHECK_FUNCS in 
configure.ac
+#the file is basically built upon the info available at
+#http://www.vtk.org/Wiki/CMake_HowToDoPlatformChecks
+INCLUDE(CheckIncludeFiles) 
+INCLUDE(CheckFunctionExists) 
+INCLUDE(CheckLibraryExists)
+
+#the two includes below seem to not be required, those headers are checked 
for
+#anyway, including them here, too...
+CHECK_INCLUDE_FILES(stdlib.h HAVE_STDLIB_H)
+CHECK_INCLUDE_FILES(unistd.h HAVE_UNISTD_H)
+
+#sendfile should be in one of the headers checked for here, so first check if
+#one of the headers is available and then check for 'sendfile'
+CHECK_INCLUDE_FILES(poll.h HAVE_POLL_H)
+CHECK_INCLUDE_FILES(sys/poll.h HAVE_SYS_POLL_H)
+CHECK_INCLUDE_FILES(sys/select.h HAVE_SYS_SELECT_H)
+if(HAVE_POLL_H OR HAVE_SYS_POLL_H OR HAVE_SYS_SELECT_H)
+  CHECK_FUNCTION_EXISTS(sendfile HAVE_SENDFILE)
+endif(HAVE_POLL_H OR HAVE_SYS_POLL_H OR HAVE_SYS_SELECT_H)
+
+#in configure.ac it is not explicitly tested, if it is in 'm', instead the 
first
+#test is if "floor" is available in m and later on it is checked if round,
+#sendfile and others do exist (with the 'm' lib linked), regarding our 
sources
+#we *only* want round from 'm'
+CHECK_LIBRARY_EXISTS(m round "" HAVE_ROUND)
+
+#use config.h.cmake to create a list of #defines comparable to the one 
configure
+#does, this file is created in the dir where cmake is run from
+CONFIGURE_FILE(${CMAKE_SOURCE_DIR}/config.h.cmake 
${CMAKE_CURRENT_BINARY_DIR}/src/config.h)
+#to make the compiler actually use the generated config.h
+add_definitions(-DHAVE_CONFIG_H)

Added: branches/1.6/config.h.cmake
URL: 
http://svn.gna.org/viewcvs/wesnoth/branches/1.6/config.h.cmake?rev=34089&view=auto
==============================================================================
--- branches/1.6/config.h.cmake (added)
+++ branches/1.6/config.h.cmake Tue Mar 24 15:18:45 2009
@@ -1,0 +1,8 @@
+/*this file is used to automatically set some defines and is used in the 
CMake recipe*/
+#cmakedefine HAVE_STDLIB_H 1
+#cmakedefine HAVE_UNISTD_H 1
+#cmakedefine HAVE_POLL_H 1
+#cmakedefine HAVE_SYS_POLL_H 1
+#cmakedefine HAVE_SYS_SELECT_H 1
+#cmakedefine HAVE_SENDFILE 1
+#cmakedefine HAVE_ROUND 1




Related Messages


Powered by MHonArc, Updated Tue Mar 24 15:40:40 2009