-
-
Notifications
You must be signed in to change notification settings - Fork 188
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* *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 <[email protected]>
- Loading branch information
Showing
7 changed files
with
53 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,12 @@ | ||
|
||
tests/cmake*/ | ||
tests/build*/ | ||
build/ | ||
|
||
.vscode/ | ||
.devcontainer/ | ||
.cache/ | ||
.idea/ | ||
.DS_Store | ||
.DS_Store | ||
|
||
compile_commands.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
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() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,7 @@ | ||
cmake_minimum_required(VERSION 3.16) | ||
|
||
project(tests) | ||
|
||
set(CMAKE_CXX_STANDARD 20) | ||
|
||
include(FetchContent) | ||
|
||
FetchContent_Declare( | ||
pattern_language | ||
GIT_REPOSITORY https://github.com/WerWolv/PatternLanguage | ||
GIT_TAG master | ||
) | ||
|
||
FetchContent_MakeAvailable(pattern_language) | ||
|
||
enable_testing() | ||
|
||
add_subdirectory(patterns) | ||
add_subdirectory(includes) | ||
add_subdirectory(magic) | ||
|
||
add_custom_target(test_all DEPENDS patterns_tests includes_test magic_test) | ||
add_subdirectory(magic) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters