summaryrefslogtreecommitdiff
path: root/3rdparty/CMakeLists.txt
diff options
context:
space:
mode:
authorflaviojs <flaviojs@54d463be-8e91-2dee-dedb-b68131a5f0ec>2011-07-01 15:43:58 +0000
committerflaviojs <flaviojs@54d463be-8e91-2dee-dedb-b68131a5f0ec>2011-07-01 15:43:58 +0000
commit0361920446e9311979b5187abf123ba8e055d944 (patch)
tree02d41953674d66ae58e0a5fae453f218b7934ae2 /3rdparty/CMakeLists.txt
parent1c39635e7f5788b4777ee9f07d45b2228edeb899 (diff)
downloadhercules-0361920446e9311979b5187abf123ba8e055d944.tar.gz
hercules-0361920446e9311979b5187abf123ba8e055d944.tar.bz2
hercules-0361920446e9311979b5187abf123ba8e055d944.tar.xz
hercules-0361920446e9311979b5187abf123ba8e055d944.zip
* CMake: marked executables as different components and other miscellaneous changes. [FlavioJS]
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@14877 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to '3rdparty/CMakeLists.txt')
-rw-r--r--3rdparty/CMakeLists.txt48
1 files changed, 48 insertions, 0 deletions
diff --git a/3rdparty/CMakeLists.txt b/3rdparty/CMakeLists.txt
index 6e5c759cc..0ea359186 100644
--- a/3rdparty/CMakeLists.txt
+++ b/3rdparty/CMakeLists.txt
@@ -1,4 +1,52 @@
+# macro to configure the use of local or system version of a package
+# Uses:
+# HAVE_LOCAL_${name} - is local version available?
+# ${name}_LOCAL_LIBRARIES - libraries of the local version
+# ${name}_LOCAL_INCLUDE_DIRS - include directories of the local version
+# HAVE_SYSTEM_${name} - is system version available?
+# ${name}_SYSTEM_LIBRARIES - libraries of the system version
+# ${name}_SYSTEM_INCLUDE_DIRS - include directories of the system version
+# Generates:
+# USE_LOCAL_${name} - use the local version of the package (only when local is available)
+# USE_${name} - use this package
+# ${name}_LIBRARIES - libraries
+# ${name}_INCLUDE_DIRS - include directories
+macro( CONFIGURE_USE_LOCAL_OR_SYSTEM name )
+ unset( ${name}_LIBRARIES CACHE )
+ unset( ${name}_INCLUDE_DIRS CACHE )
+ if( HAVE_LOCAL_${name} )
+ set( USE_LOCAL_${name} ON
+ CACHE BOOL "use local version of ${name}" )
+ else()
+ unset( USE_LOCAL_${name} CACHE )
+ endif()
+ if( USE_LOCAL_${name} )
+ message( STATUS "Configuring for local ${name}" )
+ set( ${name}_LIBRARIES ${${name}_LOCAL_LIBRARIES} )
+ set( ${name}_INCLUDE_DIRS ${${name}_LOCAL_INCLUDE_DIRS} )
+ message( STATUS "Configuring for local ${name} - done" )
+ elseif( HAVE_SYSTEM_${name} )
+ message( STATUS "Configuring for system ${name}" )
+ set( ${name}_LIBRARIES ${${name}_SYSTEM_LIBRARIES} )
+ set( ${name}_INCLUDE_DIRS ${${name}_SYSTEM_INCLUDE_DIRS} )
+ message( STATUS "Configuring for system ${name} - done" )
+ endif()
+ if( USE_LOCAL_${name} OR HAVE_SYSTEM_${name} )
+ set( USE_${name} ON
+ CACHE BOOL "use ${name}" )
+ else()
+ unset( USE_${name} CACHE )
+ endif()
+ set( ${name}_LIBRARIES ${${name}_LIBRARIES}
+ CACHE PATH "${name} libraries" )
+ set( ${name}_INCLUDE_DIRS ${${name}_INCLUDE_DIRS}
+ CACHE PATH "${name} include directories" )
+ mark_as_advanced( ${name}_LIBRARIES )
+ mark_as_advanced( ${name}_INCLUDE_DIRS )
+endmacro( CONFIGURE_USE_LOCAL_OR_SYSTEM )
+
+
add_subdirectory( msinttypes )
add_subdirectory( mt19937ar )
add_subdirectory( mysql )