Added some useful shared library macros to the build system, converted math to a...
[fail.git] / CMakeLists.txt
blob712c89ec10150b140f8cfe7f9069936d0638cb30
1 project( Awful C CXX )
3 set( CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR} )
5 set( LUA_MODULES_PATH ${CMAKE_INSTALL_PREFIX}/share/awful/lua-modules )
6 add_definitions( -DINSTALL_PREFIX='"${CMAKE_INSTALL_PREFIX}"' )
7 add_definitions( -DLUA_MODULES_PATH='"${LUA_MODULES_PATH}"' )
9 if( CMAKE_COMPILER_IS_GNUCXX )
10 # strict aliasing disabled because current gcc4.3 produces the warning when taking a reference or a pointer
11 # to a type_info using typeid. Will have to be reenabled when it's fixed.
12         add_definitions( -pipe -fPIC -pedantic -Wall -Wno-unused -fno-strict-aliasing -Wno-switch -Wno-long-long -fvisibility=hidden )
13 #       add_definitions( -pipe -fPIC -pedantic -Wall -Wno-unused -Wno-switch -Wno-long-long )
14 endif( CMAKE_COMPILER_IS_GNUCXX )
16 if( UNIX )
17         set( AWFUL_EXPORT "__attribute (( visibility (\"protected\") ))" )
18 endif( UNIX )
21 if( WIN32 )
22 # This should work both with gcc and vc++ (although there seem to be no point in
23 # ever building this with vc++, supposing that vc++ one day implements c++0x)
24         set( AWFUL_EXPORT "__declspec(dllexport)" )
25         set( AWFUL_IMPORT "__declspec(dllimport)" )
26 endif( WIN32 )
28 include_directories(
29         ${PROJECT_SOURCE_DIR}
30         ${PROJECT_SOURCE_DIR}/include
31         ${PROJECT_BINARY_DIR}/include
32         ${PROJECT_BINARY_DIR}/src
33         ${PROJECT_SOURCE_DIR}/libs
35 link_directories( ${PROJECT_SOURCE_DIR}/libs )
37 subdirs(
38         libs
39         src
40         lua-modules