|
1 | 1 | # This is the cmake config file for the Sky Culture Maker plugin |
2 | 2 | SET(SCM_VERSION "1.0.0") |
3 | 3 |
|
4 | | -# Option to manually control converter, defaults to TRUE, but overridden by Qt version |
5 | | -OPTION(SCM_SHOULD_ENABLE_CONVERTER "Attempt to enable Sky Culture Converter" TRUE) |
6 | | -SET(SCM_CONVERTER_ENABLED FALSE) # Default to disabled |
7 | | - |
8 | | -IF(SCM_SHOULD_ENABLE_CONVERTER AND NOT (QT_VERSION_MAJOR EQUAL "5")) |
9 | | - SET(SCM_CONVERTER_ENABLED TRUE) |
10 | | - MESSAGE(STATUS "Sky Culture Converter will be enabled.") |
11 | | - |
12 | | - # On macOS, Homebrew is a common way to install dependencies. |
13 | | - # We should look for it in the default locations for Apple Silicon and Intel macs |
14 | | - # to find the correct version of libtidy. Otherwise a system library might be used. |
15 | | - IF(APPLE) |
16 | | - LIST(APPEND CMAKE_PREFIX_PATH "/opt/homebrew" "/usr/local") |
17 | | - ENDIF() |
18 | | - |
19 | | - # download https://github.com/Stellarium/stellarium-skyculture-converter |
20 | | - CPMAddPackage( |
21 | | - NAME StellariumSkyCultureConverter |
22 | | - GITHUB_REPOSITORY Stellarium/stellarium-skyculture-converter |
23 | | - GIT_TAG master |
24 | | - OPTIONS |
25 | | - "SKYCULTURE_CONVERTER_BUILD_TESTS OFF" |
26 | | - ) |
27 | | - |
28 | | - # download https://github.com/selmf/unarr for archives |
29 | | - CPMAddPackage( |
30 | | - NAME unarr |
31 | | - GITHUB_REPOSITORY selmf/unarr |
32 | | - GIT_TAG v1.1.1 |
33 | | - OPTIONS |
34 | | - "USE_SYSTEM_BZ2 OFF" |
35 | | - "USE_SYSTEM_LZMA OFF" |
36 | | - ) |
37 | | - |
38 | | - IF(WIN32) |
39 | | - # Patch unarr's common/stream.c to include <objidl.h> after windows.h |
40 | | - # Ensure this runs after unarr source is available |
41 | | - IF(TARGET unarr AND EXISTS "${unarr_SOURCE_DIR}/common/stream.c") |
42 | | - FILE(READ "${unarr_SOURCE_DIR}/common/stream.c" _stream_c_content) |
43 | | - STRING(REPLACE "#define COBJMACROS\n#include <windows.h>\n" |
44 | | - "#define COBJMACROS\n#include <windows.h>\n#include <objidl.h>\n" |
45 | | - _stream_c_content "${_stream_c_content}") |
46 | | - FILE(WRITE "${unarr_SOURCE_DIR}/common/stream.c" "${_stream_c_content}") |
47 | | - ELSE() |
48 | | - MESSAGE(WARNING "unarr source directory or stream.c not found for patching. This might be an issue on Windows if the converter is enabled.") |
49 | | - ENDIF() |
50 | | - ENDIF(WIN32) |
51 | | - ADD_DEFINITIONS(-DSCM_CONVERTER_ENABLED_CPP) # Define for C++ |
52 | | -ELSE() |
53 | | - MESSAGE(STATUS "Sky Culture Converter is DISABLED (Qt version 5 or SCM_SHOULD_ENABLE_CONVERTER is OFF). Please ensure you are using Qt 6 or later to enable it.") |
54 | | -ENDIF() |
55 | | - |
56 | 4 | ADD_DEFINITIONS(-DSKYCULTUREMAKER_PLUGIN_VERSION="${SCM_VERSION}") |
57 | 5 | ADD_DEFINITIONS(-DSKYCULTUREMAKER_PLUGIN_LICENSE="GNU GPLv2 or later") |
58 | 6 |
|
|
0 commit comments