Skip to content

Commit da1d15a

Browse files
committed
Properly fix CMake warning
Fixes #96 for real.
1 parent 293987c commit da1d15a

File tree

1 file changed

+36
-33
lines changed

1 file changed

+36
-33
lines changed

CMakeLists.txt

Lines changed: 36 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@
55
cmake_minimum_required(VERSION 3.1)
66
if(POLICY CMP0076)
77
cmake_policy(SET CMP0076 NEW)
8+
set(source_prefix ".")
9+
else()
10+
set(source_prefix "${CMAKE_CURRENT_SOURCE_DIR}")
811
endif()
912

1013
project(TYPE_SAFE)
@@ -48,40 +51,40 @@ endif()
4851

4952
# interface target
5053
set(detail_header_files
51-
${CMAKE_CURRENT_SOURCE_DIR}/include/type_safe/detail/aligned_union.hpp
52-
${CMAKE_CURRENT_SOURCE_DIR}/include/type_safe/detail/all_of.hpp
53-
${CMAKE_CURRENT_SOURCE_DIR}/include/type_safe/detail/assert.hpp
54-
${CMAKE_CURRENT_SOURCE_DIR}/include/type_safe/detail/assign_or_construct.hpp
55-
${CMAKE_CURRENT_SOURCE_DIR}/include/type_safe/detail/constant_parser.hpp
56-
${CMAKE_CURRENT_SOURCE_DIR}/include/type_safe/detail/copy_move_control.hpp
57-
${CMAKE_CURRENT_SOURCE_DIR}/include/type_safe/detail/force_inline.hpp
58-
${CMAKE_CURRENT_SOURCE_DIR}/include/type_safe/detail/is_nothrow_swappable.hpp
59-
${CMAKE_CURRENT_SOURCE_DIR}/include/type_safe/detail/map_invoke.hpp
60-
${CMAKE_CURRENT_SOURCE_DIR}/include/type_safe/detail/variant_impl.hpp)
54+
${source_prefix}/include/type_safe/detail/aligned_union.hpp
55+
${source_prefix}/include/type_safe/detail/all_of.hpp
56+
${source_prefix}/include/type_safe/detail/assert.hpp
57+
${source_prefix}/include/type_safe/detail/assign_or_construct.hpp
58+
${source_prefix}/include/type_safe/detail/constant_parser.hpp
59+
${source_prefix}/include/type_safe/detail/copy_move_control.hpp
60+
${source_prefix}/include/type_safe/detail/force_inline.hpp
61+
${source_prefix}/include/type_safe/detail/is_nothrow_swappable.hpp
62+
${source_prefix}/include/type_safe/detail/map_invoke.hpp
63+
${source_prefix}/include/type_safe/detail/variant_impl.hpp)
6164
set(header_files
62-
${CMAKE_CURRENT_SOURCE_DIR}/include/type_safe/config.hpp
63-
${CMAKE_CURRENT_SOURCE_DIR}/include/type_safe/arithmetic_policy.hpp
64-
${CMAKE_CURRENT_SOURCE_DIR}/include/type_safe/boolean.hpp
65-
${CMAKE_CURRENT_SOURCE_DIR}/include/type_safe/bounded_type.hpp
66-
${CMAKE_CURRENT_SOURCE_DIR}/include/type_safe/compact_optional.hpp
67-
${CMAKE_CURRENT_SOURCE_DIR}/include/type_safe/constrained_type.hpp
68-
${CMAKE_CURRENT_SOURCE_DIR}/include/type_safe/deferred_construction.hpp
69-
${CMAKE_CURRENT_SOURCE_DIR}/include/type_safe/downcast.hpp
70-
${CMAKE_CURRENT_SOURCE_DIR}/include/type_safe/flag.hpp
71-
${CMAKE_CURRENT_SOURCE_DIR}/include/type_safe/flag_set.hpp
72-
${CMAKE_CURRENT_SOURCE_DIR}/include/type_safe/floating_point.hpp
73-
${CMAKE_CURRENT_SOURCE_DIR}/include/type_safe/index.hpp
74-
${CMAKE_CURRENT_SOURCE_DIR}/include/type_safe/integer.hpp
75-
${CMAKE_CURRENT_SOURCE_DIR}/include/type_safe/narrow_cast.hpp
76-
${CMAKE_CURRENT_SOURCE_DIR}/include/type_safe/optional.hpp
77-
${CMAKE_CURRENT_SOURCE_DIR}/include/type_safe/optional_ref.hpp
78-
${CMAKE_CURRENT_SOURCE_DIR}/include/type_safe/output_parameter.hpp
79-
${CMAKE_CURRENT_SOURCE_DIR}/include/type_safe/reference.hpp
80-
${CMAKE_CURRENT_SOURCE_DIR}/include/type_safe/strong_typedef.hpp
81-
${CMAKE_CURRENT_SOURCE_DIR}/include/type_safe/tagged_union.hpp
82-
${CMAKE_CURRENT_SOURCE_DIR}/include/type_safe/types.hpp
83-
${CMAKE_CURRENT_SOURCE_DIR}/include/type_safe/variant.hpp
84-
${CMAKE_CURRENT_SOURCE_DIR}/include/type_safe/visitor.hpp)
65+
${source_prefix}/include/type_safe/config.hpp
66+
${source_prefix}/include/type_safe/arithmetic_policy.hpp
67+
${source_prefix}/include/type_safe/boolean.hpp
68+
${source_prefix}/include/type_safe/bounded_type.hpp
69+
${source_prefix}/include/type_safe/compact_optional.hpp
70+
${source_prefix}/include/type_safe/constrained_type.hpp
71+
${source_prefix}/include/type_safe/deferred_construction.hpp
72+
${source_prefix}/include/type_safe/downcast.hpp
73+
${source_prefix}/include/type_safe/flag.hpp
74+
${source_prefix}/include/type_safe/flag_set.hpp
75+
${source_prefix}/include/type_safe/floating_point.hpp
76+
${source_prefix}/include/type_safe/index.hpp
77+
${source_prefix}/include/type_safe/integer.hpp
78+
${source_prefix}/include/type_safe/narrow_cast.hpp
79+
${source_prefix}/include/type_safe/optional.hpp
80+
${source_prefix}/include/type_safe/optional_ref.hpp
81+
${source_prefix}/include/type_safe/output_parameter.hpp
82+
${source_prefix}/include/type_safe/reference.hpp
83+
${source_prefix}/include/type_safe/strong_typedef.hpp
84+
${source_prefix}/include/type_safe/tagged_union.hpp
85+
${source_prefix}/include/type_safe/types.hpp
86+
${source_prefix}/include/type_safe/variant.hpp
87+
${source_prefix}/include/type_safe/visitor.hpp)
8588

8689
add_library(type_safe INTERFACE)
8790
target_sources(type_safe INTERFACE $<BUILD_INTERFACE:${detail_header_files} ${header_files}>)

0 commit comments

Comments
 (0)