Updated Copyright year to 2013
[getmangos.git] / cmake / ImportACE.cmake
blobdc56135b85ac4bc8af90864de0622b468ba2ea12
2 # Copyright (C) 2005-2013 MaNGOS project <http://getmangos.com/>
4 # This program is free software; you can redistribute it and/or modify
5 # it under the terms of the GNU General Public License as published by
6 # the Free Software Foundation; either version 2 of the License, or
7 # (at your option) any later version.
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12 # GNU General Public License for more details.
14 # You should have received a copy of the GNU General Public License
15 # along with this program; if not, write to the Free Software
16 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
19 # Specify ace lib that was build externally
20 # add_library(ace SHARED IMPORTED)
21 # Sadly doesn't work in current version of cmake
22 # add_dependencies(ace ACE_Project)
23 # set_target_properties(ace PROPERTIES DEPENDS ACE_Project)
25 if(WIN32)
26   set(ACE_INCLUDE_DIR ${CMAKE_SOURCE_DIR}/dep/ACE_wrappers)
27   set(ACE_LIBRARIES_DIR ${CMAKE_SOURCE_DIR}/dep/ACE_wrappers/lib)
28   set(ACE_LIBRARIES optimized ACE debug ACEd)
29 else()
30   set(ACE_INCLUDE_DIR ${CMAKE_INSTALL_PREFIX}/include)
31   set(ACE_LIBRARIES_DIR ${CMAKE_INSTALL_PREFIX}/lib)
32   set(ACE_LIBRARIES ACE)
33 endif()
35 # Little Hack to remove the link warnings because of not found directories
36 if(XCODE)
37   foreach(DIR ${ACE_LIBRARIES_DIR})
38     foreach(CONF ${CMAKE_CONFIGURATION_TYPES})
39       file(MAKE_DIRECTORY ${DIR}/${CONF})
40     endforeach(CONF)
41   endforeach(DIR)
42 endif()
44 link_directories(
45   ${ACE_LIBRARIES_DIR}
48 set(HAVE_ACE_STACK_TRACE_H ON) # config.h.cmake
50 if(WIN32)
51   foreach(DIR ${ACE_LIBRARIES_DIR})
52     install(
53       DIRECTORY ${DIR}/ DESTINATION ${LIBS_DIR}
54       FILES_MATCHING PATTERN "*.dll*" #"*.${LIB_SUFFIX}*"
55       PATTERN "pkgconfig" EXCLUDE
56     )
57   endforeach(DIR)
58 endif()