Skip to content

Commit 3ee6f1e

Browse files
committed
ENH: use double-conversion's CMake targets
This will support multiple system versions of double-conversion. Suggested by Alexander Neumann. Closes #579. Closes #912.
1 parent a092294 commit 3ee6f1e

File tree

3 files changed

+5
-14
lines changed

3 files changed

+5
-14
lines changed

CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ foreach(p
44
CMP0025 # CMake 3.0
55
CMP0028
66
CMP0042 # CMake 3.0
7+
CMP0045
78
CMP0048
89
CMP0054 # CMake 3.1
910
CMP0056 # CMake 3.2

Modules/Core/Common/src/itkNumberToString.cxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
*=========================================================================*/
1818
#include "itkNumberToString.h"
1919
#include "itkNumericTraits.h"
20-
#include "double-conversion.h"
20+
#include "double-conversion/double-conversion.h"
2121

2222
#include <sstream>
2323

Modules/ThirdParty/DoubleConversion/CMakeLists.txt

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -7,19 +7,9 @@ option(ITK_USE_SYSTEM_DOUBLECONVERSION
77
mark_as_advanced(ITK_USE_SYSTEM_DOUBLECONVERSION)
88

99
if(ITK_USE_SYSTEM_DOUBLECONVERSION)
10-
find_library(double-conversion_LIBRARIES double-conversion)
11-
find_path(double-conversion_INCLUDE_DIRS double-conversion.h
12-
PATH_SUFFIXES double-conversion
13-
)
14-
15-
if (double-conversion_LIBRARIES AND double-conversion_INCLUDE_DIRS)
16-
set(ITKDoubleConversion_SYSTEM_INCLUDE_DIRS
17-
${double-conversion_INCLUDE_DIRS})
18-
set(ITKDoubleConversion_LIBRARIES
19-
"${double-conversion_LIBRARIES}")
20-
else()
21-
message(ERROR "double-conversion system library not found")
22-
endif()
10+
find_package(double-conversion REQUIRED)
11+
get_target_property(ITKDoubleConversion_INCLUDE_DIRS double-conversion::double-conversion INTERFACE_INCLUDE_DIRECTORIES)
12+
get_target_property(ITKDoubleConversion_LIBRARIES double-conversion::double-conversion LOCATION)
2313
else()
2414
set(ITKDoubleConversion_INCLUDE_DIRS
2515
${ITKDoubleConversion_SOURCE_DIR}/src/double-conversion

0 commit comments

Comments
 (0)