-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathCMakeLists.txt
37 lines (31 loc) · 1.12 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
cmake_minimum_required(VERSION 3.0)
# project
project(OpenSimAPI_Tutorials VERSION 1.0.0)
# for emacs completion
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
# for grouping into folders
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
# (backward compatibility with older compilers); c++11, -g option is
# used to export debug symbols for gdb
if(${CMAKE_CXX_COMPILER_ID} MATCHES GNU OR
${CMAKE_CXX_COMPILER_ID} MATCHES Clang)
# Using C++11 on OSX requires using libc++ instead of libstd++.
# libc++ is an implementation of the C++ standard library for OSX.
if(APPLE)
if(XCODE)
set(CMAKE_XCODE_ATTRIBUTE_CLANG_CXX_LANGUAGE_STANDARD "c++11")
set(CMAKE_XCODE_ATTRIBUTE_CLANG_CXX_LIBRARY "libc++")
else()
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -stdlib=libc++")
endif()
else()
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -O3 -g -Wno-deprecated -w")
# -fno-var-tracking-assignments
endif()
endif()
# configure for new version of OpenSim
find_package(OpenSim REQUIRED)
include_directories(${OpenSim_INCLUDE_DIRS})
link_directories(${OpenSim_LIB_DIR})
# sub-modules
add_subdirectory(src)