diff options
Diffstat (limited to 'Modules')
59 files changed, 595 insertions, 437 deletions
diff --git a/Modules/CMakeDetermineCCompiler.cmake b/Modules/CMakeDetermineCCompiler.cmake index 171eadd..16e2f53 100644 --- a/Modules/CMakeDetermineCCompiler.cmake +++ b/Modules/CMakeDetermineCCompiler.cmake @@ -160,9 +160,7 @@ if (CMAKE_CROSSCOMPILING set(_CMAKE_TOOLCHAIN_PREFIX ${CMAKE_MATCH_1}) endif () -endif (CMAKE_CROSSCOMPILING - AND "${CMAKE_C_COMPILER_ID}" MATCHES "GNU" - AND NOT _CMAKE_TOOLCHAIN_PREFIX) +endif () include(${CMAKE_ROOT}/Modules/CMakeClDeps.cmake) include(CMakeFindBinUtils) diff --git a/Modules/CMakeDetermineCXXCompiler.cmake b/Modules/CMakeDetermineCXXCompiler.cmake index 898947a..8e4d59f 100644 --- a/Modules/CMakeDetermineCXXCompiler.cmake +++ b/Modules/CMakeDetermineCXXCompiler.cmake @@ -167,9 +167,7 @@ if (CMAKE_CROSSCOMPILING set(_CMAKE_TOOLCHAIN_PREFIX ${CMAKE_MATCH_1}) endif () -endif (CMAKE_CROSSCOMPILING - AND "${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU" - AND NOT _CMAKE_TOOLCHAIN_PREFIX) +endif () include(${CMAKE_ROOT}/Modules/CMakeClDeps.cmake) include(CMakeFindBinUtils) diff --git a/Modules/CMakeExtraGeneratorDetermineCompilerMacrosAndIncludeDirs.cmake b/Modules/CMakeExtraGeneratorDetermineCompilerMacrosAndIncludeDirs.cmake index 54a6418..1fa0157 100644 --- a/Modules/CMakeExtraGeneratorDetermineCompilerMacrosAndIncludeDirs.cmake +++ b/Modules/CMakeExtraGeneratorDetermineCompilerMacrosAndIncludeDirs.cmake @@ -42,7 +42,10 @@ macro(_DETERMINE_GCC_SYSTEM_INCLUDE_DIRS _lang _resultIncludeDirs _resultDefines # split the output into lines and then remove leading and trailing spaces from each of them: string(REGEX MATCHALL "[^\n]+\n" _includeLines "${CMAKE_MATCH_1}") foreach(nextLine ${_includeLines}) - string(STRIP "${nextLine}" _includePath) + # on OSX, gcc says things like this: "/System/Library/Frameworks (framework directory)", strip the last part + string(REGEX REPLACE "\\(framework directory\\)" "" nextLineNoFramework "${nextLine}") + # strip spaces at the beginning and the end + string(STRIP "${nextLineNoFramework}" _includePath) list(APPEND ${_resultIncludeDirs} "${_includePath}") endforeach() diff --git a/Modules/CMakeFindBinUtils.cmake b/Modules/CMakeFindBinUtils.cmake index 362052f..e08c1c6 100644 --- a/Modules/CMakeFindBinUtils.cmake +++ b/Modules/CMakeFindBinUtils.cmake @@ -39,9 +39,7 @@ if("${CMAKE_CXX_COMPILER_ID}" MATCHES "MSVC" mark_as_advanced(CMAKE_LINKER) # in all other cases search for ar, ranlib, etc. -else("${CMAKE_CXX_COMPILER_ID}" MATCHES "MSVC" - OR "${CMAKE_C_COMPILER_ID}" MATCHES "MSVC" - OR "${CMAKE_GENERATOR}" MATCHES "Visual Studio") +else() find_program(CMAKE_AR NAMES ${_CMAKE_TOOLCHAIN_PREFIX}ar HINTS ${_CMAKE_TOOLCHAIN_LOCATION}) @@ -58,9 +56,7 @@ else("${CMAKE_CXX_COMPILER_ID}" MATCHES "MSVC" mark_as_advanced(CMAKE_AR CMAKE_RANLIB CMAKE_STRIP CMAKE_LINKER CMAKE_NM CMAKE_OBJDUMP CMAKE_OBJCOPY) -endif("${CMAKE_CXX_COMPILER_ID}" MATCHES "MSVC" - OR "${CMAKE_C_COMPILER_ID}" MATCHES "MSVC" - OR "${CMAKE_GENERATOR}" MATCHES "Visual Studio") +endif() # on Apple there really should be install_name_tool diff --git a/Modules/CPackRPM.cmake b/Modules/CPackRPM.cmake index 066b295..b5826ef 100644 --- a/Modules/CPackRPM.cmake +++ b/Modules/CPackRPM.cmake @@ -259,7 +259,7 @@ if(RPMBUILD_EXECUTABLE) OUTPUT_VARIABLE _TMP_VERSION ERROR_QUIET OUTPUT_STRIP_TRAILING_WHITESPACE) - string(REGEX REPLACE "^.*\ " "" + string(REGEX REPLACE "^.* " "" RPMBUILD_EXECUTABLE_VERSION ${_TMP_VERSION}) if(CPACK_RPM_PACKAGE_DEBUG) diff --git a/Modules/CheckTypeSize.cmake b/Modules/CheckTypeSize.cmake index 1b9dc9f..7285b8a 100644 --- a/Modules/CheckTypeSize.cmake +++ b/Modules/CheckTypeSize.cmake @@ -24,6 +24,11 @@ # size check automatically includes the available headers, thus # supporting checks of types defined in the headers. # +# Despite the name of the macro you may use it to check the size of +# more complex expressions, too. To check e.g. for the size of a struct +# member you can do something like this: +# check_type_size("((struct something*)0)->member" SIZEOF_MEMBER) +# # The following variables may be set before calling this macro to # modify the way the check is run: # diff --git a/Modules/Compiler/Clang-ASM.cmake b/Modules/Compiler/Clang-ASM.cmake new file mode 100644 index 0000000..a908b60 --- /dev/null +++ b/Modules/Compiler/Clang-ASM.cmake @@ -0,0 +1 @@ +include(Compiler/GNU-ASM) diff --git a/Modules/Compiler/GNU.cmake b/Modules/Compiler/GNU.cmake index 0827e43..faad416 100644 --- a/Modules/Compiler/GNU.cmake +++ b/Modules/Compiler/GNU.cmake @@ -45,7 +45,7 @@ macro(__compiler_gnu lang) set(CMAKE_${lang}_FLAGS_DEBUG_INIT "-g") set(CMAKE_${lang}_FLAGS_MINSIZEREL_INIT "-Os -DNDEBUG") set(CMAKE_${lang}_FLAGS_RELEASE_INIT "-O3 -DNDEBUG") - set(CMAKE_${lang}_FLAGS_RELWITHDEBINFO_INIT "-O2 -g") + set(CMAKE_${lang}_FLAGS_RELWITHDEBINFO_INIT "-O2 -g -DNDEBUG") set(CMAKE_${lang}_CREATE_PREPROCESSED_SOURCE "<CMAKE_${lang}_COMPILER> <DEFINES> <FLAGS> -E <SOURCE> > <PREPROCESSED_SOURCE>") set(CMAKE_${lang}_CREATE_ASSEMBLY_SOURCE "<CMAKE_${lang}_COMPILER> <DEFINES> <FLAGS> -S <SOURCE> -o <ASSEMBLY_SOURCE>") if(NOT APPLE) diff --git a/Modules/Compiler/Intel-ASM.cmake b/Modules/Compiler/Intel-ASM.cmake index 1f064c9..74ceb0a 100644 --- a/Modules/Compiler/Intel-ASM.cmake +++ b/Modules/Compiler/Intel-ASM.cmake @@ -4,7 +4,7 @@ set(CMAKE_ASM_FLAGS_INIT "") set(CMAKE_ASM_FLAGS_DEBUG_INIT "-g") set(CMAKE_ASM_FLAGS_MINSIZEREL_INIT "-Os -DNDEBUG") set(CMAKE_ASM_FLAGS_RELEASE_INIT "-O3 -DNDEBUG") -set(CMAKE_ASM_FLAGS_RELWITHDEBINFO_INIT "-O2 -g") +set(CMAKE_ASM_FLAGS_RELWITHDEBINFO_INIT "-O2 -g -DNDEBUG") if(UNIX) set(CMAKE_ASM_SOURCE_FILE_EXTENSIONS s;S) diff --git a/Modules/Compiler/Intel-C.cmake b/Modules/Compiler/Intel-C.cmake index bca86a0..e23317c 100644 --- a/Modules/Compiler/Intel-C.cmake +++ b/Modules/Compiler/Intel-C.cmake @@ -4,7 +4,7 @@ set(CMAKE_C_FLAGS_INIT "") set(CMAKE_C_FLAGS_DEBUG_INIT "-g") set(CMAKE_C_FLAGS_MINSIZEREL_INIT "-Os -DNDEBUG") set(CMAKE_C_FLAGS_RELEASE_INIT "-O3 -DNDEBUG") -set(CMAKE_C_FLAGS_RELWITHDEBINFO_INIT "-O2 -g") +set(CMAKE_C_FLAGS_RELWITHDEBINFO_INIT "-O2 -g -DNDEBUG") set(CMAKE_C_CREATE_PREPROCESSED_SOURCE "<CMAKE_C_COMPILER> <DEFINES> <FLAGS> -E <SOURCE> > <PREPROCESSED_SOURCE>") set(CMAKE_C_CREATE_ASSEMBLY_SOURCE "<CMAKE_C_COMPILER> <DEFINES> <FLAGS> -S <SOURCE> -o <ASSEMBLY_SOURCE>") diff --git a/Modules/Compiler/Intel-CXX.cmake b/Modules/Compiler/Intel-CXX.cmake index 354bb17..ae6021a 100644 --- a/Modules/Compiler/Intel-CXX.cmake +++ b/Modules/Compiler/Intel-CXX.cmake @@ -4,7 +4,7 @@ set(CMAKE_CXX_FLAGS_INIT "") set(CMAKE_CXX_FLAGS_DEBUG_INIT "-g") set(CMAKE_CXX_FLAGS_MINSIZEREL_INIT "-Os -DNDEBUG") set(CMAKE_CXX_FLAGS_RELEASE_INIT "-O3 -DNDEBUG") -set(CMAKE_CXX_FLAGS_RELWITHDEBINFO_INIT "-O2 -g") +set(CMAKE_CXX_FLAGS_RELWITHDEBINFO_INIT "-O2 -g -DNDEBUG") set(CMAKE_CXX_CREATE_PREPROCESSED_SOURCE "<CMAKE_CXX_COMPILER> <DEFINES> <FLAGS> -E <SOURCE> > <PREPROCESSED_SOURCE>") set(CMAKE_CXX_CREATE_ASSEMBLY_SOURCE "<CMAKE_CXX_COMPILER> <DEFINES> <FLAGS> -S <SOURCE> -o <ASSEMBLY_SOURCE>") diff --git a/Modules/Compiler/SunPro-ASM.cmake b/Modules/Compiler/SunPro-ASM.cmake index 97776da..2fa8b99 100644 --- a/Modules/Compiler/SunPro-ASM.cmake +++ b/Modules/Compiler/SunPro-ASM.cmake @@ -12,7 +12,7 @@ set(CMAKE_ASM_FLAGS_INIT "") set(CMAKE_ASM_FLAGS_DEBUG_INIT "-g") set(CMAKE_ASM_FLAGS_MINSIZEREL_INIT "-xO2 -xspace -DNDEBUG") set(CMAKE_ASM_FLAGS_RELEASE_INIT "-xO3 -DNDEBUG") -set(CMAKE_ASM_FLAGS_RELWITHDEBINFO_INIT "-g -xO2") +set(CMAKE_ASM_FLAGS_RELWITHDEBINFO_INIT "-g -xO2 -DNDEBUG") # Initialize ASM link type selection flags. These flags are used when # building a shared library, shared module, or executable that links diff --git a/Modules/Compiler/SunPro-C.cmake b/Modules/Compiler/SunPro-C.cmake index 9e36051..c5b5203 100644 --- a/Modules/Compiler/SunPro-C.cmake +++ b/Modules/Compiler/SunPro-C.cmake @@ -12,7 +12,7 @@ set(CMAKE_C_FLAGS_INIT "") set(CMAKE_C_FLAGS_DEBUG_INIT "-g") set(CMAKE_C_FLAGS_MINSIZEREL_INIT "-xO2 -xspace -DNDEBUG") set(CMAKE_C_FLAGS_RELEASE_INIT "-xO3 -DNDEBUG") -set(CMAKE_C_FLAGS_RELWITHDEBINFO_INIT "-g -xO2") +set(CMAKE_C_FLAGS_RELWITHDEBINFO_INIT "-g -xO2 -DNDEBUG") # Initialize C link type selection flags. These flags are used when # building a shared library, shared module, or executable that links diff --git a/Modules/Compiler/SunPro-CXX.cmake b/Modules/Compiler/SunPro-CXX.cmake index af31c7b..5968712 100644 --- a/Modules/Compiler/SunPro-CXX.cmake +++ b/Modules/Compiler/SunPro-CXX.cmake @@ -12,7 +12,7 @@ set(CMAKE_CXX_FLAGS_INIT "") set(CMAKE_CXX_FLAGS_DEBUG_INIT "-g") set(CMAKE_CXX_FLAGS_MINSIZEREL_INIT "-xO2 -xspace -DNDEBUG") set(CMAKE_CXX_FLAGS_RELEASE_INIT "-xO3 -DNDEBUG") -set(CMAKE_CXX_FLAGS_RELWITHDEBINFO_INIT "-g -xO2") +set(CMAKE_CXX_FLAGS_RELWITHDEBINFO_INIT "-g -xO2 -DNDEBUG") # Initialize C link type selection flags. These flags are used when # building a shared library, shared module, or executable that links diff --git a/Modules/Compiler/SunPro-Fortran.cmake b/Modules/Compiler/SunPro-Fortran.cmake index 223a6c6..18e75b9 100644 --- a/Modules/Compiler/SunPro-Fortran.cmake +++ b/Modules/Compiler/SunPro-Fortran.cmake @@ -13,6 +13,6 @@ set(CMAKE_Fortran_FLAGS_INIT "") set(CMAKE_Fortran_FLAGS_DEBUG_INIT "-g") set(CMAKE_Fortran_FLAGS_MINSIZEREL_INIT "-xO2 -xspace -DNDEBUG") set(CMAKE_Fortran_FLAGS_RELEASE_INIT "-xO3 -DNDEBUG") -set(CMAKE_Fortran_FLAGS_RELWITHDEBINFO_INIT "-g -xO2") +set(CMAKE_Fortran_FLAGS_RELWITHDEBINFO_INIT "-g -xO2 -DNDEBUG") set(CMAKE_Fortran_MODDIR_FLAG "-moddir=") set(CMAKE_Fortran_MODPATH_FLAG "-M") diff --git a/Modules/Compiler/TinyCC-C.cmake b/Modules/Compiler/TinyCC-C.cmake index 178dd0c..f7937ac 100644 --- a/Modules/Compiler/TinyCC-C.cmake +++ b/Modules/Compiler/TinyCC-C.cmake @@ -5,4 +5,4 @@ set (CMAKE_C_FLAGS_INIT "") set (CMAKE_C_FLAGS_DEBUG_INIT "-g") set (CMAKE_C_FLAGS_MINSIZEREL_INIT "-DNDEBUG") set (CMAKE_C_FLAGS_RELEASE_INIT "-DNDEBUG") -set (CMAKE_C_FLAGS_RELWITHDEBINFO_INIT "-g") +set (CMAKE_C_FLAGS_RELWITHDEBINFO_INIT "-g -DNDEBUG") diff --git a/Modules/Compiler/XL-ASM.cmake b/Modules/Compiler/XL-ASM.cmake index 95af2ea..07507f9 100644 --- a/Modules/Compiler/XL-ASM.cmake +++ b/Modules/Compiler/XL-ASM.cmake @@ -8,6 +8,6 @@ set(CMAKE_ASM_FLAGS_INIT "-qthreaded -qalias=noansi -qhalt=e -qsourcetype=assemb set(CMAKE_ASM_FLAGS_DEBUG_INIT "-g") set(CMAKE_ASM_FLAGS_RELEASE_INIT "-O -DNDEBUG") set(CMAKE_ASM_FLAGS_MINSIZEREL_INIT "-O -DNDEBUG") -set(CMAKE_ASM_FLAGS_RELWITHDEBINFO_INIT "-g") +set(CMAKE_ASM_FLAGS_RELWITHDEBINFO_INIT "-g -DNDEBUG") set(CMAKE_ASM_SOURCE_FILE_EXTENSIONS s ) diff --git a/Modules/DeployQt4.cmake b/Modules/DeployQt4.cmake index 6190abe..309fce3 100644 --- a/Modules/DeployQt4.cmake +++ b/Modules/DeployQt4.cmake @@ -101,7 +101,7 @@ function(resolve_qt4_paths paths_var) if(${executable_path}) list(APPEND paths_resolved "${executable_path}/${path}") else() - list(APPEND paths_resolved "\${CMAKE_INSTALL_PREFIX}/${path}") + list(APPEND paths_resolved "\$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX}/${path}") endif() endif() endforeach() @@ -295,7 +295,7 @@ function(install_qt4_executable executable) install(CODE "include(\"${DeployQt4_cmake_dir}/DeployQt4.cmake\") set(BU_CHMOD_BUNDLE_ITEMS TRUE) - FIXUP_QT4_EXECUTABLE(\"\${CMAKE_INSTALL_PREFIX}/${executable}\" \"\" \"${libs}\" \"${dirs}\" \"${plugins_dir}\" \"${request_qt_conf}\")" + FIXUP_QT4_EXECUTABLE(\"\$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX}/${executable}\" \"\" \"${libs}\" \"${dirs}\" \"${plugins_dir}\" \"${request_qt_conf}\")" ${component} ) endfunction() diff --git a/Modules/ExternalProject.cmake b/Modules/ExternalProject.cmake index f0471ff..cd77ba4 100644 --- a/Modules/ExternalProject.cmake +++ b/Modules/ExternalProject.cmake @@ -21,6 +21,8 @@ # [SVN_TRUST_CERT 1 ] # Trust the Subversion server site certificate # [GIT_REPOSITORY url] # URL of git repo # [GIT_TAG tag] # Git branch name, commit id or tag +# [HG_REPOSITORY url] # URL of mercurial repo +# [HG_TAG tag] # Mercurial branch name, commit id or tag # [URL /.../src.tgz] # Full path or URL of source # [URL_MD5 md5] # MD5 checksum of file at URL # [TIMEOUT seconds] # Time allowed for file download operations @@ -331,6 +333,67 @@ endif() endfunction() +function(_ep_write_hgclone_script script_filename source_dir hg_EXECUTABLE hg_repository hg_tag src_name work_dir hgclone_infofile hgclone_stampfile) + file(WRITE ${script_filename} +"if(\"${hg_tag}\" STREQUAL \"\") + message(FATAL_ERROR \"Tag for hg checkout should not be empty.\") +endif() + +set(run 0) + +if(\"${hgclone_infofile}\" IS_NEWER_THAN \"${hgclone_stampfile}\") + set(run 1) +endif() + +if(NOT run) + message(STATUS \"Avoiding repeated hg clone, stamp file is up to date: '${hgclone_stampfile}'\") + return() +endif() + +execute_process( + COMMAND \${CMAKE_COMMAND} -E remove_directory \"${source_dir}\" + RESULT_VARIABLE error_code + ) +if(error_code) + message(FATAL_ERROR \"Failed to remove directory: '${source_dir}'\") +endif() + +execute_process( + COMMAND \"${hg_EXECUTABLE}\" clone \"${hg_repository}\" \"${src_name}\" + WORKING_DIRECTORY \"${work_dir}\" + RESULT_VARIABLE error_code + ) +if(error_code) + message(FATAL_ERROR \"Failed to clone repository: '${hg_repository}'\") +endif() + +execute_process( + COMMAND \"${hg_EXECUTABLE}\" update ${hg_tag} + WORKING_DIRECTORY \"${work_dir}/${src_name}\" + RESULT_VARIABLE error_code + ) +if(error_code) + message(FATAL_ERROR \"Failed to checkout tag: '${hg_tag}'\") +endif() + +# Complete success, update the script-last-run stamp file: +# +execute_process( + COMMAND \${CMAKE_COMMAND} -E copy + \"${hgclone_infofile}\" + \"${hgclone_stampfile}\" + WORKING_DIRECTORY \"${work_dir}/${src_name}\" + RESULT_VARIABLE error_code + ) +if(error_code) + message(FATAL_ERROR \"Failed to copy script-last-run stamp file: '${hgclone_stampfile}'\") +endif() + +" +) + +endfunction() + function(_ep_write_downloadfile_script script_filename remote local timeout md5) if(timeout) @@ -1027,6 +1090,7 @@ function(_ep_add_download_command name) get_property(cvs_repository TARGET ${name} PROPERTY _EP_CVS_REPOSITORY) get_property(svn_repository TARGET ${name} PROPERTY _EP_SVN_REPOSITORY) get_property(git_repository TARGET ${name} PROPERTY _EP_GIT_REPOSITORY) + get_property(hg_repository TARGET ${name} PROPERTY _EP_HG_REPOSITORY ) get_property(url TARGET ${name} PROPERTY _EP_URL) # TODO: Perhaps file:// should be copied to download dir before extraction. @@ -1148,6 +1212,46 @@ function(_ep_add_download_command name) set(comment "Performing download step (git clone) for '${name}'") set(cmd ${CMAKE_COMMAND} -P ${tmp_dir}/${name}-gitclone.cmake) list(APPEND depends ${stamp_dir}/${name}-gitinfo.txt) + elseif(hg_repository) + find_package(Hg) + if(NOT HG_EXECUTABLE) + message(FATAL_ERROR "error: could not find hg for clone of ${name}") + endif() + + get_property(hg_tag TARGET ${name} PROPERTY _EP_HG_TAG) + if(NOT hg_tag) + set(hg_tag "tip") + endif() + + # For the download step, and the hg clone operation, only the repository + # should be recorded in a configured RepositoryInfo file. If the repo + # changes, the clone script should be run again. But if only the tag + # changes, avoid running the clone script again. Let the 'always' running + # update step checkout the new tag. + # + set(repository ${hg_repository}) + set(module) + set(tag) + configure_file( + "${CMAKE_ROOT}/Modules/RepositoryInfo.txt.in" + "${stamp_dir}/${name}-hginfo.txt" + @ONLY + ) + + get_filename_component(src_name "${source_dir}" NAME) + get_filename_component(work_dir "${source_dir}" PATH) + + # Since hg clone doesn't succeed if the non-empty source_dir exists, + # create a cmake script to invoke as download command. + # The script will delete the source directory and then call hg clone. + # + _ep_write_hgclone_script(${tmp_dir}/${name}-hgclone.cmake ${source_dir} + ${HG_EXECUTABLE} ${hg_repository} ${hg_tag} ${src_name} ${work_dir} + ${stamp_dir}/${name}-hginfo.txt ${stamp_dir}/${name}-hgclone-lastrun.txt + ) + set(comment "Performing download step (hg clone) for '${name}'") + set(cmd ${CMAKE_COMMAND} -P ${tmp_dir}/${name}-hgclone.cmake) + list(APPEND depends ${stamp_dir}/${name}-hginfo.txt) elseif(url) get_filename_component(work_dir "${source_dir}" PATH) get_property(md5 TARGET ${name} PROPERTY _EP_URL_MD5) @@ -1196,7 +1300,7 @@ function(_ep_add_download_command name) else() _ep_is_dir_empty("${source_dir}" empty) if(${empty}) - message(SEND_ERROR "error: no download info for '${name}' -- please specify existing/non-empty SOURCE_DIR or one of URL, CVS_REPOSITORY and CVS_MODULE, SVN_REPOSITORY, GIT_REPOSITORY or DOWNLOAD_COMMAND") + message(SEND_ERROR "error: no download info for '${name}' -- please specify existing/non-empty SOURCE_DIR or one of URL, CVS_REPOSITORY and CVS_MODULE, SVN_REPOSITORY, GIT_REPOSITORY, HG_REPOSITORY or DOWNLOAD_COMMAND") endif() endif() @@ -1226,6 +1330,7 @@ function(_ep_add_update_command name) get_property(cvs_repository TARGET ${name} PROPERTY _EP_CVS_REPOSITORY) get_property(svn_repository TARGET ${name} PROPERTY _EP_SVN_REPOSITORY) get_property(git_repository TARGET ${name} PROPERTY _EP_GIT_REPOSITORY) + get_property(hg_repository TARGET ${name} PROPERTY _EP_HG_REPOSITORY ) set(work_dir) set(comment) @@ -1280,6 +1385,27 @@ function(_ep_add_update_command name) COMMAND ${GIT_EXECUTABLE} submodule update --recursive ) set(always 1) + elseif(hg_repository) + if(NOT HG_EXECUTABLE) + message(FATAL_ERROR "error: could not find hg for pull of ${name}") + endif() + set(work_dir ${source_dir}) + set(comment "Performing update step (hg pull) for '${name}'") + get_property(hg_tag TARGET ${name} PROPERTY _EP_HG_TAG) + if(NOT hg_tag) + set(hg_tag "tip") + endif() + if("${HG_VERSION_STRING}" STREQUAL "2.1") + message(WARNING "Mercurial 2.1 does not distinguish an empty pull from a failed pull: + http://mercurial.selenic.com/wiki/UpgradeNotes#A2.1.1:_revert_pull_return_code_change.2C_compile_issue_on_OS_X + http://thread.gmane.org/gmane.comp.version-control.mercurial.devel/47656 +Update to Mercurial >= 2.1.1. +") + endif() + set(cmd ${HG_EXECUTABLE} pull + COMMAND ${HG_EXECUTABLE} update ${hg_tag} + ) + set(always 1) endif() get_property(log TARGET ${name} PROPERTY _EP_LOG_UPDATE) diff --git a/Modules/FindArmadillo.cmake b/Modules/FindArmadillo.cmake index 0bd3e6c..bc0357e 100644 --- a/Modules/FindArmadillo.cmake +++ b/Modules/FindArmadillo.cmake @@ -64,7 +64,7 @@ if(ARMADILLO_INCLUDE_DIR) string(REGEX REPLACE ".*#define ARMA_VERSION_PATCH ([0-9]+).*" "\\1" ARMADILLO_VERSION_PATCH "${_armadillo_HEADER_CONTENTS}") # WARNING: The number of spaces before the version name is not one. - string(REGEX REPLACE ".*#define ARMA_VERSION_NAME\ +\"([0-9a-zA-Z\ _-]+)\".*" "\\1" ARMADILLO_VERSION_NAME "${_armadillo_HEADER_CONTENTS}") + string(REGEX REPLACE ".*#define ARMA_VERSION_NAME +\"([0-9a-zA-Z _-]+)\".*" "\\1" ARMADILLO_VERSION_NAME "${_armadillo_HEADER_CONTENTS}") unset(_armadillo_HEADER_CONTENTS) endif() diff --git a/Modules/FindCUDA.cmake b/Modules/FindCUDA.cmake index f152437..6a6be47 100644 --- a/Modules/FindCUDA.cmake +++ b/Modules/FindCUDA.cmake @@ -650,9 +650,11 @@ endif() # Look for the SDK stuff. As of CUDA 3.0 NVSDKCUDA_ROOT has been replaced with # NVSDKCOMPUTE_ROOT with the old CUDA C contents moved into the C subdirectory find_path(CUDA_SDK_ROOT_DIR common/inc/cutil.h + HINTS "$ENV{NVSDKCOMPUTE_ROOT}/C" - "$ENV{NVSDKCUDA_ROOT}" + ENV NVSDKCUDA_ROOT "[HKEY_LOCAL_MACHINE\\SOFTWARE\\NVIDIA Corporation\\Installed Products\\NVIDIA SDK 10\\Compute;InstallDir]" + PATHS "/Developer/GPU\ Computing/C" ) diff --git a/Modules/FindDart.cmake b/Modules/FindDart.cmake index 13e19be..a2b2926 100644 --- a/Modules/FindDart.cmake +++ b/Modules/FindDart.cmake @@ -17,14 +17,18 @@ # License text for the above reference.) find_path(DART_ROOT README.INSTALL - $ENV{DART_ROOT} - ${PROJECT_SOURCE_DIR}/Dart - /usr/share/Dart - C:/Dart - "$ENV{ProgramFiles}/Dart" - "C:/Program Files/Dart" - ${PROJECT_SOURCE_DIR}/../Dart - [HKEY_LOCAL_MACHINE\\SOFTWARE\\Dart\\InstallPath] + HINTS + ENV DART_ROOT + PATHS + ${PROJECT_SOURCE_DIR} + /usr/share + C:/ + "C:/Program Files" + ${PROJECT_SOURCE_DIR}/.. + [HKEY_LOCAL_MACHINE\\SOFTWARE\\Dart\\InstallPath] + ENV ProgramFiles + PATH_SUFFIXES + Dart DOC "If you have Dart installed, where is it located?" ) diff --git a/Modules/FindFLTK.cmake b/Modules/FindFLTK.cmake index a02d031..24cfb87 100644 --- a/Modules/FindFLTK.cmake +++ b/Modules/FindFLTK.cmake @@ -93,11 +93,13 @@ if(NOT FLTK_DIR) # find_path(FLTK_DIR FLTKConfig.cmake # Look for an environment variable FLTK_DIR. - $ENV{FLTK_DIR} + HINTS + ENV FLTK_DIR # Look in places relative to the system executable search path. ${FLTK_DIR_SEARCH} + PATHS # Look in standard UNIX install locations. /usr/local/lib/fltk /usr/lib/fltk diff --git a/Modules/FindFLTK2.cmake b/Modules/FindFLTK2.cmake index 3ea558c..071c318 100644 --- a/Modules/FindFLTK2.cmake +++ b/Modules/FindFLTK2.cmake @@ -73,7 +73,7 @@ if(NOT FLTK2_DIR) # find_path(FLTK2_DIR FLTK2Config.cmake # Look for an environment variable FLTK2_DIR. - $ENV{FLTK2_DIR} + ENV FLTK2_DIR # Look in places relative to the system executable search path. ${FLTK2_DIR_SEARCH} diff --git a/Modules/FindFreetype.cmake b/Modules/FindFreetype.cmake index 08b4a0d..c7cf0eb 100644 --- a/Modules/FindFreetype.cmake +++ b/Modules/FindFreetype.cmake @@ -44,7 +44,7 @@ # everything still works. find_path(FREETYPE_INCLUDE_DIR_ft2build ft2build.h HINTS - $ENV{FREETYPE_DIR} + ENV FREETYPE_DIR PATHS /usr/local/X11R6/include /usr/local/X11/include @@ -53,19 +53,19 @@ find_path(FREETYPE_INCLUDE_DIR_ft2build ft2build.h find_path(FREETYPE_INCLUDE_DIR_freetype2 freetype/config/ftheader.h HINTS - $ENV{FREETYPE_DIR}/include/freetype2 + ENV FREETYPE_DIR PATHS - /usr/local/X11R6/include - /usr/local/X11/include - /usr/freeware/include - PATH_SUFFIXES freetype2 + /usr/local/X11R6 + /usr/local/X11 + /usr/freeware + PATH_SUFFIXES include/freetype2 include ) find_library(FREETYPE_LIBRARY NAMES freetype libfreetype freetype219 HINTS - $ENV{FREETYPE_DIR} - PATH_SUFFIXES lib64 lib + ENV FREETYPE_DIR + PATH_SUFFIXES lib PATHS /usr/local/X11R6 /usr/local/X11 diff --git a/Modules/FindGDAL.cmake b/Modules/FindGDAL.cmake index 1e09b82..6e89847 100644 --- a/Modules/FindGDAL.cmake +++ b/Modules/FindGDAL.cmake @@ -42,8 +42,8 @@ find_path(GDAL_INCLUDE_DIR gdal.h HINTS - $ENV{GDAL_DIR} - $ENV{GDAL_ROOT} + ENV GDAL_DIR + ENV GDAL_ROOT PATH_SUFFIXES include/gdal include/GDAL @@ -64,8 +64,8 @@ if(UNIX) # libgdal.so... find_program(GDAL_CONFIG gdal-config HINTS - $ENV{GDAL_DIR} - $ENV{GDAL_ROOT} + ENV GDAL_DIR + ENV GDAL_ROOT PATH_SUFFIXES bin PATHS /sw # Fink @@ -88,10 +88,10 @@ endif() find_library(GDAL_LIBRARY NAMES ${_gdal_lib} gdal gdal_i gdal1.5.0 gdal1.4.0 gdal1.3.2 GDAL HINTS - $ENV{GDAL_DIR} - $ENV{GDAL_ROOT} + ENV GDAL_DIR + ENV GDAL_ROOT ${_gdal_libpath} - PATH_SUFFIXES lib64 lib + PATH_SUFFIXES lib PATHS /sw /opt/local diff --git a/Modules/FindGIF.cmake b/Modules/FindGIF.cmake index ff1d396..6a665ad 100644 --- a/Modules/FindGIF.cmake +++ b/Modules/FindGIF.cmake @@ -28,7 +28,7 @@ find_path(GIF_INCLUDE_DIR gif_lib.h HINTS - $ENV{GIF_DIR} + ENV GIF_DIR PATH_SUFFIXES include PATHS ~/Library/Frameworks @@ -41,8 +41,8 @@ set(POTENTIAL_GIF_LIBS gif libgif ungif libungif giflib giflib4) find_library(GIF_LIBRARY NAMES ${POTENTIAL_GIF_LIBS} HINTS - $ENV{GIF_DIR} - PATH_SUFFIXES lib64 lib + ENV GIF_DIR + PATH_SUFFIXES lib PATHS ~/Library/Frameworks /usr/freeware diff --git a/Modules/FindGTK.cmake b/Modules/FindGTK.cmake index 505a051..8a44ade 100644 --- a/Modules/FindGTK.cmake +++ b/Modules/FindGTK.cmake @@ -139,11 +139,7 @@ if(UNIX) ) endif() - endif(GTK_gtk_INCLUDE_PATH - AND GTK_glibconfig_INCLUDE_PATH - AND GTK_glib_INCLUDE_PATH - AND GTK_gtk_LIBRARY - AND GTK_glib_LIBRARY) + endif() mark_as_advanced( GTK_gdk_LIBRARY diff --git a/Modules/FindGTK2.cmake b/Modules/FindGTK2.cmake index 1e54cd7..49af0f2 100644 --- a/Modules/FindGTK2.cmake +++ b/Modules/FindGTK2.cmake @@ -172,7 +172,7 @@ function(_GTK2_FIND_INCLUDE_DIR _var _hdr) sigc++-2.0 ) - set(_suffixes) + set(_suffixes include lib) foreach(_d ${_relatives}) list(APPEND _suffixes ${_d}) list(APPEND _suffixes ${_d}/include) # for /usr/lib/gtk-2.0/include @@ -186,23 +186,15 @@ function(_GTK2_FIND_INCLUDE_DIR _var _hdr) find_path(${_var} ${_hdr} PATHS /usr/local/lib64 - /usr/local/lib /usr/lib64 - /usr/lib - /opt/gnome/include - /opt/gnome/lib - /opt/openwin/include - /usr/openwin/lib - /sw/include - /sw/lib - /opt/local/include - /opt/local/lib - $ENV{GTKMM_BASEPATH}/include - $ENV{GTKMM_BASEPATH}/lib - [HKEY_CURRENT_USER\\SOFTWARE\\gtkmm\\2.4;Path]/include - [HKEY_CURRENT_USER\\SOFTWARE\\gtkmm\\2.4;Path]/lib - [HKEY_LOCAL_MACHINE\\SOFTWARE\\gtkmm\\2.4;Path]/include - [HKEY_LOCAL_MACHINE\\SOFTWARE\\gtkmm\\2.4;Path]/lib + /opt/gnome + /opt/openwin + /usr/openwin + /sw + /opt/local + ENV GTKMM_BASEPATH + [HKEY_CURRENT_USER\\SOFTWARE\\gtkmm\\2.4;Path] + [HKEY_LOCAL_MACHINE\\SOFTWARE\\gtkmm\\2.4;Path] PATH_SUFFIXES ${_suffixes} ) @@ -469,6 +461,7 @@ foreach(_GTK2_component ${GTK2_FIND_COMPONENTS}) _GTK2_FIND_LIBRARY (GTK2_GTKMM_LIBRARY gtkmm true true) _GTK2_FIND_INCLUDE_DIR(GTK2_CAIROMM_INCLUDE_DIR cairomm/cairomm.h) + _GTK2_FIND_INCLUDE_DIR(GTK2_CAIROMMCONFIG_INCLUDE_DIR cairommconfig.h) _GTK2_FIND_LIBRARY (GTK2_CAIROMM_LIBRARY cairomm true true) _GTK2_FIND_INCLUDE_DIR(GTK2_PANGOMM_INCLUDE_DIR pangomm.h) diff --git a/Modules/FindGTest.cmake b/Modules/FindGTest.cmake index 6cffb5c..d531dd1 100644 --- a/Modules/FindGTest.cmake +++ b/Modules/FindGTest.cmake @@ -98,7 +98,7 @@ function(_gtest_find_library _name) find_library(${_name} NAMES ${ARGN} HINTS - $ENV{GTEST_ROOT} + ENV GTEST_ROOT ${GTEST_ROOT} PATH_SUFFIXES ${_gtest_libpath_suffixes} ) diff --git a/Modules/FindHg.cmake b/Modules/FindHg.cmake new file mode 100644 index 0000000..a6a4aef --- /dev/null +++ b/Modules/FindHg.cmake @@ -0,0 +1,48 @@ +# The module defines the following variables: +# HG_EXECUTABLE - path to mercurial command line client (hg) +# HG_FOUND - true if the command line client was found +# HG_VERSION_STRING - the version of mercurial found +# Example usage: +# find_package(Hg) +# if(HG_FOUND) +# message("hg found: ${HG_EXECUTABLE}") +# endif() + +#============================================================================= +# Copyright 2010-2012 Kitware, Inc. +# Copyright 2012 Rolf Eike Beer <eike@sf-mail.de> +# +# 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.) + +find_program(HG_EXECUTABLE + NAMES hg + PATH_SUFFIXES Mercurial + DOC "hg command line client" + ) +mark_as_advanced(HG_EXECUTABLE) + +if(HG_EXECUTABLE) + execute_process(COMMAND ${HG_EXECUTABLE} --version + OUTPUT_VARIABLE hg_version + ERROR_QUIET + OUTPUT_STRIP_TRAILING_WHITESPACE) + if(hg_version MATCHES "^Mercurial Distributed SCM \\(version ([0-9][^)]*)\\)") + set(HG_VERSION_STRING "${CMAKE_MATCH_1}") + endif() + unset(hg_version) +endif() + +# Handle the QUIETLY and REQUIRED arguments and set HG_FOUND to TRUE if +# all listed variables are TRUE +include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake) +find_package_handle_standard_args(Hg + REQUIRED_VARS HG_EXECUTABLE + VERSION_VAR HG_VERSION_STRING) diff --git a/Modules/FindLua50.cmake b/Modules/FindLua50.cmake index 2b8ee97..0276a98 100644 --- a/Modules/FindLua50.cmake +++ b/Modules/FindLua50.cmake @@ -26,7 +26,7 @@ find_path(LUA_INCLUDE_DIR lua.h HINTS - $ENV{LUA_DIR} + ENV LUA_DIR PATH_SUFFIXES include/lua50 include/lua5.0 include/lua5 include/lua include PATHS ~/Library/Frameworks @@ -40,8 +40,8 @@ find_path(LUA_INCLUDE_DIR lua.h find_library(LUA_LIBRARY_lua NAMES lua50 lua5.0 lua-5.0 lua5 lua HINTS - $ENV{LUA_DIR} - PATH_SUFFIXES lib64 lib + ENV LUA_DIR + PATH_SUFFIXES lib PATHS ~/Library/Frameworks /Library/Frameworks @@ -59,9 +59,9 @@ else() find_library(LUA_LIBRARY_lualib NAMES lualib50 lualib5.0 lualib5 lualib HINTS - $ENV{LUALIB_DIR} - $ENV{LUA_DIR} - PATH_SUFFIXES lib64 lib + ENV LUALIB_DIR + ENV LUA_DIR + PATH_SUFFIXES lib PATHS /sw /opt/local diff --git a/Modules/FindLua51.cmake b/Modules/FindLua51.cmake index b5a5471..eac25f5 100644 --- a/Modules/FindLua51.cmake +++ b/Modules/FindLua51.cmake @@ -27,7 +27,7 @@ find_path(LUA_INCLUDE_DIR lua.h HINTS - $ENV{LUA_DIR} + ENV LUA_DIR PATH_SUFFIXES include/lua51 include/lua5.1 include/lua include PATHS ~/Library/Frameworks @@ -41,8 +41,8 @@ find_path(LUA_INCLUDE_DIR lua.h find_library(LUA_LIBRARY NAMES lua51 lua5.1 lua-5.1 lua HINTS - $ENV{LUA_DIR} - PATH_SUFFIXES lib64 lib + ENV LUA_DIR + PATH_SUFFIXES lib PATHS ~/Library/Frameworks /Library/Frameworks diff --git a/Modules/FindOpenAL.cmake b/Modules/FindOpenAL.cmake index 311a11a..78fd632 100644 --- a/Modules/FindOpenAL.cmake +++ b/Modules/FindOpenAL.cmake @@ -63,7 +63,7 @@ find_path(OPENAL_INCLUDE_DIR al.h HINTS - $ENV{OPENALDIR} + ENV OPENALDIR PATH_SUFFIXES include/AL include/OpenAL include PATHS ~/Library/Frameworks @@ -78,7 +78,7 @@ find_path(OPENAL_INCLUDE_DIR al.h find_library(OPENAL_LIBRARY NAMES OpenAL al openal OpenAL32 HINTS - $ENV{OPENALDIR} + ENV OPENALDIR PATH_SUFFIXES lib64 lib libs64 libs libs/Win32 libs/Win64 PATHS ~/Library/Frameworks diff --git a/Modules/FindOpenSceneGraph.cmake b/Modules/FindOpenSceneGraph.cmake index 95912fa..1f30fe3 100644 --- a/Modules/FindOpenSceneGraph.cmake +++ b/Modules/FindOpenSceneGraph.cmake @@ -26,6 +26,10 @@ # OSGDIR # OSG_ROOT # +# [CMake 2.8.10]: +# The CMake variable OSG_DIR can now be used as well to influence detection, instead of needing +# to specify an environment variable. +# # This module defines the following output variables: # # OPENSCENEGRAPH_FOUND - Was the OSG and all of the specified components found? @@ -49,7 +53,7 @@ #============================================================================= # Copyright 2009 Kitware, Inc. -# Copyright 2009 Philip Lowman <philip@yhbt.com> +# Copyright 2009-2012 Philip Lowman <philip@yhbt.com> # # Distributed under the OSI-approved BSD License (the "License"); # see accompanying file Copyright.txt for details. diff --git a/Modules/FindOpenThreads.cmake b/Modules/FindOpenThreads.cmake index 4f6e920..e059960 100644 --- a/Modules/FindOpenThreads.cmake +++ b/Modules/FindOpenThreads.cmake @@ -15,10 +15,15 @@ # correspond to the ./configure --prefix=$OPENTHREADS_DIR # used in building osg. # +# [CMake 2.8.10]: +# The CMake variables OPENTHREADS_DIR or OSG_DIR can now be used as well to influence +# detection, instead of needing to specify an environment variable. +# # Created by Eric Wing. #============================================================================= # Copyright 2007-2009 Kitware, Inc. +# Copyright 2012 Philip Lowman <philip@yhbt.com> # # Distributed under the OSI-approved BSD License (the "License"); # see accompanying file Copyright.txt for details. @@ -53,14 +58,15 @@ find_path(OPENTHREADS_INCLUDE_DIR OpenThreads/Thread HINTS - # enough environment variables? - $ENV{OPENTHREADS_INCLUDE_DIR} - $ENV{OPENTHREADS_DIR} - $ENV{OSG_INCLUDE_DIR} - $ENV{OSG_DIR} - $ENV{OSGDIR} - $ENV{OpenThreads_ROOT} - $ENV{OSG_ROOT} + ENV OPENTHREADS_INCLUDE_DIR + ENV OPENTHREADS_DIR + ENV OSG_INCLUDE_DIR + ENV OSG_DIR + ENV OSGDIR + ENV OpenThreads_ROOT + ENV OSG_ROOT + ${OPENTHREADS_DIR} + ${OSG_DIR} PATHS /sw # Fink /opt/local # DarwinPorts @@ -74,40 +80,44 @@ find_path(OPENTHREADS_INCLUDE_DIR OpenThreads/Thread find_library(OPENTHREADS_LIBRARY NAMES OpenThreads OpenThreadsWin32 HINTS - $ENV{OPENTHREADS_LIBRARY_DIR} - $ENV{OPENTHREADS_DIR} - $ENV{OSG_LIBRARY_DIR} - $ENV{OSG_DIR} - $ENV{OSGDIR} - $ENV{OpenThreads_ROOT} - $ENV{OSG_ROOT} + ENV OPENTHREADS_LIBRARY_DIR + ENV OPENTHREADS_DIR + ENV OSG_LIBRARY_DIR + ENV OSG_DIR + ENV OSGDIR + ENV OpenThreads_ROOT + ENV OSG_ROOT + ${OPENTHREADS_DIR} + ${OSG_DIR} PATHS /sw /opt/local /opt/csw /opt /usr/freeware - PATH_SUFFIXES lib64 lib + PATH_SUFFIXES lib ) find_library(OPENTHREADS_LIBRARY_DEBUG NAMES OpenThreadsd OpenThreadsWin32d HINTS - $ENV{OPENTHREADS_DEBUG_LIBRARY_DIR} - $ENV{OPENTHREADS_LIBRARY_DIR} - $ENV{OPENTHREADS_DIR} - $ENV{OSG_LIBRARY_DIR} - $ENV{OSG_DIR} - $ENV{OSGDIR} - $ENV{OpenThreads_ROOT} - $ENV{OSG_ROOT} + ENV OPENTHREADS_DEBUG_LIBRARY_DIR + ENV OPENTHREADS_LIBRARY_DIR + ENV OPENTHREADS_DIR + ENV OSG_LIBRARY_DIR + ENV OSG_DIR + ENV OSGDIR + ENV OpenThreads_ROOT + ENV OSG_ROOT + ${OPENTHREADS_DIR} + ${OSG_DIR} PATHS /sw /opt/local /opt/csw /opt /usr/freeware - PATH_SUFFIXES lib64 lib + PATH_SUFFIXES lib ) if(OPENTHREADS_LIBRARY_DEBUG) diff --git a/Modules/FindPackageHandleStandardArgs.cmake b/Modules/FindPackageHandleStandardArgs.cmake index 449fd9f..888e109 100644 --- a/Modules/FindPackageHandleStandardArgs.cmake +++ b/Modules/FindPackageHandleStandardArgs.cmake @@ -247,7 +247,7 @@ function(FIND_PACKAGE_HANDLE_STANDARD_ARGS _NAME _FIRST_ARG) 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}\", required is \"${${_NAME}_FIND_VERSION}\")") + set(VERSION_MSG "(found suitable version \"${VERSION}\", minimum required is \"${${_NAME}_FIND_VERSION}\")") endif () endif() diff --git a/Modules/FindPhysFS.cmake b/Modules/FindPhysFS.cmake index ae78b27..a2d6abf 100644 --- a/Modules/FindPhysFS.cmake +++ b/Modules/FindPhysFS.cmake @@ -25,7 +25,7 @@ find_path(PHYSFS_INCLUDE_DIR physfs.h HINTS - $ENV{PHYSFSDIR} + ENV PHYSFSDIR PATH_SUFFIXES include/physfs include PATHS ~/Library/Frameworks @@ -39,8 +39,8 @@ find_path(PHYSFS_INCLUDE_DIR physfs.h find_library(PHYSFS_LIBRARY NAMES physfs HINTS - $ENV{PHYSFSDIR} - PATH_SUFFIXES lib64 lib + ENV PHYSFSDIR + PATH_SUFFIXES lib PATHS ~/Library/Frameworks /Library/Frameworks diff --git a/Modules/FindPostgreSQL.cmake b/Modules/FindPostgreSQL.cmake index 699cd41..b9440a8 100644 --- a/Modules/FindPostgreSQL.cmake +++ b/Modules/FindPostgreSQL.cmake @@ -74,11 +74,6 @@ set(PostgreSQL_LIBRARY_DIR_MESSAGE "Set the PostgreSQL_LIBRARY_DIR cmake cache e set(PostgreSQL_ROOT_DIR_MESSAGE "Set the PostgreSQL_ROOT system variable to where PostgreSQL is found on the machine E.g C:/Program Files/PostgreSQL/8.4") -set(PostgreSQL_ROOT_DIRECTORIES $ENV{PostgreSQL_ROOT}) -if(PostgreSQL_ROOT_DIRECTORIES) - file(TO_CMAKE_PATH ${PostgreSQL_ROOT_DIRECTORIES} PostgreSQL_ROOT_DIRECTORIES) -endif() - set(PostgreSQL_KNOWN_VERSIONS ${PostgreSQL_ADDITIONAL_VERSIONS} "9.1" "9.0" "8.4" "8.3" "8.2" "8.1" "8.0") @@ -89,7 +84,7 @@ if ( WIN32 ) endforeach() endif() set( PostgreSQL_ROOT_DIRECTORIES - ${PostgreSQL_ROOT_DIRECTORIES} + ENV PostgreSQL_ROOT ${PostgreSQL_ROOT} ${PostgreSQL_ADDITIONAL_SEARCH_PATHS} ) diff --git a/Modules/FindProducer.cmake b/Modules/FindProducer.cmake index 20266cb..3099062 100644 --- a/Modules/FindProducer.cmake +++ b/Modules/FindProducer.cmake @@ -44,9 +44,9 @@ # Try the user's environment request before anything else. find_path(PRODUCER_INCLUDE_DIR Producer/CameraGroup HINTS - $ENV{PRODUCER_DIR} - $ENV{OSG_DIR} - $ENV{OSGDIR} + ENV PRODUCER_DIR + ENV OSG_DIR + ENV OSGDIR PATH_SUFFIXES include PATHS ~/Library/Frameworks @@ -62,10 +62,10 @@ find_path(PRODUCER_INCLUDE_DIR Producer/CameraGroup find_library(PRODUCER_LIBRARY NAMES Producer HINTS - $ENV{PRODUCER_DIR} - $ENV{OSG_DIR} - $ENV{OSGDIR} - PATH_SUFFIXES lib64 lib + ENV PRODUCER_DIR + ENV OSG_DIR + ENV OSGDIR + PATH_SUFFIXES lib PATHS /sw /opt/local diff --git a/Modules/FindQt3.cmake b/Modules/FindQt3.cmake index 28af7ad..0665063 100644 --- a/Modules/FindQt3.cmake +++ b/Modules/FindQt3.cmake @@ -91,17 +91,18 @@ if (QT_MT_REQUIRED) qt-mt qt-mt${qt_version_str_lib} qt-mtnc${qt_version_str_lib} qt-mtedu${qt_version_str_lib} qt-mt230nc qt-mtnc321 qt-mt3 PATHS - "[HKEY_CURRENT_USER\\Software\\Trolltech\\Qt3Versions\\3.2.1;InstallDir]/lib" - "[HKEY_CURRENT_USER\\Software\\Trolltech\\Qt3Versions\\3.2.0;InstallDir]/lib" - "[HKEY_CURRENT_USER\\Software\\Trolltech\\Qt3Versions\\3.1.0;InstallDir]/lib" - $ENV{QTDIR}/lib - ${GLOB_PATHS_LIB} - /usr/local/qt/lib - /usr/lib/qt/lib - /usr/lib/qt3/lib - /usr/lib/qt3/lib64 - /usr/share/qt3/lib - C:/Progra~1/qt/lib + "[HKEY_CURRENT_USER\\Software\\Trolltech\\Qt3Versions\\3.2.1;InstallDir]" + "[HKEY_CURRENT_USER\\Software\\Trolltech\\Qt3Versions\\3.2.0;InstallDir]" + "[HKEY_CURRENT_USER\\Software\\Trolltech\\Qt3Versions\\3.1.0;InstallDir]" + ENV QTDIR + ${GLOB_PATHS_LIB} + /usr/local/qt + /usr/lib/qt + /usr/lib/qt3 + /usr/share/qt3 + C:/Progra~1/qt + PATH_SUFFIXES + lib ) else () @@ -111,17 +112,18 @@ else () qt-mt qt-mt${qt_version_str_lib} qt-mtnc${qt_version_str_lib} qt-mtedu${qt_version_str_lib} qt-mt230nc qt-mtnc321 qt-mt3 PATHS - "[HKEY_CURRENT_USER\\Software\\Trolltech\\Qt3Versions\\3.2.1;InstallDir]/lib" - "[HKEY_CURRENT_USER\\Software\\Trolltech\\Qt3Versions\\3.2.0;InstallDir]/lib" - "[HKEY_CURRENT_USER\\Software\\Trolltech\\Qt3Versions\\3.1.0;InstallDir]/lib" - $ENV{QTDIR}/lib - ${GLOB_PATHS_LIB} - /usr/local/qt/lib - /usr/lib/qt/lib - /usr/lib/qt3/lib - /usr/lib/qt3/lib64 - /usr/share/qt3/lib - C:/Progra~1/qt/lib + "[HKEY_CURRENT_USER\\Software\\Trolltech\\Qt3Versions\\3.2.1;InstallDir]" + "[HKEY_CURRENT_USER\\Software\\Trolltech\\Qt3Versions\\3.2.0;InstallDir]" + "[HKEY_CURRENT_USER\\Software\\Trolltech\\Qt3Versions\\3.1.0;InstallDir]" + ENV QTDIR + ${GLOB_PATHS_LIB} + /usr/local/qt + /usr/lib/qt + /usr/lib/qt3 + /usr/share/qt3 + C:/Progra~1/qt/lib + PATH_SUFFIXES + lib ) endif () @@ -129,35 +131,37 @@ endif () find_library(QT_QASSISTANTCLIENT_LIBRARY NAMES qassistantclient PATHS - "[HKEY_CURRENT_USER\\Software\\Trolltech\\Qt3Versions\\3.2.1;InstallDir]/lib" - "[HKEY_CURRENT_USER\\Software\\Trolltech\\Qt3Versions\\3.2.0;InstallDir]/lib" - "[HKEY_CURRENT_USER\\Software\\Trolltech\\Qt3Versions\\3.1.0;InstallDir]/lib" - $ENV{QTDIR}/lib - ${GLOB_PATHS_LIB} - /usr/local/qt/lib - /usr/lib/qt3/lib - /usr/lib/qt3/lib64 - /usr/share/qt3/lib - C:/Progra~1/qt/lib + "[HKEY_CURRENT_USER\\Software\\Trolltech\\Qt3Versions\\3.2.1;InstallDir]" + "[HKEY_CURRENT_USER\\Software\\Trolltech\\Qt3Versions\\3.2.0;InstallDir]" + "[HKEY_CURRENT_USER\\Software\\Trolltech\\Qt3Versions\\3.1.0;InstallDir]" + ENV QTDIR + ${GLOB_PATHS_LIB} + /usr/local/qt + /usr/lib/qt3 + /usr/share/qt3 + C:/Progra~1/qt + PATH_SUFFIXES + lib ) # qt 3 should prefer QTDIR over the PATH find_program(QT_MOC_EXECUTABLE NAMES moc-qt3 moc HINTS - $ENV{QTDIR}/bin + ENV QTDIR PATHS "[HKEY_CURRENT_USER\\Software\\Trolltech\\Qt3Versions\\3.2.1;InstallDir]/include/Qt" "[HKEY_CURRENT_USER\\Software\\Trolltech\\Qt3Versions\\3.2.0;InstallDir]/include/Qt" "[HKEY_CURRENT_USER\\Software\\Trolltech\\Qt3Versions\\3.1.0;InstallDir]/include/Qt" - $ENV{QTDIR}/bin ${GLOB_PATHS_BIN} - /usr/local/qt/bin - /usr/lib/qt/bin - /usr/lib/qt3/bin - /usr/share/qt3/bin - C:/Progra~1/qt/bin - /usr/X11R6/bin + /usr/local/qt + /usr/lib/qt + /usr/lib/qt3 + /usr/share/qt3 + C:/Progra~1/qt + /usr/X11R6 + PATH_SUFFIXES + bin ) if(QT_MOC_EXECUTABLE) @@ -168,18 +172,20 @@ endif() find_program(QT_UIC_EXECUTABLE NAMES uic-qt3 uic HINTS - $ENV{QTDIR}/bin + ENV QTDIR PATHS "[HKEY_CURRENT_USER\\Software\\Trolltech\\Qt3Versions\\3.2.1;InstallDir]/include/Qt" "[HKEY_CURRENT_USER\\Software\\Trolltech\\Qt3Versions\\3.2.0;InstallDir]/include/Qt" "[HKEY_CURRENT_USER\\Software\\Trolltech\\Qt3Versions\\3.1.0;InstallDir]/include/Qt" ${GLOB_PATHS_BIN} - /usr/local/qt/bin - /usr/lib/qt/bin - /usr/lib/qt3/bin - /usr/share/qt3/bin - C:/Progra~1/qt/bin - /usr/X11R6/bin + /usr/local/qt + /usr/lib/qt + /usr/lib/qt3 + /usr/share/qt3 + C:/Progra~1/qt + /usr/X11R6 + PATH_SUFFIXES + bin ) if(QT_UIC_EXECUTABLE) @@ -189,13 +195,15 @@ endif() if (WIN32) find_library(QT_QTMAIN_LIBRARY qtmain HINTS - $ENV{QTDIR}/lib - "[HKEY_CURRENT_USER\\Software\\Trolltech\\Qt3Versions\\3.2.1;InstallDir]/lib" - "[HKEY_CURRENT_USER\\Software\\Trolltech\\Qt3Versions\\3.2.0;InstallDir]/lib" - "[HKEY_CURRENT_USER\\Software\\Trolltech\\Qt3Versions\\3.1.0;InstallDir]/lib" + ENV QTDIR + "[HKEY_CURRENT_USER\\Software\\Trolltech\\Qt3Versions\\3.2.1;InstallDir]" + "[HKEY_CURRENT_USER\\Software\\Trolltech\\Qt3Versions\\3.2.0;InstallDir]" + "[HKEY_CURRENT_USER\\Software\\Trolltech\\Qt3Versions\\3.1.0;InstallDir]" PATHS - "$ENV{ProgramFiles}/qt/lib" - "C:/Program Files/qt/lib" + "$ENV{ProgramFiles}/qt" + "C:/Program Files/qt" + PATH_SUFFIXES + lib DOC "This Library is only needed by and included with Qt3 on MSWindows. It should be NOTFOUND, undefined or IGNORE otherwise." ) endif () diff --git a/Modules/FindQt4.cmake b/Modules/FindQt4.cmake index e7d25c9..6886d93 100644 --- a/Modules/FindQt4.cmake +++ b/Modules/FindQt4.cmake @@ -486,11 +486,11 @@ get_filename_component(qt_install_version "[HKEY_CURRENT_USER\\Software\\trollte # check for qmake # Debian uses qmake-qt4 # macports' Qt uses qmake-mac -find_program(QT_QMAKE_EXECUTABLE NAMES qmake qmake4 qmake-qt4 qmake-mac PATHS - "[HKEY_CURRENT_USER\\Software\\Trolltech\\Qt3Versions\\4.0.0;InstallDir]/bin" - "[HKEY_CURRENT_USER\\Software\\Trolltech\\Versions\\4.0.0;InstallDir]/bin" - "[HKEY_CURRENT_USER\\Software\\Trolltech\\Versions\\${qt_install_version};InstallDir]/bin" - $ENV{QTDIR}/bin +find_program(QT_QMAKE_EXECUTABLE NAMES qmake qmake4 qmake-qt4 qmake-mac + PATHS + ENV QTDIR + "[HKEY_CURRENT_USER\\Software\\Trolltech\\Versions\\${qt_install_version};InstallDir]" + PATH_SUFFIXES bin DOC "The qmake executable for the Qt installation to use" ) @@ -1149,7 +1149,7 @@ if (QT_QMAKE_EXECUTABLE AND QTVERSION) # set version variables string(REGEX REPLACE "^([0-9]+)\\.[0-9]+\\.[0-9]+.*" "\\1" QT_VERSION_MAJOR "${QTVERSION}") - string(REGEX REPLACE "^[0-9]+\\.([0-9])+\\.[0-9]+.*" "\\1" QT_VERSION_MINOR "${QTVERSION}") + string(REGEX REPLACE "^[0-9]+\\.([0-9]+)\\.[0-9]+.*" "\\1" QT_VERSION_MINOR "${QTVERSION}") string(REGEX REPLACE "^[0-9]+\\.[0-9]+\\.([0-9]+).*" "\\1" QT_VERSION_PATCH "${QTVERSION}") endif() diff --git a/Modules/FindQuickTime.cmake b/Modules/FindQuickTime.cmake index 57de737..42a0dce 100644 --- a/Modules/FindQuickTime.cmake +++ b/Modules/FindQuickTime.cmake @@ -22,24 +22,18 @@ # (To distribute this file outside of CMake, substitute the full # License text for the above reference.) -# QuickTime on OS X looks different than QuickTime for Windows, -# so I am going to case the two. - -if(APPLE) - find_path(QUICKTIME_INCLUDE_DIR QuickTime/QuickTime.h) - find_library(QUICKTIME_LIBRARY QuickTime) -else() - find_path(QUICKTIME_INCLUDE_DIR QuickTime.h - HINTS - $ENV{QUICKTIME_DIR}/include - $ENV{QUICKTIME_DIR} - ) - find_library(QUICKTIME_LIBRARY QuickTime - HINTS - $ENV{QUICKTIME_DIR}/lib - $ENV{QUICKTIME_DIR} - ) -endif() +find_path(QUICKTIME_INCLUDE_DIR QuickTime/QuickTime.h QuickTime.h + HINTS + ENV QUICKTIME_DIR + PATH_SUFFIXES + include +) +find_library(QUICKTIME_LIBRARY QuickTime + HINTS + ENV QUICKTIME_DIR + PATH_SUFFIXES + lib +) # handle the QUIETLY and REQUIRED arguments and set QUICKTIME_FOUND to TRUE if # all listed variables are TRUE diff --git a/Modules/FindRTI.cmake b/Modules/FindRTI.cmake index eef0dae..60990b7 100644 --- a/Modules/FindRTI.cmake +++ b/Modules/FindRTI.cmake @@ -35,18 +35,13 @@ macro(RTI_MESSAGE_QUIETLY QUIET TYPE MSG) endif() endmacro() -# Detect the CERTI installation, http://www.cert.fr/CERTI -if ("$ENV{CERTI_HOME}" STRGREATER "") - file(TO_CMAKE_PATH "$ENV{CERTI_HOME}" CERTI_HOME) - RTI_MESSAGE_QUIETLY(RTI_FIND_QUIETLY STATUS "Using environment defined CERTI_HOME: ${CERTI_HOME}") -endif () - set(RTI_DEFINITIONS "-DRTI_USES_STD_FSTREAM") +# Detect the CERTI installation, http://www.cert.fr/CERTI # Detect the MAK Technologies RTI installation, http://www.mak.com/products/rti.php # note: the following list is ordered to find the most recent version first set(RTI_POSSIBLE_DIRS - ${CERTI_HOME} + ENV CERTI_HOME "[HKEY_LOCAL_MACHINE\\SOFTWARE\\MAK Technologies\\MAK RTI 3.2 MSVC++ 8.0;Location]" "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\MAK RTI 3.2-win32-msvc++8.0;InstallLocation]" "[HKEY_LOCAL_MACHINE\\SOFTWARE\\MAK Technologies\\MAK RTI 2.2;Location]" diff --git a/Modules/FindSDL.cmake b/Modules/FindSDL.cmake index 806b659..487c5d3 100644 --- a/Modules/FindSDL.cmake +++ b/Modules/FindSDL.cmake @@ -67,7 +67,7 @@ find_path(SDL_INCLUDE_DIR SDL.h HINTS - $ENV{SDLDIR} + ENV SDLDIR PATH_SUFFIXES include/SDL include PATHS ~/Library/Frameworks @@ -87,8 +87,8 @@ find_path(SDL_INCLUDE_DIR SDL.h find_library(SDL_LIBRARY_TEMP NAMES SDL SDL-1.1 HINTS - $ENV{SDLDIR} - PATH_SUFFIXES lib64 lib + ENV SDLDIR + PATH_SUFFIXES lib PATHS /sw /opt/local @@ -105,8 +105,8 @@ if(NOT SDL_BUILDING_LIBRARY) find_library(SDLMAIN_LIBRARY NAMES SDLmain SDLmain-1.1 HINTS - $ENV{SDLDIR} - PATH_SUFFIXES lib64 lib + ENV SDLDIR + PATH_SUFFIXES lib PATHS /sw /opt/local diff --git a/Modules/FindSDL_image.cmake b/Modules/FindSDL_image.cmake index 3c1f7a0..8c9e891 100644 --- a/Modules/FindSDL_image.cmake +++ b/Modules/FindSDL_image.cmake @@ -27,34 +27,28 @@ find_path(SDLIMAGE_INCLUDE_DIR SDL_image.h HINTS - $ENV{SDLIMAGEDIR} - $ENV{SDLDIR} - PATH_SUFFIXES include + ENV SDLIMAGEDIR + ENV SDLDIR + PATH_SUFFIXES include include/SDL PATHS ~/Library/Frameworks /Library/Frameworks - /usr/local/include/SDL - /usr/include/SDL /usr/local/include/SDL12 /usr/local/include/SDL11 # FreeBSD ports /usr/include/SDL12 /usr/include/SDL11 - /sw/include/SDL # Fink - /sw/include - /opt/local/include/SDL # DarwinPorts - /opt/local/include - /opt/csw/include/SDL # Blastwave - /opt/csw/include - /opt/include/SDL - /opt/include + /sw # Fink + /opt/local # DarwinPorts + /opt/csw # Blastwave + /opt ) find_library(SDLIMAGE_LIBRARY NAMES SDL_image HINTS - $ENV{SDLIMAGEDIR} - $ENV{SDLDIR} - PATH_SUFFIXES lib64 lib + ENV SDLIMAGEDIR + ENV SDLDIR + PATH_SUFFIXES lib PATHS ~/Library/Frameworks /Library/Frameworks diff --git a/Modules/FindSDL_mixer.cmake b/Modules/FindSDL_mixer.cmake index ed333ee..97a8330 100644 --- a/Modules/FindSDL_mixer.cmake +++ b/Modules/FindSDL_mixer.cmake @@ -27,34 +27,28 @@ find_path(SDLMIXER_INCLUDE_DIR SDL_mixer.h HINTS - $ENV{SDLMIXERDIR} - $ENV{SDLDIR} - PATH_SUFFIXES include + ENV SDLMIXERDIR + ENV SDLDIR + PATH_SUFFIXES include include/SDL PATHS ~/Library/Frameworks /Library/Frameworks - /usr/local/include/SDL - /usr/include/SDL /usr/local/include/SDL12 /usr/local/include/SDL11 # FreeBSD ports /usr/include/SDL12 /usr/include/SDL11 - /sw/include/SDL # Fink - /sw/include - /opt/local/include/SDL # DarwinPorts - /opt/local/include - /opt/csw/include/SDL # Blastwave - /opt/csw/include - /opt/include/SDL - /opt/include + /sw # Fink + /opt/local # DarwinPorts + /opt/csw # Blastwave + /opt ) find_library(SDLMIXER_LIBRARY NAMES SDL_mixer HINTS - $ENV{SDLMIXERDIR} - $ENV{SDLDIR} - PATH_SUFFIXES lib64 lib + ENV SDLMIXERDIR + ENV SDLDIR + PATH_SUFFIXES lib PATHS ~/Library/Frameworks /Library/Frameworks diff --git a/Modules/FindSDL_net.cmake b/Modules/FindSDL_net.cmake index dcab3fd..7e90e90 100644 --- a/Modules/FindSDL_net.cmake +++ b/Modules/FindSDL_net.cmake @@ -27,33 +27,27 @@ find_path(SDLNET_INCLUDE_DIR SDL_net.h HINTS - $ENV{SDLNETDIR} - $ENV{SDLDIR} - PATH_SUFFIXES include + ENV SDLNETDIR + ENV SDLDIR + PATH_SUFFIXES include include/SDL PATHS ~/Library/Frameworks /Library/Frameworks - /usr/local/include/SDL - /usr/include/SDL /usr/local/include/SDL12 /usr/local/include/SDL11 # FreeBSD ports /usr/include/SDL12 /usr/include/SDL11 - /sw/include/SDL # Fink - /sw/include - /opt/local/include/SDL # DarwinPorts - /opt/local/include - /opt/csw/include/SDL # Blastwave - /opt/csw/include - /opt/include/SDL - /opt/include + /sw # Fink + /opt/local # DarwinPorts + /opt/csw # Blastwave + /opt ) find_library(SDLNET_LIBRARY NAMES SDL_net HINTS - $ENV{SDLNETDIR} - $ENV{SDLDIR} - PATH_SUFFIXES lib64 lib + ENV SDLNETDIR + ENV SDLDIR + PATH_SUFFIXES lib PATHS ~/Library/Frameworks /Library/Frameworks diff --git a/Modules/FindSDL_sound.cmake b/Modules/FindSDL_sound.cmake index 3685956..a9153c1 100644 --- a/Modules/FindSDL_sound.cmake +++ b/Modules/FindSDL_sound.cmake @@ -75,39 +75,33 @@ mark_as_advanced(SDL_SOUND_EXTRAS) # Find SDL_sound.h find_path(SDL_SOUND_INCLUDE_DIR SDL_sound.h HINTS - $ENV{SDLSOUNDDIR}/include - $ENV{SDLSOUNDDIR} - $ENV{SDLDIR}/include - $ENV{SDLDIR} + ENV SDLSOUNDDIR + ENV SDLDIR + PATH_SUFFIXES + include include/SDL PATHS - /usr/local/include/SDL - /usr/include/SDL /usr/local/include/SDL12 /usr/local/include/SDL11 # FreeBSD ports /usr/include/SDL12 /usr/include/SDL11 - /sw/include/SDL # Fink - /sw/include - /opt/local/include/SDL # DarwinPorts - /opt/local/include - /opt/csw/include/SDL # Blastwave - /opt/csw/include - /opt/include/SDL - /opt/include + /sw # Fink + /opt/local # DarwinPorts + /opt/csw # Blastwave + /opt ) find_library(SDL_SOUND_LIBRARY NAMES SDL_sound HINTS - $ENV{SDLSOUNDDIR}/lib - $ENV{SDLSOUNDDIR} - $ENV{SDLDIR}/lib - $ENV{SDLDIR} + ENV SDLSOUNDDIR + ENV SDLDIR + PATH_SUFFIXES + lib PATHS - /sw/lib - /opt/local/lib - /opt/csw/lib - /opt/lib + /sw + /opt/local + /opt/csw + /opt ) if(SDL_FOUND AND SDL_SOUND_INCLUDE_DIR AND SDL_SOUND_LIBRARY) @@ -212,37 +206,35 @@ if(SDL_FOUND AND SDL_SOUND_INCLUDE_DIR AND SDL_SOUND_LIBRARY) find_library(MIKMOD_LIBRARY NAMES libmikmod-coreaudio mikmod PATHS - $ENV{MIKMODDIR}/lib - $ENV{MIKMODDIR} - $ENV{SDLSOUNDDIR}/lib - $ENV{SDLSOUNDDIR} - $ENV{SDLDIR}/lib - $ENV{SDLDIR} - /sw/lib - /opt/local/lib - /opt/csw/lib - /opt/lib + ENV MIKMODDIR + ENV SDLSOUNDDIR + ENV SDLDIR + /sw + /opt/local + /opt/csw + /opt + PATH_SUFFIXES + lib ) if(MIKMOD_LIBRARY) set(SDL_SOUND_LIBRARIES_TMP ${SDL_SOUND_LIBRARIES_TMP} ${MIKMOD_LIBRARY}) - endif() - endif() + endif(MIKMOD_LIBRARY) + endif("${MY_OUTPUT}" MATCHES "MikMod_") # Find ModPlug if("${MY_OUTPUT}" MATCHES "MODPLUG_") find_library(MODPLUG_LIBRARY NAMES modplug PATHS - $ENV{MODPLUGDIR}/lib - $ENV{MODPLUGDIR} - $ENV{SDLSOUNDDIR}/lib - $ENV{SDLSOUNDDIR} - $ENV{SDLDIR}/lib - $ENV{SDLDIR} - /sw/lib - /opt/local/lib - /opt/csw/lib - /opt/lib + ENV MODPLUGDIR + ENV SDLSOUNDDIR + ENV SDLDIR + /sw + /opt/local + /opt/csw + /opt + PATH_SUFFIXES + lib ) if(MODPLUG_LIBRARY) set(SDL_SOUND_LIBRARIES_TMP ${SDL_SOUND_LIBRARIES_TMP} ${MODPLUG_LIBRARY}) @@ -255,18 +247,16 @@ if(SDL_FOUND AND SDL_SOUND_INCLUDE_DIR AND SDL_SOUND_LIBRARY) find_library(VORBIS_LIBRARY NAMES vorbis Vorbis VORBIS PATHS - $ENV{VORBISDIR}/lib - $ENV{VORBISDIR} - $ENV{OGGDIR}/lib - $ENV{OGGDIR} - $ENV{SDLSOUNDDIR}/lib - $ENV{SDLSOUNDDIR} - $ENV{SDLDIR}/lib - $ENV{SDLDIR} - /sw/lib - /opt/local/lib - /opt/csw/lib - /opt/lib + ENV VORBISDIR + ENV OGGDIR + ENV SDLSOUNDDIR + ENV SDLDIR + /sw + /opt/local + /opt/csw + /opt + PATH_SUFFIXES + lib ) if(VORBIS_LIBRARY) set(SDL_SOUND_LIBRARIES_TMP ${SDL_SOUND_LIBRARIES_TMP} ${VORBIS_LIBRARY}) @@ -275,18 +265,16 @@ if(SDL_FOUND AND SDL_SOUND_INCLUDE_DIR AND SDL_SOUND_LIBRARY) find_library(OGG_LIBRARY NAMES ogg Ogg OGG PATHS - $ENV{OGGDIR}/lib - $ENV{OGGDIR} - $ENV{VORBISDIR}/lib - $ENV{VORBISDIR} - $ENV{SDLSOUNDDIR}/lib - $ENV{SDLSOUNDDIR} - $ENV{SDLDIR}/lib - $ENV{SDLDIR} - /sw/lib - /opt/local/lib - /opt/csw/lib - /opt/lib + ENV OGGDIR + ENV VORBISDIR + ENV SDLSOUNDDIR + ENV SDLDIR + /sw + /opt/local + /opt/csw + /opt + PATH_SUFFIXES + lib ) if(OGG_LIBRARY) set(SDL_SOUND_LIBRARIES_TMP ${SDL_SOUND_LIBRARIES_TMP} ${OGG_LIBRARY}) @@ -299,16 +287,15 @@ if(SDL_FOUND AND SDL_SOUND_INCLUDE_DIR AND SDL_SOUND_LIBRARY) find_library(SMPEG_LIBRARY NAMES smpeg SMPEG Smpeg SMpeg PATHS - $ENV{SMPEGDIR}/lib - $ENV{SMPEGDIR} - $ENV{SDLSOUNDDIR}/lib - $ENV{SDLSOUNDDIR} - $ENV{SDLDIR}/lib - $ENV{SDLDIR} - /sw/lib - /opt/local/lib - /opt/csw/lib - /opt/lib + ENV SMPEGDIR + ENV SDLSOUNDDIR + ENV SDLDIR + /sw + /opt/local + /opt/csw + /opt + PATH_SUFFIXES + lib ) if(SMPEG_LIBRARY) set(SDL_SOUND_LIBRARIES_TMP ${SDL_SOUND_LIBRARIES_TMP} ${SMPEG_LIBRARY}) @@ -321,16 +308,15 @@ if(SDL_FOUND AND SDL_SOUND_INCLUDE_DIR AND SDL_SOUND_LIBRARY) find_library(FLAC_LIBRARY NAMES flac FLAC PATHS - $ENV{FLACDIR}/lib - $ENV{FLACDIR} - $ENV{SDLSOUNDDIR}/lib - $ENV{SDLSOUNDDIR} - $ENV{SDLDIR}/lib - $ENV{SDLDIR} - /sw/lib - /opt/local/lib - /opt/csw/lib - /opt/lib + ENV FLACDIR + ENV SDLSOUNDDIR + ENV SDLDIR + /sw + /opt/local + /opt/csw + /opt + PATH_SUFFIXES + lib ) if(FLAC_LIBRARY) set(SDL_SOUND_LIBRARIES_TMP ${SDL_SOUND_LIBRARIES_TMP} ${FLAC_LIBRARY}) @@ -346,16 +332,15 @@ if(SDL_FOUND AND SDL_SOUND_INCLUDE_DIR AND SDL_SOUND_LIBRARY) find_library(SPEEX_LIBRARY NAMES speex SPEEX PATHS - $ENV{SPEEXDIR}/lib - $ENV{SPEEXDIR} - $ENV{SDLSOUNDDIR}/lib - $ENV{SDLSOUNDDIR} - $ENV{SDLDIR}/lib - $ENV{SDLDIR} - /sw/lib - /opt/local/lib - /opt/csw/lib - /opt/lib + ENV SPEEXDIR + ENV SDLSOUNDDIR + ENV SDLDIR + /sw + /opt/local + /opt/csw + /opt + PATH_SUFFIXES + lib ) if(SPEEX_LIBRARY) set(SDL_SOUND_LIBRARIES_TMP ${SDL_SOUND_LIBRARIES_TMP} ${SPEEX_LIBRARY}) @@ -367,20 +352,16 @@ if(SDL_FOUND AND SDL_SOUND_INCLUDE_DIR AND SDL_SOUND_LIBRARY) find_library(OGG_LIBRARY NAMES ogg Ogg OGG PATHS - $ENV{OGGDIR}/lib - $ENV{OGGDIR} - $ENV{VORBISDIR}/lib - $ENV{VORBISDIR} - $ENV{SPEEXDIR}/lib - $ENV{SPEEXDIR} - $ENV{SDLSOUNDDIR}/lib - $ENV{SDLSOUNDDIR} - $ENV{SDLDIR}/lib - $ENV{SDLDIR} - /sw/lib - /opt/local/lib - /opt/csw/lib - /opt/lib + ENV OGGDIR + ENV VORBISDIR + ENV SPEEXDIR + ENV SDLSOUNDDIR + ENV SDLDIR + /sw + /opt/local + /opt/csw + /opt + PATH_SUFFIXES lib ) if(OGG_LIBRARY) set(SDL_SOUND_LIBRARIES_TMP ${SDL_SOUND_LIBRARIES_TMP} ${OGG_LIBRARY}) diff --git a/Modules/FindSDL_ttf.cmake b/Modules/FindSDL_ttf.cmake index 6f238e6..1e68ccf 100644 --- a/Modules/FindSDL_ttf.cmake +++ b/Modules/FindSDL_ttf.cmake @@ -27,33 +27,27 @@ find_path(SDLTTF_INCLUDE_DIR SDL_ttf.h HINTS - $ENV{SDLTTFDIR} - $ENV{SDLDIR} - PATH_SUFFIXES include + ENV SDLTTFDIR + ENV SDLDIR + PATH_SUFFIXES include include/SDL PATHS ~/Library/Frameworks /Library/Frameworks - /usr/local/include/SDL - /usr/include/SDL /usr/local/include/SDL12 /usr/local/include/SDL11 # FreeBSD ports /usr/include/SDL12 /usr/include/SDL11 - /sw/include/SDL # Fink - /sw/include - /opt/local/include/SDL # DarwinPorts - /opt/local/include - /opt/csw/include/SDL # Blastwave - /opt/csw/include - /opt/include/SDL - /opt/include + /sw # Fink + /opt/local # DarwinPorts + /opt/csw # Blastwave + /opt ) find_library(SDLTTF_LIBRARY NAMES SDL_ttf HINTS - $ENV{SDLTTFDIR} - $ENV{SDLDIR} + ENV SDLTTFDIR + ENV SDLDIR PATHS ~/Library/Frameworks /Library/Frameworks @@ -61,7 +55,7 @@ find_library(SDLTTF_LIBRARY /opt/local /opt/csw /opt - PATH_SUFFIXES lib64 lib + PATH_SUFFIXES lib ) include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake) diff --git a/Modules/FindSquish.cmake b/Modules/FindSquish.cmake index b44ba70..a032496 100644 --- a/Modules/FindSquish.cmake +++ b/Modules/FindSquish.cmake @@ -54,8 +54,9 @@ if(NOT SQUISH_INSTALL_DIR) # Look for an installation find_path(SQUISH_INSTALL_DIR bin/squishrunner + HINTS # Look for an environment variable SQUISH_INSTALL_DIR. - $ENV{SQUISH_INSTALL_DIR} + ENV SQUISH_INSTALL_DIR # Look in places relative to the system executable search path. ${SQUISH_INSTALL_DIR_SEARCH} diff --git a/Modules/FindVTK.cmake b/Modules/FindVTK.cmake index b60845d..fa090ff 100644 --- a/Modules/FindVTK.cmake +++ b/Modules/FindVTK.cmake @@ -90,7 +90,7 @@ if(_VTK_40_ALLOW AND NOT VTK_DIR) find_path(VTK_DIR NAMES UseVTK.cmake PATH_SUFFIXES vtk-4.0 vtk - HINTS $ENV{VTK_DIR} + HINTS ENV VTK_DIR PATHS diff --git a/Modules/FindX11.cmake b/Modules/FindX11.cmake index 0b63bc9..e12dc0a 100644 --- a/Modules/FindX11.cmake +++ b/Modules/FindX11.cmake @@ -324,6 +324,11 @@ if (UNIX) set(X11_SM_FOUND TRUE) endif() + # Most of the X11 headers will be in the same directories, avoid + # creating a huge list of duplicates. + if (X11_INCLUDE_DIR) + list(REMOVE_DUPLICATES X11_INCLUDE_DIR) + endif () # Deprecated variable for backwards compatibility with CMake 1.4 if (X11_X11_INCLUDE_PATH AND X11_LIBRARIES) diff --git a/Modules/Findosg_functions.cmake b/Modules/Findosg_functions.cmake index 30c0876..2e90837 100644 --- a/Modules/Findosg_functions.cmake +++ b/Modules/Findosg_functions.cmake @@ -1,11 +1,12 @@ # # This CMake file contains two macros to assist with searching for OSG -# libraries and nodekits. +# libraries and nodekits. Please see FindOpenSceneGraph.cmake for full +# documentation. # #============================================================================= # Copyright 2009 Kitware, Inc. -# Copyright 2009 Philip Lowman <philip@yhbt.com> +# Copyright 2009-2012 Philip Lowman <philip@yhbt.com> # # Distributed under the OSI-approved BSD License (the "License"); # see accompanying file Copyright.txt for details. @@ -26,10 +27,12 @@ function(OSG_FIND_PATH module header) # Try the user's environment request before anything else. find_path(${module_uc}_INCLUDE_DIR ${header} HINTS - $ENV{${module_uc}_DIR} - $ENV{OSG_DIR} - $ENV{OSGDIR} - $ENV{OSG_ROOT} + ENV ${module_uc}_DIR + ENV OSG_DIR + ENV OSGDIR + ENV OSG_ROOT + ${${module_uc}_DIR} + ${OSG_DIR} PATH_SUFFIXES include PATHS /sw # Fink @@ -50,11 +53,13 @@ function(OSG_FIND_LIBRARY module library) find_library(${module_uc}_LIBRARY NAMES ${library} HINTS - $ENV{${module_uc}_DIR} - $ENV{OSG_DIR} - $ENV{OSGDIR} - $ENV{OSG_ROOT} - PATH_SUFFIXES lib64 lib + ENV ${module_uc}_DIR + ENV OSG_DIR + ENV OSGDIR + ENV OSG_ROOT + ${${module_uc}_DIR} + ${OSG_DIR} + PATH_SUFFIXES lib PATHS /sw # Fink /opt/local # DarwinPorts @@ -66,11 +71,13 @@ function(OSG_FIND_LIBRARY module library) find_library(${module_uc}_LIBRARY_DEBUG NAMES ${library}d HINTS - $ENV{${module_uc}_DIR} - $ENV{OSG_DIR} - $ENV{OSGDIR} - $ENV{OSG_ROOT} - PATH_SUFFIXES lib64 lib + ENV ${module_uc}_DIR + ENV OSG_DIR + ENV OSGDIR + ENV OSG_ROOT + ${${module_uc}_DIR} + ${OSG_DIR} + PATH_SUFFIXES lib PATHS /sw # Fink /opt/local # DarwinPorts diff --git a/Modules/FindwxWidgets.cmake b/Modules/FindwxWidgets.cmake index c186eb5..218d476 100644 --- a/Modules/FindwxWidgets.cmake +++ b/Modules/FindwxWidgets.cmake @@ -421,12 +421,12 @@ if(wxWidgets_FIND_STYLE STREQUAL "win32") find_path(wxWidgets_ROOT_DIR NAMES include/wx/wx.h PATHS - $ENV{wxWidgets_ROOT_DIR} - $ENV{WXWIN} + ENV wxWidgets_ROOT_DIR + ENV WXWIN "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\wxWidgets_is1;Inno Setup: App Path]" # WX 2.6.x C:/ D:/ - $ENV{ProgramFiles} + ENV ProgramFiles PATH_SUFFIXES wxWidgets-2.9.4 wxWidgets-2.9.3 diff --git a/Modules/FindwxWindows.cmake b/Modules/FindwxWindows.cmake index 06db751..5030bcc 100644 --- a/Modules/FindwxWindows.cmake +++ b/Modules/FindwxWindows.cmake @@ -106,18 +106,6 @@ if(WIN32_STYLE_FIND) ## fix the root dir to avoid mixing of headers/libs from different ## versions/builds: - set (WXWINDOWS_POSSIBLE_ROOT_PATHS - $ENV{WXWIN} - "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\wxWidgets_is1;Inno Setup: App Path]" ## WX 2.6.x - "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\wxWindows_is1;Inno Setup: App Path]" ## WX 2.4.x - C:\\wxWidgets-2.6.2 - D:\\wxWidgets-2.6.2 - C:\\wxWidgets-2.6.1 - D:\\wxWidgets-2.6.1 - C:\\wxWindows-2.4.2 - D:\\wxWindows-2.4.2 - ) - ## WX supports monolithic and multiple smaller libs (since 2.5.x), we prefer monolithic for now. ## monolithic = WX is built as a single big library ## e.g. compile on WIN32 as "nmake -f makefile.vc MONOLITHIC=1 BUILD=debug SHARED=0 USE_OPENGL=1" (JW) @@ -132,7 +120,18 @@ if(WIN32_STYLE_FIND) ## avoid mixing of headers and libs between multiple installed WX versions, ## select just one tree here: find_path(WXWINDOWS_ROOT_DIR include/wx/wx.h - ${WXWINDOWS_POSSIBLE_ROOT_PATHS} ) + HINTS + ENV WXWIN + "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\wxWidgets_is1;Inno Setup: App Path]" ## WX 2.6.x + "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\wxWindows_is1;Inno Setup: App Path]" ## WX 2.4.x + PATHS + C:/wxWidgets-2.6.2 + D:/wxWidgets-2.6.2 + C:/wxWidgets-2.6.1 + D:/wxWidgets-2.6.1 + C:/wxWindows-2.4.2 + D:/wxWindows-2.4.2 + ) # message("DBG found WXWINDOWS_ROOT_DIR: ${WXWINDOWS_ROOT_DIR}") @@ -600,8 +599,10 @@ else() # wx-config should be in your path anyhow, usually no need to set WXWIN or # search in ../wx or ../../wx find_program(CMAKE_WXWINDOWS_WXCONFIG_EXECUTABLE wx-config - $ENV{WXWIN} - $ENV{WXWIN}/bin + HINTS + ENV WXWIN + $ENV{WXWIN}/bin + PATHS ../wx/bin ../../wx/bin ) diff --git a/Modules/GetPrerequisites.cmake b/Modules/GetPrerequisites.cmake index e51055f..8f2754e 100644 --- a/Modules/GetPrerequisites.cmake +++ b/Modules/GetPrerequisites.cmake @@ -168,6 +168,7 @@ function(is_file_executable file result_var) if(UNIX) if(NOT file_cmd) find_program(file_cmd "file") + mark_as_advanced(file_cmd) endif() if(file_cmd) diff --git a/Modules/InstallRequiredSystemLibraries.cmake b/Modules/InstallRequiredSystemLibraries.cmake index 19b06d5..bd97501 100644 --- a/Modules/InstallRequiredSystemLibraries.cmake +++ b/Modules/InstallRequiredSystemLibraries.cmake @@ -312,13 +312,14 @@ if(MSVC) set(__install__libs ${__install__libs} "${MSVC${v}_MFCLOC_DIR}/mfc${v}0chs.dll" "${MSVC${v}_MFCLOC_DIR}/mfc${v}0cht.dll" - "${MSVC${v}_MFCLOC_DIR}/mfc${v}0enu.dll" - "${MSVC${v}_MFCLOC_DIR}/mfc${v}0esp.dll" "${MSVC${v}_MFCLOC_DIR}/mfc${v}0deu.dll" + "${MSVC${v}_MFCLOC_DIR}/mfc${v}0enu.dll" + "${MSVC${v}_MFCLOC_DIR}/mfc${v}0esn.dll" "${MSVC${v}_MFCLOC_DIR}/mfc${v}0fra.dll" "${MSVC${v}_MFCLOC_DIR}/mfc${v}0ita.dll" "${MSVC${v}_MFCLOC_DIR}/mfc${v}0jpn.dll" "${MSVC${v}_MFCLOC_DIR}/mfc${v}0kor.dll" + "${MSVC${v}_MFCLOC_DIR}/mfc${v}0rus.dll" ) endmacro() diff --git a/Modules/ProcessorCount.cmake b/Modules/ProcessorCount.cmake index eff4766..0d1dfda 100644 --- a/Modules/ProcessorCount.cmake +++ b/Modules/ProcessorCount.cmake @@ -57,6 +57,7 @@ function(ProcessorCount var) # Mac, FreeBSD, OpenBSD (systems with sysctl): find_program(ProcessorCount_cmd_sysctl sysctl PATHS /usr/sbin /sbin) + mark_as_advanced(ProcessorCount_cmd_sysctl) if(ProcessorCount_cmd_sysctl) execute_process(COMMAND ${ProcessorCount_cmd_sysctl} -n hw.ncpu ERROR_QUIET @@ -69,6 +70,7 @@ function(ProcessorCount var) if(NOT count) # Linux (systems with getconf): find_program(ProcessorCount_cmd_getconf getconf) + mark_as_advanced(ProcessorCount_cmd_getconf) if(ProcessorCount_cmd_getconf) execute_process(COMMAND ${ProcessorCount_cmd_getconf} _NPROCESSORS_ONLN ERROR_QUIET @@ -82,6 +84,7 @@ function(ProcessorCount var) # HPUX (systems with machinfo): find_program(ProcessorCount_cmd_machinfo machinfo PATHS /usr/contrib/bin) + mark_as_advanced(ProcessorCount_cmd_machinfo) if(ProcessorCount_cmd_machinfo) execute_process(COMMAND ${ProcessorCount_cmd_machinfo} ERROR_QUIET @@ -97,6 +100,7 @@ function(ProcessorCount var) # IRIX (systems with hinv): find_program(ProcessorCount_cmd_hinv hinv PATHS /sbin) + mark_as_advanced(ProcessorCount_cmd_hinv) if(ProcessorCount_cmd_hinv) execute_process(COMMAND ${ProcessorCount_cmd_hinv} ERROR_QUIET @@ -112,6 +116,7 @@ function(ProcessorCount var) # AIX (systems with lsconf): find_program(ProcessorCount_cmd_lsconf lsconf PATHS /usr/sbin) + mark_as_advanced(ProcessorCount_cmd_lsconf) if(ProcessorCount_cmd_lsconf) execute_process(COMMAND ${ProcessorCount_cmd_lsconf} ERROR_QUIET @@ -126,6 +131,7 @@ function(ProcessorCount var) if(NOT count) # QNX (systems with pidin): find_program(ProcessorCount_cmd_pidin pidin) + mark_as_advanced(ProcessorCount_cmd_pidin) if(ProcessorCount_cmd_pidin) execute_process(COMMAND ${ProcessorCount_cmd_pidin} info ERROR_QUIET @@ -140,6 +146,7 @@ function(ProcessorCount var) if(NOT count) # Sun (systems where uname -X emits "NumCPU" in its output): find_program(ProcessorCount_cmd_uname uname) + mark_as_advanced(ProcessorCount_cmd_uname) if(ProcessorCount_cmd_uname) execute_process(COMMAND ${ProcessorCount_cmd_uname} -X ERROR_QUIET |