forked from nmoehrle/mvs-texturing
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
64 lines (53 loc) · 1.72 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
cmake_minimum_required(VERSION 3.1)
project(Texturing)
if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE Release)
endif()
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED yes)
# Compiler flags
if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
add_compile_options(/W3)
elseif(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
add_compile_options(-Wall -Wextra -Wundef -pedantic)
add_compile_options(-mpopcnt)
elseif(CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
add_compile_options(-Weverything -pedantic)
endif()
if(WIN32)
add_definitions(-DWIN32_LEAN_AND_MEAN -DVC_EXTRALEAN -DNOMINMAX)
add_definitions(-D_CRT_SECURE_NO_WARNINGS)
if(MSVC)
add_compile_options(/MP)
option(MVE_BUILD_WITH_SSE2 "Build MVE with SSE2 support" ON)
option(MVE_BUILD_WITH_SSE3 "Build MVE with SSE3 support" ON)
if(MVE_BUILD_WITH_SSE2)
add_definitions(-D__SSE2__)
endif()
if(MVE_BUILD_WITH_SSE3)
add_definitions(-D__SSE3__)
endif()
endif()
endif()
find_package(OpenMP REQUIRED)
#add_compile_options(${OpenMP_CXX_FLAGS})
if(OPENMP_FOUND)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS}")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${OpenMP_EXE_LINKER_FLAGS}")
endif()
find_package(JPEG REQUIRED)
find_package(PNG REQUIRED)
find_package(TIFF REQUIRED)
find_package(Eigen3 REQUIRED)
if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
find_package(TBB REQUIRED)
endif()
include_directories(SYSTEM
${CMAKE_SOURCE_DIR}/libs/mapmap/
${CMAKE_SOURCE_DIR}/libs/mapmap/mapmap
${CMAKE_SOURCE_DIR}/libs/mapmap/ext/dset
)
include_directories(libs)
add_subdirectory(libs)
add_subdirectory(apps)