File tree Expand file tree Collapse file tree 3 files changed +27
-21
lines changed Expand file tree Collapse file tree 3 files changed +27
-21
lines changed Original file line number Diff line number Diff line change 66# CMake version
77cmake_minimum_required (VERSION 3.0 FATAL_ERROR)
88
9- # Include cmake modules
9+ #
10+ # Configure CMake environment
11+ #
12+
13+ # Register general cmake commands
14+ include (cmake/Custom.cmake)
1015
16+ # Set policies
17+ set_policy(CMP0028 NEW) # ENABLE CMP0028: Double colon in target name means ALIAS or IMPORTED target.
18+ set_policy(CMP0054 NEW) # ENABLE CMP0054: Only interpret if() arguments as variables or keywords when unquoted.
19+ set_policy(CMP0042 NEW) # ENABLE CMP0042: MACOSX_RPATH is enabled by default.
20+ set_policy(CMP0063 NEW) # ENABLE CMP0063: Honor visibility properties for all target types.
21+
22+ # Include cmake modules
1123list (APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR} /cmake" )
1224
1325include (GenerateExportHeader)
@@ -19,15 +31,10 @@ if (${CMAKE_VERSION} VERSION_GREATER "3.2")
1931 include (WriteCompilerDetectionHeader OPTIONAL RESULT_VARIABLE WriterCompilerDetectionHeaderFound)
2032endif ()
2133
34+ # Include custom cmake modules
2235include (cmake/GetGitRevisionDescription.cmake)
23- include (cmake/Custom.cmake)
2436include (cmake/HealthCheck.cmake)
25-
26- # Set policies
27- set_policy(CMP0028 NEW) # ENABLE CMP0028: Double colon in target name means ALIAS or IMPORTED target.
28- set_policy(CMP0054 NEW) # ENABLE CMP0054: Only interpret if() arguments as variables or keywords when unquoted.
29- set_policy(CMP0042 NEW) # ENABLE CMP0042: MACOSX_RPATH is enabled by default.
30- set_policy(CMP0063 NEW) # ENABLE CMP0063: Honor visibility properties for all target types.
37+ include (cmake/GenerateTemplateExportHeader.cmake)
3138
3239
3340#
Original file line number Diff line number Diff line change @@ -44,16 +44,3 @@ function(list_extract OUTPUT REGEX)
4444 set (${OUTPUT} ${${OUTPUT} } PARENT_SCOPE)
4545
4646endfunction (list_extract)
47-
48-
49- # Creates an export header similar to generate_export_header, but for templates.
50- # The main difference is that for MSVC, templates must not get exported.
51- # When the file ${export_file} is included in source code, the macro ${target_id}_TEMPLATE_API
52- # may get used to define public visibility for templates on GCC and Clang platforms.
53- function (generate_template_export_header target target_id export_file)
54- if ("${CMAKE_CXX_COMPILER_ID} " MATCHES "MSVC" )
55- configure_file (${PROJECT_SOURCE_DIR} /source /codegeneration/template_msvc_api.h.in ${CMAKE_CURRENT_BINARY_DIR} /${export_file} )
56- else ()
57- configure_file (${PROJECT_SOURCE_DIR} /source /codegeneration/template_api.h.in ${CMAKE_CURRENT_BINARY_DIR} /${export_file} )
58- endif ()
59- endfunction ()
Original file line number Diff line number Diff line change 1+
2+ # Creates an export header similar to generate_export_header, but for templates.
3+ # The main difference is that for MSVC, templates must not get exported.
4+ # When the file ${export_file} is included in source code, the macro ${target_id}_TEMPLATE_API
5+ # may get used to define public visibility for templates on GCC and Clang platforms.
6+ function (generate_template_export_header target target_id export_file)
7+ if ("${CMAKE_CXX_COMPILER_ID} " MATCHES "MSVC" )
8+ configure_file (${PROJECT_SOURCE_DIR} /source /codegeneration/template_msvc_api.h.in ${CMAKE_CURRENT_BINARY_DIR} /${export_file} )
9+ else ()
10+ configure_file (${PROJECT_SOURCE_DIR} /source /codegeneration/template_api.h.in ${CMAKE_CURRENT_BINARY_DIR} /${export_file} )
11+ endif ()
12+ endfunction ()
You can’t perform that action at this time.
0 commit comments