Last active
March 20, 2023 19:31
-
-
Save scivision/e908a347a505dbe3db78163a432884d0 to your computer and use it in GitHub Desktop.
append to PATH env var on Windows for CTest
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
# works for Unix, Windows, etc. | |
cmake_minimum_required(VERSION 3.22) | |
project(WindowsPath LANGUAGES C) | |
find_library(ZLIB REQUIRED) | |
add_executable(hello hello.c) | |
target_link_libraries(hello PRIVATE ZLIB::ZLIB) | |
add_test(NAME unit_hello COMMAND hello) | |
if(WIN32) | |
set_property(TEST unit_hello PROPERTY ENVIRONMENT_MODIFICATION "PATH=path_list_append:/path/to/dlls") | |
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
#include "zlib.h" | |
int main(void) { return 0; } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment