Skip to content

Commit

Permalink
Incorporate out of tree fixes for newer CMake
Browse files Browse the repository at this point in the history
  • Loading branch information
benmwebb committed Jan 30, 2024
1 parent d596acb commit 220cf5a
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions modules/scratch/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,14 +1,19 @@
# Are we running cmake from this directory (out of tree build) ?
if(CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR)
cmake_minimum_required(VERSION 2.8.3)
cmake_minimum_required(VERSION 2.8.12...3.6.0)
project(imp_module)

if(POLICY CMP0058)
cmake_policy(SET CMP0058 NEW)
endif(POLICY CMP0058)

if(POLICY CMP0053)
cmake_policy(SET CMP0053 NEW)
endif(POLICY CMP0053)

set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${PROJECT_SOURCE_DIR}/cmake_modules)

set(SWIG_EXECUTABLE swig CACHE STRING "Swig program")
set(SWIG_EXECUTABLE swig CACHE STRING "SWIG program")

find_package(IMP REQUIRED)
include(${IMP_USE_FILE})
Expand All @@ -23,7 +28,7 @@ if(CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR)
include_directories(SYSTEM ${IMP_INCLUDE_DIR})
include_directories("${CMAKE_BINARY_DIR}/include")

imp_build_module(${CMAKE_SOURCE_DIR})
imp_build_module(${CMAKE_SOURCE_DIR} scratch)

else()
include(ModuleBuild.cmake)
Expand Down

0 comments on commit 220cf5a

Please sign in to comment.