forked from openturns/ev3
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
43 lines (33 loc) · 1.44 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
cmake_minimum_required (VERSION 2.8)
if (NOT DEFINED CMAKE_BUILD_TYPE)
set (CMAKE_BUILD_TYPE Release CACHE STRING "Build type")
endif ()
project (ev3 CXX)
set (project_dir ${ev3_SOURCE_DIR})
list (APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake)
if (MSVC)
if (NOT ${CMAKE_BUILD_TYPE} STREQUAL "")
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${project_dir}/${CMAKE_BUILD_TYPE}/bin)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${project_dir}/${CMAKE_BUILD_TYPE}/lib)
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${project_dir}/${CMAKE_BUILD_TYPE}/lib)
link_directories(${CMAKE_ARCHIVE_OUTPUT_DIRECTORY})
else()
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_DEBUG ${project_dir}/Debug/bin)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY_DEBUG ${project_dir}/Debug/lib)
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY_DEBUG ${project_dir}/Debug/lib)
link_directories(${CMAKE_ARCHIVE_OUTPUT_DIRECTORY_DEBUG})
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_RELEASE ${project_dir}/Release/bin)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE ${project_dir}/Release/lib)
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY_RELEASE ${project_dir}/Release/lib)
link_directories(${CMAKE_ARCHIVE_OUTPUT_DIRECTORY_RELEASE})
endif()
endif ()
option (BUILD_SHARED_LIBS "shared/static" ON)
if (MSVC)
find_package (Boost REQUIRED)
include_directories (${Boost_INCLUDE_DIRS})
list (APPEND EV3_DEFINITIONS -D_USE_MATH_DEFINES)
endif ()
add_definitions (${EV3_DEFINITIONS})
enable_testing()
add_subdirectory(lib)