Browse Source

Update LICENCE and README, Switch CMake to C++, Add Getopt defines to main

master
Jake Wakeling 2 months ago
parent
commit
93c0c142d8
4 changed files with 26 additions and 8 deletions
  1. 17
    7
      CMakeLists.txt
  2. 1
    1
      LICENCE
  3. 3
    0
      README.md
  4. 5
    0
      src/main.c

+ 17
- 7
CMakeLists.txt View File

@@ -1,26 +1,36 @@
# CMakeLists.txt
# CMakeLists file for HexView

cmake_minimum_required(VERSION 3.9) # CMake Minimum Required Version
project(HexView) # Project
set(CMAKE_C_STANDARD 11) # C Standard
set(CMAKE_CXX_STANDARD 17) # C++ Standard

# Output Directories
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}/lib)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}/lib)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}/bin)

IF(${CMAKE_SYSTEM_NAME} MATCHES "Linux") # Linux Specific CMake Variables
set(LINK_DIR /lib/x64/) # Standard Linux Library Directory
set(INCLUDE_DIR /include/) # Standard Linux Include Directory
ENDIF(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
IF(${CMAKE_SYSTEM_NAME} MATCHES "Windows") # Windows Specific CMake Variables
set(LINK_DIR C:/Libraries/x64/) # Standard Windows Library Directory
set(INCLUDE_DIR C:/Include/) # Standard Windows Include Directory
ENDIF(${CMAKE_SYSTEM_NAME} MATCHES "Windows")

file(GLOB SOURCES # Add Source Files
${CMAKE_SOURCE_DIR}/src/*
${CMAKE_SOURCE_DIR}/include/*
)

link_directories( # Library Directories
/lib/x64/
C:/Libraries/x64/
${LINK_DIR}
)

file(GLOB SOURCES src/* include/*) # Add Source Files
add_executable(xv ${SOURCES}) # Build Target

target_include_directories(xv PUBLIC # Target Include Directories
/include/
C:/Include/
${INCLUDE_DIR}
)

target_link_libraries(xv # Target Libraries

+ 1
- 1
LICENCE View File

@@ -1,7 +1,7 @@
OMKOV Open Source Licence 1.1
Based on the UIUC Licence

Copyright (c) 2019, Jakob Wakeling
Copyright (C) 2019, Jakob Wakeling
All rights reserved.

Permission is hereby granted, free of charge, to any person obtaining a copy of

+ 3
- 0
README.md View File

@@ -1,6 +1,9 @@
# HexView
HexView is a simple command line hex viewer written in C.

## Requirements
* Getopt

## Meta
Copyright (C) 2019, Jakob Wakeling
All rights reserved.

+ 5
- 0
src/main.c View File

@@ -5,6 +5,11 @@

#define _CRT_SECURE_NO_WARNINGS

#define ARG_NULL 0 // Argument Null
#define ARG_NONE 0 // Argument Switch Only
#define ARG_REQ 1 // Argument Required
#define ARG_OPT 2 // Argument Optional

#include <getopt.h>
#include <stdarg.h>
#include <stddef.h>

Loading…
Cancel
Save