diff options
Diffstat (limited to 'Tests')
57 files changed, 672 insertions, 40 deletions
diff --git a/Tests/CMakeLib/CMakeLists.txt b/Tests/CMakeLib/CMakeLists.txt index e04bba2..a25f25a 100644 --- a/Tests/CMakeLib/CMakeLists.txt +++ b/Tests/CMakeLib/CMakeLists.txt @@ -15,11 +15,15 @@ set(CMakeLib_TESTS testXMLParser.cxx testXMLSafe.cxx testFindPackageCommand.cxx + testUVProcessChain.cxx testUVRAII.cxx testUVStreambuf.cxx ) +add_executable(testUVProcessChainHelper testUVProcessChainHelper.cxx) + set(testRST_ARGS ${CMAKE_CURRENT_SOURCE_DIR}) +set(testUVProcessChain_ARGS $<TARGET_FILE:testUVProcessChainHelper>) set(testUVStreambuf_ARGS $<TARGET_FILE:cmake>) if(WIN32) diff --git a/Tests/CMakeLib/testUVProcessChain.cxx b/Tests/CMakeLib/testUVProcessChain.cxx new file mode 100644 index 0000000..72ae602 --- /dev/null +++ b/Tests/CMakeLib/testUVProcessChain.cxx @@ -0,0 +1,335 @@ +#include "cmUVProcessChain.h" + +#include "cmAlgorithms.h" +#include "cmGetPipes.h" +#include "cmUVHandlePtr.h" +#include "cmUVStreambuf.h" + +#include "cm_uv.h" + +#include <algorithm> +#include <functional> +#include <iostream> +#include <sstream> +#include <string> +#include <vector> + +#include <csignal> + +struct ExpectedStatus +{ + bool Finished; + bool MatchExitStatus; + bool MatchTermSignal; + cmUVProcessChain::Status Status; +}; + +static const std::vector<ExpectedStatus> status1 = { + { false, false, false, { 0, 0 } }, + { false, false, false, { 0, 0 } }, + { false, false, false, { 0, 0 } }, +}; + +static const std::vector<ExpectedStatus> status2 = { + { true, true, true, { 0, 0 } }, + { false, false, false, { 0, 0 } }, + { false, false, false, { 0, 0 } }, +}; + +static const std::vector<ExpectedStatus> status3 = { + { true, true, true, { 0, 0 } }, + { true, true, true, { 1, 0 } }, +#ifdef _WIN32 + { true, true, true, { 2, 0 } }, +#else + { true, false, true, { 0, SIGABRT } }, +#endif +}; + +bool operator==(const cmUVProcessChain::Status* actual, + const ExpectedStatus& expected) +{ + if (!expected.Finished) { + return !actual; + } else if (!actual) { + return false; + } + if (expected.MatchExitStatus && + expected.Status.ExitStatus != actual->ExitStatus) { + return false; + } + if (expected.MatchTermSignal && + expected.Status.TermSignal != actual->TermSignal) { + return false; + } + return true; +} + +bool resultsMatch(const std::vector<const cmUVProcessChain::Status*>& actual, + const std::vector<ExpectedStatus>& expected) +{ + return actual.size() == expected.size() && + std::equal(actual.begin(), actual.end(), expected.begin()); +} + +std::string getInput(std::istream& input) +{ + char buffer[1024]; + std::ostringstream str; + do { + input.read(buffer, 1024); + str.write(buffer, input.gcount()); + } while (input.gcount() > 0); + return str.str(); +} + +template <typename T> +std::function<std::ostream&(std::ostream&)> printExpected(bool match, + const T& value) +{ + return [match, value](std::ostream& stream) -> std::ostream& { + if (match) { + stream << value; + } else { + stream << "*"; + } + return stream; + }; +} + +std::ostream& operator<<( + std::ostream& stream, + const std::function<std::ostream&(std::ostream&)>& func) +{ + return func(stream); +} + +void printResults(const std::vector<const cmUVProcessChain::Status*>& actual, + const std::vector<ExpectedStatus>& expected) +{ + std::cout << "Expected: " << std::endl; + for (auto const& e : expected) { + if (e.Finished) { + std::cout << " ExitStatus: " + << printExpected(e.MatchExitStatus, e.Status.ExitStatus) + << ", TermSignal: " + << printExpected(e.MatchTermSignal, e.Status.TermSignal) + << std::endl; + } else { + std::cout << " null" << std::endl; + } + } + std::cout << "Actual:" << std::endl; + for (auto const& a : actual) { + if (a) { + std::cout << " ExitStatus: " << a->ExitStatus + << ", TermSignal: " << a->TermSignal << std::endl; + } else { + std::cout << " null" << std::endl; + } + } +} + +bool checkExecution(cmUVProcessChainBuilder& builder, + std::unique_ptr<cmUVProcessChain>& chain) +{ + std::vector<const cmUVProcessChain::Status*> status; + + chain = cm::make_unique<cmUVProcessChain>(builder.Start()); + if (!chain->Valid()) { + std::cout << "Valid() returned false, should be true" << std::endl; + return false; + } + status = chain->GetStatus(); + if (!resultsMatch(status, status1)) { + std::cout << "GetStatus() did not produce expected output" << std::endl; + printResults(status, status1); + return false; + } + + if (chain->Wait(6000)) { + std::cout << "Wait() returned true, should be false" << std::endl; + return false; + } + status = chain->GetStatus(); + if (!resultsMatch(status, status2)) { + std::cout << "GetStatus() did not produce expected output" << std::endl; + printResults(status, status2); + return false; + } + + if (!chain->Wait()) { + std::cout << "Wait() returned false, should be true" << std::endl; + return false; + } + status = chain->GetStatus(); + if (!resultsMatch(status, status3)) { + std::cout << "GetStatus() did not produce expected output" << std::endl; + printResults(status, status3); + return false; + } + + return true; +} + +bool checkOutput(std::istream& outputStream, std::istream& errorStream) +{ + std::string output = getInput(outputStream); + if (output != "HELO WRD!") { + std::cout << "Output was \"" << output << "\", expected \"HELO WRD!\"" + << std::endl; + return false; + } + + std::string error = getInput(errorStream); + if (error.length() != 3 || error.find('1') == std::string::npos || + error.find('2') == std::string::npos || + error.find('3') == std::string::npos) { + std::cout << "Error was \"" << error << "\", expected \"123\"" + << std::endl; + return false; + } + + return true; +} + +bool testUVProcessChainBuiltin(const char* helperCommand) +{ + cmUVProcessChainBuilder builder; + std::unique_ptr<cmUVProcessChain> chain; + builder.AddCommand({ helperCommand, "echo" }) + .AddCommand({ helperCommand, "capitalize" }) + .AddCommand({ helperCommand, "dedup" }) + .SetBuiltinStream(cmUVProcessChainBuilder::Stream_OUTPUT) + .SetBuiltinStream(cmUVProcessChainBuilder::Stream_ERROR); + + if (!checkExecution(builder, chain)) { + return false; + } + + if (!chain->OutputStream()) { + std::cout << "OutputStream() was null, expecting not null" << std::endl; + return false; + } + if (!chain->ErrorStream()) { + std::cout << "ErrorStream() was null, expecting not null" << std::endl; + return false; + } + + if (!checkOutput(*chain->OutputStream(), *chain->ErrorStream())) { + return false; + } + + return true; +} + +bool testUVProcessChainExternal(const char* helperCommand) +{ + cmUVProcessChainBuilder builder; + std::unique_ptr<cmUVProcessChain> chain; + int outputPipe[2], errorPipe[2]; + cm::uv_pipe_ptr outputInPipe, outputOutPipe, errorInPipe, errorOutPipe; + + if (cmGetPipes(outputPipe) < 0) { + std::cout << "Error creating pipes" << std::endl; + return false; + } + if (cmGetPipes(errorPipe) < 0) { + std::cout << "Error creating pipes" << std::endl; + return false; + } + + builder.AddCommand({ helperCommand, "echo" }) + .AddCommand({ helperCommand, "capitalize" }) + .AddCommand({ helperCommand, "dedup" }) + .SetExternalStream(cmUVProcessChainBuilder::Stream_OUTPUT, outputPipe[1]) + .SetExternalStream(cmUVProcessChainBuilder::Stream_ERROR, errorPipe[1]); + + if (!checkExecution(builder, chain)) { + return false; + } + + if (chain->OutputStream()) { + std::cout << "OutputStream() was not null, expecting null" << std::endl; + return false; + } + if (chain->ErrorStream()) { + std::cout << "ErrorStream() was not null, expecting null" << std::endl; + return false; + } + + outputOutPipe.init(chain->GetLoop(), 0); + uv_pipe_open(outputOutPipe, outputPipe[1]); + outputOutPipe.reset(); + + errorOutPipe.init(chain->GetLoop(), 0); + uv_pipe_open(errorOutPipe, errorPipe[1]); + errorOutPipe.reset(); + + outputInPipe.init(chain->GetLoop(), 0); + uv_pipe_open(outputInPipe, outputPipe[0]); + cmUVStreambuf outputBuf; + outputBuf.open(outputInPipe); + std::istream outputStream(&outputBuf); + + errorInPipe.init(chain->GetLoop(), 0); + uv_pipe_open(errorInPipe, errorPipe[0]); + cmUVStreambuf errorBuf; + errorBuf.open(errorInPipe); + std::istream errorStream(&errorBuf); + + if (!checkOutput(outputStream, errorStream)) { + return false; + } + + return true; +} + +bool testUVProcessChainNone(const char* helperCommand) +{ + cmUVProcessChainBuilder builder; + std::unique_ptr<cmUVProcessChain> chain; + builder.AddCommand({ helperCommand, "echo" }) + .AddCommand({ helperCommand, "capitalize" }) + .AddCommand({ helperCommand, "dedup" }); + + if (!checkExecution(builder, chain)) { + return false; + } + + if (chain->OutputStream()) { + std::cout << "OutputStream() was not null, expecting null" << std::endl; + return false; + } + if (chain->ErrorStream()) { + std::cout << "ErrorStream() was not null, expecting null" << std::endl; + return false; + } + + return true; +} + +int testUVProcessChain(int argc, char** const argv) +{ + if (argc < 2) { + std::cout << "Invalid arguments.\n"; + return -1; + } + + if (!testUVProcessChainBuiltin(argv[1])) { + std::cout << "While executing testUVProcessChainBuiltin().\n"; + return -1; + } + + if (!testUVProcessChainExternal(argv[1])) { + std::cout << "While executing testUVProcessChainExternal().\n"; + return -1; + } + + if (!testUVProcessChainNone(argv[1])) { + std::cout << "While executing testUVProcessChainNone().\n"; + return -1; + } + + return 0; +} diff --git a/Tests/CMakeLib/testUVProcessChainHelper.cxx b/Tests/CMakeLib/testUVProcessChainHelper.cxx new file mode 100644 index 0000000..263665d --- /dev/null +++ b/Tests/CMakeLib/testUVProcessChainHelper.cxx @@ -0,0 +1,72 @@ +#include <chrono> +#include <iostream> +#include <set> +#include <sstream> +#include <string> +#include <thread> + +#include <cctype> +#include <cstdlib> + +std::string getStdin() +{ + char buffer[1024]; + std::ostringstream str; + do { + std::cin.read(buffer, 1024); + str.write(buffer, std::cin.gcount()); + } while (std::cin.gcount() > 0); + return str.str(); +} + +int main(int argc, char** argv) +{ + if (argc < 2) { + return -1; + } + + std::string command = argv[1]; + if (command == "echo") { + std::this_thread::sleep_for(std::chrono::milliseconds(3000)); + std::cout << "HELLO world!" << std::flush; + std::cerr << "1" << std::flush; + return 0; + } + if (command == "capitalize") { + std::this_thread::sleep_for(std::chrono::milliseconds(9000)); + std::string input = getStdin(); + for (auto& c : input) { + c = static_cast<char>(std::toupper(c)); + } + std::cout << input << std::flush; + std::cerr << "2" << std::flush; + return 1; + } + if (command == "dedup") { + // Use a nested scope to free all resources before aborting below. + { + std::string input = getStdin(); + std::set<char> seen; + std::string output; + for (auto c : input) { + if (!seen.count(c)) { + seen.insert(c); + output += c; + } + } + std::cout << output << std::flush; + std::cerr << "3" << std::flush; + } + + // On Windows, the exit code of abort() is different between debug and + // release builds, and does not yield a term_signal in libuv in either + // case. For the sake of simplicity, we just return another non-zero code. +#ifdef _WIN32 + return 2; +#else + std::abort(); +#endif + } + + return -1; +} diff --git a/Tests/CompileFeatures/cxx_relaxed_constexpr.cpp b/Tests/CompileFeatures/cxx_relaxed_constexpr.cpp index 7b3602c..953148d 100644 --- a/Tests/CompileFeatures/cxx_relaxed_constexpr.cpp +++ b/Tests/CompileFeatures/cxx_relaxed_constexpr.cpp @@ -22,6 +22,7 @@ constexpr int g(const int (&is)[4]) int someFunc() { - constexpr int k3 = g({ 4, 5, 6, 7 }); + constexpr int values[4] = { 4, 5, 6, 7 }; + constexpr int k3 = g(values); return k3 - 42; } diff --git a/Tests/FindPython/CMakeLists.txt b/Tests/FindPython/CMakeLists.txt index d6f50e7..8dfcf40 100644 --- a/Tests/FindPython/CMakeLists.txt +++ b/Tests/FindPython/CMakeLists.txt @@ -79,6 +79,28 @@ if(CMake_TEST_FindPython) --build-options ${build_options} --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION> ) + + add_test(NAME FindPython.Python2Embedded COMMAND + ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION> + --build-and-test + "${CMake_SOURCE_DIR}/Tests/FindPython/Python2Embedded" + "${CMake_BINARY_DIR}/Tests/FindPython/Python2Embedded" + ${build_generator_args} + --build-project TestPython2Embedded + --build-options ${build_options} + --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION> + ) + add_test(NAME FindPython.Python3Embedded COMMAND + ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION> + --build-and-test + "${CMake_SOURCE_DIR}/Tests/FindPython/Python3Embedded" + "${CMake_BINARY_DIR}/Tests/FindPython/Python3Embedded" + ${build_generator_args} + --build-project TestPython3Embedded + --build-options ${build_options} + --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION> + ) + endif() if(CMake_TEST_FindPython_NumPy) diff --git a/Tests/FindPython/Python/CMakeLists.txt b/Tests/FindPython/Python/CMakeLists.txt index f7fc243..62c805e 100644 --- a/Tests/FindPython/Python/CMakeLists.txt +++ b/Tests/FindPython/Python/CMakeLists.txt @@ -16,6 +16,9 @@ endif() if(NOT TARGET Python::Python) message(SEND_ERROR "Python::Python not found") endif() +if(NOT TARGET Python::Module) + message(SEND_ERROR "Python::Module not found") +endif() Python_add_library (spam3 MODULE ../spam.c) target_compile_definitions (spam3 PRIVATE PYTHON3) diff --git a/Tests/FindPython/Python2/CMakeLists.txt b/Tests/FindPython/Python2/CMakeLists.txt index a0753f6..274745a 100644 --- a/Tests/FindPython/Python2/CMakeLists.txt +++ b/Tests/FindPython/Python2/CMakeLists.txt @@ -21,6 +21,9 @@ endif() if(NOT TARGET Python2::Python) message(SEND_ERROR "Python2::Python not found") endif() +if(NOT TARGET Python2::Module) + message(SEND_ERROR "Python2::Module not found") +endif() Python2_add_library (spam2 MODULE ../spam.c) target_compile_definitions (spam2 PRIVATE PYTHON2) diff --git a/Tests/FindPython/Python2Embedded/CMakeLists.txt b/Tests/FindPython/Python2Embedded/CMakeLists.txt new file mode 100644 index 0000000..0115dea --- /dev/null +++ b/Tests/FindPython/Python2Embedded/CMakeLists.txt @@ -0,0 +1,29 @@ +cmake_minimum_required(VERSION 3.1) + +project(TestPython2Embedded C) + +include(CTest) + +find_package(Python2 REQUIRED COMPONENTS Development) +if (NOT Python2_FOUND) + message (FATAL_ERROR "Fail to found Python 2") +endif() + +if(NOT TARGET Python2::Python) + message(SEND_ERROR "Python2::Python not found") +endif() + +Python2_add_library (display_time2 SHARED ../display_time.c) +set_property (TARGET display_time2 PROPERTY WINDOWS_EXPORT_ALL_SYMBOLS ON) +target_compile_definitions (display_time2 PRIVATE PYTHON2) + +add_executable (main2 ../main.c) +target_link_libraries (main2 PRIVATE display_time2) + +if (WIN32 OR CYGWIN OR MSYS OR MINGW) + list (JOIN Python2_RUNTIME_LIBRARY_DIRS "$<SEMICOLON>" RUNTIME_DIRS) + add_test (NAME Python2.Embedded COMMAND "${CMAKE_COMMAND}" -E env "PATH=${RUNTIME_DIRS}" $<TARGET_FILE:main2>) +else() + add_test (NAME Python2.Embedded COMMAND main2) +endif() +set_property (TEST Python2.Embedded PROPERTY PASS_REGULAR_EXPRESSION "Today is") diff --git a/Tests/FindPython/Python3/CMakeLists.txt b/Tests/FindPython/Python3/CMakeLists.txt index 65eea4c..b21a15b 100644 --- a/Tests/FindPython/Python3/CMakeLists.txt +++ b/Tests/FindPython/Python3/CMakeLists.txt @@ -21,6 +21,9 @@ endif() if(NOT TARGET Python3::Python) message(SEND_ERROR "Python2::Python not found") endif() +if(NOT TARGET Python3::Module) + message(SEND_ERROR "Python2::Module not found") +endif() Python3_add_library (spam3 MODULE ../spam.c) target_compile_definitions (spam3 PRIVATE PYTHON3) diff --git a/Tests/FindPython/Python3Embedded/CMakeLists.txt b/Tests/FindPython/Python3Embedded/CMakeLists.txt new file mode 100644 index 0000000..4eb7ebc --- /dev/null +++ b/Tests/FindPython/Python3Embedded/CMakeLists.txt @@ -0,0 +1,29 @@ +cmake_minimum_required(VERSION 3.1) + +project(TestPython3Embedded C) + +include(CTest) + +find_package(Python3 REQUIRED COMPONENTS Development) +if (NOT Python3_FOUND) + message (FATAL_ERROR "Fail to found Python 3") +endif() + +if(NOT TARGET Python3::Python) + message(SEND_ERROR "Python3::Python not found") +endif() + +Python3_add_library (display_time3 SHARED ../display_time.c) +set_property (TARGET display_time3 PROPERTY WINDOWS_EXPORT_ALL_SYMBOLS ON) +target_compile_definitions (display_time3 PRIVATE PYTHON3) + +add_executable (main3 ../main.c) +target_link_libraries (main3 PRIVATE display_time3) + +if (WIN32 OR CYGWIN OR MSYS OR MINGW) + list (JOIN Python3_RUNTIME_LIBRARY_DIRS "$<SEMICOLON>" RUNTIME_DIRS) + add_test (NAME Python3.Embedded COMMAND "${CMAKE_COMMAND}" -E env "PATH=${RUNTIME_DIRS}" $<TARGET_FILE:main3>) +else() + add_test (NAME Python3.Embedded COMMAND main3) +endif() +set_property (TEST Python3.Embedded PROPERTY PASS_REGULAR_EXPRESSION "Today is") diff --git a/Tests/FindPython/display_time.c b/Tests/FindPython/display_time.c new file mode 100644 index 0000000..0e78434 --- /dev/null +++ b/Tests/FindPython/display_time.c @@ -0,0 +1,36 @@ + +#include <stdio.h> + +#define PY_SSIZE_T_CLEAN +#include <Python.h> + +#include "display_time.h" + +void display_time() +{ +#if defined(PYTHON3) + wchar_t* program = Py_DecodeLocale("display_time", NULL); + if (program == NULL) { + fprintf(stderr, "Fatal error: cannot decode argv[0]\n"); + exit(1); + } + char* cmd = "from time import time,ctime\n" + "print('Today is', ctime(time()))\n"; +#else + char* program = "display_time"; + char* cmd = "from time import time,ctime\n" + "print 'Today is', ctime(time())\n"; +#endif + + Py_SetProgramName(program); /* optional but recommended */ + Py_Initialize(); + PyRun_SimpleString(cmd); +#if defined(PYTHON3) + if (Py_FinalizeEx() < 0) { + exit(120); + } + PyMem_RawFree(program); +#else + Py_Finalize(); +#endif +} diff --git a/Tests/FindPython/display_time.h b/Tests/FindPython/display_time.h new file mode 100644 index 0000000..d825e02 --- /dev/null +++ b/Tests/FindPython/display_time.h @@ -0,0 +1,2 @@ + +void display_time(); diff --git a/Tests/FindPython/main.c b/Tests/FindPython/main.c new file mode 100644 index 0000000..0acba29 --- /dev/null +++ b/Tests/FindPython/main.c @@ -0,0 +1,7 @@ + +#include "display_time.h" + +int main() +{ + display_time(); +} diff --git a/Tests/RunCMake/CMP0069/CMP0069-NEW-cmake-stderr.txt b/Tests/RunCMake/CMP0069/CMP0069-NEW-cmake-stderr.txt index ddb3cae..87ac88e 100644 --- a/Tests/RunCMake/CMP0069/CMP0069-NEW-cmake-stderr.txt +++ b/Tests/RunCMake/CMP0069/CMP0069-NEW-cmake-stderr.txt @@ -1,4 +1,6 @@ ^CMake Error at CMP0069-NEW-cmake\.cmake:[0-9]+ \(add_executable\): CMake doesn't support IPO for current compiler Call Stack \(most recent call first\): - CMakeLists\.txt:[0-9]+ \(include\)$ + CMakeLists\.txt:[0-9]+ \(include\) ++ +CMake Generate step failed\. Build files cannot be regenerated correctly\.$ diff --git a/Tests/RunCMake/CMP0069/CMP0069-NEW-compiler-stderr.txt b/Tests/RunCMake/CMP0069/CMP0069-NEW-compiler-stderr.txt index 8decfab..cb9d19b 100644 --- a/Tests/RunCMake/CMP0069/CMP0069-NEW-compiler-stderr.txt +++ b/Tests/RunCMake/CMP0069/CMP0069-NEW-compiler-stderr.txt @@ -1,4 +1,6 @@ ^CMake Error at CMP0069-NEW-compiler\.cmake:[0-9]+ \(add_executable\): Compiler doesn't support IPO Call Stack \(most recent call first\): - CMakeLists\.txt:[0-9]+ \(include\)$ + CMakeLists\.txt:[0-9]+ \(include\) ++ +CMake Generate step failed\. Build files cannot be regenerated correctly\.$ diff --git a/Tests/RunCMake/CMP0069/CMP0069-NEW-generator-stderr.txt b/Tests/RunCMake/CMP0069/CMP0069-NEW-generator-stderr.txt index 0e05ee7..1159ec0 100644 --- a/Tests/RunCMake/CMP0069/CMP0069-NEW-generator-stderr.txt +++ b/Tests/RunCMake/CMP0069/CMP0069-NEW-generator-stderr.txt @@ -1,4 +1,6 @@ ^CMake Error at CMP0069-NEW-generator\.cmake:[0-9]+ \(add_executable\): CMake doesn't support IPO for current generator Call Stack \(most recent call first\): - CMakeLists\.txt:[0-9]+ \(include\)$ + CMakeLists\.txt:[0-9]+ \(include\) ++ +CMake Generate step failed\. Build files cannot be regenerated correctly\.$ diff --git a/Tests/RunCMake/FindBoost/CMP0093-NEW-stdout.txt b/Tests/RunCMake/FindBoost/CMP0093-NEW-stdout.txt new file mode 100644 index 0000000..62a6d39 --- /dev/null +++ b/Tests/RunCMake/FindBoost/CMP0093-NEW-stdout.txt @@ -0,0 +1 @@ +-- Boost_VERSION=1.70.0 diff --git a/Tests/RunCMake/FindBoost/CMP0093-NEW.cmake b/Tests/RunCMake/FindBoost/CMP0093-NEW.cmake new file mode 100644 index 0000000..64f44d2 --- /dev/null +++ b/Tests/RunCMake/FindBoost/CMP0093-NEW.cmake @@ -0,0 +1,2 @@ +cmake_policy(SET CMP0093 NEW) +include(ModuleMode.cmake) diff --git a/Tests/RunCMake/FindBoost/CMP0093-OLD-stdout.txt b/Tests/RunCMake/FindBoost/CMP0093-OLD-stdout.txt new file mode 100644 index 0000000..9e51e35 --- /dev/null +++ b/Tests/RunCMake/FindBoost/CMP0093-OLD-stdout.txt @@ -0,0 +1 @@ +-- Boost_VERSION=107000 diff --git a/Tests/RunCMake/FindBoost/CMP0093-OLD.cmake b/Tests/RunCMake/FindBoost/CMP0093-OLD.cmake new file mode 100644 index 0000000..69a3a95 --- /dev/null +++ b/Tests/RunCMake/FindBoost/CMP0093-OLD.cmake @@ -0,0 +1,2 @@ +cmake_policy(SET CMP0093 OLD) +include(ModuleMode.cmake) diff --git a/Tests/RunCMake/FindBoost/CMP0093-UNSET-stdout.txt b/Tests/RunCMake/FindBoost/CMP0093-UNSET-stdout.txt new file mode 100644 index 0000000..9e51e35 --- /dev/null +++ b/Tests/RunCMake/FindBoost/CMP0093-UNSET-stdout.txt @@ -0,0 +1 @@ +-- Boost_VERSION=107000 diff --git a/Tests/RunCMake/FindBoost/CMP0093-UNSET.cmake b/Tests/RunCMake/FindBoost/CMP0093-UNSET.cmake new file mode 100644 index 0000000..974094a --- /dev/null +++ b/Tests/RunCMake/FindBoost/CMP0093-UNSET.cmake @@ -0,0 +1 @@ +include(ModuleMode.cmake) diff --git a/Tests/RunCMake/FindBoost/RunCMakeTest.cmake b/Tests/RunCMake/FindBoost/RunCMakeTest.cmake index d66bda1..3916890 100644 --- a/Tests/RunCMake/FindBoost/RunCMakeTest.cmake +++ b/Tests/RunCMake/FindBoost/RunCMakeTest.cmake @@ -14,3 +14,7 @@ run_cmake(ConfigModeNotFound) run_cmake(ModuleModeNotFound) unset(RunCMake-stdout-file) unset(RunCMake-stderr-file) + +run_cmake(CMP0093-NEW) +run_cmake(CMP0093-OLD) +run_cmake(CMP0093-UNSET) diff --git a/Tests/RunCMake/GeneratorExpression/BadAND-stderr.txt b/Tests/RunCMake/GeneratorExpression/BadAND-stderr.txt index 0e48ba4..86d3e04 100644 --- a/Tests/RunCMake/GeneratorExpression/BadAND-stderr.txt +++ b/Tests/RunCMake/GeneratorExpression/BadAND-stderr.txt @@ -50,4 +50,6 @@ CMake Error at BadAND.cmake:1 \(add_custom_target\): Parameters to \$<AND> must resolve to either '0' or '1'. Call Stack \(most recent call first\): - CMakeLists.txt:3 \(include\)$ + CMakeLists.txt:3 \(include\) ++ +CMake Generate step failed\. Build files cannot be regenerated correctly\.$ diff --git a/Tests/RunCMake/GeneratorExpression/BadCONFIG-stderr.txt b/Tests/RunCMake/GeneratorExpression/BadCONFIG-stderr.txt index 964ea4d..42dd0ce 100644 --- a/Tests/RunCMake/GeneratorExpression/BadCONFIG-stderr.txt +++ b/Tests/RunCMake/GeneratorExpression/BadCONFIG-stderr.txt @@ -32,4 +32,6 @@ CMake Error at BadCONFIG.cmake:1 \(add_custom_target\): Expression syntax not recognized. Call Stack \(most recent call first\): - CMakeLists.txt:3 \(include\)$ + CMakeLists.txt:3 \(include\) ++ +CMake Generate step failed\. Build files cannot be regenerated correctly\.$ diff --git a/Tests/RunCMake/GeneratorExpression/BadNOT-stderr.txt b/Tests/RunCMake/GeneratorExpression/BadNOT-stderr.txt index e5e628c..627327c 100644 --- a/Tests/RunCMake/GeneratorExpression/BadNOT-stderr.txt +++ b/Tests/RunCMake/GeneratorExpression/BadNOT-stderr.txt @@ -49,4 +49,6 @@ CMake Error at BadNOT.cmake:1 \(add_custom_target\): \$<NOT> parameter must resolve to exactly one '0' or '1' value. Call Stack \(most recent call first\): - CMakeLists.txt:3 \(include\)$ + CMakeLists.txt:3 \(include\) ++ +CMake Generate step failed\. Build files cannot be regenerated correctly\.$ diff --git a/Tests/RunCMake/GeneratorExpression/BadOR-stderr.txt b/Tests/RunCMake/GeneratorExpression/BadOR-stderr.txt index eb26328..56e6af0 100644 --- a/Tests/RunCMake/GeneratorExpression/BadOR-stderr.txt +++ b/Tests/RunCMake/GeneratorExpression/BadOR-stderr.txt @@ -50,4 +50,6 @@ CMake Error at BadOR.cmake:1 \(add_custom_target\): Parameters to \$<OR> must resolve to either '0' or '1'. Call Stack \(most recent call first\): - CMakeLists.txt:3 \(include\)$ + CMakeLists.txt:3 \(include\) ++ +CMake Generate step failed\. Build files cannot be regenerated correctly\.$ diff --git a/Tests/RunCMake/GeneratorExpression/BadStrEqual-stderr.txt b/Tests/RunCMake/GeneratorExpression/BadStrEqual-stderr.txt index dd0d931..2f04c78 100644 --- a/Tests/RunCMake/GeneratorExpression/BadStrEqual-stderr.txt +++ b/Tests/RunCMake/GeneratorExpression/BadStrEqual-stderr.txt @@ -35,4 +35,6 @@ CMake Error at BadStrEqual.cmake:1 \(add_custom_target\): \$<STREQUAL> expression requires 2 comma separated parameters, but got 3 instead. Call Stack \(most recent call first\): - CMakeLists.txt:3 \(include\)$ + CMakeLists.txt:3 \(include\) ++ +CMake Generate step failed\. Build files cannot be regenerated correctly\.$ diff --git a/Tests/RunCMake/GeneratorExpression/BadTargetName-stderr.txt b/Tests/RunCMake/GeneratorExpression/BadTargetName-stderr.txt index 969393a..98eed1f 100644 --- a/Tests/RunCMake/GeneratorExpression/BadTargetName-stderr.txt +++ b/Tests/RunCMake/GeneratorExpression/BadTargetName-stderr.txt @@ -5,4 +5,6 @@ CMake Error at BadTargetName.cmake:1 \(add_custom_target\): \$<TARGET_NAME> expression requires literal input. Call Stack \(most recent call first\): - CMakeLists.txt:3 \(include\)$ + CMakeLists.txt:3 \(include\) ++ +CMake Generate step failed\. Build files cannot be regenerated correctly\.$ diff --git a/Tests/RunCMake/MSVCRuntimeLibrary/CMP0091-NEW-stderr.txt b/Tests/RunCMake/MSVCRuntimeLibrary/CMP0091-NEW-stderr.txt index 803058d..9afa461 100644 --- a/Tests/RunCMake/MSVCRuntimeLibrary/CMP0091-NEW-stderr.txt +++ b/Tests/RunCMake/MSVCRuntimeLibrary/CMP0091-NEW-stderr.txt @@ -1,2 +1,4 @@ ^CMake Error in CMakeLists.txt: - MSVC_RUNTIME_LIBRARY value 'BogusValue' not known for this C compiler.$ + MSVC_RUNTIME_LIBRARY value 'BogusValue' not known for this C compiler. ++ +CMake Generate step failed\. Build files cannot be regenerated correctly\.$ diff --git a/Tests/RunCMake/ObjectLibrary/OwnSources-stderr.txt b/Tests/RunCMake/ObjectLibrary/OwnSources-stderr.txt index 40d650e..208f3c9 100644 --- a/Tests/RunCMake/ObjectLibrary/OwnSources-stderr.txt +++ b/Tests/RunCMake/ObjectLibrary/OwnSources-stderr.txt @@ -2,4 +2,6 @@ The SOURCES of "A" use a generator expression that depends on the SOURCES themselves. Call Stack \(most recent call first\): - CMakeLists.txt:[0-9]+ \(include\)$ + CMakeLists.txt:[0-9]+ \(include\) ++ +CMake Generate step failed\. Build files cannot be regenerated correctly\.$ diff --git a/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadInvalidName-stderr.txt b/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadInvalidName-stderr.txt index fec12ae..6da79b7 100644 --- a/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadInvalidName-stderr.txt +++ b/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadInvalidName-stderr.txt @@ -47,4 +47,6 @@ \$<TARGET_PROPERTY:> \$<TARGET_PROPERTY:...> expression requires a non-empty property name. -*)+$ +*)+ ++ +CMake Generate step failed\. Build files cannot be regenerated correctly\.$ diff --git a/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadNonTarget-stderr.txt b/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadNonTarget-stderr.txt index 75865ad..d40b16b 100644 --- a/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadNonTarget-stderr.txt +++ b/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadNonTarget-stderr.txt @@ -5,4 +5,6 @@ CMake Error at BadNonTarget.cmake:7 \(include_directories\): Target "NonExistent" not found. Call Stack \(most recent call first\): - CMakeLists\.txt:[0-9]+ \(include\)$ + CMakeLists\.txt:[0-9]+ \(include\) ++ +CMake Generate step failed\. Build files cannot be regenerated correctly\.$ diff --git a/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadSelfReference-stderr.txt b/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadSelfReference-stderr.txt index f0f71ec..fa26861 100644 --- a/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadSelfReference-stderr.txt +++ b/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadSelfReference-stderr.txt @@ -34,4 +34,6 @@ \$<TARGET_PROPERTY:BadSelfReference6,COMPILE_DEFINITIONS> Self reference on target "BadSelfReference6". -*)+$ +*)+ ++ +CMake Generate step failed\. Build files cannot be regenerated correctly\.$ diff --git a/Tests/RunCMake/UseSWIG/CMP0086-common.cmake b/Tests/RunCMake/UseSWIG/CMP0086-common.cmake index c02592a..ef90218 100644 --- a/Tests/RunCMake/UseSWIG/CMP0086-common.cmake +++ b/Tests/RunCMake/UseSWIG/CMP0086-common.cmake @@ -8,4 +8,4 @@ include(UseSWIG) set_property (SOURCE example.i PROPERTY SWIG_MODULE_NAME "new_example") swig_add_library(example LANGUAGE python TYPE MODULE SOURCES example.i) -target_link_libraries(example PRIVATE Python::Python) +target_link_libraries(example PRIVATE Python::Module) diff --git a/Tests/RunCMake/XcodeProject/PerConfigPerSourceDefinitions-stderr.txt b/Tests/RunCMake/XcodeProject/PerConfigPerSourceDefinitions-stderr.txt index 46a294d..69c61e6 100644 --- a/Tests/RunCMake/XcodeProject/PerConfigPerSourceDefinitions-stderr.txt +++ b/Tests/RunCMake/XcodeProject/PerConfigPerSourceDefinitions-stderr.txt @@ -5,4 +5,6 @@ specified for source: - .*/Tests/RunCMake/XcodeProject/main.c$ + .*/Tests/RunCMake/XcodeProject/main.c ++ +CMake Generate step failed\. Build files cannot be regenerated correctly\.$ diff --git a/Tests/RunCMake/XcodeProject/PerConfigPerSourceFlags-stderr.txt b/Tests/RunCMake/XcodeProject/PerConfigPerSourceFlags-stderr.txt index 6500649..c3e9e31 100644 --- a/Tests/RunCMake/XcodeProject/PerConfigPerSourceFlags-stderr.txt +++ b/Tests/RunCMake/XcodeProject/PerConfigPerSourceFlags-stderr.txt @@ -5,4 +5,6 @@ specified for source: - .*/Tests/RunCMake/XcodeProject/main.c$ + .*/Tests/RunCMake/XcodeProject/main.c ++ +CMake Generate step failed\. Build files cannot be regenerated correctly\.$ diff --git a/Tests/RunCMake/XcodeProject/PerConfigPerSourceIncludeDirs-stderr.txt b/Tests/RunCMake/XcodeProject/PerConfigPerSourceIncludeDirs-stderr.txt index f9b8ee7..ff70b95 100644 --- a/Tests/RunCMake/XcodeProject/PerConfigPerSourceIncludeDirs-stderr.txt +++ b/Tests/RunCMake/XcodeProject/PerConfigPerSourceIncludeDirs-stderr.txt @@ -5,4 +5,6 @@ specified for source: - .*/Tests/RunCMake/XcodeProject/main.c$ + .*/Tests/RunCMake/XcodeProject/main.c ++ +CMake Generate step failed\. Build files cannot be regenerated correctly\.$ diff --git a/Tests/RunCMake/XcodeProject/PerConfigPerSourceOptions-stderr.txt b/Tests/RunCMake/XcodeProject/PerConfigPerSourceOptions-stderr.txt index bfca020..100008a 100644 --- a/Tests/RunCMake/XcodeProject/PerConfigPerSourceOptions-stderr.txt +++ b/Tests/RunCMake/XcodeProject/PerConfigPerSourceOptions-stderr.txt @@ -5,4 +5,6 @@ specified for source: - .*/Tests/RunCMake/XcodeProject/main.c$ + .*/Tests/RunCMake/XcodeProject/main.c ++ +CMake Generate step failed\. Build files cannot be regenerated correctly\.$ diff --git a/Tests/RunCMake/XcodeProject/RunCMakeTest.cmake b/Tests/RunCMake/XcodeProject/RunCMakeTest.cmake index 4918f7c..191f56d 100644 --- a/Tests/RunCMake/XcodeProject/RunCMakeTest.cmake +++ b/Tests/RunCMake/XcodeProject/RunCMakeTest.cmake @@ -256,4 +256,19 @@ if(XCODE_VERSION VERSION_GREATER_EQUAL 8) deployment_target_test(watchOS watchsimulator) endif() +if(XCODE_VERSION VERSION_GREATER_EQUAL 8) + function(xctest_lookup_test SystemName SDK) + set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/XCTestLookup-${SDK}-build) + set(RunCMake_TEST_OPTIONS "-DCMAKE_SYSTEM_NAME=${SystemName}" "-DCMAKE_OSX_SYSROOT=${SDK}") + + run_cmake(XCTestLookup) + endfunction() + + xctest_lookup_test(Darwin macosx) + xctest_lookup_test(iOS iphoneos) + xctest_lookup_test(iOS iphonesimulator) + xctest_lookup_test(tvOS appletvos) + xctest_lookup_test(tvOS appletvsimulator) +endif() + # Please add macOS-only tests above before the device-specific tests. diff --git a/Tests/RunCMake/XcodeProject/XCTestLookup.cmake b/Tests/RunCMake/XcodeProject/XCTestLookup.cmake new file mode 100644 index 0000000..77676e5 --- /dev/null +++ b/Tests/RunCMake/XcodeProject/XCTestLookup.cmake @@ -0,0 +1,3 @@ +enable_language(C) + +find_package(XCTest REQUIRED) diff --git a/Tests/RunCMake/add_executable/NoSources-stderr.txt b/Tests/RunCMake/add_executable/NoSources-stderr.txt index 4fcfd49..abefc6d 100644 --- a/Tests/RunCMake/add_executable/NoSources-stderr.txt +++ b/Tests/RunCMake/add_executable/NoSources-stderr.txt @@ -1,4 +1,6 @@ ^CMake Error at NoSources.cmake:[0-9]+ \(add_executable\): No SOURCES given to target: TestExeWithoutSources Call Stack \(most recent call first\): - CMakeLists.txt:[0-9]+ \(include\)$ + CMakeLists.txt:[0-9]+ \(include\) ++ +CMake Generate step failed\. Build files cannot be regenerated correctly\.$ diff --git a/Tests/RunCMake/add_executable/NoSourcesButLinkObjects-stderr.txt b/Tests/RunCMake/add_executable/NoSourcesButLinkObjects-stderr.txt index 5561daa..80026bf 100644 --- a/Tests/RunCMake/add_executable/NoSourcesButLinkObjects-stderr.txt +++ b/Tests/RunCMake/add_executable/NoSourcesButLinkObjects-stderr.txt @@ -1,4 +1,6 @@ ^CMake Error at NoSourcesButLinkObjects.cmake:[0-9]+ \(add_executable\): No SOURCES given to target: TestExeWithoutSources Call Stack \(most recent call first\): - CMakeLists.txt:[0-9]+ \(include\)$ + CMakeLists.txt:[0-9]+ \(include\) ++ +CMake Generate step failed\. Build files cannot be regenerated correctly\.$ diff --git a/Tests/RunCMake/add_library/MODULEwithNoSources-stderr.txt b/Tests/RunCMake/add_library/MODULEwithNoSources-stderr.txt index 41da381..72b92ce 100644 --- a/Tests/RunCMake/add_library/MODULEwithNoSources-stderr.txt +++ b/Tests/RunCMake/add_library/MODULEwithNoSources-stderr.txt @@ -1,4 +1,6 @@ ^CMake Error at MODULEwithNoSources.cmake:[0-9]+ \(add_library\): No SOURCES given to target: TestModuleLibWithoutSources Call Stack \(most recent call first\): - CMakeLists.txt:[0-9]+ \(include\)$ + CMakeLists.txt:[0-9]+ \(include\) ++ +CMake Generate step failed\. Build files cannot be regenerated correctly\.$ diff --git a/Tests/RunCMake/add_library/MODULEwithNoSourcesButLinkObjects-stderr.txt b/Tests/RunCMake/add_library/MODULEwithNoSourcesButLinkObjects-stderr.txt index 67dd87c..1490524 100644 --- a/Tests/RunCMake/add_library/MODULEwithNoSourcesButLinkObjects-stderr.txt +++ b/Tests/RunCMake/add_library/MODULEwithNoSourcesButLinkObjects-stderr.txt @@ -1,4 +1,6 @@ ^CMake Error at MODULEwithNoSourcesButLinkObjects.cmake:[0-9]+ \(add_library\): No SOURCES given to target: TestModuleLibWithoutSources Call Stack \(most recent call first\): - CMakeLists.txt:[0-9]+ \(include\)$ + CMakeLists.txt:[0-9]+ \(include\) ++ +CMake Generate step failed\. Build files cannot be regenerated correctly\.$ diff --git a/Tests/RunCMake/add_library/OBJECTwithNoSources-stderr.txt b/Tests/RunCMake/add_library/OBJECTwithNoSources-stderr.txt index 20d3a8a..be7634c 100644 --- a/Tests/RunCMake/add_library/OBJECTwithNoSources-stderr.txt +++ b/Tests/RunCMake/add_library/OBJECTwithNoSources-stderr.txt @@ -1,4 +1,6 @@ ^CMake Error at OBJECTwithNoSources.cmake:[0-9]+ \(add_library\): No SOURCES given to target: TestObjectLibWithoutSources Call Stack \(most recent call first\): - CMakeLists.txt:[0-9]+ \(include\)$ + CMakeLists.txt:[0-9]+ \(include\) ++ +CMake Generate step failed\. Build files cannot be regenerated correctly\.$ diff --git a/Tests/RunCMake/add_library/OBJECTwithNoSourcesButLinkObjects-stderr.txt b/Tests/RunCMake/add_library/OBJECTwithNoSourcesButLinkObjects-stderr.txt index 1bcc114..3f85916 100644 --- a/Tests/RunCMake/add_library/OBJECTwithNoSourcesButLinkObjects-stderr.txt +++ b/Tests/RunCMake/add_library/OBJECTwithNoSourcesButLinkObjects-stderr.txt @@ -1,4 +1,6 @@ ^CMake Error at OBJECTwithNoSourcesButLinkObjects.cmake:[0-9]+ \(add_library\): No SOURCES given to target: TestObjectLibWithoutSources Call Stack \(most recent call first\): - CMakeLists.txt:[0-9]+ \(include\)$ + CMakeLists.txt:[0-9]+ \(include\) ++ +CMake Generate step failed\. Build files cannot be regenerated correctly\.$ diff --git a/Tests/RunCMake/add_library/SHAREDwithNoSources-stderr.txt b/Tests/RunCMake/add_library/SHAREDwithNoSources-stderr.txt index 5cedd62..471eda1 100644 --- a/Tests/RunCMake/add_library/SHAREDwithNoSources-stderr.txt +++ b/Tests/RunCMake/add_library/SHAREDwithNoSources-stderr.txt @@ -1,4 +1,6 @@ ^CMake Error at SHAREDwithNoSources.cmake:[0-9]+ \(add_library\): No SOURCES given to target: TestSharedLibWithoutSources Call Stack \(most recent call first\): - CMakeLists.txt:[0-9]+ \(include\)$ + CMakeLists.txt:[0-9]+ \(include\) ++ +CMake Generate step failed\. Build files cannot be regenerated correctly\.$ diff --git a/Tests/RunCMake/add_library/SHAREDwithNoSourcesButLinkObjects-stderr.txt b/Tests/RunCMake/add_library/SHAREDwithNoSourcesButLinkObjects-stderr.txt index d621e76..4bec7ae 100644 --- a/Tests/RunCMake/add_library/SHAREDwithNoSourcesButLinkObjects-stderr.txt +++ b/Tests/RunCMake/add_library/SHAREDwithNoSourcesButLinkObjects-stderr.txt @@ -1,4 +1,6 @@ ^CMake Error at SHAREDwithNoSourcesButLinkObjects.cmake:[0-9]+ \(add_library\): No SOURCES given to target: TestSharedLibWithoutSources Call Stack \(most recent call first\): - CMakeLists.txt:[0-9]+ \(include\)$ + CMakeLists.txt:[0-9]+ \(include\) ++ +CMake Generate step failed\. Build files cannot be regenerated correctly\.$ diff --git a/Tests/RunCMake/add_library/STATICwithNoSources-stderr.txt b/Tests/RunCMake/add_library/STATICwithNoSources-stderr.txt index 10b2112..f655221 100644 --- a/Tests/RunCMake/add_library/STATICwithNoSources-stderr.txt +++ b/Tests/RunCMake/add_library/STATICwithNoSources-stderr.txt @@ -1,4 +1,6 @@ ^CMake Error at STATICwithNoSources.cmake:[0-9]+ \(add_library\): No SOURCES given to target: TestStaticLibWithoutSources Call Stack \(most recent call first\): - CMakeLists.txt:[0-9]+ \(include\)$ + CMakeLists.txt:[0-9]+ \(include\) ++ +CMake Generate step failed\. Build files cannot be regenerated correctly\.$ diff --git a/Tests/RunCMake/add_library/STATICwithNoSourcesButLinkObjects-stderr.txt b/Tests/RunCMake/add_library/STATICwithNoSourcesButLinkObjects-stderr.txt index 33c23b2..185aad8 100644 --- a/Tests/RunCMake/add_library/STATICwithNoSourcesButLinkObjects-stderr.txt +++ b/Tests/RunCMake/add_library/STATICwithNoSourcesButLinkObjects-stderr.txt @@ -1,4 +1,6 @@ ^CMake Error at STATICwithNoSourcesButLinkObjects.cmake:[0-9]+ \(add_library\): No SOURCES given to target: TestStaticLibWithoutSources Call Stack \(most recent call first\): - CMakeLists.txt:[0-9]+ \(include\)$ + CMakeLists.txt:[0-9]+ \(include\) ++ +CMake Generate step failed\. Build files cannot be regenerated correctly\.$ diff --git a/Tests/UseSWIG/ModuleName/CMakeLists.txt b/Tests/UseSWIG/ModuleName/CMakeLists.txt index de63883..435b441 100644 --- a/Tests/UseSWIG/ModuleName/CMakeLists.txt +++ b/Tests/UseSWIG/ModuleName/CMakeLists.txt @@ -34,7 +34,7 @@ set_target_properties (example1 PROPERTIES LIBRARY_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/example1" ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/example1" RUNTIME_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/example1") -target_link_libraries(example1 PRIVATE Python2::Python) +target_link_libraries(example1 PRIVATE Python2::Module) add_test (NAME ModuleName.example1 diff --git a/Tests/UseSWIG/ModuleVersion2/CMakeLists.txt b/Tests/UseSWIG/ModuleVersion2/CMakeLists.txt index a7ee210..093e858 100644 --- a/Tests/UseSWIG/ModuleVersion2/CMakeLists.txt +++ b/Tests/UseSWIG/ModuleVersion2/CMakeLists.txt @@ -33,7 +33,7 @@ set_target_properties (example1 PROPERTIES LIBRARY_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/Python2" ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/Python2" RUNTIME_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/Python2") -target_link_libraries(example1 PRIVATE Python2::Python) +target_link_libraries(example1 PRIVATE Python2::Module) # re-use sample interface file for another plugin swig_add_library(example2 @@ -44,7 +44,7 @@ set_target_properties (example2 PROPERTIES LIBRARY_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/Python3" ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/Python3" RUNTIME_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/Python3") -target_link_libraries(example2 PRIVATE Python3::Python) +target_link_libraries(example2 PRIVATE Python3::Module) add_test (NAME ModuleVersion2.example1 diff --git a/Tests/UseSWIG/MultipleModules/CMakeLists.txt b/Tests/UseSWIG/MultipleModules/CMakeLists.txt index f1dc379..4380080 100644 --- a/Tests/UseSWIG/MultipleModules/CMakeLists.txt +++ b/Tests/UseSWIG/MultipleModules/CMakeLists.txt @@ -36,7 +36,7 @@ set_target_properties (example1 PROPERTIES LIBRARY_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/Python" ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/Python" RUNTIME_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/Python") -target_link_libraries(example1 PRIVATE Python::Python) +target_link_libraries(example1 PRIVATE Python::Module) # re-use sample interface file for another plugin set_property(SOURCE "../example.i" APPEND PROPERTY diff --git a/Tests/UseSWIG/MultiplePython/CMakeLists.txt b/Tests/UseSWIG/MultiplePython/CMakeLists.txt index 8f87755..cf6c80e 100644 --- a/Tests/UseSWIG/MultiplePython/CMakeLists.txt +++ b/Tests/UseSWIG/MultiplePython/CMakeLists.txt @@ -34,7 +34,7 @@ set_target_properties (example1 PROPERTIES LIBRARY_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/Python2" ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/Python2" RUNTIME_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/Python2") -target_link_libraries(example1 PRIVATE Python2::Python) +target_link_libraries(example1 PRIVATE Python2::Module) # re-use sample interface file for another plugin swig_add_library(example2 @@ -46,7 +46,7 @@ set_target_properties (example2 PROPERTIES LIBRARY_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/Python3" ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/Python3" RUNTIME_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/Python3") -target_link_libraries(example2 PRIVATE Python3::Python) +target_link_libraries(example2 PRIVATE Python3::Module) diff --git a/Tests/UseSWIG/SwigSrcFileExtension/CMakeLists.txt b/Tests/UseSWIG/SwigSrcFileExtension/CMakeLists.txt index 7eb73d4..f70ce49 100644 --- a/Tests/UseSWIG/SwigSrcFileExtension/CMakeLists.txt +++ b/Tests/UseSWIG/SwigSrcFileExtension/CMakeLists.txt @@ -16,11 +16,11 @@ set(SWIG_SOURCE_FILE_EXTENSIONS ".i" ".swg") # Generate a Python module out of `.i` swig_add_library(my_add LANGUAGE python SOURCES my_add.i) -target_link_libraries(my_add Python::Python) +target_link_libraries(my_add Python::Module) # Generate a Python module out of `.swg` swig_add_library(my_sub LANGUAGE python SOURCES my_sub.swg) -target_link_libraries(my_sub Python::Python) +target_link_libraries(my_sub Python::Module) # Add a test add_test(NAME SwigSrcFileExtension diff --git a/Tests/UseSWIG/UseTargetINCLUDE_DIRECTORIES/CMakeLists.txt b/Tests/UseSWIG/UseTargetINCLUDE_DIRECTORIES/CMakeLists.txt index fbb72d5..80a2e16 100644 --- a/Tests/UseSWIG/UseTargetINCLUDE_DIRECTORIES/CMakeLists.txt +++ b/Tests/UseSWIG/UseTargetINCLUDE_DIRECTORIES/CMakeLists.txt @@ -25,7 +25,7 @@ set_target_properties (example1 PROPERTIES LIBRARY_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/example1" ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/example1" RUNTIME_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/example1") -target_link_libraries(example1 PRIVATE Python3::Python) +target_link_libraries(example1 PRIVATE Python3::Module) # Check that source property override target property @@ -42,4 +42,4 @@ set_target_properties (example2 PROPERTIES LIBRARY_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/example2" ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/example2" RUNTIME_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/example2") -target_link_libraries(example2 PRIVATE Python3::Python) +target_link_libraries(example2 PRIVATE Python3::Module) |