-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
57 lines (48 loc) · 1.73 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
cmake_minimum_required(VERSION 3.22)
set(NATIVE_LANGUAGES C CXX)
if(APPLE)
list(APPEND NATIVE_LANGUAGES OBJC OBJCXX)
endif()
project(native
VERSION 0.0.1
LANGUAGES ${NATIVE_LANGUAGES}
DESCRIPTION "Build your macOS app with C++"
)
# Load Native CMake module
list(APPEND CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake")
include(cmake/native.cmake)
include(cmake/example.cmake)
# Load Noa CMake module
include(vendor/noa/cmake/noa.cmake)
include(vendor/noa/cmake/noa/defaults.cmake)
# Load install helpers
include(GNUInstallDirs)
include(CMakePackageConfigHelpers)
# Configure the Native CMake module
configure_package_config_file(
config.cmake.in
"${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}-config.cmake"
INSTALL_DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}")
write_basic_package_version_file(
"${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}-config-version.cmake"
COMPATIBILITY SameMajorVersion)
# Install the Native CMake module
install(FILES
"${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}-config-version.cmake"
"${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}-config.cmake"
DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}"
COMPONENT sourcemeta_native)
install(DIRECTORY
"${CMAKE_CURRENT_SOURCE_DIR}/cmake/resources/macos/"
"${CMAKE_CURRENT_SOURCE_DIR}/cmake/resources/win32/"
DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}"
COMPONENT sourcemeta_native)
# Install native functions like (native_add_app, native_set_profile)
install(FILES
"${CMAKE_CURRENT_SOURCE_DIR}/cmake/native.cmake"
DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}"
COMPONENT sourcemeta_native)
add_subdirectory(src/application)
add_subdirectory(src/ui)
add_subdirectory(src/sysmod)
add_subdirectory(example)