From 88d0ce499d9638d98071c69590238a60d3fe9753 Mon Sep 17 00:00:00 2001 From: Jan Mulder Date: Tue, 13 Feb 2018 14:38:51 +0100 Subject: Build: do include modules instead of files Cleanup only. It seems a little weird to first define a CMAKE_MODULE_PATH search path and then explicitly include files including a hard coded path instead of letting the include command search for the modules we like to include. Signed-off-by: Jan Mulder --- CMakeLists.txt | 31 +++++++++++++++---------------- 1 file changed, 15 insertions(+), 16 deletions(-) (limited to 'CMakeLists.txt') diff --git a/CMakeLists.txt b/CMakeLists.txt index d67879725..94acf6782 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -14,8 +14,13 @@ endif() # global settings +set(CMAKE_MODULE_PATH + ${${PROJECT_NAME}_SOURCE_DIR}/cmake/Modules + ${CMAKE_MODULE_PATH} +) + set(CMAKE_AUTOMOC ON) -include(cmake/Modules/MacroOutOfSourceBuild.cmake) +include(MacroOutOfSourceBuild) MACRO_ENSURE_OUT_OF_SOURCE_BUILD( "We don't support building in source, please create a build folder elsewhere and remember to run git clean -xdf to remove temporary files created by CMake." ) @@ -62,12 +67,6 @@ endif() set(SUBSURFACE_SOURCE ${CMAKE_SOURCE_DIR}) add_definitions(-DSUBSURFACE_SOURCE="${SUBSURFACE_SOURCE}") -#evenrything's correct, moving on. -set(CMAKE_MODULE_PATH - ${CMAKE_MODULE_PATH} - ${${PROJECT_NAME}_SOURCE_DIR}/cmake/Modules -) - # # TODO: This Compilation part should go on the Target specific CMake. # @@ -112,7 +111,7 @@ set (CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -O2") # pkgconfig for required libraries find_package(PkgConfig) -include(cmake/Modules/pkgconfig_helper.cmake) +include(pkgconfig_helper) # The 'HandleFindXXX' are special libraries that subsurface needs # to find and configure in a few different ways because of a few @@ -120,16 +119,16 @@ include(cmake/Modules/pkgconfig_helper.cmake) # everyone happy. It also sets some variables for each library, so # if you think a module miss anything, take a look on the specific # module file. -include(cmake/Modules/HandleFindGit2.cmake) -include(cmake/Modules/HandleFindLibDiveComputer.cmake) +include(HandleFindGit2) +include(HandleFindLibDiveComputer) if(${SUBSURFACE_TARGET_EXECUTABLE} MATCHES "DesktopExecutable") - include(cmake/Modules/HandleFindGrantlee.cmake) - include(cmake/Modules/HandleUserManual.cmake) + include(HandleFindGrantlee) + include(HandleUserManual) endif() -include(cmake/Modules/HandleFtdiSupport.cmake) -include(cmake/Modules/HandleVersionGeneration.cmake) -include(cmake/Modules/RunOnBuildDir.cmake) -include(cmake/Modules/cmake_variables_helper.cmake) +include(HandleFtdiSupport) +include(HandleVersionGeneration) +include(RunOnBuildDir) +include(cmake_variables_helper) if(CMAKE_SYSTEM_NAME STREQUAL "Darwin") include_directories(${CMAKE_OSX_SYSROOT}/usr/include/libxml2) -- cgit v1.2.3-70-g09d2