-
Notifications
You must be signed in to change notification settings - Fork 2
/
CMakeLists.txt
53 lines (39 loc) · 1.58 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
# Copyright (C) 2017 by Godlike
# This code is licensed under the MIT license (MIT)
# (http://opensource.org/licenses/MIT)
cmake_minimum_required(VERSION 3.1)
project(Pegasus)
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
option(PEGASUS_BUILD_DEMOS "Build Pegasus demo." ON)
option(PEGASUS_BUILD_TESTS "Build Pegasus tests." ON)
option(PEGASUS_BUILD_DEBUG "Build Pegasus debug." ON)
message(STATUS "${PROJECT_NAME} ${CMAKE_BUILD_TYPE} configuration:")
message(STATUS "-- PEGASUS_BUILD_DEMOS: ${PEGASUS_BUILD_DEMOS}")
message(STATUS "-- PEGASUS_BUILD_TESTS: ${PEGASUS_BUILD_TESTS}")
message(STATUS "-- PEGASUS_BUILD_DEBUG: ${PEGASUS_BUILD_DEBUG}")
set(PEGASUS_ROOT "${CMAKE_CURRENT_SOURCE_DIR}" CACHE STRING "Pegasus root directory.")
include(PegasusConfig)
if (NOT CMAKE_ARCHIVE_OUTPUT_DIRECTORY)
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/output/lib)
endif()
if (NOT CMAKE_LIBRARY_OUTPUT_DIRECTORY)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/output/lib)
endif()
if (NOT CMAKE_RUNTIME_OUTPUT_DIRECTORY)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/output)
endif()
add_subdirectory(Pegasus)
add_definitions(${PEGASUS_DEFINITIONS})
message(STATUS "Pegasus definitions:${PEGASUS_DEFINITIONS}")
if (${PEGASUS_BUILD_DEMOS})
add_subdirectory(demo)
endif()
if (PEGASUS_BUILD_TESTS)
enable_testing()
set(CATCH_ROOT ${CMAKE_CURRENT_SOURCE_DIR}/third_party/Catch)
add_subdirectory(test)
endif()
get_directory_property(HAS_PARENT PARENT_DIRECTORY)
if (HAS_PARENT)
set(PEGASUS_PHYSICS_LIB ${PEGASUS_LIB} PARENT_SCOPE)
endif()