<commit_before># -*- Mode:cmake -*-

####################################################################################################
#                                                                                                  #
# Copyright (C) 2014 University of Hull                                                            #
#                                                                                                  #
####################################################################################################

CMAKE_MINIMUM_REQUIRED(VERSION 2.8.4 FATAL_ERROR)

IF(POLICY CMP0046)
  CMAKE_POLICY(SET CMP0046 OLD)
ENDIF()

PROJECT(DCS08961)

# disallow in-source build
IF("${CMAKE_SOURCE_DIR}" STREQUAL "${CMAKE_BINARY_DIR}")
  MESSAGE(FATAL_ERROR
    "\n"
    "This project requires an out-of-source build.\n"
    "Please create a separate build directory and run CMake there.\n"
    "Consult README.build for command-line examples.")
ENDIF()

IF("" STREQUAL "${CMAKE_BUILD_TYPE}")
  SET(CMAKE_BUILD_TYPE "RelWithDebInfo")
ENDIF()

MESSAGE(STATUS "CMAKE_BUILD_TYPE set to '" ${CMAKE_BUILD_TYPE} "'")

# initial cache to make life easier on window$ (if we ever get there ;)
IF(NOT DCS08961INITCACHELOADED AND EXISTS ${CMAKE_SOURCE_DIR}/CMakeCacheInitial.txt)
  INCLUDE(${CMAKE_SOURCE_DIR}/CMakeCacheInitial.txt)
  SET(DCS08961INITCACHELOADED TRUE CACHE INTERNAL "")
ENDIF()

# globally visible functions/modules/variables
SET(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake")
INCLUDE(SetupProjectOptions)
INCLUDE(SetupFunctions)
INCLUDE(SetupWindowsSDK)
INCLUDE(SetupProjectPaths)
INCLUDE(SetupProjectVariables)
INCLUDE(SetupCompilerPre)

# see [http://athile.net/library/blog/?p=288]
SET_PROPERTY(GLOBAL PROPERTY USE_FOLDERS ON)

# testing
IF(DCS08961_BLD_UTEST)
  MESSAGE(STATUS "Enabling unit-test building")

  IF(DCS08961_RUN_CTEST)
    ENABLE_TESTING()
    CONFIGURE_FILE(cmake/SetupTestConfig.cmake ${CMAKE_BINARY_DIR}/CTestConfig.cmake COPYONLY)
    MESSAGE(STATUS "Enabling CTest unit-test execution")
  ELSEIF(DCS08961_RUN_UTEST)
    MESSAGE(STATUS "Enabling unit-test execution")
  ELSE()
    MESSAGE(STATUS "Disabling unit-test execution")
  ENDIF()

  ADD_CUSTOM_TARGET(check)
  SET_PROPERTY(TARGET check PROPERTY FOLDER "Tests")
  ADD_DEPENDENCIES(check test_all)
ELSE()
  MESSAGE(STATUS "Disabling unit-test building")
ENDIF()

# globally added include directories (-I); keep ordering
# 1. project
INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/inc)

# 2. BOOST
FIND_PACKAGE(Boost ${BOOST_MINIMUM_VERSION} REQUIRED)

# 3. GLM
FIND_PACKAGE(GLM REQUIRED)

# 4. GLI
FIND_PACKAGE(GLI REQUIRED)

# 5. AntTweakBar (hdr/lib not globally available though)
FIND_PACKAGE(ATB REQUIRED)

INCLUDE(SetupCompilerPost)

# traverse these sub dirs
ADD_SUBDIRECTORY(doc)
ADD_SUBDIRECTORY(share)
ADD_SUBDIRECTORY(src)

ADD_CUSTOM_TARGET(ALL_BUILD)
SET_PROPERTY(TARGET ALL_BUILD PROPERTY FOLDER "CMakePredefinedTargets")

IF(VERBOSE)
  INCLUDE(FeatureSummary)
  FEATURE_SUMMARY(WHAT ALL)
ENDIF()

# keep last
INCLUDE(SetupPackaging)<commit_msg>update: cmake 3.x<commit_after># -*- Mode:cmake -*-

####################################################################################################
#                                                                                                  #
# Copyright (C) 2014-2015 University of Hull                                                            #
#                                                                                                  #
####################################################################################################

CMAKE_MINIMUM_REQUIRED(VERSION 2.8.4 FATAL_ERROR)

IF(POLICY CMP0046)
  CMAKE_POLICY(SET CMP0046 OLD)
ENDIF()

PROJECT(DCS08961)

# disallow in-source build
IF("${CMAKE_SOURCE_DIR}" STREQUAL "${CMAKE_BINARY_DIR}")
  MESSAGE(FATAL_ERROR
    "\n"
    "This project requires an out-of-source build.\n"
    "Please create a separate build directory and run CMake there.\n"
    "Consult README.build for command-line examples.")
ENDIF()

IF("" STREQUAL "${CMAKE_BUILD_TYPE}")
  SET(CMAKE_BUILD_TYPE "RelWithDebInfo")
ENDIF()

MESSAGE(STATUS "CMAKE_BUILD_TYPE set to '" ${CMAKE_BUILD_TYPE} "'")

# initial cache to make life easier on window$ (if we ever get there ;)
IF(NOT DCS08961INITCACHELOADED AND EXISTS ${CMAKE_SOURCE_DIR}/CMakeCacheInitial.txt)
  INCLUDE(${CMAKE_SOURCE_DIR}/CMakeCacheInitial.txt)
  SET(DCS08961INITCACHELOADED TRUE CACHE INTERNAL "")
ENDIF()

# globally visible functions/modules/variables
SET(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake")
INCLUDE(SetupProjectOptions)
INCLUDE(SetupFunctions)
INCLUDE(SetupWindowsSDK)
INCLUDE(SetupProjectPaths)
INCLUDE(SetupProjectVariables)
INCLUDE(SetupCompilerPre)

# see [http://athile.net/library/blog/?p=288]
SET_PROPERTY(GLOBAL PROPERTY USE_FOLDERS ON)

# testing
IF(DCS08961_BLD_UTEST)
  MESSAGE(STATUS "Enabling unit-test building")

  IF(DCS08961_RUN_CTEST)
    ENABLE_TESTING()
    CONFIGURE_FILE(cmake/SetupTestConfig.cmake ${CMAKE_BINARY_DIR}/CTestConfig.cmake COPYONLY)
    MESSAGE(STATUS "Enabling CTest unit-test execution")
  ELSEIF(DCS08961_RUN_UTEST)
    MESSAGE(STATUS "Enabling unit-test execution")
  ELSE()
    MESSAGE(STATUS "Disabling unit-test execution")
  ENDIF()

  ADD_CUSTOM_TARGET(check)
  SET_PROPERTY(TARGET check PROPERTY FOLDER "Tests")
  ADD_DEPENDENCIES(check test_all)
ELSE()
  MESSAGE(STATUS "Disabling unit-test building")
ENDIF()

# globally added include directories (-I); keep ordering
# 1. project
INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/inc)

# 2. BOOST
FIND_PACKAGE(Boost ${BOOST_MINIMUM_VERSION} REQUIRED)

# 3. GLM
FIND_PACKAGE(GLM REQUIRED)

# 4. GLI
FIND_PACKAGE(GLI REQUIRED)

# 5. AntTweakBar (hdr/lib not globally available though)
FIND_PACKAGE(ATB REQUIRED)

INCLUDE(SetupCompilerPost)

# traverse these sub dirs
ADD_SUBDIRECTORY(doc)
ADD_SUBDIRECTORY(share)
ADD_SUBDIRECTORY(src)

IF(POLICY CMP0037)
  CMAKE_POLICY(SET CMP0037 OLD)
ENDIF()

ADD_CUSTOM_TARGET(ALL_BUILD)
SET_PROPERTY(TARGET ALL_BUILD PROPERTY FOLDER "CMakePredefinedTargets")

IF(VERBOSE)
  INCLUDE(FeatureSummary)
  FEATURE_SUMMARY(WHAT ALL)
ENDIF()

# keep last
INCLUDE(SetupPackaging)
{'fraction_non_alphanumeric': 0.15492053299084926, 'fraction_numerical': 0.01910419007866431, 'mean_word_length': 4.024193548387097, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 20, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '710546', 'n_tokens_mistral': 2188, 'n_tokens_neox': 1952, 'n_words': 399}