Compile with cmake
authorMiriam Ruiz <miriam@debian.org>
Wed, 3 Dec 2008 00:29:59 +0000 (3 01:29 +0100)
committerMiriam Ruiz <miriam@debian.org>
Wed, 3 Dec 2008 00:29:59 +0000 (3 01:29 +0100)
(Obtained from FreeBSD)

CMakeLists.txt [new file with mode: 0644]
cmake/FindZlib.cmake [new file with mode: 0644]
src/CMakeLists.txt [new file with mode: 0644]

diff --git a/CMakeLists.txt b/CMakeLists.txt
new file mode 100644 (file)
index 0000000..47aaf4f
--- /dev/null
@@ -0,0 +1,31 @@
+# Created by Tomas Chvatal (Scarabeus IV)
+###############################################################################
+# sdlpango/CMakeLists.txt
+###############################################################################
+SET ( VERSION "1.45" CACHE STRING "Version" ) # this is redefine able
+SET ( SONAME_VERSION "1" CACHE STRING "SONAME Version" )
+SET ( CMAKE_INSTALL_PREFIX "/usr/local/" CACHE PATH "Install path prefix" )
+SET ( CMAKE_INSTALL_LIBDIR lib )
+SET ( WORKDIR ${CMAKE_SOURCE_DIR}/src )
+###############################################################################
+
+PROJECT ( glpng C )
+SET ( APPNAME glpng )
+CMAKE_MINIMUM_REQUIRED ( VERSION 2.6.0 )
+CMAKE_MINIMUM_REQUIRED ( VERSION 2.6.0 FATAL_ERROR )
+IF ( COMMAND cmake_policy )
+       cmake_policy( SET CMP0003 NEW )
+ENDIF ( COMMAND cmake_policy )
+SET ( CMAKE_COLOR_MAKEFILE ON )
+SET ( CMAKE_BUILD_TYPE_SHARED_LIBS ON )
+# uninstall
+###############################################################################
+SET ( CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake" )
+FIND_PACKAGE ( Zlib REQUIRED)
+FIND_PACKAGE ( PNG REQUIRED )
+FIND_PACKAGE ( OpenGL REQUIRED )
+ADD_SUBDIRECTORY ( src )
+ADD_SUBDIRECTORY ( Example )
+# install include files
+FILE ( GLOB files "${CMAKE_SOURCE_DIR}/include/GL/*.h" )
+INSTALL ( FILES ${files} DESTINATION include/GL/ )
diff --git a/cmake/FindZlib.cmake b/cmake/FindZlib.cmake
new file mode 100644 (file)
index 0000000..f5c1497
--- /dev/null
@@ -0,0 +1,64 @@
+# - Find zlib
+# Find the native ZLIB includes and library
+#
+#  ZLIB_INCLUDE_DIR - where to find zlib.h, etc.
+#  ZLIB_LIBRARIES   - List of libraries when using zlib.
+#  ZLIB_FOUND       - True if zlib found.
+#
+#  Modified by Nicolas Schlumberger, (c) 2007
+#  to make it work on the Tardis Infrastucture of the ETH Zurich
+#
+IF(UNIX)
+  IF (ZLIB_INCLUDE_DIR)
+  # Already in cache, be silent
+    SET(ZLIB_FIND_QUIETLY TRUE)
+  ENDIF (ZLIB_INCLUDE_DIR)
+  FIND_PATH(ZLIB_INCLUDE_DIR zlib.h
+    /usr/pack/zziplib-0.13.49-sd/include/
+    /usr/local/include
+    /usr/include
+  )
+  SET(ZLIB_NAMES z zlib zdll)
+  FIND_LIBRARY(ZLIB_LIBRARY
+    NAMES ${ZLIB_NAMES}
+    PATHS /usr/pack/zziplib-0.13.49-sd/i686-debian-linux3.1/lib/ /usr/lib /usr/local/lib
+  )
+  IF (ZLIB_INCLUDE_DIR AND ZLIB_LIBRARY)
+    SET(ZLIB_FOUND TRUE)
+      SET( ZLIB_LIBRARIES ${ZLIB_LIBRARY} )
+  ELSE (ZLIB_INCLUDE_DIR AND ZLIB_LIBRARY)
+    SET(ZLIB_FOUND FALSE)
+    SET( ZLIB_LIBRARIES )
+  ENDIF (ZLIB_INCLUDE_DIR AND ZLIB_LIBRARY)
+  IF (ZLIB_FOUND)
+    IF (NOT ZLIB_FIND_QUIETLY)
+      MESSAGE(STATUS "Found ZLIB: ${ZLIB_LIBRARY}")
+    ENDIF (NOT ZLIB_FIND_QUIETLY)
+  ELSE (ZLIB_FOUND)
+    IF (ZLIB_FIND_REQUIRED)
+        MESSAGE(STATUS "Looked for Z libraries named ${ZLIBS_NAMES}.")
+        MESSAGE(FATAL_ERROR "Could NOT find z library")
+    ENDIF (ZLIB_FIND_REQUIRED)
+  ENDIF (ZLIB_FOUND)
+  MARK_AS_ADVANCED(
+    ZLIB_LIBRARY
+    ZLIB_INCLUDE_DIR
+  )
+ENDIF(UNIX)
+IF(WIN32)
+  IF(EXISTS "../libs/ogre/Dependencies/lib/Release")
+    SET (ZLIB_LIBRARY_DIR "../libs/ogre/Dependencies/lib/Release")
+  ENDIF(EXISTS "../libs/ogre/Dependencies/lib/Release")
+  FIND_PATH(ZLIB_INCLUDE_DIR zlib.h
+    ../libs/ogre/Dependencies/include
+  )
+  FIND_LIBRARY(ZLIB_LIBRARY
+    NAMES zlib
+    PATHS ${ZLIB_LIBRARY_DIR}
+  )
+  IF(ZLIB_LIBRARY AND ZLIB_INCLUDE_DIR)
+    MESSAGE(STATUS "Zlib was found.")
+  ELSE(ZLIB_LIBRARY AND ZLIB_INCLUDE_DIR)
+    MESSAGE(FATAL_ERROR "Zlib was NOT found.")
+  ENDIF(ZLIB_LIBRARY AND ZLIB_INCLUDE_DIR)
+ENDIF(WIN32)
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
new file mode 100644 (file)
index 0000000..cb26d04
--- /dev/null
@@ -0,0 +1,24 @@
+# Created by Tomas Chvatal (Scarabeus IV)
+###############################################################################
+# sdlpango/src/CMakeLists.txt
+###############################################################################
+INCLUDE_DIRECTORIES ( ${ZLIB_INCLUDE_DIR} ${PNG_INCLUDE_DIR}
+               ${OPENGL_INCLUDE_DIR}  ${CMAKE_SOURCE_DIR}/include/ )
+LINK_LIBRARIES ( ${CMAKE_DL_LIBS} ${ZLIB_LIBRARIES} ${PNG_LIBRARY}
+               ${OPENGL_LIBRARIES} )
+SET ( SRCS ${APPNAME}.c
+)
+SET(CMAKE_SHARED_LIBRARY_C_FLAGS "-fPIC")
+SET(CMAKE_STATIC_LIBRARY_C_FLAG "-Wl," )
+ADD_LIBRARY ( shared SHARED ${SRCS} )
+ADD_LIBRARY ( static STATIC ${SRCS} )
+SET_TARGET_PROPERTIES(shared static PROPERTIES OUTPUT_NAME glpng)
+SET_TARGET_PROPERTIES (shared PROPERTIES VERSION ${VERSION} SOVERSION ${SONAME_VERSION})
+#INCLUDE(MacroCreateLibtoolFile.cmake)
+#CREATE_LIBTOOL_FILE(pango-shared "/${CMAKE_INSTALL_LIBDIR}")
+INSTALL ( TARGETS shared
+       LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} )
+INSTALL ( TARGETS static
+       ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} )
+
+