Merge pull request #3830 from lrineau/Installation-fix_Windows_DLL_verinfo-lrineau

Fix CGAL DLLs verinfo on Windows
This commit is contained in:
Laurent Rineau 2019-04-08 15:57:31 +02:00
commit b86532d357
5 changed files with 50 additions and 10 deletions

View File

@ -14,11 +14,47 @@ if(PROPERTY_CGAL_run_at_the_end_of_configuration_INCLUDED)
endif()
function(CGAL_run_at_the_end_of_configuration variable access value current_list_file stack)
if(NOT access STREQUAL "MODIFIED_ACCESS" OR value)
# Only do something at the end of the CMake process, when the value of
# variable CMAKE_CURRENT_LIST_DIR is changed to the empty string.
if(NOT access STREQUAL "MODIFIED_ACCESS")
return()
endif()
if(CGAL_CHECK_UNUSED_CPP_FILES
AND NOT current_list_file STREQUAL "${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt"
AND stack STREQUAL "${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt")
file(GLOB _cppfiles ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp)
get_property(_targets DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} PROPERTY BUILDSYSTEM_TARGETS)
if(_targets AND _cppfiles)
set(_sources)
foreach(_target ${_targets})
get_property(_target_type TARGET ${_target} PROPERTY TYPE)
if(_target_type STREQUAL INTERFACE_LIBRARY)
continue()
endif()
get_property(_target_sources TARGET ${_target} PROPERTY SOURCES)
list(APPEND _sources ${_target_sources})
endforeach()
if(_sources)
list(REMOVE_ITEM _cppfiles ${_sources})
endif()
if(_cppfiles)
set(_warning "In ${CMAKE_CURRENT_SOURCE_DIR}, the following files are unused:")
foreach(_cppfile ${_cppfiles})
set(_warning "${_warning}
${_cppfile}")
endforeach()
set(_warning "${_warning}
")
message(AUTHOR_WARNING "${_warning}")
endif()
endif()
endif()
if(value)
# Only do the following at the end of the CMake process, when the
# value of variable CMAKE_CURRENT_LIST_DIR is changed to the empty
# string.
return()
endif()
# Warn when CMAKE_BUILD_TYPE is empty or Debug
if(DEFINED CMAKE_BUILD_TYPE AND ( NOT CMAKE_BUILD_TYPE OR CMAKE_BUILD_TYPE STREQUAL "Debug") )
set(keyword WARNING)

View File

@ -25,7 +25,7 @@
#define CGAL_VER_str(s) CGAL_VER_xstr(s)
#define CGAL_VER_VERSION CGAL_VERSION_MAJOR,CGAL_VERSION_MINOR,CGAL_VERSION_PATCH,CGAL_VERSION_BUILD
#define CGAL_VER_VERSION_STR CGAL_VER_str(CGAL_VERSION)
#define CGAL_VER_VERSION_STR CGAL_VER_str(CGAL_VERSION_MAJOR) "." CGAL_VER_str(CGAL_VERSION_MINOR) "." CGAL_VER_str(CGAL_VERSION_PATCH) "." CGAL_VER_str(CGAL_VERSION_BUILD)
#define CGAL_VER_COMPANYNAME_STR "The CGAL Project, https://www.cgal.org/\0"
#define CGAL_VER_FILEDESCRIPTION_STR "@LIBRARY_NAME@ Library\0"
#define CGAL_VER_FILEVERSION_STR CGAL_VER_VERSION_STR

View File

@ -79,10 +79,13 @@ if ( CGAL_FOUND )
endif()
endif()
if(WIN32)
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 version)
add_executable(test_gmp_mpfr_dll test_gmp_mpfr_dll.cpp)
target_link_libraries(test_gmp_mpfr_dll Version)
endif(WIN32)
target_link_libraries(test_gmp_mpfr_dll version)
CGAL_add_test(test_gmp_mpfr_dll)
endif()
find_package( LEDA QUIET)
if(LEDA_FOUND)

View File

@ -49,7 +49,7 @@ int main(int argc, char** argv) {
} else {
std::cerr << "Usage:\n"
<< " display_dll_version_info /path/to/a.dll\n";
return 0;
}
return 0;
}
#endif

View File

@ -142,9 +142,10 @@ if(CGAL_Qt5_FOUND AND Qt5_FOUND AND OPENGL_FOUND )
qt5_add_resources ( CGAL_Qt5_RESOURCE_FILES Polyhedron_3.qrc )
find_path(CGAL_THREE_HEADERS_PATH
NAME CGAL/Three/Scene_item.h
NAMES CGAL/Three/Scene_item.h
HINTS ${CGAL_INCLUDE_DIRS}
NO_DEFAULT_PATH
NO_CMAKE_FIND_ROOT_PATH
DOC "Path to CGAL/Three/Scene_item.h")
if(CGAL_THREE_HEADERS_PATH)
@ -159,7 +160,7 @@ if(CGAL_Qt5_FOUND AND Qt5_FOUND AND OPENGL_FOUND )
qt5_generate_moc( "${CGAL_THREE_HEADERS_PATH}/CGAL/Three/TextRenderer.h"
"${CMAKE_CURRENT_BINARY_DIR}/TextRenderer_moc.cpp" )
else()
message(FATAL_ERROR "Cannot find <CGAL/Three/Viewer_interface.h>")
message(FATAL_ERROR "Cannot find <CGAL/Three/Scene_item.h>")
endif()
unset(CGAL_THREE_HEADERS_PATH CACHE)