forked from decimad/luabind-deboostified
-
Notifications
You must be signed in to change notification settings - Fork 1
/
CMakeLists.txt
68 lines (54 loc) · 1.87 KB
/
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
# Boost Software License http://www.boost.org/LICENSE_1_0.txt
# Copyright (c) 2010 The Luabind Authors
cmake_minimum_required(VERSION 3.16)
project(luabind)
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
option(LUABIND_HEADER_TEST "Compile-test header files" OFF)
option(LUABIND_BUILD_TESTS "Build executable tests" OFF)
option(LUABIND_BUILD_SHARED "Build shared library" ON)
option(LUABIND_BUILD_EXAMPLES "Build examples" OFF)
option(LUABIND_BUILD_DOC "Build documentation" OFF)
add_compile_definitions($<$<CONFIG:Debug>:DEBUG>)
add_compile_definitions($<$<CONFIG:Release>:NDEBUG>)
if(LUABIND_BUILD_SHARED)
add_compile_definitions(LUABIND_DYNAMIC_LINK)
endif()
if(MSVC)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /MP /permissive-")
endif()
if(CMAKE_COMPILER_IS_GNUCXX OR "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall")
endif()
if(NOT EXISTS "${CMAKE_BINARY_DIR}/conan.cmake")
message(STATUS "Downloading conan.cmake from https://github.com/nitrocaster/cmake-conan")
file(DOWNLOAD "https://github.com/nitrocaster/cmake-conan/raw/master/conan.cmake"
"${CMAKE_BINARY_DIR}/conan.cmake")
endif()
include("${CMAKE_BINARY_DIR}/conan.cmake")
if (WIN32)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin/$<CONFIG>")
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin/$<CONFIG>")
endif()
conan_add_remote(
NAME nitrocaster
URL https://api.bintray.com/conan/nitrocaster/conan
)
conan_cmake_run(
REQUIRES
luajit/2.0.5@nitrocaster/stable
doctest/2.3.8
OPTIONS
luajit:shared=True
BASIC_SETUP CMAKE_TARGETS
BUILD missing
)
include(GNUInstallDirs)
include("${CMAKE_BINARY_DIR}/conanbuildinfo.cmake")
include(luabind.cmake)
add_subdirectory(test)
if(LUABIND_BUILD_EXAMPLES)
add_subdirectory(examples)
endif()
if(LUABIND_BUILD_DOC)
add_subdirectory(doc)
endif()