Skip to content

Commit 0320c8a

Browse files
authored
Bump CMake version and remove outdated code (#46)
1 parent caadbc0 commit 0320c8a

File tree

3 files changed

+5
-27
lines changed

3 files changed

+5
-27
lines changed

CMakeLists.txt

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -10,24 +10,12 @@
1010

1111

1212
# minimum required cmake version
13-
cmake_minimum_required(VERSION 2.8.12)
14-
15-
16-
# choose new behaviour for CMP0042
17-
# see http://www.cmake.org/cmake/help/v3.0/policy/CMP0042.html for more details
18-
if (POLICY CMP0042)
19-
cmake_policy(SET CMP0042 NEW)
20-
endif (POLICY CMP0042)
21-
13+
cmake_minimum_required(VERSION 3.10)
2214

2315
#
2416
# project information
2517
#
26-
if (${CMAKE_MAJOR_VERSION} EQUAL 3)
27-
project("test" LANGUAGES C Fortran)
28-
else ()
29-
project("test" C Fortran)
30-
endif ()
18+
project("test" LANGUAGES C Fortran)
3119

3220

3321
#

src/bar/CMakeLists.txt

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,17 +10,9 @@
1010

1111

1212
include_directories(../libfoo ../libheader)
13-
if ("${CMAKE_VERSION}" VERSION_LESS "3.0.2")
14-
include_directories(../libheader)
15-
endif ()
16-
1713
add_executable(bar bar.c)
18-
1914
target_link_libraries(bar foo)
20-
if ("${CMAKE_VERSION}" VERSION_GREATER "3.0.2")
21-
target_link_libraries(bar header)
22-
endif()
23-
15+
target_link_libraries(bar header)
2416

2517
add_test(test1 ${CMAKE_CURRENT_BINARY_DIR}/bar 1)
2618
add_test(test2 ${CMAKE_CURRENT_BINARY_DIR}/bar 2)

src/libheader/CMakeLists.txt

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,5 @@
88
# Written by Alexander Haase, alexander.haase@rwth-aachen.de
99
#
1010

11-
if ("${CMAKE_VERSION}" VERSION_GREATER "3.0.2")
12-
add_library(header INTERFACE)
13-
target_include_directories(header INTERFACE ${CMAKE_CURRENT_SOURCE_DIR})
14-
endif ()
11+
add_library(header INTERFACE)
12+
target_include_directories(header INTERFACE ${CMAKE_CURRENT_SOURCE_DIR})

0 commit comments

Comments
 (0)