-
Notifications
You must be signed in to change notification settings - Fork 2
/
CMakeLists.txt
66 lines (56 loc) · 1.79 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
65
66
cmake_minimum_required(VERSION 3.12...3.26)
project(
s2let
VERSION "2.2.6"
DESCRIPTION "Fast wavelets on the sphere"
HOMEPAGE_URL "http://astro-informatics.github.io/s2let/"
LANGUAGES C)
option(cfitsio "Links to cfitsio" OFF)
option(conan_deps "Download dependencies using conan" OFF)
if(conan_deps AND NOT cfitsio)
message(
WARNING "cfitsio is always included when managing dependencies via conan")
endif()
if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE "Debug")
endif()
include(CTest)
if(conan_deps OR CONAN_EDITABLE_MODE)
include("${PROJECT_SOURCE_DIR}/cmake/conan_dependencies.cmake")
endif()
if(EXISTS "${PROJECT_BINARY_DIR}/conan_paths.cmake")
include("${PROJECT_BINARY_DIR}/conan_paths.cmake")
elseif(EXISTS "${PROJECT_BINARY_DIR}/FindFFTW3.cmake")
list(APPEND CMAKE_MODULE_PATH "${PROJECT_BINARY_DIR}")
else()
list(APPEND CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake")
endif()
find_package(astro-informatics-so3 REQUIRED)
find_library(MATH_LIBRARY m)
if(cfitsio)
find_package(cfitsio REQUIRED)
endif()
add_subdirectory(src/main/c)
include(CTest)
if(BUILD_TESTING)
include("${PROJECT_SOURCE_DIR}/cmake/fetch_cmocka.cmake")
add_subdirectory(src/test/c)
endif()
if(SKBUILD)
find_package(PythonExtensions REQUIRED)
find_package(Cython REQUIRED)
find_package(NumPy REQUIRED)
add_subdirectory(src/main/pys2let)
elseif(NOT CONAN_EXPORTED)
include("${PROJECT_SOURCE_DIR}/cmake/exporting.cmake")
endif()
# only run documentation if this is not a sub-project
if(CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR)
find_package(Doxygen)
if(DOXYGEN_FOUND)
set(DOXYGEN_PROJECT_LOGO ${PROJECT_SOURCE_DIR}/docs/images/wav.png)
set(DOXYGEN_OPTIMIZE_OUTPUT_FOR_C "YES")
set(DOXYGEN_EXTRACT_ALL "YES")
doxygen_add_docs(docs src/main/c src/test/c include)
endif()
endif()