|
Removed
Link Here
|
| 1 |
--- CMakeLists.txt.orig 2022-01-05 13:44:44.993511000 -0600 |
| 2 |
+++ CMakeLists.txt 2022-01-05 14:10:26.330330000 -0600 |
| 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,19 +9,27 @@ |
| 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 |
if(MSVC) |
| 33 |
add_definitions(/bigobj) # Allow big object |
| 34 |
elseif(MINGW) |
| 35 |
- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wa,-mbig-obj") # Allow big object |
| 36 |
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mbig-obj") # Allow big object |
| 37 |
endif() |
| 38 |
|
| 39 |
###################################################################### |
| 40 |
@@ -62,6 +70,7 @@ |
| 41 |
include_directories(${RIPES_LIB} PUBLIC external/VSRTL/external) |
| 42 |
include_directories(SYSTEM external/ELFIO) |
| 43 |
include_directories(SYSTEM external/VSRTL/external/Signals) |
| 44 |
+include_directories(external/libelfin_cmake) |
| 45 |
include_directories(external) |
| 46 |
|
| 47 |
option(RIPES_BUILD_VERILATOR_PROCESSORS "Build verilator processors" OFF) |
| 48 |
@@ -89,6 +98,9 @@ |
| 49 |
endif() |
| 50 |
|
| 51 |
add_subdirectory(external) |
| 52 |
+ |
| 53 |
+# Fix the name of the ripes library. |
| 54 |
+set(RIPES_LIB ripes_lib) |
| 55 |
add_subdirectory(src) |
| 56 |
|
| 57 |
option(RIPES_BUILD_TESTS "Build Ripes tests" OFF) |
| 58 |
@@ -102,4 +114,24 @@ |
| 59 |
# Link Qt libraries |
| 60 |
target_link_libraries(${APP_NAME} Qt5::Core Qt5::Widgets) |
| 61 |
# Link Ripes library |
| 62 |
-target_link_libraries(${APP_NAME} ripes_lib) |
| 63 |
+target_link_libraries(${APP_NAME} ${RIPES_LIB}) |
| 64 |
+ |
| 65 |
+if(UNIX AND NOT APPLE) #Define the LINUX variable before testing it |
| 66 |
+ set(LINUX TRUE) |
| 67 |
+endif() |
| 68 |
+ |
| 69 |
+if(${LINUX}) |
| 70 |
+ install(TARGETS ${APP_NAME} |
| 71 |
+ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} |
| 72 |
+ ) |
| 73 |
+elseif(${APPLE}) |
| 74 |
+ install(TARGETS ${APP_NAME} |
| 75 |
+ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} |
| 76 |
+ BUNDLE DESTINATION ${CMAKE_INSTALL_BINDIR} |
| 77 |
+ ) |
| 78 |
+endif() |
| 79 |
+ |
| 80 |
+install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/appdir/usr/ |
| 81 |
+ DESTINATION ${CMAKE_INSTALL_PREFIX} |
| 82 |
+) |
| 83 |
+ |