]> git.jsancho.org Git - lugaru.git/commitdiff
Added support for 'make install' target in CMake scripts
authorNeal Gompa <ngompa13@gmail.com>
Wed, 12 May 2010 02:21:26 +0000 (21:21 -0500)
committerNeal Gompa <ngompa13@gmail.com>
Wed, 12 May 2010 02:21:26 +0000 (21:21 -0500)
CMakeLists.txt

index ca13013ff324551c2cd349a648d866a933cff25b..0ea8c4708004ab9c050bf1bcd89c98d638b8905c 100644 (file)
@@ -2,6 +2,29 @@ project(lugaru)
 
 cmake_minimum_required(VERSION 2.6)
 
+if(NOT CMAKE_BUILD_TYPE)\r
+  set(CMAKE_BUILD_TYPE RelWithDebInfo CACHE STRING\r
+      "Choose the type of build, options are: None Debug Release RelWithDebInfo MinSizeRel"\r
+      FORCE)\r
+endif(NOT CMAKE_BUILD_TYPE)
+
+if(NOT LUGARU_INSTALL_PREFIX)
+  if(WIN32)
+     set(LUGARU_INSTALL_PREFIX C:\Lugaru CACHE PATH
+     "LUGARU_INSTALL_PREFIX: Install path prefix, prepended onto install directories."
+      FORCE)
+  else(WIN32)
+     set(LUGARU_INSTALL_PREFIX /usr/local/lugaru CACHE PATH
+     "CMAKE_INSTALL_PREFIX: Install path prefix, prepended onto install directories."
+      FORCE)
+  endif(WIN32)
+endif(NOT LUGARU_INSTALL_PREFIX)
+
+set(CMAKE_INSTALL_PREFIX "${LUGARU_INSTALL_PREFIX}" CACHE INTERNAL "Prefix
+prepended to install directories" FORCE)
+
+
+
 set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/Modules/")
 find_package(OpenAL REQUIRED)
 find_package(BZip2 REQUIRED)
@@ -29,3 +52,13 @@ include_directories(
 set(LUGARU_LIBS ${OPENAL_LIBRARY} ${PNG_LIBRARY} ${JPEG_LIBRARY} ${BZIP2_LIBRARIES} ${ZLIB_LIBRARIES} ${SDL_LIBRARY} ${GLU_LIBRARY} ${OPENGL_LIBRARY} ${VORBISFILE_LIBS} ${OGG_LIBS})
 
 add_subdirectory(Source)
+
+# Install target
+if(WIN32)
+       install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/Source/lugaru.exe DESTINATION ${CMAKE_INSTALL_PREFIX})
+else(WIN32)
+       install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/Source/lugaru DESTINATION ${CMAKE_INSTALL_PREFIX})
+endif(WIN32)
+
+install(DIRECTORY ${CMAKE_SOURCE_DIR}/Data DESTINATION ${CMAKE_INSTALL_PREFIX})
+