-
Notifications
You must be signed in to change notification settings - Fork 94
/
Copy pathCMakeLists.txt
99 lines (73 loc) · 2.46 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
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
cmake_minimum_required(VERSION 3.27)
include(cmake-scripts/common.cmake)
include(asy-pkg-version-suffix.cmake OPTIONAL RESULT_VARIABLE ASY_ADDR_VERSION_SUFFIX_FILE)
include(cmake-scripts/options.cmake)
include(pkg-info.cmake)
include(cmake-scripts/vcpkg-features.cmake)
project(${ASY_PACKAGE_NAME})
include(cmake-scripts/compiler-config.cmake)
include(cmake-scripts/basic-parameters.cmake)
include(cmake-scripts/buildfiles-to-src.cmake)
include(cmake-scripts/asy-files.cmake)
# setting build files
if (WIN32)
include(cmake-scripts/win32-specific.cmake)
endif()
build_files_to_src(CORE_BUILD_FILES CORE_SOURCE_FILES)
include(cmake-scripts/subrepo-projects.cmake)
include(cmake-scripts/external-libs.cmake)
include(cmake-scripts/thirdparty-impl.cmake)
include(cmake-scripts/backport-libs.cmake)
# PRC
add_subdirectory(prc/)
list(APPEND ASY_STATIC_LIBARIES PRC)
get_target_property(prc_incl_dir PRC INCLUDE_DIRECTORIES)
list(APPEND ASYMPTOTE_INCLUDES $<TARGET_PROPERTY:PRC,INCLUDE_DIRECTORIES>)
include(cmake-scripts/gnu-install-macros.cmake)
include(cmake-scripts/asy-macro.cmake)
include(cmake-scripts/generated-files.cmake)
# asy-reflect
if (ENABLE_CUDA_ASY_REFLECT)
message(STATUS "asy reflect target enabled")
add_subdirectory(cudareflect/)
endif()
# defining asy target
add_library(
asycore STATIC
${CORE_SOURCE_FILES}
${ASY_GENERATED_BUILD_SOURCES}
)
target_include_directories(asycore PUBLIC ${ASYMPTOTE_INCLUDES})
add_dependencies(asycore asy_gen_headers)
target_link_libraries(asycore PUBLIC ${ASY_STATIC_LIBARIES})
target_compile_definitions(asycore PUBLIC ${ASY_MACROS})
target_compile_options(asycore PUBLIC ${ASY_COMPILE_OPTS})
# asy executable
add_executable(
asy ${ASY_SRC_DIR}/main.cc ${ASY_WIN_RC_FILE}
)
target_link_libraries(asy PUBLIC asycore)
# base files
include(cmake-scripts/asy-base-files.cmake)
# asy + base files
add_custom_target(asy-basefiles DEPENDS ${ASY_OUTPUT_BASE_FILES})
add_custom_target(asy-with-basefiles ALL DEPENDS asy asy-basefiles)
# asy misc files
if (ENABLE_MISCFILES_GEN)
include(cmake-scripts/asy-misc-files.cmake)
endif()
# documentation generation
if (ENABLE_DOCGEN)
include(cmake-scripts/docgen.cmake)
endif()
# testing
enable_testing()
include(cmake-scripts/tests-asy.cmake)
include(cmake-scripts/tests-wce.cmake)
if (ENABLE_ASY_CXXTEST)
add_subdirectory(cxxtests)
endif()
# installation (on windows, pre-NSIS)
if (WIN32)
include(cmake-scripts/win32-pre-nsis-installer.cmake)
endif()