|
1 |
| -cmake_minimum_required(VERSION 3.4) |
2 |
| - |
3 |
| -project(wxmaxima) |
4 |
| - |
5 |
| -set(VERSION 18.10.0.unofficial) |
6 |
| -set(PACKAGE_VERSION ${VERSION}) |
7 |
| -set(GITVERSION ${VERSION}) |
8 |
| -set(PACKAGE wxMaxima) |
9 |
| - |
10 |
| -# Turn off many warnings wxWidgets triggers on MSVC |
11 |
| -if(MSVC) |
12 |
| - add_definitions(-D_CRT_SECURE_NO_WARNINGS) |
13 |
| -endif() |
14 |
| - |
15 |
| -# Set a default build type if none was specified |
16 |
| -if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES) |
17 |
| - message(STATUS "Setting build type to 'Debug' as none was specified.") |
18 |
| - set(CMAKE_BUILD_TYPE Debug CACHE STRING "Choose the type of build." FORCE) |
19 |
| - # Set the possible values of build type for cmake-gui |
20 |
| - set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "Debug" "Release" |
21 |
| - "MinSizeRel" "RelWithDebInfo") |
22 |
| -endif() |
23 |
| - |
24 |
| - |
25 |
| -if("${PROJECT_SOURCE_DIR}" STREQUAL "${PROJECT_BINARY_DIR}") |
26 |
| - message(WARNING "In-source builds are strongly discouraged. Please make an out-of-source-build instead (which means: run cmake and build the program from a different directory than the one the source package is in).") |
27 |
| -endif() |
28 |
| - |
29 |
| -# should the PDF doku be build from the texinfo source? (requires a TeX installation) |
30 |
| -option(BUILD_PDF_DOCUMENTATION "Build the PDF documentation." NO) |
31 |
| - |
32 |
| -# MacOSX version-min compiler settings |
33 |
| -if(MACOSX_VERSION_MIN) |
34 |
| - message(STATUS "Compiling with min macosx version ${MACOSX_VERSION_MIN}") |
35 |
| - set(CMAKE_CXX_FLAGS -mmacosx-version-min=${MACOSX_VERSION_MIN}) |
36 |
| - set(CMAKE_EXE_LINKER_FLAGS -mmacosx-version-min=${MACOSX_VERSION_MIN}) |
37 |
| - set(CMAKE_CXX_FLAGS_DEBUG -mmacosx-version-min=${MACOSX_VERSION_MIN}) |
38 |
| - set(CMAKE_EXE_LINKER_FLAGS_DEBUG -mmacosx-version-min=${MACOSX_VERSION_MIN}) |
39 |
| -endif() |
40 |
| - |
41 |
| - |
42 |
| -# Get the git version, if available. |
43 |
| -find_package(Git) |
44 |
| -if(Git_FOUND) |
45 |
| - if(EXISTS "${CMAKE_SOURCE_DIR}/.git") |
46 |
| - execute_process(COMMAND ${GIT_EXECUTABLE} rev-parse --short HEAD |
47 |
| - OUTPUT_VARIABLE WXMAXIMA_GIT_VERSION |
48 |
| - OUTPUT_STRIP_TRAILING_WHITESPACE) |
49 |
| - message(STATUS "Building from git development tree, revision: ${WXMAXIMA_GIT_VERSION}") |
50 |
| - add_definitions("-DWXMAXIMA_GIT_VERSION=\"${WXMAXIMA_GIT_VERSION}\"") |
51 |
| - endif() |
52 |
| -endif() |
53 |
| - |
54 |
| - |
55 |
| -add_subdirectory(locales) |
56 |
| -add_subdirectory(Doxygen) |
57 |
| -add_subdirectory(data) |
58 |
| -add_subdirectory(info) |
59 |
| -add_subdirectory(src) |
60 |
| - |
61 |
| -if(WIN32) |
62 |
| - install(FILES COPYING README README.md DESTINATION wxMaxima/doc) |
63 |
| - install(FILES test/testbench_simple.wxmx test/a.png test/b.png test/c.png test/d.png DESTINATION wxMaxima/data) |
64 |
| -else() |
65 |
| - install(FILES COPYING README README.md DESTINATION share/wxMaxima) |
66 |
| - install(FILES test/testbench_simple.wxmx test/a.png test/b.png test/c.png test/d.png DESTINATION share/wxMaxima) |
67 |
| -endif() |
68 |
| - |
69 |
| - |
70 |
| -# allow local execution (./wxmaxima-local) from the build directory without installation |
71 |
| -if(UNIX) |
72 |
| - file(COPY "${CMAKE_SOURCE_DIR}/src/wxmaxima-local" DESTINATION .) |
73 |
| -endif() |
74 |
| -# Build Packages |
75 |
| -set(CPACK_GENERATOR "TGZ;TBZ2") |
76 |
| -if(UNIX AND NOT APPLE) |
77 |
| - list(APPEND CPACK_GENERATOR "DEB") # Don't build DEB packages on MacOS |
78 |
| -endif() |
79 |
| - |
80 |
| -# build RPMs only if rpmbuild is installed |
81 |
| -find_program(RPMBUILD_EXECUTABLE rpmbuild) |
82 |
| -if(NOT RPMBUILD_EXECUTABLE) |
83 |
| - message(STATUS "rpmbuild not found - no RPM package will be build with make package.") |
84 |
| -else() |
85 |
| - message(STATUS "rpmbuild found - RPM package can be build with make package.") |
86 |
| - list(APPEND CPACK_GENERATOR "RPM") |
87 |
| -endif() |
88 |
| - |
89 |
| - |
90 |
| - |
91 |
| -set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "wxMaxima is a GUI for the CAS Maxima") |
92 |
| -set(CPACK_PACKAGE_VENDOR "The wxMaxima Team") |
93 |
| -set(CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_SOURCE_DIR}/README.md") |
94 |
| -set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_SOURCE_DIR}/COPYING") |
95 |
| -set(CPACK_SOURCE_PACKAGE_FILE_NAME "${CMAKE_PROJECT_NAME}-${VERSION}") |
96 |
| -set(CPACK_PACKAGE_CONTACT "The wxMaxima Team <[email protected]>") |
97 |
| -set(CPACK_PACKAGE_SECTION "science") |
98 |
| -set(CPACK_PACKAGE_ICON "${CMAKE_SOURCE_DIR}/data/wxmaxima.png") |
99 |
| -set(CPACK_PACKAGE_VERSION "${VERSION}") |
100 |
| - |
101 |
| - |
102 |
| -set(CPACK_DEBIAN_PACKAGE_SHLIBDEPS ON) |
103 |
| -set(CPACK_DEBIAN_PACKAGE_DEPENDS "maxima, maxima-doc") |
104 |
| -set(CPACK_DEBIAN_PACKAGE_SUGGESTS "jsmath-fonts") |
105 |
| - |
106 |
| -set(CPACK_RPM_PACKAGE_SUGGESTS "jsmath-fonts") |
107 |
| - |
108 |
| -# Build a tarball |
109 |
| -set(CPACK_SOURCE_IGNORE_FILES |
110 |
| - "build/" |
111 |
| - ".git/" |
112 |
| - ".gitignore" |
113 |
| - ".gitattributes" |
114 |
| - "Doxygen/html/" |
115 |
| - "\\\\.gmo$" |
116 |
| - "\\\\.mo$" |
117 |
| - "~$" |
118 |
| - "CPackConfig.cmake" |
119 |
| - "CPackSourceConfig.cmake" |
120 |
| - "CMakeCache.txt" |
121 |
| - "CMakeFiles" |
122 |
| - "_CPack_Packages" |
123 |
| - "wxmaxima-.*\\\\.tgz$" |
124 |
| - "wxmaxima-.*\\\\.deb$" |
125 |
| - "wxmaxima-.*\\\\.rpm$" |
126 |
| - "wxmaxima-.*\\\\.bz2$" |
127 |
| - "wxmaxima-.*\\\\.xz$" |
128 |
| - "wxmaxima-.*\\\\.Z$" |
129 |
| - "wxmaxima-.*\\\\.gz$" |
130 |
| - "${CPACK_SOURCE_IGNORE_FILES}") |
131 |
| - |
132 |
| -add_custom_target(dist COMMAND ${CMAKE_MAKE_PROGRAM} package_source) |
133 |
| - |
134 |
| -# Debian wants to be able to download a signature of the source package from the |
135 |
| -# project's download directory. If it cannot find it it will still work, but will |
136 |
| -# issue a warning. For details see |
137 |
| -# https://lintian.debian.org/tags/debian-watch-may-check-gpg-signature.html |
138 |
| -find_program(gpg NAMES gpg pgp) |
139 |
| -add_custom_target(gpg DEPENDS dist |
140 |
| - COMMAND ${gpg} --armor --detach-sign ${CPACK_SOURCE_PACKAGE_FILE_NAME}.tar.bz2 |
141 |
| - COMMAND ${gpg} --armor --detach-sign ${CPACK_SOURCE_PACKAGE_FILE_NAME}.tar.gz |
142 |
| - COMMAND ${gpg} --armor --detach-sign ${CPACK_SOURCE_PACKAGE_FILE_NAME}.tar.xz |
143 |
| - COMMAND ${gpg} --armor --detach-sign ${CPACK_SOURCE_PACKAGE_FILE_NAME}.tar.Z) |
144 |
| - |
145 |
| - |
146 |
| -add_custom_target(checksums |
147 |
| - ${CMAKE_COMMAND} -DVERSION=${VERSION} -DCMAKE_SYSTEM_NAME=${CMAKE_SYSTEM_NAME} -P ${CMAKE_SOURCE_DIR}/checksums.cmake) |
148 |
| - |
149 |
| -include(CPack) |
| 1 | +cmake_minimum_required(VERSION 3.4) |
| 2 | + |
| 3 | +project(wxmaxima) |
| 4 | + |
| 5 | +set(VERSION 18.10.0.unofficial) |
| 6 | +set(PACKAGE_VERSION ${VERSION}) |
| 7 | +set(GITVERSION ${VERSION}) |
| 8 | +set(PACKAGE wxMaxima) |
| 9 | + |
| 10 | +# Turn off many warnings wxWidgets triggers on MSVC |
| 11 | +if(MSVC) |
| 12 | + add_definitions(-D_CRT_SECURE_NO_WARNINGS) |
| 13 | +endif() |
| 14 | + |
| 15 | +# Set a default build type if none was specified |
| 16 | +if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES) |
| 17 | + message(STATUS "Setting build type to 'Debug' as none was specified.") |
| 18 | + set(CMAKE_BUILD_TYPE Debug CACHE STRING "Choose the type of build." FORCE) |
| 19 | + # Set the possible values of build type for cmake-gui |
| 20 | + set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "Debug" "Release" |
| 21 | + "MinSizeRel" "RelWithDebInfo") |
| 22 | +endif() |
| 23 | + |
| 24 | + |
| 25 | +if("${PROJECT_SOURCE_DIR}" STREQUAL "${PROJECT_BINARY_DIR}") |
| 26 | + message(WARNING "In-source builds are strongly discouraged. Please make an out-of-source-build instead (which means: run cmake and build the program from a different directory than the one the source package is in).") |
| 27 | +endif() |
| 28 | + |
| 29 | +# should the PDF doku be build from the texinfo source? (requires a TeX installation) |
| 30 | +option(BUILD_PDF_DOCUMENTATION "Build the PDF documentation." NO) |
| 31 | + |
| 32 | +# MacOSX version-min compiler settings |
| 33 | +if(MACOSX_VERSION_MIN) |
| 34 | + message(STATUS "Compiling with min macosx version ${MACOSX_VERSION_MIN}") |
| 35 | + set(CMAKE_CXX_FLAGS -mmacosx-version-min=${MACOSX_VERSION_MIN}) |
| 36 | + set(CMAKE_EXE_LINKER_FLAGS -mmacosx-version-min=${MACOSX_VERSION_MIN}) |
| 37 | + set(CMAKE_CXX_FLAGS_DEBUG -mmacosx-version-min=${MACOSX_VERSION_MIN}) |
| 38 | + set(CMAKE_EXE_LINKER_FLAGS_DEBUG -mmacosx-version-min=${MACOSX_VERSION_MIN}) |
| 39 | +endif() |
| 40 | + |
| 41 | + |
| 42 | +# Get the git version, if available. |
| 43 | +find_package(Git) |
| 44 | +if(Git_FOUND) |
| 45 | + if(EXISTS "${CMAKE_SOURCE_DIR}/.git") |
| 46 | + execute_process(COMMAND ${GIT_EXECUTABLE} rev-parse --short HEAD |
| 47 | + OUTPUT_VARIABLE WXMAXIMA_GIT_VERSION |
| 48 | + OUTPUT_STRIP_TRAILING_WHITESPACE) |
| 49 | + message(STATUS "Building from git development tree, revision: ${WXMAXIMA_GIT_VERSION}") |
| 50 | + add_definitions("-DWXMAXIMA_GIT_VERSION=\"${WXMAXIMA_GIT_VERSION}\"") |
| 51 | + endif() |
| 52 | +endif() |
| 53 | + |
| 54 | + |
| 55 | +add_subdirectory(locales) |
| 56 | +add_subdirectory(Doxygen) |
| 57 | +add_subdirectory(data) |
| 58 | +add_subdirectory(info) |
| 59 | +add_subdirectory(src) |
| 60 | + |
| 61 | +if(WIN32) |
| 62 | + install(FILES COPYING README README.md DESTINATION wxMaxima/doc) |
| 63 | + install(FILES test/testbench_simple.wxmx test/a.png test/b.png test/c.png test/d.png DESTINATION wxMaxima/data) |
| 64 | +else() |
| 65 | + install(FILES COPYING README README.md DESTINATION share/wxMaxima) |
| 66 | + install(FILES test/testbench_simple.wxmx test/a.png test/b.png test/c.png test/d.png DESTINATION share/wxMaxima) |
| 67 | +endif() |
| 68 | + |
| 69 | + |
| 70 | +# allow local execution (./wxmaxima-local) from the build directory without installation |
| 71 | +if(UNIX) |
| 72 | + file(COPY "${CMAKE_SOURCE_DIR}/src/wxmaxima-local" DESTINATION .) |
| 73 | +endif() |
| 74 | +# Build Packages |
| 75 | +set(CPACK_GENERATOR "TGZ;TBZ2") |
| 76 | +if(UNIX AND NOT APPLE) |
| 77 | + list(APPEND CPACK_GENERATOR "DEB") # Don't build DEB packages on MacOS |
| 78 | +endif() |
| 79 | + |
| 80 | +# build RPMs only if rpmbuild is installed |
| 81 | +find_program(RPMBUILD_EXECUTABLE rpmbuild) |
| 82 | +if(NOT RPMBUILD_EXECUTABLE) |
| 83 | + message(STATUS "rpmbuild not found - no RPM package will be build with make package.") |
| 84 | +else() |
| 85 | + message(STATUS "rpmbuild found - RPM package can be build with make package.") |
| 86 | + list(APPEND CPACK_GENERATOR "RPM") |
| 87 | +endif() |
| 88 | + |
| 89 | + |
| 90 | + |
| 91 | +set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "wxMaxima is a GUI for the CAS Maxima") |
| 92 | +set(CPACK_PACKAGE_VENDOR "The wxMaxima Team") |
| 93 | +set(CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_SOURCE_DIR}/README.md") |
| 94 | +set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_SOURCE_DIR}/COPYING") |
| 95 | +set(CPACK_SOURCE_PACKAGE_FILE_NAME "${CMAKE_PROJECT_NAME}-${VERSION}") |
| 96 | +set(CPACK_PACKAGE_CONTACT "The wxMaxima Team <[email protected]>") |
| 97 | +set(CPACK_PACKAGE_SECTION "science") |
| 98 | +set(CPACK_PACKAGE_ICON "${CMAKE_SOURCE_DIR}/data/wxmaxima.png") |
| 99 | +set(CPACK_PACKAGE_VERSION "${VERSION}") |
| 100 | + |
| 101 | + |
| 102 | +set(CPACK_DEBIAN_PACKAGE_SHLIBDEPS ON) |
| 103 | +set(CPACK_DEBIAN_PACKAGE_DEPENDS "maxima, maxima-doc") |
| 104 | +set(CPACK_DEBIAN_PACKAGE_SUGGESTS "jsmath-fonts") |
| 105 | + |
| 106 | +set(CPACK_RPM_PACKAGE_SUGGESTS "jsmath-fonts") |
| 107 | + |
| 108 | +# Build a tarball |
| 109 | +set(CPACK_SOURCE_IGNORE_FILES |
| 110 | + "build/" |
| 111 | + ".git/" |
| 112 | + ".gitignore" |
| 113 | + ".gitattributes" |
| 114 | + "Doxygen/html/" |
| 115 | + "\\\\.gmo$" |
| 116 | + "\\\\.mo$" |
| 117 | + "~$" |
| 118 | + "CPackConfig.cmake" |
| 119 | + "CPackSourceConfig.cmake" |
| 120 | + "CMakeCache.txt" |
| 121 | + "CMakeFiles" |
| 122 | + "_CPack_Packages" |
| 123 | + "wxmaxima-.*\\\\.tgz$" |
| 124 | + "wxmaxima-.*\\\\.deb$" |
| 125 | + "wxmaxima-.*\\\\.rpm$" |
| 126 | + "wxmaxima-.*\\\\.bz2$" |
| 127 | + "wxmaxima-.*\\\\.xz$" |
| 128 | + "wxmaxima-.*\\\\.Z$" |
| 129 | + "wxmaxima-.*\\\\.gz$" |
| 130 | + "${CPACK_SOURCE_IGNORE_FILES}") |
| 131 | + |
| 132 | +add_custom_target(dist COMMAND ${CMAKE_MAKE_PROGRAM} package_source) |
| 133 | + |
| 134 | +# Debian wants to be able to download a signature of the source package from the |
| 135 | +# project's download directory. If it cannot find it it will still work, but will |
| 136 | +# issue a warning. For details see |
| 137 | +# https://lintian.debian.org/tags/debian-watch-may-check-gpg-signature.html |
| 138 | +find_program(gpg NAMES gpg pgp) |
| 139 | +add_custom_target(gpg DEPENDS dist |
| 140 | + COMMAND ${gpg} --armor --detach-sign ${CPACK_SOURCE_PACKAGE_FILE_NAME}.tar.bz2 |
| 141 | + COMMAND ${gpg} --armor --detach-sign ${CPACK_SOURCE_PACKAGE_FILE_NAME}.tar.gz |
| 142 | + COMMAND ${gpg} --armor --detach-sign ${CPACK_SOURCE_PACKAGE_FILE_NAME}.tar.xz |
| 143 | + COMMAND ${gpg} --armor --detach-sign ${CPACK_SOURCE_PACKAGE_FILE_NAME}.tar.Z) |
| 144 | + |
| 145 | + |
| 146 | +add_custom_target(checksums |
| 147 | + ${CMAKE_COMMAND} -DVERSION=${VERSION} -DCMAKE_SYSTEM_NAME=${CMAKE_SYSTEM_NAME} -P ${CMAKE_SOURCE_DIR}/checksums.cmake) |
| 148 | + |
| 149 | +include(CPack) |
0 commit comments