Skip to content

Commit 2e8eb52

Browse files
hjmjohnsonjcfr
authored andcommitted
COMP: Fix language feature introspection for SEM
Configuring with clang version 6.0.0 would fail with error message: CMake Error at (target_compile_features): target_compile_features no known features for CXX compiler "Clang" version 6.0.0. This is related to reported issues, and suggested solution in: https://gitlab.kitware.com/cmake/cmake/issues/17712 https://gitlab.kitware.com/cmake/cmake/issues/17714 The canonical top-level CMakeLists.txt file should be: cmake_minimum_required(VERSION 3.10) # or some other version project(MyProject) # optionally list languages or use NONE to suppress them
1 parent df8d5f2 commit 2e8eb52

File tree

8 files changed

+34
-16
lines changed

8 files changed

+34
-16
lines changed

CMakeLists.txt

Lines changed: 24 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,28 @@
1-
project(SlicerExecutionModel)
2-
31
#-----------------------------------------------------------------------------
4-
cmake_minimum_required(VERSION 2.8.6)
2+
cmake_minimum_required(VERSION 3.5)
3+
foreach(p
4+
## Only policies introduced after the cmake_minimum_required
5+
## version need to explicitly be set to NEW.
6+
#Policies Introduced by CMake 3.11
7+
CMP0072 # FindOpenGL prefers GLVND by default when available.
8+
#Policies Introduced by CMake 3.10
9+
CMP0071 # Let AUTOMOC and AUTOUIC process GENERATED files.
10+
CMP0070 # Define file(GENERATE) behavior for relative paths.
11+
#Policies Introduced by CMake 3.9
12+
CMP0069 # INTERPROCEDURAL_OPTIMIZATION is enforced when enabled.
13+
CMP0068 # RPATH settings on macOS do not affect install_name.
14+
#Policies Introduced by CMake 3.8
15+
CMP0067 # Honor language standard in try_compile() source-file signature.
16+
#Policies Introduced by CMake 3.7
17+
CMP0066 # Honor per-config flags in try_compile() source-file signature.
18+
)
19+
if(POLICY ${p})
20+
cmake_policy(SET ${p} NEW)
21+
endif()
22+
endforeach()
23+
24+
project(SlicerExecutionModel CXX)
25+
526
#-----------------------------------------------------------------------------
627

728
include(CMakeDependentOption)

GenerateCLP/CMakeLists.txt

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
1-
project(GenerateCLP)
2-
31
#-----------------------------------------------------------------------------
4-
cmake_minimum_required(VERSION 2.8.6)
2+
cmake_minimum_required(VERSION 3.5)
53
#-----------------------------------------------------------------------------
4+
project(GenerateCLP)
65

76
#-----------------------------------------------------------------------------
87
# Set a default build type if none was specified

GenerateCLP/Testing/CLPExample1/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
cmake_minimum_required(VERSION 2.8.6)
1+
cmake_minimum_required(VERSION 3.5)
22

33
include(${CMAKE_CURRENT_SOURCE_DIR}/../CMake/GenerateCLPTestMacros.cmake)
44

GenerateCLP/Testing/CLPTestMultiple/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
cmake_minimum_required(VERSION 2.8.6)
1+
cmake_minimum_required(VERSION 3.5)
22

33
include(${CMAKE_CURRENT_SOURCE_DIR}/../CMake/GenerateCLPTestMacros.cmake)
44

GenerateCLP/Testing/PointExample1/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
cmake_minimum_required(VERSION 2.8.6)
1+
cmake_minimum_required(VERSION 3.5)
22

33
#-----------------------------------------------------------------------------
44
# Configure & Build

GenerateCLP/Testing/Slicer3Example/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
cmake_minimum_required(VERSION 2.8.6)
1+
cmake_minimum_required(VERSION 3.5)
22

33
include(${CMAKE_CURRENT_SOURCE_DIR}/../CMake/GenerateCLPTestMacros.cmake)
44

ModuleDescriptionParser/CMakeLists.txt

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
1-
project(ModuleDescriptionParser)
2-
31
#-----------------------------------------------------------------------------
4-
cmake_minimum_required(VERSION 2.8.6)
2+
cmake_minimum_required(VERSION 3.5)
53
#-----------------------------------------------------------------------------
4+
project(ModuleDescriptionParser CXX)
65

76
#-----------------------------------------------------------------------------
87
# Set a default build type if none was specified

tclap/CMakeLists.txt

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
1-
project(TCLAP)
2-
31
#-----------------------------------------------------------------------------
4-
cmake_minimum_required(VERSION 2.8.6)
2+
cmake_minimum_required(VERSION 3.5)
53
#-----------------------------------------------------------------------------
4+
project(TCLAP)
65

76
# --------------------------------------------------------------------------
87
# Install headers

0 commit comments

Comments
 (0)