diff options
Diffstat (limited to 'Tests/RunCMake/TargetArtifacts')
4 files changed, 30 insertions, 0 deletions
diff --git a/Tests/RunCMake/TargetArtifacts/DLL-SOVERSION-build-stdout.txt b/Tests/RunCMake/TargetArtifacts/DLL-SOVERSION-build-stdout.txt new file mode 100644 index 0000000..b375da6 --- /dev/null +++ b/Tests/RunCMake/TargetArtifacts/DLL-SOVERSION-build-stdout.txt @@ -0,0 +1,2 @@ +.*exA_name="(libexA\.so\.2|libexA\.2\.dylib|(lib|cyg|msys-|)exA-2\.dll)" +.*exB_name="(libexB\.so\.2|libexB\.2\.dylib|(lib|cyg|msys-|)exB-2\.dll)" diff --git a/Tests/RunCMake/TargetArtifacts/DLL-SOVERSION.cmake b/Tests/RunCMake/TargetArtifacts/DLL-SOVERSION.cmake new file mode 100644 index 0000000..82eca0b --- /dev/null +++ b/Tests/RunCMake/TargetArtifacts/DLL-SOVERSION.cmake @@ -0,0 +1,18 @@ +enable_language(C) + +add_library(exA SHARED dll.c) +set_target_properties(exA PROPERTIES + SOVERSION 2 + DLL_NAME_WITH_SOVERSION 1 + ) + +set(CMAKE_DLL_NAME_WITH_SOVERSION 1) +add_library(exB SHARED dll.c) +set_property(TARGET exB PROPERTY SOVERSION 2) + +add_custom_target(checkNames ALL + COMMAND ${CMAKE_COMMAND} -E echo exA_name="$<TARGET_FILE_NAME:exA>" + COMMAND ${CMAKE_COMMAND} -E echo exB_name="$<TARGET_FILE_NAME:exB>" + VERBATIM + ) +add_dependencies(checkNames exA exB) diff --git a/Tests/RunCMake/TargetArtifacts/RunCMakeTest.cmake b/Tests/RunCMake/TargetArtifacts/RunCMakeTest.cmake index 2b5c4b8..de69936 100644 --- a/Tests/RunCMake/TargetArtifacts/RunCMakeTest.cmake +++ b/Tests/RunCMake/TargetArtifacts/RunCMakeTest.cmake @@ -9,7 +9,11 @@ function(run_cmake_and_verify_after_build case) endif() run_cmake(${case}) set(RunCMake_TEST_NO_CLEAN 1) + set(RunCMake_TEST_OUTPUT_MERGE 1) run_cmake_command("${case}-build" ${CMAKE_COMMAND} --build .) endfunction() +if(NOT CMAKE_SYSTEM_NAME STREQUAL "AIX") + run_cmake_and_verify_after_build(DLL-SOVERSION) +endif() run_cmake_and_verify_after_build(OutputDirs) diff --git a/Tests/RunCMake/TargetArtifacts/dll.c b/Tests/RunCMake/TargetArtifacts/dll.c new file mode 100644 index 0000000..31e1dbf --- /dev/null +++ b/Tests/RunCMake/TargetArtifacts/dll.c @@ -0,0 +1,6 @@ +#ifdef _WIN32 +__declspec(dllexport) +#endif + void dll(void) +{ +} |