From 21a659d0ba34b6aa93919f411799ae03d26aa986 Mon Sep 17 00:00:00 2001 From: Jason Lokerson Date: Fri, 8 Jan 2016 13:56:01 -0800 Subject: [PATCH] Remove unnecessary finder modules These modules do not always work, and shouldn't be necessary as of CMake 3.4.0 --- cmake-modules/FindAssimp.cmake | 43 -- cmake-modules/FindBreakpad.cmake | 36 -- cmake-modules/FindBullet.cmake | 61 --- cmake-modules/FindCURL.cmake | 42 -- cmake-modules/FindCinder.cmake | 95 ---- cmake-modules/FindEigen.cmake | 32 -- cmake-modules/FindFbxSdk.cmake | 56 --- cmake-modules/FindFreeImage.cmake | 47 -- cmake-modules/FindGlew.cmake | 47 -- cmake-modules/FindInf2Cat.cmake | 28 -- cmake-modules/FindIrrklang.cmake | 48 --- cmake-modules/FindLeap.cmake | 61 --- cmake-modules/FindNanoSVG.cmake | 31 -- cmake-modules/FindOculusSDK.cmake | 47 -- cmake-modules/FindOpenGL.cmake | 96 ----- cmake-modules/FindOpenSSL.cmake | 43 -- .../FindPackageHandleStandardArgs.cmake | 357 --------------- cmake-modules/FindPolyPartition.cmake | 38 -- cmake-modules/FindSDL.cmake | 407 ------------------ cmake-modules/FindSFML.cmake | 326 -------------- cmake-modules/FindThreads.cmake | 188 -------- cmake-modules/FindWDK.cmake | 58 --- cmake-modules/TargetStrip.cmake | 15 - 23 files changed, 2202 deletions(-) delete mode 100644 cmake-modules/FindAssimp.cmake delete mode 100644 cmake-modules/FindBreakpad.cmake delete mode 100644 cmake-modules/FindBullet.cmake delete mode 100644 cmake-modules/FindCURL.cmake delete mode 100644 cmake-modules/FindCinder.cmake delete mode 100644 cmake-modules/FindEigen.cmake delete mode 100644 cmake-modules/FindFbxSdk.cmake delete mode 100644 cmake-modules/FindFreeImage.cmake delete mode 100644 cmake-modules/FindGlew.cmake delete mode 100644 cmake-modules/FindInf2Cat.cmake delete mode 100644 cmake-modules/FindIrrklang.cmake delete mode 100644 cmake-modules/FindLeap.cmake delete mode 100644 cmake-modules/FindNanoSVG.cmake delete mode 100644 cmake-modules/FindOculusSDK.cmake delete mode 100644 cmake-modules/FindOpenGL.cmake delete mode 100644 cmake-modules/FindOpenSSL.cmake delete mode 100644 cmake-modules/FindPackageHandleStandardArgs.cmake delete mode 100644 cmake-modules/FindPolyPartition.cmake delete mode 100644 cmake-modules/FindSDL.cmake delete mode 100644 cmake-modules/FindSFML.cmake delete mode 100644 cmake-modules/FindThreads.cmake delete mode 100644 cmake-modules/FindWDK.cmake delete mode 100644 cmake-modules/TargetStrip.cmake diff --git a/cmake-modules/FindAssimp.cmake b/cmake-modules/FindAssimp.cmake deleted file mode 100644 index eb11b194e..000000000 --- a/cmake-modules/FindAssimp.cmake +++ /dev/null @@ -1,43 +0,0 @@ -#.rst -# FindAssimp -# ------------ -# -# Created by Raffi Bedikian. -# Locate and configure Assimp -# -# Interface Targets -# ^^^^^^^^^^^^^^^^^ -# Assimp::Assimp -# -# Variables -# ^^^^^^^^^ -# Assimp_ROOT_DIR -# Assimp_FOUND -# Assimp_INCLUDE_DIR -# Assimp_LIBRARIES -# - -find_path(Assimp_ROOT_DIR - NAMES include/assimp/scene.h - PATH_SUFFIXES assimp-${Assimp_FIND_VERSION} - assimp) - -set(Assimp_INCLUDE_DIR ${Assimp_ROOT_DIR}/include) - -if(MSVC) - find_library(Assimp_LIBRARY_RELEASE "assimp.lib" HINTS "${Assimp_ROOT_DIR}" PATH_SUFFIXES lib) - find_library(Assimp_LIBRARY_DEBUG "assimpd.lib" HINTS "${Assimp_ROOT_DIR}" PATH_SUFFIXES lib) -else(${CMAKE_SYSTEM_NAME} MATCHES "Darwin") - find_library(Assimp_LIBRARY_RELEASE "libassimp.a" HINTS "${Assimp_ROOT_DIR}" PATH_SUFFIXES lib) - find_library(Assimp_LIBRARY_DEBUG "libassimp.a" HINTS "${Assimp_ROOT_DIR}" PATH_SUFFIXES lib) -endif() -include(SelectConfigurations) -select_configurations(Assimp LIBRARY LIBRARIES) - -include(FindPackageHandleStandardArgs) -find_package_handle_standard_args(Assimp DEFAULT_MSG Assimp_ROOT_DIR Assimp_INCLUDE_DIR Assimp_LIBRARY_RELEASE Assimp_LIBRARY_DEBUG) - -include(CreateImportTargetHelpers) - -generate_import_target(Assimp STATIC) - diff --git a/cmake-modules/FindBreakpad.cmake b/cmake-modules/FindBreakpad.cmake deleted file mode 100644 index 4dc96d20d..000000000 --- a/cmake-modules/FindBreakpad.cmake +++ /dev/null @@ -1,36 +0,0 @@ -#.rst -# FindBreakpad -# ------------ -# -# Created by Walter Gray. -# Locate and configure Breakpad -# -# Interface Targets -# ^^^^^^^^^^^^^^^^^ -# Breakpad::Breakpad -# -# Variables -# ^^^^^^^^^ -# Breakpad_FOUND -# Breakpad_INCLUDE_DIR -# Breakpad_LIBRARY_DIR -# Breakpad_ROOT_DIR - -find_path(Breakpad_ROOT_DIR - NAMES include/google_breakpad/common/breakpad_types.h - PATH_SUFFIXES breakpad-${Breakpad_FIND_VERSION} - breakpad) - -set(Breakpad_INCLUDE_DIR "${Breakpad_ROOT_DIR}/include") -set(Breakpad_LIBRARY_DIR "${Breakpad_ROOT_DIR}/lib") -foreach(_lib IN ITEMS common.lib exception_handler.lib crash_generation_client.lib) - list(APPEND Breakpad_LIBRARIES "${Breakpad_LIBRARY_DIR}/${_lib}") -endforeach() - -set(Breakpad_LIBRARY ${Breakpad_LIBRARIES}) - -include(FindPackageHandleStandardArgs) -find_package_handle_standard_args(Breakpad DEFAULT_MSG Breakpad_ROOT_DIR Breakpad_INCLUDE_DIR Breakpad_LIBRARY_DIR Breakpad_LIBRARIES) - -include(CreateImportTargetHelpers) -generate_import_target(Breakpad STATIC) diff --git a/cmake-modules/FindBullet.cmake b/cmake-modules/FindBullet.cmake deleted file mode 100644 index 550c254e2..000000000 --- a/cmake-modules/FindBullet.cmake +++ /dev/null @@ -1,61 +0,0 @@ -#.rst -# FindBullet -# ------------ -# -# Locate and configure Bullet Physics -# -# Interface Targets -# ^^^^^^^^^^^^^^^^^ -# FindBullet::FindBullet -# -# Variables -# ^^^^^^^^^ -# Bullet_ROOT_DIR -# Bullet_FOUND -# Bullet_INCLUDE_DIR -# Bullet_LIBRARIES -# - - -find_path(Bullet_ROOT_DIR NAMES "src/btBulletDynamicsCommon.h" PATH_SUFFIXES bullet-2.82-r2704) - -set(Bullet_INCLUDE_DIR ${Bullet_ROOT_DIR}/src) - -if(MSVC) - find_library(Bullet_COLLISION_LIBRARY_RELEASE NAMES "BulletCollision.lib" HINTS "${Bullet_ROOT_DIR}/lib/Win32/VS2013/Release" PATH_SUFFIXES lib) - find_library(Bullet_DYNAMICS_LIBRARY_RELEASE NAMES "BulletDynamics.lib" HINTS "${Bullet_ROOT_DIR}/lib/Win32/VS2013/Release" PATH_SUFFIXES lib) - find_library(Bullet_LINEAR_MATH_LIBRARY_RELEASE NAMES "LinearMath.lib" HINTS "${Bullet_ROOT_DIR}/lib/Win32/VS2013/Release" PATH_SUFFIXES lib) - - find_library(Bullet_COLLISION_LIBRARY_DEBUG NAMES "BulletCollision_Debug.lib" HINTS "${Bullet_ROOT_DIR}/lib/Win32/VS2013/Debug" PATH_SUFFIXES lib) - find_library(Bullet_DYNAMICS_LIBRARY_DEBUG NAMES "BulletDynamics_Debug.lib" HINTS "${Bullet_ROOT_DIR}/lib/Win32/VS2013/Debug" PATH_SUFFIXES lib) - find_library(Bullet_LINEAR_MATH_LIBRARY_DEBUG NAMES "LinearMath_Debug.lib" HINTS "${Bullet_ROOT_DIR}/lib/Win32/VS2013/Debug" PATH_SUFFIXES lib) -elseif(${CMAKE_SYSTEM_NAME} MATCHES "Darwin") # Mac - find_library(Bullet_COLLISION_LIBRARY_RELEASE NAMES "BulletCollision.a" HINTS "${Bullet_ROOT_DIR}/lib/Mac/Release" PATH_SUFFIXES lib) - find_library(Bullet_DYNAMICS_LIBRARY_RELEASE NAMES "BulletDynamics.a" HINTS "${Bullet_ROOT_DIR}/lib/Mac/Release" PATH_SUFFIXES lib) - find_library(Bullet_LINEAR_MATH_LIBRARY_RELEASE NAMES "LinearMath.a" HINTS "${Bullet_ROOT_DIR}/lib/Mac/Release" PATH_SUFFIXES lib) - - find_library(Bullet_COLLISION_LIBRARY_DEBUG NAMES "BulletCollision_Debug.a" HINTS "${Bullet_ROOT_DIR}/lib/Mac/Debug" PATH_SUFFIXES lib) - find_library(Bullet_DYNAMICS_LIBRARY_DEBUG NAMES "BulletDynamics_Debug.a" HINTS "${Bullet_ROOT_DIR}/lib/Mac/Debug" PATH_SUFFIXES lib) - find_library(Bullet_LINEAR_MATH_LIBRARY_DEBUG NAMES "LinearMath_Debug.a" HINTS "${Bullet_ROOT_DIR}/lib/Mac/Debug" PATH_SUFFIXES lib) -else() - # No linux support from Bullet! -endif() - -set(Bullet_LIBRARY_RELEASE "${Bullet_COLLISION_LIBRARY_RELEASE}" "${Bullet_DYNAMICS_LIBRARY_RELEASE}" "${Bullet_LINEAR_MATH_LIBRARY_RELEASE}") -set(Bullet_LIBRARY_DEBUG "${Bullet_COLLISION_LIBRARY_DEBUG}" "${Bullet_DYNAMICS_LIBRARY_DEBUG}" "${Bullet_LINEAR_MATH_LIBRARY_DEBUG}") -mark_as_advanced(Bullet_COLLISION_LIBRARY_RELEASE) -mark_as_advanced(Bullet_DYNAMICS_LIBRARY_RELEASE) -mark_as_advanced(Bullet_LINEAR_MATH_LIBRARY_RELEASE) -mark_as_advanced(Bullet_COLLISION_LIBRARY_DEBUG) -mark_as_advanced(Bullet_DYNAMICS_LIBRARY_DEBUG) -mark_as_advanced(Bullet_LINEAR_MATH_LIBRARY_DEBUG) - -include(SelectConfigurations) -select_configurations(Bullet LIBRARY LIBRARIES) - -include(FindPackageHandleStandardArgs) -find_package_handle_standard_args(Bullet DEFAULT_MSG Bullet_ROOT_DIR Bullet_INCLUDE_DIR Bullet_LIBRARY_RELEASE Bullet_LIBRARY_DEBUG) - -include(CreateImportTargetHelpers) - -generate_import_target(Bullet STATIC) diff --git a/cmake-modules/FindCURL.cmake b/cmake-modules/FindCURL.cmake deleted file mode 100644 index a17c5cca4..000000000 --- a/cmake-modules/FindCURL.cmake +++ /dev/null @@ -1,42 +0,0 @@ -#.rst -# FindCURL -# ------------ -# -# Created by Walter Gray. -# Locate and configure CURL -# -# Interface Targets -# ^^^^^^^^^^^^^^^^^ -# CURL::CURL -# -# Variables -# ^^^^^^^^^ -# CURL_ROOT_DIR -# CURL_FOUND -# CURL_INCLUDE_DIR -# CURL_LIBRARIES -# CURL_LIBRARY_RELEASE -# CURL_LIBRARY_DEBUG - -find_path(CURL_ROOT_DIR - NAMES include/curl/curl.h - PATH_SUFFIXES curl-${CURL_FIND_VERSION} - curl) - -set(CURL_INCLUDE_DIR ${CURL_ROOT_DIR}/include) - -if(MSVC) - find_library(CURL_LIBRARY_RELEASE "libcurl.lib" HINTS "${CURL_ROOT_DIR}/lib/release") - find_library(CURL_LIBRARY_DEBUG "libcurl.lib" HINTS "${CURL_ROOT_DIR}/lib/debug") -else() - find_library(CURL_LIBRARY_RELEASE "libcurl.a" HINTS "${CURL_ROOT_DIR}/lib") - find_library(CURL_LIBRARY_DEBUG "libcurl.a" HINTS "${CURL_ROOT_DIR}/lib") -endif() -include(SelectConfigurations) -select_configurations(CURL LIBRARY LIBRARIES) - -include(FindPackageHandleStandardArgs) -find_package_handle_standard_args(CURL DEFAULT_MSG CURL_INCLUDE_DIR CURL_LIBRARIES) - -include(CreateImportTargetHelpers) -generate_import_target(CURL STATIC) \ No newline at end of file diff --git a/cmake-modules/FindCinder.cmake b/cmake-modules/FindCinder.cmake deleted file mode 100644 index 8f9db999a..000000000 --- a/cmake-modules/FindCinder.cmake +++ /dev/null @@ -1,95 +0,0 @@ -#.rst -# FindCinder -# ---------- -# -# Created by Walter Gray -# Locate and configure cinder 0.8.5 for vc2010. Untested with other versions. -# -# Interface Targets -# ^^^^^^^^^^^^^^^^^ -# Cinder::Cinder -# Interface target. references Cinder::Core and all -# required boost libraries with the required ordering. -# -# Cinder::Core -# Static import target. Does not include cinder's dependencies. -# Typically not referenced outside of Cinder::Cinder -# -# Variables -# ^^^^^^^^^ -# Cinder_ROOT_DIR -# Root of the cinder package -# Cinder_FOUND -# If false, do not link to Cinder -# Cinder_LIBRARIES -# The names of the libraries to feed into target_link_libraries -# Cinder_INCLUDE_DIR -# Where to find the root of the cinder includes -# Cinder_LIBRARY_ -# The location of the main cinder library -# -# This module will also find and add the Boost package which is included with Cinder, -# create a master Boost::Boost interface library which links to a series of -# Boost:: static import libraries. - -if(MSVC10) - set(_compiler_SUFFIX "vc2010") -endif() - -find_path(Cinder_ROOT_DIR - NAMES include/cinder/Cinder.h - PATH_SUFFIXES cinder_${Cinder_FIND_VERSION}_${_compiler_SUFFIX} - cinder_${Cinder_FIND_VERSION} - cinder) - - -find_path(Cinder_INCLUDE_DIR - NAMES "cinder/Cinder.h" - HINTS "${Cinder_ROOT_DIR}" - PATH_SUFFIXES "include") - -find_library(Cinder_LIBRARY_RELEASE "cinder.lib" HINTS "${Cinder_ROOT_DIR}/lib") -find_library(Cinder_LIBRARY_DEBUG "cinder_d.lib" HINTS "${Cinder_ROOT_DIR}/lib") - -include(SelectConfigurations) -select_configurations(Cinder LIBRARY LIBRARIES) - -#Find Boost -if(MSVC) - set(BOOST_LIBRARYDIR "${Cinder_ROOT_DIR}/lib/msw") - set(_boost_components chrono date_time filesystem regex system thread) -else() - set(BOOST_LIBRARYDIR "${Cinder_ROOT_DIR}/lib/macosx") - set(_boost_components date_time filesystem system) -endif() - - -set(BOOST_ROOT ${Cinder_ROOT_DIR}/boost) -set(Boost_USE_STATIC_RUNTIME ON) -set(Boost_USE_MULTITHREADED ON) -set(Boost_USE_STATIC_LIBS ON) - -find_package(Boost REQUIRED QUIET COMPONENTS ${_boost_components} ) - -include(FindPackageHandleStandardArgs) -find_package_handle_standard_args(Cinder DEFAULT_MSG Cinder_ROOT_DIR Cinder_LIBRARIES Cinder_INCLUDE_DIR) - -#Setup the interface targets - -#Thanks to cinder's custom boost layout, we have to first create import targets -#for all of the boost components, then link them with the Cinder master interface library -#BEFORE linking in the actual cinder import target -include(CreateImportTargetHelpers) - -if(Cinder_FOUND AND NOT TARGET Cinder::Cinder) - generate_import_target(Boost INTERFACE) - foreach(_component ${_boost_components}) - string(TOUPPER ${_component} _componentUPPER) - generate_import_target(Boost_${_componentUPPER} STATIC TARGET Boost::${_component}) - target_link_libraries(Boost::Boost INTERFACE Boost::${_component}) - endforeach() - - generate_import_target(Cinder STATIC TARGET Cinder::Core) - add_library(Cinder::Cinder INTERFACE IMPORTED GLOBAL) - target_link_libraries(Cinder::Cinder INTERFACE Boost::Boost Cinder::Core) -endif() \ No newline at end of file diff --git a/cmake-modules/FindEigen.cmake b/cmake-modules/FindEigen.cmake deleted file mode 100644 index 0caefe4a0..000000000 --- a/cmake-modules/FindEigen.cmake +++ /dev/null @@ -1,32 +0,0 @@ -#.rst -# FindEigen -# ---------- -# -# Created by Walter Gray -# Locate and configure Eigen -# -# Interface Targets -# ^^^^^^^^^^^^^^^^^ -# Eigen::Eigen -# -# Variables -# ^^^^^^^^^ -# Eigen_ROOT_DIR -# Eigen_FOUND -# Eigen_INCLUDE_DIR - -find_path(Eigen_ROOT_DIR - NAMES Eigen/Eigen - PATH_SUFFIXES eigen-${Eigen_FIND_VERSION} - eigen) - -set(Eigen_INCLUDE_DIR "${Eigen_ROOT_DIR}") -if(EXISTS ${Eigen_INCLUDE_DIR}) - set(Eigen_FOUND) -endif() - -include(FindPackageHandleStandardArgs) -find_package_handle_standard_args(Eigen DEFAULT_MSG Eigen_INCLUDE_DIR) - -include(CreateImportTargetHelpers) -generate_import_target(Eigen INTERFACE) \ No newline at end of file diff --git a/cmake-modules/FindFbxSdk.cmake b/cmake-modules/FindFbxSdk.cmake deleted file mode 100644 index 63b1c5797..000000000 --- a/cmake-modules/FindFbxSdk.cmake +++ /dev/null @@ -1,56 +0,0 @@ -#.rst -# FindFbxSdk -# ------------ -# -# Created by Walter Gray. -# Locate and configure FbxSdk -# -# Interface Targets -# ^^^^^^^^^^^^^^^^^ -# FbxSdk::FbxSdk -# -# Variables -# ^^^^^^^^^ -# FbxSdk_ROOT_DIR -# FbxSdk_FOUND -# FbxSdk_INCLUDE_DIR -# FbxSdk_LIBRARIES - -find_path(FbxSdk_ROOT_DIR - NAMES include/fbxsdk.h - HINTS ${EXTERNAL_LIBRARY_DIR} - PATH_SUFFIXES fbx-sdk-${FbxSdk_FIND_VERSION} - fbx-sdk - # NOTE: 2014.2 does not compile with VS2012 - # fbx-sdk/2014.2 - # TODO: we should make this folder structure more consistent, most likely fbx-sdk/2015.1 - fbx-sdk/2015.1 - fbx2015/2015.1) - -set(FbxSdk_INCLUDE_DIR "${FbxSdk_ROOT_DIR}/include") - -if (CMAKE_SIZEOF_VOID_P EQUAL 8) # 64bit - set(BUILD_BIT_TYPE "x64") -else() # 32bit - set(BUILD_BIT_TYPE "x86") -endif() - -if(MSVC) - find_library(FbxSdk_LIBRARY_RELEASE "libfbxsdk-md.lib" HINTS "${FbxSdk_ROOT_DIR}/lib/vs2013/${BUILD_BIT_TYPE}/release") - find_library(FbxSdk_LIBRARY_DEBUG "libfbxsdk-md.lib" HINTS "${FbxSdk_ROOT_DIR}/lib/vs2013/${BUILD_BIT_TYPE}/debug") -elseif(${CMAKE_SYSTEM_NAME} MATCHES "Linux") # This is the correct way to detect Linux operating system -- see http://www.openguru.com/2009/04/cmake-detecting-platformoperating.html - find_library(FbxSdk_LIBRARY_RELEASE "libfbxsdk.a" HINTS "${FbxSdk_ROOT_DIR}/lib/gcc4/${BUILD_BIT_TYPE}/release") - find_library(FbxSdk_LIBRARY_DEBUG "libfbxsdk.a" HINTS "${FbxSdk_ROOT_DIR}/lib/gcc4/${BUILD_BIT_TYPE}/debug") -else() - find_library(FbxSdk_LIBRARY_RELEASE "libfbxsdk.a" HINTS "${FbxSdk_ROOT_DIR}/lib/clang/ub/release") - find_library(FbxSdk_LIBRARY_DEBUG "libfbxsdk.a" HINTS "${FbxSdk_ROOT_DIR}/lib/clang/ub/debug") -endif() -include(SelectConfigurations) -select_configurations(FbxSdk LIBRARY LIBRARIES) - -include(FindPackageHandleStandardArgs) -find_package_handle_standard_args(FbxSdk DEFAULT_MSG FbxSdk_INCLUDE_DIR FbxSdk_LIBRARIES) - -include(CreateImportTargetHelpers) -generate_import_target(FbxSdk STATIC) - diff --git a/cmake-modules/FindFreeImage.cmake b/cmake-modules/FindFreeImage.cmake deleted file mode 100644 index 2d559b710..000000000 --- a/cmake-modules/FindFreeImage.cmake +++ /dev/null @@ -1,47 +0,0 @@ -#.rst -# FindFreeImage -# ------------ -# -# Created by Walter Gray. -# Locate and configure FreeImage -# -# Interface Targets -# ^^^^^^^^^^^^^^^^^ -# FreeImage::FreeImage -# -# Variables -# ^^^^^^^^^ -# FreeImage_ROOT_DIR -# FreeImage_FOUND -# FreeImage_INCLUDE_DIR -# FreeImage_LIBRARIES -# -find_path(FreeImage_ROOT_DIR - NAMES Dist/FreeImage.h - include/FreeImage.h - PATH_SUFFIXES FreeImage-${FreeImage_FIND_VERSION} - FreeImage) - -find_path(FreeImage_INCLUDE_DIR "FreeImage.h" - HINTS "${FreeImage_ROOT_DIR}" - PATH_SUFFIXES Dist include) - - -#Todo: add the ability to select between shared and dynamic versions -if(MSVC) - find_library(FreeImage_LIBRARY_RELEASE "FreeImage.lib" HINTS "${FreeImage_ROOT_DIR}" PATH_SUFFIXES lib Dist) - find_library(FreeImage_LIBRARY_DEBUG "FreeImaged.lib" HINTS "${FreeImage_ROOT_DIR}" PATH_SUFFIXES lib Dist) -else() - find_library(FreeImage_LIBRARY_RELEASE "libfreeimage.a" HINTS "${FreeImage_ROOT_DIR}" PATH_SUFFIXES lib Dist) - find_library(FreeImage_LIBRARY_DEBUG "libfreeimage.a" HINTS "${FreeImage_ROOT_DIR}" PATH_SUFFIXES lib Dist) -endif() - -include(SelectConfigurations) -select_configurations(FreeImage LIBRARY LIBRARIES) - -include(FindPackageHandleStandardArgs) -find_package_handle_standard_args(FreeImage DEFAULT_MSG FreeImage_ROOT_DIR FreeImage_INCLUDE_DIR FreeImage_LIBRARY_RELEASE FreeImage_LIBRARY_DEBUG) - -include(CreateImportTargetHelpers) - -generate_import_target(FreeImage STATIC) diff --git a/cmake-modules/FindGlew.cmake b/cmake-modules/FindGlew.cmake deleted file mode 100644 index 8e80ad594..000000000 --- a/cmake-modules/FindGlew.cmake +++ /dev/null @@ -1,47 +0,0 @@ -#.rst -# FindGlew -# ------------ -# -# Created by Raffi Bedikian. -# Locate and configure Glew -# -# Interface Targets -# ^^^^^^^^^^^^^^^^^ -# FindGlew::FindGlew -# -# Variables -# ^^^^^^^^^ -# Glew_ROOT_DIR -# Glew_FOUND -# Glew_INCLUDE_DIR -# Glew_LIBRARIES -# -find_path(Glew_ROOT_DIR - NAMES include/GL/glew.h - PATH_SUFFIXES glew-${Glew_FIND_VERSION} - Glew) -find_path( - Glew_INCLUDE_DIR - NAMES GL/glew.h - HINTS ${Glew_ROOT_DIR} - PATH_SUFFIXES include - NO_DEFAULT_PATH - ) - -if(MSVC) - find_library(Glew_LIBRARY_RELEASE "glew32s.lib" HINTS "${Glew_ROOT_DIR}" PATH_SUFFIXES lib) - find_library(Glew_LIBRARY_DEBUG "glew32s.lib" HINTS "${Glew_ROOT_DIR}" PATH_SUFFIXES lib) -else() - # Linux's glew-1.9.0 package's libs are in lib64 - find_library(Glew_LIBRARY_RELEASE "libGLEW.a" HINTS "${Glew_ROOT_DIR}" PATH_SUFFIXES lib lib64) - find_library(Glew_LIBRARY_DEBUG "libGLEW.a" HINTS "${Glew_ROOT_DIR}" PATH_SUFFIXES lib lib64) -endif() -include(SelectConfigurations) -select_configurations(Glew LIBRARY LIBRARIES) - -include(FindPackageHandleStandardArgs) -find_package_handle_standard_args(Glew DEFAULT_MSG Glew_ROOT_DIR Glew_INCLUDE_DIR Glew_LIBRARY_RELEASE Glew_LIBRARY_DEBUG) - -include(CreateImportTargetHelpers) - -generate_import_target(Glew STATIC) diff --git a/cmake-modules/FindInf2Cat.cmake b/cmake-modules/FindInf2Cat.cmake deleted file mode 100644 index b6089581a..000000000 --- a/cmake-modules/FindInf2Cat.cmake +++ /dev/null @@ -1,28 +0,0 @@ -# - Try to find Inf2Cat -# Once done this will define -# Inf2Cat_FOUND - System has Inf2Cat -# Inf2Cat_BIN - The path to Inf2Cat - -set(wdkregpath80 "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows Kits\\Installed Roots;KitsRoot]") -get_filename_component(wdkpath80 ${wdkregpath80} ABSOLUTE) - -set(wdkregpath81 "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows Kits\\Installed Roots;KitsRoot81]") -get_filename_component(wdkpath81 ${wdkregpath81} ABSOLUTE) - -if(CMAKE_SIZEOF_VOID_P EQUAL 8) - set(WDK_ARCH "x64") -else() - set(WDK_ARCH "x86") -endif() - -# Directly locate inf2cat: -find_program( - Inf2Cat_BIN Inf2Cat - PATHS ${wdkpath81} ${wdkpath80} ${WDK_ROOT_ALTERNATE} - PATH_SUFFIXES bin/${WDK_ARCH} -) - -include(FindPackageHandleStandardArgs) -find_package_handle_standard_args(Inf2Cat DEFAULT_MSG Inf2Cat_BIN) - - diff --git a/cmake-modules/FindIrrklang.cmake b/cmake-modules/FindIrrklang.cmake deleted file mode 100644 index a94f8db55..000000000 --- a/cmake-modules/FindIrrklang.cmake +++ /dev/null @@ -1,48 +0,0 @@ -#.rst -# FindIrrklang -# ------------ -# -# Created by Walter Gray. -# Locate and configure Irrklang -# -# Interface Targets -# ^^^^^^^^^^^^^^^^^ -# Irrklang::Irrklang -# -# Variables -# ^^^^^^^^^ -# Irrklang_ROOT_DIR -# Irrklang_FOUND -# Irrklang_INCLUDE_DIR -# Irrklang_LIBRARY -# Irrklang_IMPORT_LIB - -find_path(Irrklang_ROOT_DIR - NAMES include/irrKlang.h - HINTS ${EXTERNAL_LIBRARY_DIR} - PATH_SUFFIXES irrKlang-${Irrklang_FIND_VERSION} - irrKlang) - -find_path(Irrklang_INCLUDE_DIR - NAMES irrKlang.h - HINTS "${Irrklang_ROOT_DIR}/include") - -if(MSVC) - find_file(Irrklang_LIBRARY - NAMES irrKlang.dll - HINTS "${Irrklang_ROOT_DIR}/bin/win32-visualStudio/") - find_library(Irrklang_IMPORT_LIB - NAMES irrKlang.lib - HINTS "${Irrklang_ROOT_DIR}/lib/win32-visualStudio/") - mark_as_advanced(Irrklang_IMPORT_LIB) -else() - find_library(Irrklang_LIBRARY - NAMES libirrklang.dylib - HINTS "${Irrklang_ROOT_DIR}/bin/macosx-gcc/") -endif() - -include(FindPackageHandleStandardArgs) -find_package_handle_standard_args(Irrklang DEFAULT_MSG Irrklang_INCLUDE_DIR Irrklang_LIBRARY) - -include(CreateImportTargetHelpers) -generate_import_target(Irrklang SHARED) \ No newline at end of file diff --git a/cmake-modules/FindLeap.cmake b/cmake-modules/FindLeap.cmake deleted file mode 100644 index d4e480831..000000000 --- a/cmake-modules/FindLeap.cmake +++ /dev/null @@ -1,61 +0,0 @@ -#.rst -# FindLeap -# ------------ -# -# Created by Walter Gray. -# Locate and configure Leap -# -# Interface Targets -# ^^^^^^^^^^^^^^^^^ -# Leap::Leap -# -# Variables -# ^^^^^^^^^ -# Leap_ROOT_DIR -# Leap_FOUND -# Leap_INCLUDE_DIR -# Leap_LIBRARY -# Leap_IMPORT_LIB - -find_path(Leap_ROOT_DIR - NAMES include/Leap.h - HINTS ${EXTERNAL_LIBRARY_DIR} - PATH_SUFFIXES LeapSDK-${Leap_FIND_VERSION} - LeapSDK) -#we should check the version.txt file here... - -set(Leap_INCLUDE_DIR "${Leap_ROOT_DIR}/include") -if(MSVC) - find_library(Leap_IMPORT_LIB_RELEASE "Leap.lib" HINTS "${Leap_ROOT_DIR}/lib/x86") - find_library(Leap_IMPORT_LIB_DEBUG "Leapd.lib" HINTS "${Leap_ROOT_DIR}/lib/x86") - - find_file(Leap_LIBRARY_RELEASE - NAMES Leap.dll - HINTS "${Leap_ROOT_DIR}/lib/x86") - find_file(Leap_LIBRARY_DEBUG - NAMES Leapd.dll - Leap.dll #fallback on the release library if we must - HINTS "${Leap_ROOT_DIR}/lib/x86") - mark_as_advanced(Leap_IMPORT_LIB_RELEASE Leap_IMPORT_LIB_DEBUG) -else() - if(USE_LIBCXX) - set(_libdir ${Leap_ROOT_DIR}/lib/libc++) - else() - set(_libdir ${Leap_ROOT_DIR}/lib) - endif() - - find_library(Leap_LIBRARY_RELEASE - NAMES libLeap.dylib - HINTS "${_libdir}") - find_library(Leap_LIBRARY_DEBUG - NAMES libLeapd.dylib - libLeap.dylib #fallback on the release library - HINTS "${_libdir}") -endif() - - -include(FindPackageHandleStandardArgs) -find_package_handle_standard_args(Leap DEFAULT_MSG Leap_ROOT_DIR Leap_INCLUDE_DIR Leap_LIBRARY_RELEASE Leap_LIBRARY_DEBUG) - -include(CreateImportTargetHelpers) -generate_import_target(Leap SHARED) diff --git a/cmake-modules/FindNanoSVG.cmake b/cmake-modules/FindNanoSVG.cmake deleted file mode 100644 index d06860b31..000000000 --- a/cmake-modules/FindNanoSVG.cmake +++ /dev/null @@ -1,31 +0,0 @@ -#.rst -# FindNanoSVG -# ---------- -# -# Created by Jonathan Marsden -# Locate and configure nanosvg -# -# Interface Targets -# ^^^^^^^^^^^^^^^^^ -# NanoSVG::NanoSVG -# -# Variables -# ^^^^^^^^^ -# NanoSVG_ROOT_DIR -# NanoSVG_FOUND -# NanoSVG_INCLUDE_DIR - -find_path(NanoSVG_ROOT_DIR - NAMES include/nanosvg.h - PATH_SUFFIXES nanosvg) - -set(NanoSVG_INCLUDE_DIR "${NanoSVG_ROOT_DIR}/include") -if(EXISTS ${NanoSVG_INCLUDE_DIR}) - set(NanoSVG_FOUND) -endif() - -include(FindPackageHandleStandardArgs) -find_package_handle_standard_args(NanoSVG DEFAULT_MSG NanoSVG_INCLUDE_DIR) - -include(CreateImportTargetHelpers) -generate_import_target(NanoSVG INTERFACE) diff --git a/cmake-modules/FindOculusSDK.cmake b/cmake-modules/FindOculusSDK.cmake deleted file mode 100644 index 49540ca51..000000000 --- a/cmake-modules/FindOculusSDK.cmake +++ /dev/null @@ -1,47 +0,0 @@ -#.rst -# FindOculusSDK -# ------------ -# -# Locate and configure Oculus -# -# Interface Targets -# ^^^^^^^^^^^^^^^^^ -# FindOculusSDK::FindOculusSDK -# -# Variables -# ^^^^^^^^^ -# OculusSDK_ROOT_DIR -# OculusSDK_INCLUDE_DIR -# OculusSDK_LIBRARIES_RELEASE -# OculusSDK_LIBRARIES_DEBUG -# - - -find_path(OculusSDK_ROOT_DIR NAMES "LibOVR/Include/OVR.h" PATH_SUFFIXES OculusSDK) - -#We include the src directory as well since we need OVR_CAPI_GL/D3D -set(OculusSDK_INCLUDE_DIR "${OculusSDK_ROOT_DIR}/LibOVR/Include" "${OculusSDK_ROOT_DIR}/LibOVR/Src") - -if(MSVC) - find_library(OculusSDK_LIBRARY_RELEASE "libovr.lib" HINTS "${OculusSDK_ROOT_DIR}/LibOVR/Lib/Win32/VS2013" PATH_SUFFIXES lib) - find_library(OculusSDK_LIBRARY_DEBUG "libovrd.lib" HINTS "${OculusSDK_ROOT_DIR}/LibOVR/Lib/Win32/VS2013" PATH_SUFFIXES lib) -elseif(${CMAKE_SYSTEM_NAME} MATCHES "Darwin") # Mac - find_library(OculusSDK_LIBRARY_RELEASE "libovr.a" HINTS "${OculusSDK_ROOT_DIR}/LibOVR/Lib/Mac/Release" PATH_SUFFIXES lib) - find_library(OculusSDK_LIBRARY_DEBUG "libovr.a" HINTS "${OculusSDK_ROOT_DIR}/LibOVR/Lib/Mac/Debug" PATH_SUFFIXES lib) -else() - # No linux support from Oculus Rift! -endif() -include(SelectConfigurations) -select_configurations(OculusSDK LIBRARY LIBRARIES) - -include(FindPackageHandleStandardArgs) -find_package_handle_standard_args(OculusSDK DEFAULT_MSG OculusSDK_ROOT_DIR OculusSDK_INCLUDE_DIR OculusSDK_LIBRARY_RELEASE OculusSDK_LIBRARY_DEBUG) - -include(CreateImportTargetHelpers) - -generate_import_target(OculusSDK STATIC) - -if(WIN32) - #Oculus dev kit relies on winmm and winsock2 - target_link_libraries(OculusSDK::OculusSDK INTERFACE winmm Ws2_32) -endif() \ No newline at end of file diff --git a/cmake-modules/FindOpenGL.cmake b/cmake-modules/FindOpenGL.cmake deleted file mode 100644 index fc2984c21..000000000 --- a/cmake-modules/FindOpenGL.cmake +++ /dev/null @@ -1,96 +0,0 @@ -#.rst: -# FindOpenGL -# ---------- -# -# Total refactor of the cmake-supplied FindOpenGL.cmake module to be -# more in-line with the generate_import_target command. - -set(_OpenGL_REQUIRED_VARS "") - -if(${CMAKE_SYSTEM_NAME} MATCHES "Windows") - list(APPEND _OpenGL_REQUIRED_VARS OpenGL_LIBRARY) - - #opengl32.lib lives in the windows sdk, which means we can't use find_library since windows - #doesn't add the wdk directory to any path variable that I could find. - set(OpenGL_LIBRARY opengl32.lib CACHE STRING "OpenGL library for win32") - set(OpenGL_INTERFACE_LIBS glu32.lib CACHE STRING "GLU library for win32") -elseif(${CMAKE_SYSTEM_NAME} MATCHES "Darwin") # Mac - list(APPEND _OpenGL_REQUIRED_VARS OpenGL_INCLUDE_DIR) - find_path(OpenGL_INCLUDE_DIR OpenGL/gl.h DOC "Include for OpenGL on OSX") - set(OpenGL_INTERFACE_LIBS "-framework OpenGL;-framework AGL") -else() - # The first line below is to make sure that the proper headers - # are used on a Linux machine with the NVidia drivers installed. - # They replace Mesa with NVidia's own library but normally do not - # install headers and that causes the linking to - # fail since the compiler finds the Mesa headers but NVidia's library. - # Make sure the NVIDIA directory comes BEFORE the others. - # - Atanas Georgiev - - list(APPEND _OpenGL_REQUIRED_VARS OpenGL_INCLUDE_DIR) - list(APPEND _OpenGL_REQUIRED_VARS OpenGL_LIBRARY) - find_path( - OpenGL_INCLUDE_DIR - NAMES - GL/gl.h - PATHS - /usr/share/doc/NVIDIA_GLX-1.0/include - /usr/openwin/share/include - /opt/graphics/OpenGL/include - /usr/X11R6/include - ) - - find_library( - OpenGL_LIBRARY - NAMES - GL - MesaGL - PATHS - /opt/graphics/OpenGL/lib - /usr/openwin/lib - /usr/shlib /usr/X11R6/lib - ) - find_library( - OpenGL_INTERFACE_LIBS - NAMES - GLU - MesaGLU - PATHS - ${OpenGL_gl_LIBRARY} - /opt/graphics/OpenGL/lib - /usr/openwin/lib - /usr/shlib /usr/X11R6/lib - ) - - # # On Unix OpenGL most certainly always requires X11. - # # Feel free to tighten up these conditions if you don't - # # think this is always true. - - # if (OpenGL_gl_LIBRARY) - # if(NOT X11_FOUND) - # include(${CMAKE_CURRENT_LIST_DIR}/FindX11.cmake) - # endif() - # if (X11_FOUND) - # set (OPENGL_LIBRARIES ${X11_LIBRARIES}) - # endif () - # endif () -endif () - -include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake) -find_package_handle_standard_args(OpenGL REQUIRED_VARS ${_OpenGL_REQUIRED_VARS}) -unset(_OpenGL_REQUIRED_VARS) - -mark_as_advanced( - OpenGL_LIBRARY - OpenGL_INCLUDE_DIR -) - -include(CreateImportTargetHelpers) -if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin") - generate_import_target(OpenGL INTERFACE) -elseif(${CMAKE_SYSTEM_NAME} MATCHES "Windows") - #technically not true, but we don't have to do anything with the dll so... - generate_import_target(OpenGL STATIC) -else() - generate_import_target(OpenGL SHARED) -endif() diff --git a/cmake-modules/FindOpenSSL.cmake b/cmake-modules/FindOpenSSL.cmake deleted file mode 100644 index 4253b5bdf..000000000 --- a/cmake-modules/FindOpenSSL.cmake +++ /dev/null @@ -1,43 +0,0 @@ -#Our OpenSSL setup is non-standard, so set these variables up beforehand - -find_path(OPENSSL_ROOT_DIR - NAMES include/openssl/opensslconf.h - PATH_SUFFIXES openssl -) - -include(CreateImportTargetHelpers) - -if(MSVC) - find_library(LIB_EAY_DEBUG NAMES libeay32.lib HINTS ${OPENSSL_ROOT_DIR}/lib/debug) - find_library(LIB_EAY_RELEASE NAMES libeay32.lib HINTS ${OPENSSL_ROOT_DIR}/lib/release) - find_library(SSL_EAY_DEBUG NAMES ssleay32.lib HINTS ${OPENSSL_ROOT_DIR}/lib/debug) - find_library(SSL_EAY_RELEASE NAMES ssleay32.lib HINTS ${OPENSSL_ROOT_DIR}/lib/release) - mark_as_advanced(LIB_EAY_DEBUG LIB_EAY_RELEASE SSL_EAY_DEBUG SSL_EAY_RELEASE) - - include(${CMAKE_ROOT}/Modules/FindOpenSSL.cmake) - - #override the bad OPENSSL_LIBRARIES value - include(SelectConfigurations) - select_configurations(LIB_EAY LIBRARY) - select_configurations(SSL_EAY LIBRARY) - - set(OPENSSL_LIBRARIES "${SSL_EAY_LIBRARY} ${LIB_EAY_LIBRARY}") - set(OPENSSL_LIBRARY_DEBUG "${LIB_EAY_DEBUG};${SSL_EAY_DEBUG}") - set(OPENSSL_LIBRARY_RELEASE "${LIB_EAY_RELEASE};${SSL_EAY_RELEASE}") - generate_import_target(OPENSSL STATIC) - -else() - include(${CMAKE_ROOT}/Modules/FindOpenSSL.cmake) - if(EXISTS "${OPENSSL_CRYPTO_LIBRARY}") - set(OPENSSL_CRYPTO_FOUND TRUE) - endif() - if(EXISTS "${OPENSSL_SSL_LIBRARY}") - set(OPENSSL_SSL_FOUND TRUE) - endif() - generate_import_target(OPENSSL_CRYPTO STATIC TARGET OPENSSL::Crypto) - generate_import_target(OPENSSL_SSL STATIC TARGET OPENSSL::SSL) - generate_import_target(OPENSSL INTERFACE) - target_link_libraries(OPENSSL::OPENSSL INTERFACE OPENSSL::Crypto OPENSSL::SSL) -endif() - - diff --git a/cmake-modules/FindPackageHandleStandardArgs.cmake b/cmake-modules/FindPackageHandleStandardArgs.cmake deleted file mode 100644 index 5dd4c376d..000000000 --- a/cmake-modules/FindPackageHandleStandardArgs.cmake +++ /dev/null @@ -1,357 +0,0 @@ -#.rst: -# FindPackageHandleStandardArgs -# ----------------------------- -# -# Changed By Walter Gray to make the default FOUND_VAR use -# the OriginalCase_Name instead of UPPERCASE_NAME. It also -# will now mark all find_vars as advanced. -# -# FIND_PACKAGE_HANDLE_STANDARD_ARGS( ... ) -# -# This function is intended to be used in FindXXX.cmake modules files. -# It handles the REQUIRED, QUIET and version-related arguments to -# find_package(). It also sets the _FOUND variable. The -# package is considered found if all variables ... listed contain -# valid results, e.g. valid filepaths. -# -# There are two modes of this function. The first argument in both -# modes is the name of the Find-module where it is called (in original -# casing). -# -# The first simple mode looks like this: -# -# :: -# -# FIND_PACKAGE_HANDLE_STANDARD_ARGS( (DEFAULT_MSG|"Custom failure message") ... ) -# -# If the variables to are all valid, then -# _FOUND will be set to TRUE. If DEFAULT_MSG is given -# as second argument, then the function will generate itself useful -# success and error messages. You can also supply a custom error -# message for the failure case. This is not recommended. -# -# The second mode is more powerful and also supports version checking: -# -# :: -# -# FIND_PACKAGE_HANDLE_STANDARD_ARGS(NAME [FOUND_VAR ] -# [REQUIRED_VARS ...] -# [VERSION_VAR ] -# [HANDLE_COMPONENTS] -# [CONFIG_MODE] -# [FAIL_MESSAGE "Custom failure message"] ) -# -# -# -# In this mode, the name of the result-variable can be set either to -# either _FOUND or _FOUND using the -# FOUND_VAR option. Other names for the result-variable are not -# allowed. So for a Find-module named FindFooBar.cmake, the two -# possible names are FooBar_FOUND and FOOBAR_FOUND. It is recommended -# to use the original case version. If the FOUND_VAR option is not -# used, the default is _FOUND. -# -# As in the simple mode, if through are all valid, -# _FOUND will be set to TRUE. After REQUIRED_VARS the -# variables which are required for this package are listed. Following -# VERSION_VAR the name of the variable can be specified which holds the -# version of the package which has been found. If this is done, this -# version will be checked against the (potentially) specified required -# version used in the find_package() call. The EXACT keyword is also -# handled. The default messages include information about the required -# version and the version which has been actually found, both if the -# version is ok or not. If the package supports components, use the -# HANDLE_COMPONENTS option to enable handling them. In this case, -# find_package_handle_standard_args() will report which components have -# been found and which are missing, and the _FOUND variable -# will be set to FALSE if any of the required components (i.e. not the -# ones listed after OPTIONAL_COMPONENTS) are missing. Use the option -# CONFIG_MODE if your FindXXX.cmake module is a wrapper for a -# find_package(... NO_MODULE) call. In this case VERSION_VAR will be -# set to _VERSION and the macro will automatically check whether -# the Config module was found. Via FAIL_MESSAGE a custom failure -# message can be specified, if this is not used, the default message -# will be displayed. -# -# Example for mode 1: -# -# :: -# -# find_package_handle_standard_args(LibXml2 DEFAULT_MSG LIBXML2_LIBRARY LIBXML2_INCLUDE_DIR) -# -# -# -# LibXml2 is considered to be found, if both LIBXML2_LIBRARY and -# LIBXML2_INCLUDE_DIR are valid. Then also LIBXML2_FOUND is set to -# TRUE. If it is not found and REQUIRED was used, it fails with -# FATAL_ERROR, independent whether QUIET was used or not. If it is -# found, success will be reported, including the content of . On -# repeated Cmake runs, the same message won't be printed again. -# -# Example for mode 2: -# -# :: -# -# find_package_handle_standard_args(LibXslt FOUND_VAR LibXslt_FOUND -# REQUIRED_VARS LibXslt_LIBRARIES LibXslt_INCLUDE_DIRS -# VERSION_VAR LibXslt_VERSION_STRING) -# -# In this case, LibXslt is considered to be found if the variable(s) -# listed after REQUIRED_VAR are all valid, i.e. LibXslt_LIBRARIES and -# LibXslt_INCLUDE_DIRS in this case. The result will then be stored in -# LibXslt_FOUND . Also the version of LibXslt will be checked by using -# the version contained in LibXslt_VERSION_STRING. Since no -# FAIL_MESSAGE is given, the default messages will be printed. -# -# Another example for mode 2: -# -# :: -# -# find_package(Automoc4 QUIET NO_MODULE HINTS /opt/automoc4) -# find_package_handle_standard_args(Automoc4 CONFIG_MODE) -# -# In this case, FindAutmoc4.cmake wraps a call to find_package(Automoc4 -# NO_MODULE) and adds an additional search directory for automoc4. Here -# the result will be stored in AUTOMOC4_FOUND. The following -# FIND_PACKAGE_HANDLE_STANDARD_ARGS() call produces a proper -# success/error message. - -#============================================================================= -# Copyright 2007-2009 Kitware, Inc. -# -# Distributed under the OSI-approved BSD License (the "License"); -# see accompanying file Copyright.txt for details. -# -# This software is distributed WITHOUT ANY WARRANTY; without even the -# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -# See the License for more information. -#============================================================================= -# (To distribute this file outside of CMake, substitute the full -# License text for the above reference.) - -include(FindPackageMessage) -include(CMakeParseArguments) - -# internal helper macro -macro(_FPHSA_FAILURE_MESSAGE _msg) - if (${_NAME}_FIND_REQUIRED) - message(FATAL_ERROR "${_msg}") - else () - if (NOT ${_NAME}_FIND_QUIETLY) - message(STATUS "${_msg}") - endif () - endif () -endmacro() - - -# internal helper macro to generate the failure message when used in CONFIG_MODE: -macro(_FPHSA_HANDLE_FAILURE_CONFIG_MODE) - # _CONFIG is set, but FOUND is false, this means that some other of the REQUIRED_VARS was not found: - if(${_NAME}_CONFIG) - _FPHSA_FAILURE_MESSAGE("${FPHSA_FAIL_MESSAGE}: missing: ${MISSING_VARS} (found ${${_NAME}_CONFIG} ${VERSION_MSG})") - else() - # If _CONSIDERED_CONFIGS is set, the config-file has been found, but no suitable version. - # List them all in the error message: - if(${_NAME}_CONSIDERED_CONFIGS) - set(configsText "") - list(LENGTH ${_NAME}_CONSIDERED_CONFIGS configsCount) - math(EXPR configsCount "${configsCount} - 1") - foreach(currentConfigIndex RANGE ${configsCount}) - list(GET ${_NAME}_CONSIDERED_CONFIGS ${currentConfigIndex} filename) - list(GET ${_NAME}_CONSIDERED_VERSIONS ${currentConfigIndex} version) - set(configsText "${configsText} ${filename} (version ${version})\n") - endforeach() - if (${_NAME}_NOT_FOUND_MESSAGE) - set(configsText "${configsText} Reason given by package: ${${_NAME}_NOT_FOUND_MESSAGE}\n") - endif() - _FPHSA_FAILURE_MESSAGE("${FPHSA_FAIL_MESSAGE} ${VERSION_MSG}, checked the following files:\n${configsText}") - - else() - # Simple case: No Config-file was found at all: - _FPHSA_FAILURE_MESSAGE("${FPHSA_FAIL_MESSAGE}: found neither ${_NAME}Config.cmake nor ${_NAME_LOWER}-config.cmake ${VERSION_MSG}") - endif() - endif() -endmacro() - - -function(FIND_PACKAGE_HANDLE_STANDARD_ARGS _NAME _FIRST_ARG) - -# set up the arguments for CMAKE_PARSE_ARGUMENTS and check whether we are in -# new extended or in the "old" mode: - set(options CONFIG_MODE HANDLE_COMPONENTS) - set(oneValueArgs FAIL_MESSAGE VERSION_VAR FOUND_VAR) - set(multiValueArgs REQUIRED_VARS) - set(_KEYWORDS_FOR_EXTENDED_MODE ${options} ${oneValueArgs} ${multiValueArgs} ) - list(FIND _KEYWORDS_FOR_EXTENDED_MODE "${_FIRST_ARG}" INDEX) - - if(${INDEX} EQUAL -1) - set(FPHSA_FAIL_MESSAGE ${_FIRST_ARG}) - set(FPHSA_REQUIRED_VARS ${ARGN}) - set(FPHSA_VERSION_VAR) - else() - - CMAKE_PARSE_ARGUMENTS(FPHSA "${options}" "${oneValueArgs}" "${multiValueArgs}" ${_FIRST_ARG} ${ARGN}) - - if(FPHSA_UNPARSED_ARGUMENTS) - message(FATAL_ERROR "Unknown keywords given to FIND_PACKAGE_HANDLE_STANDARD_ARGS(): \"${FPHSA_UNPARSED_ARGUMENTS}\"") - endif() - - if(NOT FPHSA_FAIL_MESSAGE) - set(FPHSA_FAIL_MESSAGE "DEFAULT_MSG") - endif() - endif() - -# now that we collected all arguments, process them - - if("${FPHSA_FAIL_MESSAGE}" STREQUAL "DEFAULT_MSG") - set(FPHSA_FAIL_MESSAGE "Could NOT find ${_NAME}") - endif() - - # In config-mode, we rely on the variable _CONFIG, which is set by find_package() - # when it successfully found the config-file, including version checking: - if(FPHSA_CONFIG_MODE) - list(INSERT FPHSA_REQUIRED_VARS 0 ${_NAME}_CONFIG) - list(REMOVE_DUPLICATES FPHSA_REQUIRED_VARS) - set(FPHSA_VERSION_VAR ${_NAME}_VERSION) - endif() - - if(NOT FPHSA_REQUIRED_VARS) - message(FATAL_ERROR "No REQUIRED_VARS specified for FIND_PACKAGE_HANDLE_STANDARD_ARGS()") - endif() - - list(GET FPHSA_REQUIRED_VARS 0 _FIRST_REQUIRED_VAR) - - string(TOUPPER ${_NAME} _NAME_UPPER) - string(TOLOWER ${_NAME} _NAME_LOWER) - - if(FPHSA_FOUND_VAR) - if(FPHSA_FOUND_VAR MATCHES "^${_NAME}_FOUND$" OR FPHSA_FOUND_VAR MATCHES "^${_NAME_UPPER}_FOUND$") - set(_FOUND_VAR ${FPHSA_FOUND_VAR}) - else() - message(FATAL_ERROR "The argument for FOUND_VAR is \"${FPHSA_FOUND_VAR}\", but only \"${_NAME}_FOUND\" and \"${_NAME_UPPER}_FOUND\" are valid names.") - endif() - else() - set(_FOUND_VAR ${_NAME}_FOUND) - endif() - - # collect all variables which were not found, so they can be printed, so the - # user knows better what went wrong (#6375) - set(MISSING_VARS "") - set(DETAILS "") - # check if all passed variables are valid - unset(${_FOUND_VAR}) - foreach(_CURRENT_VAR ${FPHSA_REQUIRED_VARS}) - if(NOT ${_CURRENT_VAR}) - set(${_FOUND_VAR} FALSE) - set(MISSING_VARS "${MISSING_VARS} ${_CURRENT_VAR}") - else() - if(NOT _CURRENT_VAR MATCHES ".*_ROOT_DIR") - mark_as_advanced(${_CURRENT_VAR}) - endif() - - set(DETAILS "${DETAILS}[${${_CURRENT_VAR}}]") - endif() - endforeach() - if(NOT "${${_FOUND_VAR}}" STREQUAL "FALSE") - set(${_FOUND_VAR} TRUE) - endif() - - # component handling - unset(FOUND_COMPONENTS_MSG) - unset(MISSING_COMPONENTS_MSG) - - if(FPHSA_HANDLE_COMPONENTS) - foreach(comp ${${_NAME}_FIND_COMPONENTS}) - if(${_NAME}_${comp}_FOUND) - - if(NOT DEFINED FOUND_COMPONENTS_MSG) - set(FOUND_COMPONENTS_MSG "found components: ") - endif() - set(FOUND_COMPONENTS_MSG "${FOUND_COMPONENTS_MSG} ${comp}") - - else() - - if(NOT DEFINED MISSING_COMPONENTS_MSG) - set(MISSING_COMPONENTS_MSG "missing components: ") - endif() - set(MISSING_COMPONENTS_MSG "${MISSING_COMPONENTS_MSG} ${comp}") - - if(${_NAME}_FIND_REQUIRED_${comp}) - set(${_FOUND_VAR} FALSE) - set(MISSING_VARS "${MISSING_VARS} ${comp}") - endif() - - endif() - endforeach() - set(COMPONENT_MSG "${FOUND_COMPONENTS_MSG} ${MISSING_COMPONENTS_MSG}") - set(DETAILS "${DETAILS}[c${COMPONENT_MSG}]") - endif() - - # version handling: - set(VERSION_MSG "") - set(VERSION_OK TRUE) - set(VERSION ${${FPHSA_VERSION_VAR}} ) - if (${_NAME}_FIND_VERSION) - - if(VERSION) - - if(${_NAME}_FIND_VERSION_EXACT) # exact version required - if (NOT "${${_NAME}_FIND_VERSION}" VERSION_EQUAL "${VERSION}") - set(VERSION_MSG "Found unsuitable version \"${VERSION}\", but required is exact version \"${${_NAME}_FIND_VERSION}\"") - set(VERSION_OK FALSE) - else () - set(VERSION_MSG "(found suitable exact version \"${VERSION}\")") - endif () - - else() # minimum version specified: - if ("${${_NAME}_FIND_VERSION}" VERSION_GREATER "${VERSION}") - set(VERSION_MSG "Found unsuitable version \"${VERSION}\", but required is at least \"${${_NAME}_FIND_VERSION}\"") - set(VERSION_OK FALSE) - else () - set(VERSION_MSG "(found suitable version \"${VERSION}\", minimum required is \"${${_NAME}_FIND_VERSION}\")") - endif () - endif() - - else() - - # if the package was not found, but a version was given, add that to the output: - if(${_NAME}_FIND_VERSION_EXACT) - set(VERSION_MSG "(Required is exact version \"${${_NAME}_FIND_VERSION}\")") - else() - set(VERSION_MSG "(Required is at least version \"${${_NAME}_FIND_VERSION}\")") - endif() - - endif() - else () - if(VERSION) - set(VERSION_MSG "(found version \"${VERSION}\")") - endif() - endif () - - if(VERSION_OK) - set(DETAILS "${DETAILS}[v${VERSION}(${${_NAME}_FIND_VERSION})]") - else() - set(${_FOUND_VAR} FALSE) - endif() - - - # print the result: - if (${_FOUND_VAR}) - FIND_PACKAGE_MESSAGE(${_NAME} "Found ${_NAME}: ${${_FIRST_REQUIRED_VAR}} ${VERSION_MSG} ${COMPONENT_MSG}" "${DETAILS}") - else () - - if(FPHSA_CONFIG_MODE) - _FPHSA_HANDLE_FAILURE_CONFIG_MODE() - else() - if(NOT VERSION_OK) - _FPHSA_FAILURE_MESSAGE("${FPHSA_FAIL_MESSAGE}: ${VERSION_MSG} (found ${${_FIRST_REQUIRED_VAR}})") - else() - _FPHSA_FAILURE_MESSAGE("${FPHSA_FAIL_MESSAGE} (missing: ${MISSING_VARS}) ${VERSION_MSG}") - endif() - endif() - - endif () - - set(${_FOUND_VAR} ${${_FOUND_VAR}} PARENT_SCOPE) - -endfunction() diff --git a/cmake-modules/FindPolyPartition.cmake b/cmake-modules/FindPolyPartition.cmake deleted file mode 100644 index e54be6fd4..000000000 --- a/cmake-modules/FindPolyPartition.cmake +++ /dev/null @@ -1,38 +0,0 @@ -#.rst -# FindPolyPartition -# ------------ -# -# Created by Jonathan Marsden -# Locate and configure PolyPartition -# -# Interface Targets -# ^^^^^^^^^^^^^^^^^ -# PolyPartition::PolyPartition -# -# Variables -# ^^^^^^^^^ -# PolyPartition_ROOT_DIR -# PolyPartition_FOUND -# PolyPartition_INCLUDE_DIR -# PolyPartition_LIBRARY -# PolyPartition_IMPORT_LIB - -find_path(PolyPartition_ROOT_DIR - NAMES include/polypartition.h - HINTS ${EXTERNAL_LIBRARY_DIR} - PATH_SUFFIXES polypartition) - -set(PolyPartition_INCLUDE_DIR "${PolyPartition_ROOT_DIR}/include") -if(MSVC) - find_library(PolyPartition_LIBRARY_RELEASE "polypartition.lib" HINTS "${PolyPartition_ROOT_DIR}/lib/release") - find_library(PolyPartition_LIBRARY_DEBUG "polypartition.lib" HINTS "${PolyPartition_ROOT_DIR}/lib/debug") -else() - find_library(PolyPartition_LIBRARY_RELEASE "libpolypartition.a" HINTS "${PolyPartition_ROOT_DIR}/lib") - find_library(PolyPartition_LIBRARY_DEBUG "libpolypartition.a" HINTS "${PolyPartition_ROOT_DIR}/lib") -endif() - -include(FindPackageHandleStandardArgs) -find_package_handle_standard_args(PolyPartition DEFAULT_MSG PolyPartition_ROOT_DIR PolyPartition_INCLUDE_DIR PolyPartition_LIBRARY_RELEASE PolyPartition_LIBRARY_DEBUG) - -include(CreateImportTargetHelpers) -generate_import_target(PolyPartition STATIC) diff --git a/cmake-modules/FindSDL.cmake b/cmake-modules/FindSDL.cmake deleted file mode 100644 index 74ccb6f2e..000000000 --- a/cmake-modules/FindSDL.cmake +++ /dev/null @@ -1,407 +0,0 @@ -#.rst: -# FindSDL -# ------- -# -# Locate SDL library. Modified by Walter Gray to be compatible with SDL 2.x and -# provide import library pseudo targets. Untested with SDL 1.x. Then modified -# by Victor Dods to forget SDL 1.x, and only look for SDL 2.x. This find module -# should be renamed to FindSDL2.cmake -- it is useful to note that the developers -# of SDL have actually changed the name of the library, not just the version. It -# is actually "SDL2", not "SDL" anymore. Thus a fully-qualified lib directory name -# would be something like "SDL2-2.0.3", and not "SDL-2.0.3" as one would expect. -# -# Imported Targets -# ^^^^^^^^^^^^^^^^ -# SDL::SDL -# Basic import target. Use to build an application -# SDL::Library -# Advanced import target. Does not link with SDLmain, for use when building libraries -# SDL::Main -# Advanced import target. contains only SDLMain.lib -# Result Variables -# ^^^^^^^^^^^^^^^^ -# This module defines the following variables -# -# SDL_ROOT_DIR -# -# SDL_FOUND -# -# SDL_INCLUDE_DIR -# -# SDL_LIBRARY -# Where to find SDL.dll/dylib if linking dynamically, or .lib/.a statically -# SDL_SHARED_LIB -# Where to find the SDL.dll/dylib if it exists -# SDL_STATIC_LIB -# Where to find the SDL.lib/.a if it exists -# SDL_IMPORT_LIB -# Where to find SDL.lib (Windows only) if it exists -# SDL_MAIN_LIBRARY -# Where to find SDLmain.lib/.a -# SDL_LINK_TYPE -# Either STATIC or SHARED depending on if SDL.dll/dylib is found. If both are available, -# defaults to SHARED. Setting this in the cache will attempt to force one or the other -# SDL_VERSION_STRING -# A human-readable string containing the version of SDL -# SDL_LIBRARIES -# A legacy string - contains a list of all .lib files used by SDL, modified by SDL_BUILDING_LIBRARY. -# -# This module responds to the flag: -# -# :: -# -# SDL_BUILDING_LIBRARY -# If this is defined, then no SDL_main will be linked in because -# only applications need main(). -# Otherwise, it is assumed you are building an application and this -# module will attempt to locate and set the proper link flags -# as part of the returned SDL_LIBRARY variable. -# -# -# -# Don't forget to include SDLmain.h and SDLmain.m your project for the -# OS X framework based version. (Other versions link to -lSDLmain which -# this module will try to find on your behalf.) Also for OS X, this -# module will automatically add the -framework Cocoa on your behalf. -# -# -# -# Additional Note: If you see an empty SDL_LIBRARY_TEMP in your -# configuration and no SDL_LIBRARY, it means CMake did not find your SDL -# library (SDL.dll, libsdl.so, SDL.framework, etc). Set -# SDL_LIBRARY_TEMP to point to your SDL library, and configure again. -# Similarly, if you see an empty SDL_MAIN_LIBRARY, you should set this -# value as appropriate. These values are used to generate the final -# SDL_LIBRARY variable, but when these values are unset, SDL_LIBRARY -# does not get created. -# -# -# -# $SDLDIR is an environment variable that would correspond to the -# ./configure --prefix=$SDLDIR used in building SDL. l.e.galup 9-20-02 -# -# Modified by Eric Wing. Added code to assist with automated building -# by using environmental variables and providing a more -# controlled/consistent search behavior. Added new modifications to -# recognize OS X frameworks and additional Unix paths (FreeBSD, etc). -# Also corrected the header search path to follow "proper" SDL -# guidelines. Added a search for SDLmain which is needed by some -# platforms. Added a search for threads which is needed by some -# platforms. Added needed compile switches for MinGW. -# -# Modified by Walter Gray. Added code to find SDL2, and create an import -# target. -# -# On OSX, this will prefer the Framework version (if found) over others. -# People will have to manually change the cache values of SDL_LIBRARY to -# override this selection or set the CMake environment -# CMAKE_INCLUDE_PATH to modify the search paths. -# -# Note that the header path has changed from SDL/SDL.h to just SDL.h -# This needed to change because "proper" SDL convention is #include -# "SDL.h", not . This is done for portability reasons -# because not all systems place things in SDL/ (see FreeBSD). - -#============================================================================= -# Copyright 2003-2009 Kitware, Inc. -# Copyright 2012 Benjamin Eikel -# -# Distributed under the OSI-approved BSD License (the "License"); -# see accompanying file Copyright.txt for details. -# -# This software is distributed WITHOUT ANY WARRANTY; without even the -# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -# See the License for more information. -#============================================================================= -# (To distribute this file outside of CMake, substitute the full -# License text for the above reference.) - -include(VerboseMessage) - -function(find_multitype_library shared_out static_out import_out) - list(REMOVE_AT ARGV 0) #remove shared_out - list(REMOVE_AT ARGV 0) #remove static_out - list(REMOVE_AT ARGV 0) #remove import_out - - set(_oldlibsuffixes "${CMAKE_FIND_LIBRARY_SUFFIXES}") - set(CMAKE_FIND_LIBRARY_SUFFIXES "${CMAKE_SHARED_LIBRARY_SUFFIX}") - find_library(${shared_out} ${ARGV}) - set(CMAKE_FIND_LIBRARY_SUFFIXES "${CMAKE_STATIC_LIBRARY_SUFFIX}") - find_library(${static_out} ${ARGV}) - set(CMAKE_FIND_LIBRARY_SUFFIXES "${CMAKE_IMPORT_LIBRARY_SUFFIX}") - find_library(${import_out} ${ARGV}) - set(CMAKE_FIND_LIBRARY_SUFFIXES "${_oldlibsuffixes}") - - #TODO:verify the types of the static & import libraries - if(MSVC) - #file(READ ${static_out}) - endif() - -endfunction() - -#Checks _SHARED_LIB, _STATIC_LIB and _IMPORT_LIB -#And fills _LIBRARY with the appropriate lib type depending on which is found -#If both are found, it will default to shared. We may, at a later time, also add verification -#of if the static library is actually a static lib and not an import lib on windows. -#It will then fill _LIBRARY_TYPE with either SHARED or STATIC -function(select_library_type namespace) - #select the primary library type - if(${namespace}_SHARED_LIB AND EXISTS "${${namespace}_SHARED_LIB}") - #add either the .lib or the .dylib to the libraries list - if(${namespace}_IMPORT_LIB AND EXISTS "${${namespace}_IMPORT_LIB}") - set(${namespace}_LIBRARIES "${${namespace}_LIBRARIES}" "${${namespace}_IMPORT_LIB}" PARENT_SCOPE) - else() - set(${namespace}_LIBRARIES "${${namespace}_LIBRARIES}" "${${namespace}_SHARED_LIB}" PARENT_SCOPE) - endif() - - set(${namespace}_LIBRARY "${${namespace}_SHARED_LIB}" PARENT_SCOPE) - set(${namespace}_LIBRARY_TYPE "SHARED" PARENT_SCOPE) - elseif(${namespace}_STATIC_LIB AND EXISTS "${${namespace}_STATIC_LIB}") - set(${namespace}_LIBRARIES "${${namespace}_LIBRARIES}" "${${namespace}_STATIC_LIB}" PARENT_SCOPE) - set(${namespace}_LIBRARY "${${namespace}_STATIC_LIB}" PARENT_SCOPE) - set(${namespace}_LIBRARY_TYPE "STATIC" PARENT_SCOPE) - endif() - -endfunction() - -function(find_likely_dirs package dir_list_var path_list ) - list(REMOVE_AT ARGV 0) #pop package name - list(REMOVE_AT ARGV 0) #pop dir_list_var - - set(_dirs ${${dir_list_var}}) #make sure we're appending - - foreach(_path ${ARGV}) - file(GLOB _subdirs RELATIVE ${_path} ${_path}/*) - foreach(_subdir ${_subdirs}) - if(IS_DIRECTORY ${_path}/${_subdir} AND _subdir MATCHES "^${package}*") - list(APPEND _dirs ${_path}/${_subdir}) - endif() - endforeach() - endforeach() - - set(${dir_list_var} "${_dirs}" PARENT_SCOPE) -endfunction() - -function(sdl_parse_version_file filename major minor patch version_string) - file(STRINGS "${filename}" _major_line REGEX "^#define[ \t]+SDL_MAJOR_VERSION[ \t]+[0-9]+$") - file(STRINGS "${filename}" _minor_line REGEX "^#define[ \t]+SDL_MINOR_VERSION[ \t]+[0-9]+$") - file(STRINGS "${filename}" _patch_line REGEX "^#define[ \t]+SDL_PATCHLEVEL[ \t]+[0-9]+$") - string(REGEX REPLACE "^#define[ \t]+SDL_MAJOR_VERSION[ \t]+([0-9]+)$" "\\1" sdl_major "${_major_line}") - string(REGEX REPLACE "^#define[ \t]+SDL_MINOR_VERSION[ \t]+([0-9]+)$" "\\1" sdl_minor "${_minor_line}") - string(REGEX REPLACE "^#define[ \t]+SDL_PATCHLEVEL[ \t]+([0-9]+)$" "\\1" sdl_patch "${_patch_line}") - unset(_major_line) - unset(_minor_line) - unset(_patch_line) - - set(${major} ${sdl_major} PARENT_SCOPE) - set(${minor} ${sdl_minor} PARENT_SCOPE) - set(${patch} ${sdl_patch} PARENT_SCOPE) - set(${version_string} "${sdl_major}.${sdl_minor}.${sdl_patch}" PARENT_SCOPE) -endfunction() - -############################# -# The actual find module begins here -############################# -if(NOT EXISTS SDL_ROOT_DIR) - - set(_likely_dirs "") - - # NOTE: this could be done much more cleanly if we write a multiple-return-value find_file and find_path. - # As it stands, cmake's find_file and find_path functions return at most one value, even if there are - # multiple matches, and which one it returns depends on a rather complicated prioritized list of dirs. - - #Find any dirs in the prefix path matching SDL* and add them to the list of candidates - find_likely_dirs(SDL _likely_dirs "${CMAKE_PREFIX_PATH}") - - set(_best_version "") - - #TODO: create a filter function that takes a function(to determine version given a path) - #and filters dirs based on the package version & if EXACT has been set. - foreach(_dir ${_likely_dirs}) - find_path( - _candidate_sdl2_root_dir - NAMES include/SDL_version.h - include/SDL2/SDL_version.h - include/SDL/SDL_version.h - HINTS $ENV{SDLDIR} ${_likely_dirs} - ) - if(_candidate_sdl2_root_dir AND EXISTS ${_candidate_sdl2_root_dir}) - find_file( - _version_file - NAMES SDL_version.h - PATHS ${_candidate_sdl2_root_dir} - PATH_SUFFIXES include include/SDL2 include/SDL - NO_DEFAULT_PATH - ) - verbose_message("found SDL_version.h file in dir ${_candidate_sdl2_root_dir}") - if(_version_file AND EXISTS ${_version_file}) - sdl_parse_version_file("${_version_file}" _major _minor _patch _version_string) - verbose_message(" version string = ${_version_string}") - - #exact matches in front - set(_version_matches FALSE) - if(_version_string STREQUAL SDL_FIND_VERSION) - set(_version_matches TRUE) - endif() - if(_major EQUAL SDL_FIND_VERSION_MAJOR AND - _minor EQUAL SDL_FIND_VERSION_MINOR AND - _patch EQUAL SDL_FIND_VERSION_PATCH) - set(_version_matches TRUE) - endif() - if(NOT SDL_FIND_VERSION_EXACT AND - _major EQUAL SDL_FIND_VERSION_MAJOR AND - _version_string VERSION_GREATER SDL_FIND_VERSION) - set(_version_matches TRUE) - endif() - - if(_version_matches) - verbose_message(" version ${_version_string} matches") - if(NOT _best_version OR _version_string VERSION_GREATER _best_version) - verbose_message(" setting best version") - set(_best_version ${_version_string}) - set(SDL_ROOT_DIR ${_candidate_sdl2_root_dir}) - set(SDL_VERSION_STRING ${_version_string}) - set(SDL_VERSION_MAJOR ${_major}) - set(SDL_VERSION_MINOR ${_minor}) - set(SDL_VERSION_PATCH ${_patch}) - endif() - endif() - endif() - endif() - endforeach() - verbose_message("SDL_ROOT_DIR = ${SDL_ROOT_DIR}") - verbose_message("SDL_VERSION_STRING = ${SDL_VERSION_STRING}") - verbose_message("SDL_VERSION_MAJOR = ${SDL_VERSION_MAJOR}") - verbose_message("SDL_VERSION_MINOR = ${SDL_VERSION_MINOR}") - verbose_message("SDL_VERSION_PATCH = ${SDL_VERSION_PATCH}") - unset(_version_file CACHE) - unset(_candidate_sdl2_root_dir CACHE) -endif() - -### Find SDL version by using predefined SDL root directory ### - find_file( - _version_file - NAMES SDL_version.h - PATHS ${SDL_ROOT_DIR} - PATH_SUFFIXES include include/SDL2 include/SDL - NO_DEFAULT_PATH - ) -sdl_parse_version_file("${_version_file}" _major _minor _patch _version_string) -set(SDL_VERSION_MAJOR ${_major}) - -# A find_path command analogous to the one used to derived SDL_ROOT_DIR is used here. -find_path( - SDL_INCLUDE_DIR - NAMES SDL_version.h - HINTS ${SDL_ROOT_DIR} - PATH_SUFFIXES - include/SDL2 - include - include/SDL - NO_DEFAULT_PATH -) -verbose_message("SDL_INCLUDE_DIR = ${SDL_INCLUDE_DIR}") - -find_multitype_library( - SDL_SHARED_LIB - SDL_STATIC_LIB - SDL_IMPORT_LIB - NAMES - SDL${SDL_VERSION_MAJOR} - HINTS - $ENV{SDLDIR} ${SDL_ROOT_DIR} - PATH_SUFFIXES - lib ${VC_LIB_PATH_SUFFIX} - NO_DEFAULT_PATH -) - -select_library_type(SDL) - -find_library(SDL_MAIN_LIBRARY - NAMES - SDL${SDL_VERSION_MAJOR}main - SDLmain - HINTS - ENV{SDLDIR} ${SDL_ROOT_DIR} - PATH_SUFFIXES - lib ${VC_LIB_PATH_SUFFIX} - PATHS - /sw /opt/local /opt/csw /opt -) - -if(NOT SDL_BUILDING_LIBRARY) - list(APPEND SDL_LIBRARIES ${SDL_MAIN_LIBRARY}) -endif() - -# MinGW needs an additional library, mwindows -# It's total link flags should look like -lmingw32 -lSDLmain -lSDL -lmwindows -# (Actually on second look, I think it only needs one of the m* libraries.) -if(MINGW) - set(MINGW32_LIBRARY mingw32 CACHE STRING "mwindows for MinGW") -endif() - -# For OS X, SDL uses Cocoa as a backend so it must link to Cocoa (as -# well as the dependencies of Cocoa (the frameworks: Carbon, IOKit, -# and the library: iconv)). CMake doesn't display the -framework Cocoa -# string in the UI even though it actually is there if I modify a -# pre-used variable. I think it has something to do with the CACHE -# STRING. So I use a temporary variable until the end so I can set -# the "real" variable in one-shot. -if(APPLE) - list(APPEND SDL_INTERFACE_LIBS "-framework Cocoa" "-framework IOKit" "-framework Carbon" "iconv") -endif() - -# For threads, as mentioned Apple doesn't need this. -# In fact, there seems to be a problem if I used the Threads package -# and try using this line, so I'm just skipping it entirely for OS X. -if(NOT APPLE) - list(APPEND SDL_INTERFACE_LIBS ${CMAKE_THREAD_LIBS_INIT}) -endif() - -# For MinGW library -if(MINGW) - list(APPEND SDL_INTERFACE_LIBS ${MINGW32_LIBRARY}) -endif() - -# Set the final string here so the GUI reflects the final state. -list(APPEND SDL_LIBRARIES ${SDL_INTERFACE_LIBS} CACHE STRING "Where the SDL Library can be found") - -include(FindPackageHandleStandardArgs) -find_package_handle_standard_args(SDL - REQUIRED_VARS SDL_LIBRARY SDL_MAIN_LIBRARY SDL_INCLUDE_DIR - VERSION_VAR SDL_VERSION_STRING) - -mark_as_advanced(SDL_INCLUDE_DIR SDL_LIBRARIES SDL_MAIN_LIBRARY SDL_IMPORT_LIB SDL_SHARED_LIB SDL_STATIC_LIB) - -if(SDL_MAIN_LIBRARY AND EXISTS "${SDL_MAIN_LIBRARY}") - set(SDL_MAIN_FOUND TRUE) -endif() - -include(CreateImportTargetHelpers) - -if(SDL_FOUND AND NOT TARGET SDL::SDL) - generate_import_target(SDL_MAIN STATIC TARGET SDL::Main) - - include(CreateImportTargetHelpers) - if(SDL_LIBRARY MATCHES "${CMAKE_SHARED_LIBRARY_SUFFIX}$") - generate_import_target(SDL SHARED TARGET SDL::Library) - elseif(SDL_LIBRARY MATCHES "${CMAKE_STATIC_LIBRARY_SUFFIX}$") - generate_import_target(SDL STATIC TARGET SDL::Library) - else() - message(FATAL_ERROR "Unable to determine library type of file ${SDL_LIBRARY}") - endif() - - add_library(SDL::SDL INTERFACE IMPORTED GLOBAL) - set_property(TARGET SDL::SDL APPEND PROPERTY INTERFACE_LINK_LIBRARIES SDL::Library SDL::Main) - - # NOTE: this is commented out because SDL does not in principle need to depend - # on X11 (it should be using Cocoa), and thus the SDL library we use should be - # configured to not use X11. Jon has rolled an SDL build with X11 disabled, and - # that build should be making it into our external libraries. - # # HACK FOR MAC X11 DEPENDENCY - # # TODO - Create a modernized FindX11.cmake module, make SDL depend on it on macs - # if(APPLE) - # find_package(X11 REQUIRED) - # set_property(TARGET SDL::SDL APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES ${X11_INCLUDE_DIR}) - # endif() -endif() \ No newline at end of file diff --git a/cmake-modules/FindSFML.cmake b/cmake-modules/FindSFML.cmake deleted file mode 100644 index cd152b62a..000000000 --- a/cmake-modules/FindSFML.cmake +++ /dev/null @@ -1,326 +0,0 @@ -# This script locates the SFML library -# ------------------------------------ -# -# Usage -# ----- -# -# When you try to locate the SFML libraries, you must specify which modules you want to use (system, window, graphics, network, audio, main). -# If none is given, the SFML_LIBRARIES variable will be empty and you'll end up linking to nothing. -# example: -# find_package(SFML COMPONENTS graphics window system) // find the graphics, window and system modules -# -# You can enforce a specific version, either MAJOR.MINOR or only MAJOR. -# If nothing is specified, the version won't be checked (ie. any version will be accepted). -# example: -# find_package(SFML COMPONENTS ...) // no specific version required -# find_package(SFML 2 COMPONENTS ...) // any 2.x version -# find_package(SFML 2.4 COMPONENTS ...) // version 2.4 or greater -# -# By default, the dynamic libraries of SFML will be found. To find the static ones instead, -# you must set the SFML_STATIC_LIBRARIES variable to TRUE before calling find_package(SFML ...). -# In case of static linking, the SFML_STATIC macro will also be defined by this script. -# example: -# set(SFML_STATIC_LIBRARIES TRUE) -# find_package(SFML 2 COMPONENTS network system) -# -# On Mac OS X if SFML_STATIC_LIBRARIES is not set to TRUE then by default CMake will search for frameworks unless -# CMAKE_FIND_FRAMEWORK is set to "NEVER" for example. Please refer to CMake documentation for more details. -# Moreover, keep in mind that SFML frameworks are only available as release libraries unlike dylibs which -# are available for both release and debug modes. -# -# If SFML is not installed in a standard path, you can use the SFML_ROOT CMake (or environment) variable -# to tell CMake where SFML is. -# -# Output -# ------ -# -# This script defines the following interface targets: -# SFML:: -# SFML - Meta-target. Links to all targets below. -# Main - The minimum required core target. -# Audio -# Graphics -# Network -# System -# Window -# -# Targets for different components will only defined for modules in the COMPONENTS list passed to find_package. -# If no components are listed, it is assumed that all components are requested. -# -# This script also defines the following variables: -# - For each specified module XXX (system, window, graphics, network, audio, main): -# - SFML_XXX_LIBRARY_DEBUG: the name of the debug library of the xxx module (set to SFML_XXX_LIBRARY_RELEASE is no debug version is found) -# - SFML_XXX_LIBRARY_RELEASE: the name of the release library of the xxx module (set to SFML_XXX_LIBRARY_DEBUG is no release version is found) -# - SFML_XXX_LIBRARY: the name of the library to link to for the xxx module (includes both debug and optimized names if necessary) -# - SFML_XXX_FOUND: true if either the debug or release library of the xxx module is found -# - SFML_LIBRARIES: the list of all libraries corresponding to the required modules -# - SFML_DEFINITIONS: thie list of compiler flags required. -# - SFML_FOUND: true if all the required modules are found -# - SFML_INCLUDE_DIR: the path where SFML headers are located (the directory containing the SFML/Config.hpp file) -# -# example: -# find_package(SFML 2 COMPONENTS system window graphics audio REQUIRED) -# include_directories(${SFML_INCLUDE_DIR}) -# add_executable(myapp ...) -# target_link_libraries(myapp ${SFML_LIBRARIES}) - -# define the SFML_STATIC macro if static build was chosen -set(SFML_DEFINITIONS "") - -if(SFML_STATIC_LIBRARIES) - set(SFML_DEFINITIONS SFML_STATIC) -endif() - -find_path(SFML_ROOT_DIR - NAMES include/SFML/Config.hpp - PATH_SUFFIXES SFML_${SFML_FIND_VERSION}_${_compiler_SUFFIX} - SFML_${SFML_FIND_VERSION} - SFML-${SFML_FIND_VERSION}-${_compiler_SUFFIX} - SFML-${SFML_FIND_VERSION} - SFML) - -# deduce the libraries suffix from the options -set(FIND_SFML_LIB_SUFFIX "") -if(SFML_STATIC_LIBRARIES) - set(FIND_SFML_LIB_SUFFIX "${FIND_SFML_LIB_SUFFIX}-s") -endif() - -# find the SFML include directory -find_path(SFML_INCLUDE_DIR SFML/Config.hpp - PATH_SUFFIXES include - PATHS - ${SFML_ROOT} - $ENV{SFML_ROOT} - ${SFML_ROOT_DIR} - ~/Library/Frameworks - /Library/Frameworks - /usr/local/ - /usr/ - /sw # Fink - /opt/local/ # DarwinPorts - /opt/csw/ # Blastwave - /opt/) -mark_as_advanced(SFML_INCLUDE_DIR) - -# check the version number -set(SFML_VERSION_OK TRUE) -if(SFML_FIND_VERSION AND SFML_INCLUDE_DIR) - # extract the major and minor version numbers from SFML/Config.hpp - # we have to handle framework a little bit differently : - if("${SFML_INCLUDE_DIR}" MATCHES "SFML.framework") - set(SFML_CONFIG_HPP_INPUT "${SFML_INCLUDE_DIR}/Headers/Config.hpp") - else() - set(SFML_CONFIG_HPP_INPUT "${SFML_INCLUDE_DIR}/SFML/Config.hpp") - endif() - FILE(READ "${SFML_CONFIG_HPP_INPUT}" SFML_CONFIG_HPP_CONTENTS) - STRING(REGEX MATCH ".*#define SFML_VERSION_MAJOR ([0-9]+).*#define SFML_VERSION_MINOR ([0-9]+).*" SFML_CONFIG_HPP_CONTENTS "${SFML_CONFIG_HPP_CONTENTS}") - STRING(REGEX REPLACE ".*#define SFML_VERSION_MAJOR ([0-9]+).*" "\\1" SFML_VERSION_MAJOR "${SFML_CONFIG_HPP_CONTENTS}") - STRING(REGEX REPLACE ".*#define SFML_VERSION_MINOR ([0-9]+).*" "\\1" SFML_VERSION_MINOR "${SFML_CONFIG_HPP_CONTENTS}") - math(EXPR SFML_REQUESTED_VERSION "${SFML_FIND_VERSION_MAJOR} * 10 + ${SFML_FIND_VERSION_MINOR}") - - # if we could extract them, compare with the requested version number - if (SFML_VERSION_MAJOR) - # transform version numbers to an integer - math(EXPR SFML_VERSION "${SFML_VERSION_MAJOR} * 10 + ${SFML_VERSION_MINOR}") - - # compare them - if(SFML_VERSION LESS SFML_REQUESTED_VERSION) - set(SFML_VERSION_OK FALSE) - endif() - else() - # SFML version is < 2.0 - if (SFML_REQUESTED_VERSION GREATER 19) - set(SFML_VERSION_OK FALSE) - set(SFML_VERSION_MAJOR 1) - set(SFML_VERSION_MINOR x) - endif() - endif() -endif() - -# find the requested modules -set(SFML_FOUND TRUE) # will be set to false if one of the required modules is not found -set(FIND_SFML_LIB_PATHS - ${SFML_ROOT} - $ENV{SFML_ROOT} - ${SFML_ROOT_DIR} - ~/Library/Frameworks - /Library/Frameworks - /usr/local - /usr - /sw - /opt/local - /opt/csw - /opt) - -if(NOT SFML_FIND_COMPONENTS) - set(SFML_FIND_COMPONENTS audio graphics network system window) - if(WIN32) - list(APPEND SFML_FIND_COMPONENTS main) - endif() -endif() - -foreach(FIND_SFML_COMPONENT ${SFML_FIND_COMPONENTS}) - string(TOLOWER ${FIND_SFML_COMPONENT} FIND_SFML_COMPONENT_LOWER) - string(TOUPPER ${FIND_SFML_COMPONENT} FIND_SFML_COMPONENT_UPPER) - set(FIND_SFML_COMPONENT_NAME sfml-${FIND_SFML_COMPONENT_LOWER}${FIND_SFML_LIB_SUFFIX}) - - # no suffix for sfml-main, it is always a static library - if(FIND_SFML_COMPONENT_LOWER STREQUAL "main") - set(FIND_SFML_COMPONENT_NAME sfml-${FIND_SFML_COMPONENT_LOWER}) - endif() - - # debug library - find_library(SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY_DEBUG - NAMES ${FIND_SFML_COMPONENT_NAME}-d - PATH_SUFFIXES lib64 lib - PATHS ${FIND_SFML_LIB_PATHS}) - - # release library - find_library(SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY_RELEASE - NAMES ${FIND_SFML_COMPONENT_NAME} - PATH_SUFFIXES lib64 lib - PATHS ${FIND_SFML_LIB_PATHS}) - - if(NOT SFML_STATIC_LIBRARIES) - set(SFML_${FIND_SFML_COMPONENT_UPPER}_IMPORT_LIB_DEBUG ${SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY_DEBUG}) - set(SFML_${FIND_SFML_COMPONENT_UPPER}_IMPORT_LIB_RELEASE ${SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY_RELEASE}) - - set(_old_suffixes ${CMAKE_FIND_LIBRARY_SUFFIXES}) - set(CMAKE_FIND_LIBRARY_SUFFIXES "${CMAKE_SHARED_LIBRARY_SUFFIX}") - find_library(SFML_${FIND_SFML_COMPONENT_UPPER}_SHARED_LIB_DEBUG - NAMES ${FIND_SFML_COMPONENT_NAME}-d ${FIND_SFML_COMPONENT_NAME}-d-2 - PATH_SUFFIXES bin64 bin - PATHS ${FIND_SFML_LIB_PATHS}) - - find_library(SFML_${FIND_SFML_COMPONENT_UPPER}_SHARED_LIB_RELEASE - NAMES ${FIND_SFML_COMPONENT_NAME} ${FIND_SFML_COMPONENT_NAME}-2 - PATH_SUFFIXES bin64 bin - PATHS ${FIND_SFML_LIB_PATHS}) - - set(CMAKE_FIND_LIBRARY_SUFFIXES ${_old_suffixes}) - mark_as_advanced(SFML_${FIND_SFML_COMPONENT_UPPER}_SHARED_LIB_DEBUG SFML_${FIND_SFML_COMPONENT_UPPER}_SHARED_LIB_RELEASE) - endif() - - if (SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY_DEBUG OR SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY_RELEASE) - # library found - set(SFML_${FIND_SFML_COMPONENT_UPPER}_FOUND TRUE) - - # if both are found, set SFML_XXX_LIBRARY to contain both - if (SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY_DEBUG AND SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY_RELEASE) - set(SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY debug ${SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY_DEBUG} - optimized ${SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY_RELEASE}) - endif() - - # if only one debug/release variant is found, set the other to be equal to the found one - if (SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY_DEBUG AND NOT SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY_RELEASE) - # debug and not release - set(SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY_RELEASE ${SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY_DEBUG}) - set(SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY ${SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY_DEBUG}) - endif() - if (SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY_RELEASE AND NOT SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY_DEBUG) - # release and not debug - set(SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY_DEBUG ${SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY_RELEASE}) - set(SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY ${SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY_RELEASE}) - endif() - - else() - # library not found - set(SFML_FOUND FALSE) - set(SFML_${FIND_SFML_COMPONENT_UPPER}_FOUND FALSE) - set(SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY "") - set(FIND_SFML_MISSING "${FIND_SFML_MISSING} SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY") - endif() - - # mark as advanced - MARK_AS_ADVANCED(SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY - SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY_RELEASE - SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY_DEBUG) - - # add to the global list of libraries - set(SFML_LIBRARIES ${SFML_LIBRARIES} "${SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY}") -endforeach() - -# handle errors -if(NOT SFML_VERSION_OK) - # SFML version not ok - set(FIND_SFML_ERROR "SFML found but version too low (requested: ${SFML_FIND_VERSION}, found: ${SFML_VERSION_MAJOR}.${SFML_VERSION_MINOR})") - set(SFML_FOUND FALSE) -elseif(NOT SFML_FOUND) - # include directory or library not found - set(FIND_SFML_ERROR "Could NOT find SFML (missing: ${FIND_SFML_MISSING})") -endif() -if (NOT SFML_FOUND) - if(SFML_FIND_REQUIRED) - # fatal error - message(FATAL_ERROR ${FIND_SFML_ERROR}) - elseif(NOT SFML_FIND_QUIETLY) - # error but continue - message("${FIND_SFML_ERROR}") - endif() -endif() - -# handle success -#if(SFML_FOUND) - #message(STATUS "Found SFML ${SFML_VERSION_MAJOR}.${SFML_VERSION_MINOR} in ${SFML_INCLUDE_DIR}") -#endif() - -include(CreateImportTargetHelpers) - -if( SFML_FOUND AND NOT TARGET SFML::SFML) - - set(_libtype SHARED) - if(SFML_STATIC_LIBRARIES) - set(_libtype STATIC) - endif() - - - add_library(SFML::SFML INTERFACE IMPORTED GLOBAL) - - if(APPLE) - find_library(SFML_GLEW - NAMES GLEW - PATH_SUFFIXES lib64 lib - PATHS ${FIND_SFML_LIB_PATHS} - NO_DEFAULT_PATH) - find_library(SFML_JPEG - NAMES jpeg - PATH_SUFFIXES lib64 lib - PATHS ${FIND_SFML_LIB_PATHS} - NO_DEFAULT_PATH) - mark_as_advanced(SFML_GLEW SFML_JPEG) - endif() - - foreach(_component ${SFML_FIND_COMPONENTS}) - string(TOUPPER ${_component} _componentUPPER) - string(TOLOWER ${_component} _componentLOWER) - - string(SUBSTRING ${_componentLOWER} 0 1 _first_letter) - string(TOUPPER ${_first_letter} _first_letter) - string(REGEX REPLACE "^.(.*)" "${_first_letter}\\1" _componentCap "${_componentLOWER}") - - if(_componentLOWER STREQUAL "main") #main is always a static lib - generate_import_target(SFML_MAIN STATIC TARGET SFML::Main) - - else() - generate_import_target(SFML_${_componentUPPER} ${_libtype} TARGET SFML::${_componentCap}) - endif() - - map_var_to_prop(SFML::${_componentCap} INTERFACE_COMPILE_DEFINITIONS SFML_DEFINITIONS) - map_var_to_prop(SFML::${_componentCap} INTERFACE_INCLUDE_DIRECTORIES SFML_INCLUDE_DIR REQUIRED) - - if(APPLE) - if(SFML_STATIC_LIBRARIES) - if(_componentLOWER STREQUAL "audio") - set_property(TARGET SFML::${_componentCap} APPEND PROPERTY INTERFACE_LINK_LIBRARIES "-framework OpenAL") - endif() - if(_componentLOWER STREQUAL "graphics") - set_property(TARGET SFML::${_componentCap} APPEND PROPERTY - INTERFACE_LINK_LIBRARIES "-framework OpenGL" "-framework AppKit" "-framework IOKit" "-framework Carbon" - "${SFML_GLEW}" "${SFML_JPEG}") - endif() - endif() - endif() - - set_property(TARGET SFML::SFML APPEND PROPERTY INTERFACE_LINK_LIBRARIES SFML::${_componentCap}) - endforeach() -endif() \ No newline at end of file diff --git a/cmake-modules/FindThreads.cmake b/cmake-modules/FindThreads.cmake deleted file mode 100644 index 39b5a78b9..000000000 --- a/cmake-modules/FindThreads.cmake +++ /dev/null @@ -1,188 +0,0 @@ -#.rst: -# FindThreads -# ----------- -# -# Modified by Victor Dods to use the generate_import_target function to define -# the library correctly as a target under the new cmake usage requirements rules. -# -# This module determines the thread library of the system. -# -# The following variables are set -# -# :: -# -# CMAKE_THREAD_LIBS_INIT - the thread library -# CMAKE_USE_SPROC_INIT - are we using sproc? -# CMAKE_USE_WIN32_THREADS_INIT - using WIN32 threads? -# CMAKE_USE_PTHREADS_INIT - are we using pthreads -# CMAKE_HP_PTHREADS_INIT - are we using hp pthreads -# -# For systems with multiple thread libraries, caller can set -# -# :: -# -# CMAKE_THREAD_PREFER_PTHREAD - -#============================================================================= -# Copyright 2002-2009 Kitware, Inc. -# -# Distributed under the OSI-approved BSD License (the "License"); -# see accompanying file Copyright.txt for details. -# -# This software is distributed WITHOUT ANY WARRANTY; without even the -# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -# See the License for more information. -#============================================================================= -# (To distribute this file outside of CMake, substitute the full -# License text for the above reference.) - -include (CheckIncludeFiles) -include (CheckLibraryExists) -include (CheckSymbolExists) -set(Threads_FOUND FALSE) - -# Do we have sproc? -if(CMAKE_SYSTEM MATCHES IRIX AND NOT CMAKE_THREAD_PREFER_PTHREAD) - CHECK_INCLUDE_FILES("sys/types.h;sys/prctl.h" CMAKE_HAVE_SPROC_H) -endif() - -if(CMAKE_HAVE_SPROC_H AND NOT CMAKE_THREAD_PREFER_PTHREAD) - # We have sproc - set(CMAKE_USE_SPROC_INIT 1) -else() - # Do we have pthreads? - CHECK_INCLUDE_FILES("pthread.h" CMAKE_HAVE_PTHREAD_H) - if(CMAKE_HAVE_PTHREAD_H) - # - # We have pthread.h - # Let's check for the library now. - # - set(CMAKE_HAVE_THREADS_LIBRARY) - if(NOT THREADS_HAVE_PTHREAD_ARG) - # Check if pthread functions are in normal C library - CHECK_SYMBOL_EXISTS(pthread_create pthread.h CMAKE_HAVE_LIBC_CREATE) - if(CMAKE_HAVE_LIBC_CREATE) - set(CMAKE_THREAD_LIBS_INIT "") - set(CMAKE_HAVE_THREADS_LIBRARY 1) - set(Threads_FOUND TRUE) - endif() - - if(NOT CMAKE_HAVE_THREADS_LIBRARY) - # Do we have -lpthreads - CHECK_LIBRARY_EXISTS(pthreads pthread_create "" CMAKE_HAVE_PTHREADS_CREATE) - if(CMAKE_HAVE_PTHREADS_CREATE) - set(CMAKE_THREAD_LIBS_INIT "-lpthreads") - set(CMAKE_HAVE_THREADS_LIBRARY 1) - set(Threads_FOUND TRUE) - endif() - - # Ok, how about -lpthread - CHECK_LIBRARY_EXISTS(pthread pthread_create "" CMAKE_HAVE_PTHREAD_CREATE) - if(CMAKE_HAVE_PTHREAD_CREATE) - set(CMAKE_THREAD_LIBS_INIT "-lpthread") - set(CMAKE_HAVE_THREADS_LIBRARY 1) - set(Threads_FOUND TRUE) - endif() - - if(CMAKE_SYSTEM MATCHES "SunOS.*") - # On sun also check for -lthread - CHECK_LIBRARY_EXISTS(thread thr_create "" CMAKE_HAVE_THR_CREATE) - if(CMAKE_HAVE_THR_CREATE) - set(CMAKE_THREAD_LIBS_INIT "-lthread") - set(CMAKE_HAVE_THREADS_LIBRARY 1) - set(Threads_FOUND TRUE) - endif() - endif() - endif() - endif() - - if(NOT CMAKE_HAVE_THREADS_LIBRARY) - # If we did not found -lpthread, -lpthread, or -lthread, look for -pthread - if("THREADS_HAVE_PTHREAD_ARG" MATCHES "^THREADS_HAVE_PTHREAD_ARG") - message(STATUS "Check if compiler accepts -pthread") - try_run(THREADS_PTHREAD_ARG THREADS_HAVE_PTHREAD_ARG - ${CMAKE_BINARY_DIR} - ${CMAKE_ROOT}/Modules/CheckForPthreads.c - CMAKE_FLAGS -DLINK_LIBRARIES:STRING=-pthread - COMPILE_OUTPUT_VARIABLE OUTPUT) - - if(THREADS_HAVE_PTHREAD_ARG) - if(THREADS_PTHREAD_ARG STREQUAL "2") - set(Threads_FOUND TRUE) - message(STATUS "Check if compiler accepts -pthread - yes") - else() - message(STATUS "Check if compiler accepts -pthread - no") - file(APPEND - ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log - "Determining if compiler accepts -pthread returned ${THREADS_PTHREAD_ARG} instead of 2. The compiler had the following output:\n${OUTPUT}\n\n") - endif() - else() - message(STATUS "Check if compiler accepts -pthread - no") - file(APPEND - ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log - "Determining if compiler accepts -pthread failed with the following output:\n${OUTPUT}\n\n") - endif() - - endif() - - if(THREADS_HAVE_PTHREAD_ARG) - set(Threads_FOUND TRUE) - set(CMAKE_THREAD_LIBS_INIT "-pthread") - endif() - - endif() - endif() -endif() - -if(CMAKE_THREAD_LIBS_INIT OR CMAKE_HAVE_LIBC_CREATE) - set(CMAKE_USE_PTHREADS_INIT 1) - set(Threads_FOUND TRUE) -endif() - -if(CMAKE_SYSTEM MATCHES "Windows") - set(CMAKE_USE_WIN32_THREADS_INIT 1) - set(Threads_FOUND TRUE) -endif() - -if(CMAKE_USE_PTHREADS_INIT) - if(CMAKE_SYSTEM MATCHES "HP-UX-*") - # Use libcma if it exists and can be used. It provides more - # symbols than the plain pthread library. CMA threads - # have actually been deprecated: - # http://docs.hp.com/en/B3920-90091/ch12s03.html#d0e11395 - # http://docs.hp.com/en/947/d8.html - # but we need to maintain compatibility here. - # The CMAKE_HP_PTHREADS setting actually indicates whether CMA threads - # are available. - CHECK_LIBRARY_EXISTS(cma pthread_attr_create "" CMAKE_HAVE_HP_CMA) - if(CMAKE_HAVE_HP_CMA) - set(CMAKE_THREAD_LIBS_INIT "-lcma") - set(CMAKE_HP_PTHREADS_INIT 1) - set(Threads_FOUND TRUE) - endif() - set(CMAKE_USE_PTHREADS_INIT 1) - endif() - - if(CMAKE_SYSTEM MATCHES "OSF1-V*") - set(CMAKE_USE_PTHREADS_INIT 0) - set(CMAKE_THREAD_LIBS_INIT ) - endif() - - if(CMAKE_SYSTEM MATCHES "CYGWIN_NT*") - set(CMAKE_USE_PTHREADS_INIT 1) - set(Threads_FOUND TRUE) - set(CMAKE_THREAD_LIBS_INIT ) - set(CMAKE_USE_WIN32_THREADS_INIT 0) - endif() -endif() - -include(${CMAKE_ROOT}/Modules/FindPackageHandleStandardArgs.cmake) -find_package_handle_standard_args(Threads DEFAULT_MSG Threads_FOUND) - -if(${CMAKE_THREAD_LIBS_INIT}) - include(CreateImportTargetHelpers) - set(Threads_LIBRARY ${CMAKE_THREAD_LIBS_INIT}) - generate_import_target(Threads STATIC) -else() - add_library(Threads::Threads INTERFACE IMPORTED) -endif() diff --git a/cmake-modules/FindWDK.cmake b/cmake-modules/FindWDK.cmake deleted file mode 100644 index f30b22713..000000000 --- a/cmake-modules/FindWDK.cmake +++ /dev/null @@ -1,58 +0,0 @@ -# - Try to find WDK -# This module takes as inputs -# WDK_ROOT_ALTERNATE - An alternate possible location for the wdk -# -# Once done this will define -# WDK_FOUND - System has WDK -# WDK_INCLUDE_DIRS - The WDK include directory -# WDK_LIBRARIES - The libraries needed to use WDK -# WDK_BIN - The path to the WDK binaries folder - -set(wdkregpath80 "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows Kits\\Installed Roots;KitsRoot]") -get_filename_component(wdkpath80 ${wdkregpath80} ABSOLUTE) - -set(wdkregpath81 "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows Kits\\Installed Roots;KitsRoot81]") -get_filename_component(wdkpath81 ${wdkregpath81} ABSOLUTE) - -if(CMAKE_SIZEOF_VOID_P EQUAL 8) - set(WDK_ARCH "x64") -else() - set(WDK_ARCH "x86") -endif() - -# Select a root path first: -find_path( - WDK_ROOT_DIR Include/um/UPnP.h - HINTS ${wdkpath81} ${wdkpath80} ${WDK_ROOT_ALTERNATE} -) - -# Generate include directories variable from the root path -set(WDK_INCLUDE_DIRS ${WDK_ROOT_DIR}/Include/um ${WDK_ROOT_DIR}/Include/Shared) - -# Also generate the binaries directory: -find_path( - WDK_BIN_DIR makecat.exe - HINTS ${WDK_ROOT_DIR}/bin/${WDK_ARCH} -) - -# Now we scan for all components: -foreach(COMPONENT ${WDK_FIND_COMPONENTS}) - string(TOUPPER ${COMPONENT} UPPERCOMPONENT) - - find_library( - WDK_${UPPERCOMPONENT} ${COMPONENT} - PATHS ${WDK_ROOT_DIR} - PATH_SUFFIXES /Lib/win8/um/${WDK_ARCH} /Lib/winv6.3/um/${WDK_ARCH} - ) - mark_as_advanced(CLEAR WDK_${UPPERCOMPONENT}) - list(APPEND WDK_LIBRARIES ${WDK_${UPPERCOMPONENT}}) -endforeach() - -include(FindPackageHandleStandardArgs) -if(WDK_FIND_COMPONENTS) - find_package_handle_standard_args(WDK DEFAULT_MSG WDK_LIBRARIES WDK_INCLUDE_DIRS) -else() - find_package_handle_standard_args(WDK DEFAULT_MSG WDK_INCLUDE_DIRS) -endif() - - diff --git a/cmake-modules/TargetStrip.cmake b/cmake-modules/TargetStrip.cmake deleted file mode 100644 index 65c941295..000000000 --- a/cmake-modules/TargetStrip.cmake +++ /dev/null @@ -1,15 +0,0 @@ -# primary function of this macro: strip symbols at link time on Mac and Linux -# secondary function: avoid MSVC warnings in Debug by specifying /nodefaultlib -# tertiary function: avoid MSVC warnings about combining /incremental with /ltcg -function(target_strip Target) - if(MSVC) - if(CMAKE_CXX_FLAGS_RELEASE) - set_target_properties(${Target} PROPERTIES LINK_FLAGS_DEBUG "/INCREMENTAL:NO /NODEFAULTLIB:MSVCRT") - else() - set_target_properties(${Target} PROPERTIES LINK_FLAGS_DEBUG "/NODEFAULTLIB:MSVCRT") - endif() - else() - set_target_properties(${Target} PROPERTIES LINK_FLAGS_RELEASE - "-Xlinker -unexported_symbol -Xlinker \"*\" -Xlinker -dead_strip -Xlinker -dead_strip_dylibs") - endif() -endfunction()