forked from jeremyong/Selene
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
30 lines (23 loc) · 888 Bytes
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
cmake_minimum_required(VERSION 2.8)
project(Selene)
set(LUA_PC_CFG "lua lua5.3 lua5.2 lua5.1" CACHE STRING "pkg-config Lua configuration file")
find_package(PkgConfig)
pkg_search_module(LUA REQUIRED ${LUA_PC_CFG})
if(${LUA_INCLUDE_DIR})
if(NOT EXISTS ${LUA_INCLUDE_DIR}/lua.h)
message(SEND_ERROR "Can't find lua.h in ${LUA_INCLUDE_DIR}")
endif()
endif()
include_directories(${LUA_INCLUDE_DIR})
if(APPLE)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -std=c++11 -stdlib=libc++")
elseif(UNIX)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -std=c++11")
elseif(WIN32)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -std=c++11")
endif(APPLE)
include_directories(include)
file(GLOB headers RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}
include/*.h include/selene/*.h)
add_executable(test_runner ${CMAKE_CURRENT_SOURCE_DIR}/test/Test.cpp)
target_link_libraries(test_runner ${LUA_LIBRARIES})