PROJECT(SUPERTUX)
+## Some default settings
+
+set(DEBUG 0 CACHE BOOL "Build with debugging options")
+set(ENABLE_BINRELOC 0 CACHE BOOL "Enable autopackage's BINRELOC features")
+set(APPDATADIR "" CACHE STRING "APPDATADIR for autopackage's BINRELOC features")
+set(ENABLE_SQDBG 0 CACHE BOOL "Build squirrel script interpreter with debugging options")
+
## Search here for additional cmake modules (for finding deps)
set(CMAKE_MODULE_PATH ${SUPERTUX_SOURCE_DIR}/mk/cmake ${CMAKE_MODULE_PATH})
INCLUDE_DIRECTORIES(${PHYSFS_INCLUDE_DIR})
LINK_LIBRARIES(${PHYSFS_LIBRARY})
+#FIND_PACKAGE(ICONV REQUIRED)
+#INCLUDE_DIRECTORIES(${ICONV_INCLUDE_DIR})
+#LINK_LIBRARIES(${ICONV_LIBRARY})
+
+## Check platform-dependent build options
+
+INCLUDE(ConfigureChecks)
+
+## Create config.h
+
+configure_file(config.h.cmake ${CMAKE_BINARY_DIR}/config.h )
+include_directories (${CMAKE_BINARY_DIR}/)
+
## Also execute instructions in src/squirrel/CMakeLists.txt
ADD_SUBDIRECTORY(src/squirrel)
## Some additional include paths
-include_directories (${SUPERTUX_SOURCE_DIR}/)
include_directories (${SUPERTUX_SOURCE_DIR}/src/)
include_directories (${SUPERTUX_SOURCE_DIR}/src/squirrel/include/)
--- /dev/null
+#define PACKAGE_NAME "supertux"
+#define PACKAGE_VERSION "0.3.0"
+
+#cmakedefine DEBUG
+#cmakedefine ENABLE_SQDBG
+
+#cmakedefine ENABLE_BINRELOC
+#ifdef ENABLE_BINRELOC
+#define APPDATADIR ${APPDATADIR}
+#endif
+
+#define SIZEOF_VOID_P ${SIZEOF_VOID_P}
+#if SIZEOF_VOID_P == 8
+#define _SQ64
+#endif
+
+#cmakedefine HAVE_ICONV_CONST
+#ifdef HAVE_ICONV_CONST
+#define ICONV_CONST const
+#else
+#define ICONV_CONST
+#endif
+
--- /dev/null
+include(CheckCXXSourceCompiles)
+include(CheckTypeSize)
+
+check_cxx_source_compiles(
+ "
+ #include <iconv.h>
+ // this declaration will fail when there already exists a non const char** version which returns size_t
+ double iconv(iconv_t cd, char **inbuf, size_t *inbytesleft, char **outbuf, size_t *outbytesleft);
+ int main() { return 0; }
+ "
+ HAVE_ICONV_CONST
+)
+
+CHECK_TYPE_SIZE("void*" SIZEOF_VOID_P)
+message(STATUS "Size of void* is ${SIZEOF_VOID_P}")
+