summaryrefslogtreecommitdiffhomepage
path: root/cmake/linux.cmake
blob: 520db1a997bcc17694d08d649c6cdb0fda035049 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
set(CMAKE_BUILD_TYPE_INIT RELEASE)

set(CMAKE_CXX_FLAGS "-std=c++14 -fPIC" CACHE STRING "" FORCE)
set(CMAKE_C_FLAGS "-fPIC" CACHE STRING "" FORCE)

set(CMAKE_AR "gcc-ar" CACHE STRING "" FORCE)
set(CMAKE_NM "gcc-nm" CACHE STRING "" FORCE)
set(CMAKE_RANLIB "gcc-ranlib" CACHE STRING "" FORCE)

set(CMAKE_C_FLAGS_RELEASE "-ffast-math -O3 -flto -fuse-linker-plugin -fvisibility=hidden -fPIC" CACHE STRING "" FORCE)
set(CMAKE_CXX_FLAGS_RELEASE " ${CMAKE_C_FLAGS_RELEASE} " CACHE STRING "" FORCE)

set(cmake-link-common "-std=c++14")
set(CMAKE_EXE_LINKER_FLAGS "${cmake-link-common}" CACHE STRING "" FORCE)
set(CMAKE_SHARED_LINKER_FLAGS ${cmake-link-common} CACHE STRING "" FORCE)
set(CMAKE_MODULE_LINKER_FLAGS ${cmake-link-common} CACHE STRING "" FORCE)

set(CMAKE_EXE_LINKER_FLAGS_RELEASE "-flto -fuse-linker-plugin" CACHE STRING "" FORCE)
set(CMAKE_SHARED_LINKER_FLAGS_RELEASE ${CMAKE_EXE_LINKER_FLAGS_RELEASE} CACHE STRING "" FORCE)
set(CMAKE_MODULE_LINKER_FLAGS_RELEASE ${CMAKE_EXE_LINKER_FLAGS_RELEASE} CACHE STRING "" FORCE)

set(OpenCV_DIR ~/dev/opentrack-depends/opencv/build)