Skip to content

Commit

Permalink
Merge pull request #48 from cginternals/handle_CMP0054
Browse files Browse the repository at this point in the history
Fix policy declarations for test subproject (closes #44)
  • Loading branch information
scheibel authored Feb 1, 2017
2 parents 70a376b + 1c48075 commit 568a92d
Showing 1 changed file with 9 additions and 11 deletions.
20 changes: 9 additions & 11 deletions source/tests/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@

#
# Configure test project
# Configure test project and environment
#

# CMake version
cmake_minimum_required(VERSION 3.0 FATAL_ERROR)

# Meta information about the project
Expand All @@ -11,6 +12,13 @@ set(META_PROJECT_NAME "template")
# Declare project
project("${META_PROJECT_NAME}-tests" C CXX)

# Set policies
set_policy(CMP0028 NEW) # ENABLE CMP0028: Double colon in target name means ALIAS or IMPORTED target.
set_policy(CMP0054 NEW) # ENABLE CMP0054: Only interpret if() arguments as variables or keywords when unquoted.
set_policy(CMP0042 NEW) # ENABLE CMP0042: MACOSX_RPATH is enabled by default.
set_policy(CMP0063 NEW) # ENABLE CMP0063: Honor visibility properties for all target types.
set_policy(CMP0037 OLD) # DISABLE CMP0037: Target names should not be reserved and should match a validity pattern.

# Compiler settings and options

if (EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/../../cmake")
Expand All @@ -23,16 +31,6 @@ else()
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
endif()

#
# Setup test environment
#

set_policy(CMP0028 NEW) # ENABLE CMP0028: Double colon in target name means ALIAS or IMPORTED target.
set_policy(CMP0054 NEW) # ENABLE CMP0054: Only interpret if() arguments as variables or keywords when unquoted.
set_policy(CMP0042 NEW) # ENABLE CMP0042: MACOSX_RPATH is enabled by default.
set_policy(CMP0063 NEW) # ENABLE CMP0063: Honor visibility properties for all target types.
set_policy(CMP0037 OLD) # DISABLE CMP0037: Target names should not be reserved and should match a validity pattern.

# Function: Build test and add command to execute it via target 'test'
function(add_test_without_ctest target)
add_subdirectory(${target})
Expand Down

0 comments on commit 568a92d

Please sign in to comment.