diff --git a/Installation/test/Installation/CMakeLists.txt b/Installation/test/Installation/CMakeLists.txt index cf090c2d39ad..183527601e32 100644 --- a/Installation/test/Installation/CMakeLists.txt +++ b/Installation/test/Installation/CMakeLists.txt @@ -48,13 +48,8 @@ endif() if(WIN32 OR CMAKE_SYSTEM_NAME STREQUAL Windows) - add_executable(display_dll_version_info display_dll_version_info.cpp) - target_link_libraries(display_dll_version_info PRIVATE version) - add_executable(test_gmp_mpfr_dll test_gmp_mpfr_dll.cpp) + create_single_source_cgal_program(test_gmp_mpfr_dll.cpp) target_link_libraries(test_gmp_mpfr_dll PRIVATE version) - use_CGAL_GMP_support(test_gmp_mpfr_dll) - CGAL_add_test(test_gmp_mpfr_dll) - add_to_cached_list( CGAL_EXECUTABLE_TARGETS test_gmp_mpfr_dll ) string(RANDOM RDM_DIR)#5 random chars to avoid conflicts in parallel testsuites set(NON_STANDARD_INSTALL_PREFIX $ENV{TEMP}/${RDM_DIR}) else() diff --git a/Installation/test/Installation/display_dll_version_info.cpp b/Installation/test/Installation/display_dll_version_info.cpp deleted file mode 100644 index ac826198f747..000000000000 --- a/Installation/test/Installation/display_dll_version_info.cpp +++ /dev/null @@ -1,55 +0,0 @@ -// This program is for MSVC only. -#ifndef WIN32 -int main() { - return 0; -} -#else - -#include -#include -#include - -bool get_version_info(const char* fileName, - int& major, - int& minor, - int& patch, - int& build) -{ - std::cout << "Query FileVersion of \"" << fileName << "\"\n"; - DWORD handle = 0; - DWORD size = GetFileVersionInfoSize(fileName, &handle); - BYTE* versionInfo = new BYTE[size]; - if (!GetFileVersionInfo(fileName, handle, size, versionInfo)) - { - delete[] versionInfo; - return false; - } - // we have version information - UINT len = 0; - VS_FIXEDFILEINFO* vsfi = NULL; - VerQueryValue(versionInfo, "\\", (void**)&vsfi, &len); - major = HIWORD(vsfi->dwFileVersionMS); - minor = LOWORD(vsfi->dwFileVersionMS); - patch = HIWORD(vsfi->dwFileVersionLS); - build = LOWORD(vsfi->dwFileVersionLS); - delete[] versionInfo; - return true; -} - -int main(int argc, char** argv) { - if(argc == 2) { - int major, minor, patch, build; - bool result = get_version_info(argv[1], major, minor, patch, build); - assert(result); - std::cout << "version " - << major << "." - << minor << "." - << patch << "." - << build << "\n"; - } else { - std::cerr << "Usage:\n" - << " display_dll_version_info /path/to/a.dll\n"; - } - return 0; -} -#endif