Added
Link Here
|
1 |
--- CMakeLists.txt.orig 2021-11-29 18:06:47 UTC |
2 |
+++ CMakeLists.txt |
3 |
@@ -1,4 +1,4 @@ |
4 |
-cmake_minimum_required(VERSION 3.9) |
5 |
+cmake_minimum_required(VERSION 3.13) |
6 |
set(CMAKE_CXX_STANDARD 17) |
7 |
set(CMAKE_CXX_STANDARD_REQUIRED ON) |
8 |
set(CMAKE_POSITION_INDEPENDENT_CODE ON) |
9 |
@@ -9,12 +9,20 @@ if(CCACHE_PROGRAM) |
10 |
set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE "${CCACHE_PROGRAM}") |
11 |
endif() |
12 |
|
13 |
-project(Ripes CXX) |
14 |
+project(Ripes |
15 |
+ LANGUAGES CXX |
16 |
+ DESCRIPTION "A graphical processor simulator and assembly editor for the RISC-V ISA" |
17 |
+ HOMEPAGE_URL "https://github.com/mortbopet/Ripes" |
18 |
+) |
19 |
|
20 |
+if(NOT ${CMAKE_SYSTEM_NAME} STREQUAL "Windows") |
21 |
+ include(GNUInstallDirs) #Must exist after declaring a project |
22 |
+endif() |
23 |
+ |
24 |
# Error flags on everything but MSVC |
25 |
if(NOT MSVC) |
26 |
set(CMAKE_CXX_FLAGS "-Wextra -Wall \ |
27 |
- -Werror=switch -Werror=return-type -Werror=shadow \ |
28 |
+ -Werror=switch -Werror=return-type \ |
29 |
-Werror=unreachable-code") |
30 |
endif() |
31 |
|
32 |
@@ -89,6 +97,9 @@ elseif(${WIN32}) |
33 |
endif() |
34 |
|
35 |
add_subdirectory(external) |
36 |
+ |
37 |
+# Fix the name of the ripes library. |
38 |
+set(RIPES_LIB ripes_lib) |
39 |
add_subdirectory(src) |
40 |
|
41 |
option(RIPES_BUILD_TESTS "Build Ripes tests" OFF) |
42 |
@@ -102,4 +113,23 @@ add_executable(${APP_NAME} ${SYSTEM_FLAGS} ${ICONS_SRC |
43 |
# Link Qt libraries |
44 |
target_link_libraries(${APP_NAME} Qt5::Core Qt5::Widgets) |
45 |
# Link Ripes library |
46 |
-target_link_libraries(${APP_NAME} ripes_lib) |
47 |
+target_link_libraries(${APP_NAME} ${RIPES_LIB}) |
48 |
+ |
49 |
+if(UNIX AND NOT APPLE) #Define the LINUX variable before testing it |
50 |
+ set(LINUX TRUE) |
51 |
+endif() |
52 |
+ |
53 |
+if(${LINUX}) |
54 |
+ install(TARGETS ${APP_NAME} |
55 |
+ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} |
56 |
+ ) |
57 |
+elseif(${APPLE}) |
58 |
+ install(TARGETS ${APP_NAME} |
59 |
+ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} |
60 |
+ BUNDLE DESTINATION ${CMAKE_INSTALL_BINDIR} |
61 |
+ ) |
62 |
+endif() |
63 |
+ |
64 |
+install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/appdir/usr/ |
65 |
+ DESTINATION ${CMAKE_INSTALL_PREFIX} |
66 |
+) |