File: CMakeLists.txt

package info (click to toggle)
openturns 1.11-2
  • links: PTS, VCS
  • area: main
  • in suites: experimental
  • size: 64,144 kB
  • sloc: cpp: 202,072; python: 31,104; ansic: 8,352; makefile: 358; sh: 279; yacc: 123; lex: 43
file content (101 lines) | stat: -rw-r--r-- 3,655 bytes parent folder | download | duplicates (2)
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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
#                                               -*- cmake -*-

# Recurse in subdirectories
add_subdirectory (include)
add_subdirectory (src)
add_subdirectory (etc)

# Build the OpenTURNSConfig.cmake file
set (OPENTURNS_LIBRARY_DIRS            ${LIBRARY_PATH})
set (OPENTURNS_LIBRARY                 OT)
list (APPEND OPENTURNS_LIBRARIES       ${OPENTURNS_LIBRARY})
set (OPENTURNS_INCLUDE_DIR             ${INCLUDE_PATH})
list (INSERT OPENTURNS_INCLUDE_DIRS 0  ${OPENTURNS_INCLUDE_DIR})

set (OPENTURNS_ROOT_DIR       ${INSTALL_PATH})
set (OPENTURNS_VERSION_STRING ${PACKAGE_VERSION})
set (OPENTURNS_VERSION_MAJOR  ${CPACK_PACKAGE_VERSION_MAJOR})
set (OPENTURNS_VERSION_MINOR  ${CPACK_PACKAGE_VERSION_MINOR})
set (OPENTURNS_VERSION_PATCH  ${CPACK_PACKAGE_VERSION_PATCH})
set (OPENTURNS_USE_FILE       ${CONFIG_CMAKE_PATH}/UseOpenTURNS.cmake)

if(CMAKE_VERSION VERSION_LESS 2.8.8)
  # CMakePackageConfigHelpers is not available
  set (PACKAGE_INIT "
# Generated by a CMake version without CMakePackageConfigHelpers.
macro(set_and_check _var _value)
  set(\${_var} \"\${_value}\")
endmacro(set_and_check _var _value)
"    )
  foreach (_var
      OPENTURNS_USE_FILE
      OPENTURNS_ROOT_DIR
      OPENTURNS_INCLUDE_DIR
      OPENTURNS_INCLUDE_DIRS
      OPENTURNS_LIBRARY_DIRS
      OPENTURNS_SWIG_INCLUDE_DIRS)
    set(PACKAGE_${_var} ${${_var}})
  endforeach ()


  configure_file (OpenTURNSConfig.cmake.in
                   ${CMAKE_CURRENT_BINARY_DIR}/OpenTURNSConfig.cmake
                   @ONLY
                )
                 
  install (FILES UseOpenTURNS.cmake
                  ${CMAKE_CURRENT_BINARY_DIR}/OpenTURNSConfig.cmake
            DESTINATION ${OPENTURNS_CONFIG_CMAKE_PATH}
     )

else (CMAKE_VERSION VERSION_LESS 2.8.8)
  include(CMakePackageConfigHelpers)
  configure_package_config_file (
    OpenTURNSConfig.cmake.in
    ${CMAKE_CURRENT_BINARY_DIR}/OpenTURNSConfig.cmake
    INSTALL_DESTINATION ${OPENTURNS_CONFIG_CMAKE_PATH}
    PATH_VARS
      OPENTURNS_USE_FILE
      OPENTURNS_ROOT_DIR
      OPENTURNS_INCLUDE_DIR
      OPENTURNS_INCLUDE_DIRS
      OPENTURNS_LIBRARY_DIRS
      OPENTURNS_SWIG_INCLUDE_DIRS
    NO_CHECK_REQUIRED_COMPONENTS_MACRO
                               )                   
  write_basic_package_version_file(OpenTURNSConfigVersion.cmake VERSION ${OPENTURNS_VERSION_STRING} COMPATIBILITY AnyNewerVersion)               

  install (FILES UseOpenTURNS.cmake
                  ${CMAKE_CURRENT_BINARY_DIR}/OpenTURNSConfig.cmake
                  ${CMAKE_CURRENT_BINARY_DIR}/OpenTURNSConfigVersion.cmake
            DESTINATION ${OPENTURNS_CONFIG_CMAKE_PATH}
         )
endif (CMAKE_VERSION VERSION_LESS 2.8.8)

# Recurse in subdirectories : test should be run after src (for target OT to be built)
add_subdirectory (test)

if (DOXYGEN_FOUND)

  # generate Doxyfile
  set (VERSION ${PACKAGE_VERSION})
  set (builddir ${CMAKE_CURRENT_BINARY_DIR})
  set ( top_srcdir ${CMAKE_CURRENT_SOURCE_DIR})
  configure_file (${CMAKE_CURRENT_SOURCE_DIR}/Doxyfile.in
                   ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile
                    @ONLY)
                    
  # generate html doc and compress it
  add_custom_target (html 
                      COMMAND ${CMAKE_COMMAND} -E make_directory ${CMAKE_CURRENT_BINARY_DIR}/doc
                      COMMAND ${DOXYGEN_EXECUTABLE} Doxyfile
                      COMMAND tar czf doc-api-${PACKAGE_VERSION}.tar.gz doc
                      COMMAND tar cjf doc-api-${PACKAGE_VERSION}.tar.bz2 doc
                     )                   
                      
endif (DOXYGEN_FOUND)

install (FILES ${HEADERFILES}
          DESTINATION ${INCLUDE_PATH}/openturns
       )