Moved lua-modules into src, because it didn't really made sense.
[fail.git] / CMakeLists.txt
blob0e906f9f64ed938bd3d346b622d467deabc121be
2 #   Fail game engine
3 #   Copyright 2007 Antoine Chavasse <a.chavasse@gmail.com>
4
5 #   This file is part of Fail.
7 #   Fail is free software; you can redistribute it and/or modify
8 #   it under the terms of the GNU General Public License version 3
9 #   as published by the Free Software Foundation.
11 #   Fail is distributed in the hope that it will be useful,
12 #   but WITHOUT ANY WARRANTY; without even the implied warranty of
13 #   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14 #   GNU General Public License for more details.
16 #   You should have received a copy of the GNU General Public License
17 #   along with this program.  If not, see <http://www.gnu.org/licenses/>.
19 cmake_minimum_required( VERSION 2.6 )
20 project( Fail C CXX )
22 set( CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake )
23 set( LUA_MODULES_DIR ${CMAKE_INSTALL_PREFIX}/share/lua/5.1 )
24 #${CMAKE_INSTALL_PREFIX}/share/fail/lua-modules )
26 find_package( Lua51 REQUIRED )
28 #add_definitions( -DINSTALL_PREFIX='${CMAKE_INSTALL_PREFIX}' )
29 #add_definitions( -DLUA_MODULES_PATH='${LUA_MODULES_PATH}' )
31 if( CMAKE_COMPILER_IS_GNUCXX )
32         add_definitions( -fvisibility=hidden -std=c++0x -pipe -fPIC -pedantic -Wall -Wno-unused -Wno-switch -Wno-long-long )
33 endif( CMAKE_COMPILER_IS_GNUCXX )
35 if( UNIX )
36         set( FAIL_EXPORT "__attribute (( visibility (\"default\") ))" )
37         set( FAIL_IMPORT "__attribute (( visibility (\"default\") ))" )
38 endif( UNIX )
41 if( WIN32 )
42 # This should work both with gcc and vc++ (although there seem to be no point in
43 # ever building this with vc++, assuming that vc++ one day implements c++0x)
44         set( FAIL_EXPORT "__declspec(dllexport)" )
45         set( FAIL_IMPORT "__declspec(dllimport)" )
46 endif( WIN32 )
48 set( LIBDIR lib )
50 include_directories(
51         ${PROJECT_SOURCE_DIR}
52         ${PROJECT_SOURCE_DIR}/src
53         ${PROJECT_BINARY_DIR}/include
56 include( Fail )
58 subdirs(
59         src