Commits

Andrew Fenn committed 827b00b Draft

Added version string, defined correct install prefix

Comments (0)

Files changed (1)

 # statements.
 cmake_policy(SET CMP0005 NEW)
 
-set(TerrainCutter_VERSION_STRING "1.0.0")
-set(CMAKE_INSTALL_PREFIX "${CMAKE_CURRENT_BINARY_DIR}/RunPath")
+if(WIN32)
+    if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
+        set(CMAKE_INSTALL_PREFIX "${OGITOR_BUILD_DIR}/RunPath/Plugins" CACHE PATH "Ogitor install prefix" FORCE)
+    endif (CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
+else(WIN32)
+    if(NOT CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
+        set(CMAKE_INSTALL_PREFIX "/usr/local" CACHE PATH "Ogitor install prefix" FORCE)
+    endif (NOT CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
+endif(WIN32)
+
+set(TerrainCutter_VERSION_MAJOR "1")
+set(TerrainCutter_VERSION_MINOR "0")
+set(TerrainCutter_VERSION_PATCH "0")
+set(TerrainCutter_VERSION "${TerrainCutter_VERSION_MAJOR}.${TerrainCutter_VERSION_MINOR}.${TerrainCutter_VERSION_PATCH}")
+
 set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/CMakeModules/;${CMAKE_MODULE_PATH}")
 
 find_package(OGRE REQUIRED)
 
 
 set_target_properties(TerrainCutter PROPERTIES DEBUG_POSTFIX _d)
+set_target_properties(TerrainCutter PROPERTIES INSTALL_RPATH ${OGRE_INSTALL_DIR}/lib/OGRE)
+set_target_properties(TerrainCutter PROPERTIES VERSION ${TerrainCutter_VERSION} SOVERSION ${TerrainCutter_VERSION_MAJOR})
 
 if (UNIX)
     set(CMAKE_CXX_FLAGS -fPIC)
 endif()
 
 if (UNIX AND NOT APPLE)
+    set_target_properties( TerrainCutter PROPERTIES OUTPUT_NAME "OgTerrainCutter" )
     install(TARGETS TerrainCutter
-            LIBRARY DESTINATION lib
-            CONFIGURATIONS Release RelWithDebInfo MinSizeRel Debug)
+            LIBRARY DESTINATION lib/ogitor)
 endif()
 
 if(WIN32)