-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCompilerSettings.cmake
45 lines (39 loc) · 1.55 KB
/
CompilerSettings.cmake
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
set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
if(CMAKE_COMPILER_IS_GNUCXX)
add_definitions(-W -Wall -Wextra -Wno-system-headers)
# prepend optimizion flag (in case the default setting doesn't include one)
set(CMAKE_CXX_FLAGS_RELEASE "-O3 ${CMAKE_CXX_FLAGS_RELEASE}")
endif(CMAKE_COMPILER_IS_GNUCXX)
if(CMAKE_CXX_COMPILER_ID MATCHES "^(Apple)?Clang$")
add_definitions(-W -Wall -Wextra -Wno-system-headers)
# prepend optimizion flag (in case the default setting doesn't include one)
set(CMAKE_CXX_FLAGS_RELEASE "-O3 ${CMAKE_CXX_FLAGS_RELEASE}")
endif()
if(MSVC)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /EHsc /MP /W1 -DNOMINMAX")
endif(MSVC)
if(CMAKE_CXX_COMPILER_ID STREQUAL "XL")
set(IS_XLC 1)
else()
set(IS_XLC 0)
endif()
if(IS_XLC)
add_definitions(-qpic -q64 -qmaxmem=-1)
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -q64")
set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} -q64")
endif(IS_XLC)
if(CMAKE_COMPILER_IS_GNUCXX AND NOT MINGW)
add_definitions(-fPIC)
endif(CMAKE_COMPILER_IS_GNUCXX AND NOT MINGW)
option(OMPL_SKIP_RPATH "Don't set RPATH to the OMPL library" OFF)
if(NOT OMPL_SKIP_RPATH)
# Set rpath, see https://gitlab.kitware.com/cmake/community/wikis/doc/cmake/RPATH-handling
set(CMAKE_SKIP_BUILD_RPATH OFF)
set(CMAKE_BUILD_WITH_INSTALL_RPATH OFF)
set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_FULL_LIBDIR}")
set(CMAKE_INSTALL_RPATH_USE_LINK_PATH ON)
endif()
# no prefix needed for python modules
set(CMAKE_SHARED_MODULE_PREFIX "")