CMakeLists.txt 3.06 KB
Newer Older
1
2
cmake_minimum_required(VERSION 2.8.8)

3
project(VeloViewSuperBuild)
4
5
set (SuperBuild_CMAKE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/CMake")
set (SuperBuild_PROJECTS_DIR "${CMAKE_CURRENT_SOURCE_DIR}/Projects")
6
set (SuperBuild_BINARY_DIR ${VeloViewSuperBuild_BINARY_DIR})
7

8
9
10
11
12
13
14
15
16
17
#------------------------------------------------------------------------------
# Set a default build type if none was specified
if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
  message(STATUS "Setting build type to 'RelWithDebInfo' as none was specified.")
  set(CMAKE_BUILD_TYPE RelWithDebInfo CACHE STRING "Choose the type of build." FORCE)
  # Set the possible values of build type for cmake-gui
  set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "Debug" "Release"
    "MinSizeRel" "RelWithDebInfo")
endif()

18
19
20
21
22
#-----------------------------------------------------------------------------
# Collect information about the build platform.
include(CheckTypeSize)
check_type_size(void* VOID_PTR_SIZE BUILTIN_TYPES_ONLY)
if (VOID_PTR_SIZE EQUAL 8)
23
  set(VV_BUILD_ARCHITECTURE "64")
24
else ()
25
  set(VV_BUILD_ARCHITECTURE "32")
26
27
28
29
endif()

# Set suffix to be used for generating archives. This ensures that the package
# files have decent names that we can directly upload to the website.
30
set (package_suffix "${CMAKE_SYSTEM_NAME}-${VV_BUILD_ARCHITECTURE}bit")
31
32
33
34
35
36
37
38

#-----------------------------------------------------------------------------
# Setup CMAKE_MODULE_PATH so that platform specific configurations are processed
# before the generic ones.
set (CMAKE_MODULE_PATH
  "${SuperBuild_PROJECTS_DIR}"
  "${SuperBuild_CMAKE_DIR}"
  "${CMAKE_CURRENT_SOURCE_DIR}"
39
  "${CMAKE_CURRENT_SOURCE_DIR}/../CMake"
40
41
  ${CMAKE_MODULE_PATH})

42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
function (superbuild_find_projects var)
  # Some of these allow using system libraries.
  set(projects
    boost
    cxx11
    eigen
    liblas
    paraview
    pcap
    png
    python
    pythonqt
    qt4
    veloview
    veloview.bundle
    zlib
    )

  if (UNIX)
    list(APPEND projects
      libxml2
    )

    if (NOT APPLE)
      list(APPEND projects
        gperf
      )
    endif()
  endif()
71

72
73
74
75
  set("${var}"
    ${projects}
    PARENT_SCOPE)
endfunction ()
76
77
78


if (WIN32)
Bastien Jacquet's avatar
Bastien Jacquet committed
79
  # Since we only support superbuild compilation with ninja, let's provide it
Bastien Jacquet's avatar
Bastien Jacquet committed
80
81
  file(COPY ${SuperBuild_PROJECTS_DIR}/win32/ninja.exe
       DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
82
83
84
85
86
87
88
89
90
91
  if ( (NOT "${CMAKE_GENERATOR}" MATCHES "^NMake.*$") OR
       (NOT "${CMAKE_GENERATOR}" MATCHES "^Visual Studio.*$"))
    # not use VS environment. We need to be pointed to nmake and devenv paths
    # since they are needed when building tools (qt, python, etc.)
    find_program(DEVENV_PATH devenv)
    find_program(NMAKE_PATH nmake)
    mark_as_advanced(DEVENV_PATH NMAKE_PATH)
  endif()
endif()

92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
set(boost_libraries
  chrono
  date_time
  filesystem
  iostreams
  program_options
  system
  regex
  thread)
set(boost_extra_options
  "-sNO_BZIP2=1")

list(APPEND superbuild_version_files
  "${CMAKE_CURRENT_LIST_DIR}/versions.cmake")
list(APPEND superbuild_project_roots
  "${SuperBuild_PROJECTS_DIR}")

set(_superbuild_default_cxx11 ON)

add_subdirectory(common-superbuild)