diff --git a/CMakeLists.txt b/CMakeLists.txt index 448d0af..ac528a4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,8 +1,4 @@ -cmake_minimum_required(VERSION 2.8) - -if(POLICY CMP0048) - cmake_policy(SET CMP0048 NEW) # CMake 3.0.0 -endif() +cmake_minimum_required(VERSION 3.5) set(MODULE_NAME "OpenIGTLinkIF") set(MODULE_TITLE "OpenIGTLink I/F") @@ -10,8 +6,13 @@ set(MODULE_TITLE "OpenIGTLink I/F") string(TOUPPER ${MODULE_NAME} MODULE_NAME_UPPER) #----------------------------------------------------------------------------- -find_package(Slicer REQUIRED) -include(${Slicer_USE_FILE}) +if(Slicer_SOURCE_DIR) + find_package(OpenIGTLink REQUIRED) + include(${OpenIGTLink_USE_FILE}) +else() + find_package(Slicer REQUIRED) + include(${Slicer_USE_FILE}) +endif() # -------------------------------------------------------------------------- # Check if version 2 protocol is available @@ -98,7 +99,6 @@ slicerMacroBuildQtModule( RESOURCES ${MODULE_RESOURCES} ) - if(BUILD_TESTING) #add_subdirectory(Testing) endif()