Improve CMake and add instructions to README

This commit is contained in:
Duncan Ogilvie 2022-01-14 16:32:31 +01:00
parent cda7694f91
commit 033c7577ce
8 changed files with 42 additions and 9 deletions

View file

@ -4,10 +4,16 @@ cmake_minimum_required(VERSION 3.14.5)
# Define the VTIL project
project(VTIL-Core)
option(VTIL_BUILD_TESTS "Build tests" OFF)
# Detect if VTIL-Core is compiled as the root project
set(VTIL_ROOT_PROJECT OFF)
if(CMAKE_CURRENT_SOURCE_DIR STREQUAL CMAKE_SOURCE_DIR)
set(VTIL_ROOT_PROJECT ON)
# Enable solution folder support
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
# Enable solution folder support
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
endif()
option(VTIL_BUILD_TESTS "Build tests" ${VTIL_ROOT_PROJECT})
# Load the dependencies
set(CMAKE_FOLDER "VTIL-Core/Dependencies")

View file

@ -40,3 +40,18 @@ This repository contains the core components of the VTIL Project used across the
It is currently incomplete as the initial release is not done yet, and documentation and FAQ will be within this repository and the organization website once they're done.
Until the initial release, you can keep up to date with the VTIL project by checking my [personal twitter account](https://twitter.com/_can1357) or the VTIL website [vtil.org](https://vtil.org/).
## Building (Windows)
```
cmake -B build
```
Then open `build\VTIL-Core.sln`. You can also open this folder in a CMake-compatible IDE (Visual Studio, CLion, Qt Creator, VS Code).
## Building (Linux/Mac)
```
cmake -G Ninja -B build -DCMAKE_BUILD_TYPE=Release
cmake --build build
```

View file

@ -1,4 +1,6 @@
project(VTIL-Architecture)
# Extract project name from folder
get_filename_component(PROJECT_NAME ${CMAKE_CURRENT_LIST_DIR} NAME)
string(REPLACE " " "_" PROJECT_NAME "${PROJECT_NAME}")
file(GLOB_RECURSE SOURCES CONFIGURE_DEPENDS *.cpp *.hpp)
file(GLOB_RECURSE INCLUDES CONFIGURE_DEPENDS includes/*)

View file

@ -1,4 +1,6 @@
project(VTIL-Common)
# Extract project name from folder
get_filename_component(PROJECT_NAME ${CMAKE_CURRENT_LIST_DIR} NAME)
string(REPLACE " " "_" PROJECT_NAME "${PROJECT_NAME}")
file(GLOB_RECURSE SOURCES CONFIGURE_DEPENDS *.cpp *.hpp)
file(GLOB_RECURSE INCLUDES CONFIGURE_DEPENDS includes/*)

View file

@ -1,4 +1,6 @@
project(VTIL-Compiler)
# Extract project name from folder
get_filename_component(PROJECT_NAME ${CMAKE_CURRENT_LIST_DIR} NAME)
string(REPLACE " " "_" PROJECT_NAME "${PROJECT_NAME}")
file(GLOB_RECURSE SOURCES CONFIGURE_DEPENDS *.cpp *.hpp)
file(GLOB_RECURSE INCLUDES CONFIGURE_DEPENDS includes/*)

View file

@ -1,4 +1,6 @@
project(VTIL-SymEx)
# Extract project name from folder
get_filename_component(PROJECT_NAME ${CMAKE_CURRENT_LIST_DIR} NAME)
string(REPLACE " " "_" PROJECT_NAME "${PROJECT_NAME}")
file(GLOB_RECURSE SOURCES CONFIGURE_DEPENDS *.cpp *.hpp)
file(GLOB_RECURSE INCLUDES CONFIGURE_DEPENDS includes/*)

View file

@ -1,4 +1,6 @@
project(VTIL-Tests)
# Extract project name from folder
get_filename_component(PROJECT_NAME ${CMAKE_CURRENT_LIST_DIR} NAME)
string(REPLACE " " "_" PROJECT_NAME "${PROJECT_NAME}")
file(GLOB_RECURSE SOURCES CONFIGURE_DEPENDS *.cpp *.hpp *.h)

View file

@ -1,4 +1,6 @@
project(VTIL)
# Extract project name from folder
get_filename_component(PROJECT_NAME ${CMAKE_CURRENT_LIST_DIR} NAME)
string(REPLACE " " "_" PROJECT_NAME "${PROJECT_NAME}")
# This builds no sources -- it simply aliases a collection of all other targets created by VTIL
#