[Tux4kids-commits] r464 - in tuxmath/trunk: . cmake-modules data doc src
tholy-guest at alioth.debian.org
tholy-guest at alioth.debian.org
Sun Apr 20 13:39:56 UTC 2008
Author: tholy-guest
Date: 2008-04-20 13:39:55 +0000 (Sun, 20 Apr 2008)
New Revision: 464
Added:
tuxmath/trunk/cmake-modules/
tuxmath/trunk/cmake-modules/FindMSGFMT.cmake
tuxmath/trunk/data/CMakeLists.txt
tuxmath/trunk/doc/CMakeLists.txt
Removed:
tuxmath/trunk/FindMSGFMT.cmake
Modified:
tuxmath/trunk/CMakeLists.txt
tuxmath/trunk/src/CMakeLists.txt
Log:
This looks like it might be an almost-working Mac OS X build. The
main things that are left are:
1. To make the .dmg file.
2. Internationalization
The executable hasn't been tested, because I have only terminal access.
Modified: tuxmath/trunk/CMakeLists.txt
===================================================================
--- tuxmath/trunk/CMakeLists.txt 2008-04-20 03:22:37 UTC (rev 463)
+++ tuxmath/trunk/CMakeLists.txt 2008-04-20 13:39:55 UTC (rev 464)
@@ -1,31 +1,32 @@
project (tuxmath)
-message("CMAKE_INSTALL_PREFIX is ${CMAKE_INSTALL_PREFIX}")
-
set (TUXMATH_VERSION "1.6.1")
set (TUXMATHADMIN_VERSION "0.1.1")
+## Allow loading of any tuxmath-specific CMake modules
+set(CMAKE_MODULE_PATH "${tuxmath_SOURCE_DIR}/cmake-modules")
+
+if (UNIX AND NOT APPLE)
+ message("CMAKE_INSTALL_PREFIX is ${CMAKE_INSTALL_PREFIX}")
+endif (UNIX AND NOT APPLE)
+message("TUXMATH_VERSION is ${TUXMATH_VERSION}")
+
## Define the extra paths
set (DATA_TUXMATH ${tuxmath_SOURCE_DIR}/data)
set (DOC_TUXMATH ${tuxmath_SOURCE_DIR}/doc)
set (PO_TUXMATH ${tuxmath_SOURCE_DIR}/po)
## Set up OS-specific path information
-set (EXTRA_INCLUDE)
-set (EXTRA_SRC)
+set (EXTRA_INCLUDE) # makes it blank
+set (EXTRA_SRC) # makes it blank
if (APPLE)
- set(DATA_PREFIX tuxmath.app/Contents/Resources/data)
- set(LOCALEDIR tuxmath.app/Contents/Resources/locale)
- # OS X does not have a pre-build libSDLmain, so we instead include
- # SDLmain as a source
+ set (MACOSX_BUNDLE_NAME tuxmath)
+ set(DATA_PREFIX ${MACOSX_BUNDLE_NAME}.app/Contents/Resources)
+ set(LOCALEDIR ${MACOSX_BUNDLE_NAME}.app/Contents/Resources/locale)
+ # OS X does not have a pre-built libSDLmain, so we instead include
+ # SDLmain.m as a source file
set (EXTRA_INCLUDE ${tuxmath_SOURCE_DIR}/macosx)
set (EXTRA_SRC ${tuxmath_SOURCE_DIR}/macosx/SDLMain.m)
- #include (CMakeFindFrameworks)
- set_source_files_properties (
- ${DATA_TUXMATH}
- PROPERTIES
- MACOSX_PACKAGE_LOCATION Resources
- )
elseif (UNIX)
# A non-apple Unix (Linux, Solaris, etc.)
set (DATA_PREFIX ${CMAKE_INSTALL_PREFIX}/share/tuxmath)
@@ -36,13 +37,28 @@
## compile the intl library
include (CheckSymbolExists)
check_symbol_exists (gettext libintl.h HAVE_GETTEXT)
-set(CMAKE_MODULE_PATH "${tuxmath_SOURCE_DIR}")
find_package (MSGFMT)
## Add subdirectories
add_subdirectory (src)
+add_subdirectory (data)
+add_subdirectory (doc)
if (HAVE_GETTEXT)
add_subdirectory (po)
endif (HAVE_GETTEXT)
+if (APPLE)
+ macro (getFramework headerDir)
+ string(REPLACE "/Headers" "" FRAMEWORK_SOURCE_DIR ${headerDir})
+ endmacro(getFramework)
+ set(FRAMEWORK_DEST_DIR ${tuxmath_BINARY_DIR}/src/${MACOSX_BUNDLE_NAME}.app/Contents/Frameworks)
+ getFramework(${SDL_INCLUDE_DIR})
+ install (DIRECTORY ${FRAMEWORK_SOURCE_DIR} DESTINATION ${FRAMEWORK_DEST_DIR})
+ getFramework(${SDLMIXER_INCLUDE_DIR})
+ install (DIRECTORY ${FRAMEWORK_SOURCE_DIR} DESTINATION ${FRAMEWORK_DEST_DIR})
+ getFramework(${SDLIMAGE_INCLUDE_DIR})
+ install (DIRECTORY ${FRAMEWORK_SOURCE_DIR} DESTINATION ${FRAMEWORK_DEST_DIR})
+ getFramework(${SDLTTF_INCLUDE_DIR})
+ install (DIRECTORY ${FRAMEWORK_SOURCE_DIR} DESTINATION ${FRAMEWORK_DEST_DIR})
+endif (APPLE)
Deleted: tuxmath/trunk/FindMSGFMT.cmake
===================================================================
--- tuxmath/trunk/FindMSGFMT.cmake 2008-04-20 03:22:37 UTC (rev 463)
+++ tuxmath/trunk/FindMSGFMT.cmake 2008-04-20 13:39:55 UTC (rev 464)
@@ -1,49 +0,0 @@
-#
-# Find the msgfmt program
-#
-# Defined variables:
-# MSGFMT_FOUND
-# MSGFMT_EXECUTABLE
-#
-# Macro:
-# ADD_TRANSLATIONS
-#
-# This requires that the variable LOCALEDIR be set to the place you
-# want to install the .mo files.
-
-
-IF(MSGFMT_EXECUTABLE)
- SET(MSGFMT_FOUND TRUE)
-ELSE(MSGFMT_EXECUTABLE)
- FIND_PROGRAM(MSGFMT_EXECUTABLE
- NAMES msgfmt gmsgfmt
- PATHS /bin /usr/bin /usr/local/bin )
- IF(MSGFMT_EXECUTABLE)
- SET(MSGFMT_FOUND TRUE)
- ELSE(MSGFMT_EXECUTABLE)
- IF(NOT MSGFMT_FIND_QUIETLY)
- IF(MSGFMT_FIND_REQUIRED)
- MESSAGE(FATAL_ERROR "msgfmt program couldn't be found")
- ENDIF(MSGFMT_FIND_REQUIRED)
- ENDIF(NOT MSGFMT_FIND_QUIETLY)
- ENDIF(MSGFMT_EXECUTABLE)
- MARK_AS_ADVANCED(MSGFMT_EXECUTABLE)
-ENDIF (MSGFMT_EXECUTABLE)
-
-MACRO(ADD_TRANSLATIONS _baseName)
- SET(_outputs)
- FOREACH(_file ${ARGN})
- GET_FILENAME_COMPONENT(_file_we ${_file} NAME_WE)
- SET(_out "${CMAKE_CURRENT_BINARY_DIR}/${_file_we}.gmo")
- SET(_in "${CMAKE_CURRENT_SOURCE_DIR}/${_file_we}.po")
- ADD_CUSTOM_COMMAND(
- OUTPUT ${_out}
- COMMAND ${MSGFMT_EXECUTABLE} -o ${_out} ${_in}
- DEPENDS ${_in} )
- INSTALL(FILES ${_out}
- DESTINATION ${LOCALEDIR}/${_file_we}/LC_MESSAGES/
- RENAME ${_baseName}.mo )
- SET(_outputs ${_outputs} ${_out})
- ENDFOREACH(_file)
- ADD_CUSTOM_TARGET(translations ALL DEPENDS ${_outputs})
-ENDMACRO(ADD_TRANSLATIONS)
Added: tuxmath/trunk/cmake-modules/FindMSGFMT.cmake
===================================================================
--- tuxmath/trunk/cmake-modules/FindMSGFMT.cmake (rev 0)
+++ tuxmath/trunk/cmake-modules/FindMSGFMT.cmake 2008-04-20 13:39:55 UTC (rev 464)
@@ -0,0 +1,49 @@
+#
+# Find the msgfmt program
+#
+# Defined variables:
+# MSGFMT_FOUND
+# MSGFMT_EXECUTABLE
+#
+# Macro:
+# ADD_TRANSLATIONS
+#
+# This requires that the variable LOCALEDIR be set to the place you
+# want to install the .mo files.
+
+
+IF(MSGFMT_EXECUTABLE)
+ SET(MSGFMT_FOUND TRUE)
+ELSE(MSGFMT_EXECUTABLE)
+ FIND_PROGRAM(MSGFMT_EXECUTABLE
+ NAMES msgfmt gmsgfmt
+ PATHS /bin /usr/bin /usr/local/bin )
+ IF(MSGFMT_EXECUTABLE)
+ SET(MSGFMT_FOUND TRUE)
+ ELSE(MSGFMT_EXECUTABLE)
+ IF(NOT MSGFMT_FIND_QUIETLY)
+ IF(MSGFMT_FIND_REQUIRED)
+ MESSAGE(FATAL_ERROR "msgfmt program couldn't be found")
+ ENDIF(MSGFMT_FIND_REQUIRED)
+ ENDIF(NOT MSGFMT_FIND_QUIETLY)
+ ENDIF(MSGFMT_EXECUTABLE)
+ MARK_AS_ADVANCED(MSGFMT_EXECUTABLE)
+ENDIF (MSGFMT_EXECUTABLE)
+
+MACRO(ADD_TRANSLATIONS _baseName)
+ SET(_outputs)
+ FOREACH(_file ${ARGN})
+ GET_FILENAME_COMPONENT(_file_we ${_file} NAME_WE)
+ SET(_out "${CMAKE_CURRENT_BINARY_DIR}/${_file_we}.gmo")
+ SET(_in "${CMAKE_CURRENT_SOURCE_DIR}/${_file_we}.po")
+ ADD_CUSTOM_COMMAND(
+ OUTPUT ${_out}
+ COMMAND ${MSGFMT_EXECUTABLE} -o ${_out} ${_in}
+ DEPENDS ${_in} )
+ INSTALL(FILES ${_out}
+ DESTINATION ${LOCALEDIR}/${_file_we}/LC_MESSAGES/
+ RENAME ${_baseName}.mo )
+ SET(_outputs ${_outputs} ${_out})
+ ENDFOREACH(_file)
+ ADD_CUSTOM_TARGET(translations ALL DEPENDS ${_outputs})
+ENDMACRO(ADD_TRANSLATIONS)
Added: tuxmath/trunk/data/CMakeLists.txt
===================================================================
--- tuxmath/trunk/data/CMakeLists.txt (rev 0)
+++ tuxmath/trunk/data/CMakeLists.txt 2008-04-20 13:39:55 UTC (rev 464)
@@ -0,0 +1,22 @@
+# The information in the data directory has to be placed in a location
+# that tuxmath can find
+
+if (UNIX)
+ if (APPLE)
+ # The MACOSX_PACKAGE_LOCATION source file property doesn't seem to
+ # work, so just do this by an explicit install command.
+ set (DESTDIR "${tuxmath_BINARY_DIR}/src/${DATA_PREFIX}")
+ # Install the icon file in the proper location
+ install (FILES images/icons/tuxmath.icns
+ DESTINATION ${DESTDIR})
+ else (APPLE)
+ # This sets it relative to the install location (usually /usr/local/)
+ set (DESTDIR "share/tuxmath")
+ endif (APPLE)
+ install (DIRECTORY .
+ DESTINATION ${DESTDIR}
+ PATTERN Makefile* EXCLUDE
+ PATTERN .svn EXCLUDE
+ PATTERN CMakeLists.txt EXCLUDE
+ PATTERN *~ EXCLUDE)
+endif (UNIX)
Added: tuxmath/trunk/doc/CMakeLists.txt
===================================================================
--- tuxmath/trunk/doc/CMakeLists.txt (rev 0)
+++ tuxmath/trunk/doc/CMakeLists.txt 2008-04-20 13:39:55 UTC (rev 464)
@@ -0,0 +1,18 @@
+# Install the documentation
+
+if (UNIX)
+ if (APPLE)
+ # The MACOSX_PACKAGE_LOCATION source file property doesn't seem to
+ # work, so just do this by an explicit install command.
+ set (DESTDIR "${tuxmath_BINARY_DIR}/src/${DATA_PREFIX}/doc")
+ else (APPLE)
+ # This sets it relative to the install location (usually /usr/local/)
+ set (DESTDIR "doc/tuxmath")
+ endif (APPLE)
+ install (DIRECTORY .
+ DESTINATION ${DESTDIR}
+ PATTERN Makefile* EXCLUDE
+ PATTERN .svn EXCLUDE
+ PATTERN CMakeLists.txt EXCLUDE
+ PATTERN *~ EXCLUDE)
+endif (UNIX)
Modified: tuxmath/trunk/src/CMakeLists.txt
===================================================================
--- tuxmath/trunk/src/CMakeLists.txt 2008-04-20 03:22:37 UTC (rev 463)
+++ tuxmath/trunk/src/CMakeLists.txt 2008-04-20 13:39:55 UTC (rev 464)
@@ -70,7 +70,7 @@
tuxmath
MACOSX_BUNDLE
WIN32
- ${SOURCES_TUXMATH} ${DATA_TUXMATH}
+ ${SOURCES_TUXMATH}
)
add_executable (
@@ -103,16 +103,4 @@
if (UNIX AND NOT APPLE)
install (TARGETS tuxmath tuxmathadmin
RUNTIME DESTINATION bin)
- install (DIRECTORY ${DATA_TUXMATH}/
- DESTINATION share/tuxmath
- PATTERN Makefile* EXCLUDE
- PATTERN .svn EXCLUDE
- PATTERN *~ EXCLUDE
- )
- install (DIRECTORY ${DOC_TUXMATH}/
- DESTINATION doc/tuxmath
- PATTERN Makefile* EXCLUDE
- PATTERN .svn EXCLUDE
- PATTERN *~ EXCLUDE
- )
endif(UNIX AND NOT APPLE)
More information about the Tux4kids-commits
mailing list