-
Notifications
You must be signed in to change notification settings - Fork 44
/
CMakeLists.txt
69 lines (53 loc) · 1.96 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
69
# Copyright (c) 2015-2016 Vittorio Romeo
# License: Academic Free License ("AFL") v. 3.0
# AFL License page: http://opensource.org/licenses/AFL-3.0
# http://vittorioromeo.info | [email protected]
cmake_minimum_required(VERSION 3.0)
# Include `vrm_cmake`.
list(APPEND CMAKE_MODULE_PATH
"${CMAKE_SOURCE_DIR}/../vrm_cmake/cmake/"
"${CMAKE_SOURCE_DIR}/extlibs/vrm_cmake/cmake/")
include(vrm_cmake)
# Basic project setup.
vrm_cmake_init_project(ecst)
vrm_cmake_find_extlib(vrm_pp)
vrm_cmake_find_extlib(vrm_core)
# TODO: improve/remove MinGW devel environment setup
# set(WIN_MINGW_DEVEL true)
if(DEFINED WIN_MINGW_DEVEL)
#{
add_definitions("-DECST_USE_MEGANZ_MINGW_THREAD")
find_package(SFML)
find_package(Boost 1.60.0 COMPONENTS thread)
link_directories("${CMAKE_SOURCE_DIR}/../SFML/lib/")
include_directories("${CMAKE_SOURCE_DIR}/../SFML/include/")
include_directories("${CMAKE_SOURCE_DIR}/../hana/include/")
include_directories(${Boost_INCLUDE_DIRS})
#}
endif()
# Alias the include directory.
set(ECST_INC_DIR "${ECST_SOURCE_DIR}/include/")
include_directories("${ECST_INC_DIR}")
# Other compiler flags.
vrm_cmake_add_common_compiler_flags()
# The `check` target runs all tests and examples.
vrm_check_target()
# Setup subdirectories.
add_subdirectory(test)
add_subdirectory(example)
# Create header-only install target (automatically glob)
vrm_cmake_header_only_install_glob("${ECST_INC_DIR}" "include")
# vrm_cmake_add_common_compiler_flags_suggest_attribute()
add_executable(particles "${ECST_SOURCE_DIR}/example/particles.cpp")
add_executable(pres_code "${ECST_SOURCE_DIR}/example/pres_code.cpp")
if(DEFINED WIN_MINGW_DEVEL)
#{
target_link_libraries(particles boost_system boost_thread)
target_link_libraries(pres_code boost_system boost_thread sfml-system sfml-graphics sfml-window)
#}
else()
#{
target_link_libraries(particles pthread)
target_link_libraries(pres_code pthread sfml-system sfml-graphics sfml-window)
#}
endif()