mirror of
https://github.com/WerWolv/ImHex-Patterns.git
synced 2026-03-28 07:47:02 -05:00
* *Add top level CMakeLists.txt, to make it easier to use both independently and from within other projects * Add a unit_test target, to attach all unit tests to * * Fix unit tests for windows * Silence cmake warning regarding missing top project * update .gitignore for vscode --------- Co-authored-by: BobSmun <6492115+BobSmun@users.noreply.github.com>
30 lines
843 B
CMake
30 lines
843 B
CMake
cmake_minimum_required(VERSION 3.16)
|
|
|
|
project(ImHex-Patterns)
|
|
|
|
option(IMHEX_PATTERNS_ENABLE_UNIT_TESTS "Enable building unit tests for ImHex-Patterns" OFF)
|
|
|
|
# if enabled, add a unit_test custom target for all the unit tests to be registered against
|
|
if(IMHEX_PATTERNS_ENABLE_UNIT_TESTS)
|
|
if(NOT TARGET unit_tests)
|
|
enable_testing()
|
|
add_custom_target(unit_tests)
|
|
endif()
|
|
endif()
|
|
|
|
# If this has been manually cloned into another project, libpl may already have been set up
|
|
if(NOT TARGET libpl)
|
|
include(FetchContent)
|
|
|
|
FetchContent_Declare(
|
|
pattern_language
|
|
GIT_REPOSITORY https://github.com/WerWolv/PatternLanguage
|
|
GIT_TAG master
|
|
)
|
|
|
|
FetchContent_MakeAvailable(pattern_language)
|
|
endif()
|
|
|
|
if(IMHEX_PATTERNS_ENABLE_UNIT_TESTS)
|
|
add_subdirectory(tests)
|
|
endif() |