Skip to content

Commit 01ba13a

Browse files
committed
Fix CMake errors with the default setting. Update CMAKE_MINIMUM_REQUIRED to VERSION 3.5 for CMake 4.x compatibility.
1 parent 4e33499 commit 01ba13a

3 files changed

Lines changed: 7 additions & 7 deletions

File tree

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
PROJECT(OpenIGTLink)
22

3-
CMAKE_MINIMUM_REQUIRED(VERSION 3.1)
3+
CMAKE_MINIMUM_REQUIRED(VERSION 3.5)
44

55
INCLUDE(ExternalProject)
66

Examples/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.4)
1+
cmake_minimum_required(VERSION 3.5)
22

33
#
44
# Examples

Testing/CMakeLists.txt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
PROJECT( OpenIGTLinkTesting )
22

3-
cmake_minimum_required(VERSION 2.8.11)
4-
find_package(OpenIGTLink REQUIRED)
5-
include(${OpenIGTLink_USE_FILE})
6-
include_directories(${OpenIGTLink_INCLUDE_DIRS})
7-
link_directories(${OpenIGTLink_LIBRARY_DIRS})
3+
cmake_minimum_required(VERSION 3.5)
4+
# Use the parent project's OpenIGTLink target instead of find_package
5+
# since we're building OpenIGTLink in the same CMake project
6+
include_directories(${OpenIGTLink_SOURCE_DIR}/Source)
7+
include_directories(${OpenIGTLink_BINARY_DIR})
88
include_directories(${PROJECT_BINARY_DIR})
99
configure_file(${PROJECT_SOURCE_DIR}/igtlTestConfig.h.in ${PROJECT_BINARY_DIR}/igtlTestConfig.h)
1010
ENABLE_TESTING()

0 commit comments

Comments
 (0)