Remove CMake-language block-end command arguments

Ancient versions of CMake required else(), endif(), and similar block
termination commands to have arguments matching the command starting the
block.  This is no longer the preferred style.

Run the following shell code:

for c in else endif endforeach endfunction endmacro endwhile; do
    echo 's/\b'"$c"'\(\s*\)(.\+)/'"$c"'\1()/'
done >convert.sed &&
git ls-files -z -- bootstrap '*.cmake' '*.cmake.in' '*CMakeLists.txt' |
egrep -z -v '^(Utilities/cm|Source/kwsys/)' |
egrep -z -v 'Tests/CMakeTests/While-Endwhile-' |
xargs -0 sed -i -f convert.sed &&
rm convert.sed
This commit is contained in:
Kitware Robot 2012-08-13 13:50:14 -04:00 committed by Brad King
parent 77543bde41
commit 9db3116226
385 changed files with 4107 additions and 4107 deletions

View File

@ -23,7 +23,7 @@ if(EXISTS "${CMAKE_ROOT}/Modules/CPack.cmake")
endif() endif()
include(${CMake_SOURCE_DIR}/Modules/InstallRequiredSystemLibraries.cmake) include(${CMake_SOURCE_DIR}/Modules/InstallRequiredSystemLibraries.cmake)
endif(EXISTS "${CMAKE_ROOT}/Modules/InstallRequiredSystemLibraries.cmake") endif()
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "CMake is a build tool") set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "CMake is a build tool")
set(CPACK_PACKAGE_VENDOR "Kitware") set(CPACK_PACKAGE_VENDOR "Kitware")
@ -56,17 +56,17 @@ if(EXISTS "${CMAKE_ROOT}/Modules/CPack.cmake")
# cygwin is good for the system name # cygwin is good for the system name
if("${CMAKE_SYSTEM_NAME}" STREQUAL "CYGWIN") if("${CMAKE_SYSTEM_NAME}" STREQUAL "CYGWIN")
set(CPACK_SYSTEM_NAME Cygwin) set(CPACK_SYSTEM_NAME Cygwin)
else("${CMAKE_SYSTEM_NAME}" STREQUAL "CYGWIN") else()
set(CPACK_SYSTEM_NAME ${CMAKE_SYSTEM_NAME}-${CMAKE_SYSTEM_PROCESSOR}) set(CPACK_SYSTEM_NAME ${CMAKE_SYSTEM_NAME}-${CMAKE_SYSTEM_PROCESSOR})
endif("${CMAKE_SYSTEM_NAME}" STREQUAL "CYGWIN") endif()
endif(NOT DEFINED CPACK_SYSTEM_NAME) endif()
if(${CPACK_SYSTEM_NAME} MATCHES Windows) if(${CPACK_SYSTEM_NAME} MATCHES Windows)
if(CMAKE_CL_64) if(CMAKE_CL_64)
set(CPACK_SYSTEM_NAME win64-x64) set(CPACK_SYSTEM_NAME win64-x64)
else(CMAKE_CL_64) else()
set(CPACK_SYSTEM_NAME win32-x86) set(CPACK_SYSTEM_NAME win32-x86)
endif(CMAKE_CL_64) endif()
endif(${CPACK_SYSTEM_NAME} MATCHES Windows) endif()
if(NOT DEFINED CPACK_PACKAGE_FILE_NAME) if(NOT DEFINED CPACK_PACKAGE_FILE_NAME)
# if the CPACK_PACKAGE_FILE_NAME is not defined by the cache # if the CPACK_PACKAGE_FILE_NAME is not defined by the cache
@ -74,11 +74,11 @@ if(EXISTS "${CMAKE_ROOT}/Modules/CPack.cmake")
# needed # needed
if(CYGWIN) if(CYGWIN)
set(CPACK_PACKAGE_FILE_NAME "${CPACK_SOURCE_PACKAGE_FILE_NAME}") set(CPACK_PACKAGE_FILE_NAME "${CPACK_SOURCE_PACKAGE_FILE_NAME}")
else(CYGWIN) else()
set(CPACK_PACKAGE_FILE_NAME set(CPACK_PACKAGE_FILE_NAME
"${CPACK_SOURCE_PACKAGE_FILE_NAME}-${CPACK_SYSTEM_NAME}") "${CPACK_SOURCE_PACKAGE_FILE_NAME}-${CPACK_SYSTEM_NAME}")
endif(CYGWIN) endif()
endif(NOT DEFINED CPACK_PACKAGE_FILE_NAME) endif()
set(CPACK_PACKAGE_CONTACT "cmake@cmake.org") set(CPACK_PACKAGE_CONTACT "cmake@cmake.org")
@ -86,7 +86,7 @@ if(EXISTS "${CMAKE_ROOT}/Modules/CPack.cmake")
set(CPACK_STRIP_FILES "bin/ccmake;bin/cmake;bin/cpack;bin/ctest") set(CPACK_STRIP_FILES "bin/ccmake;bin/cmake;bin/cpack;bin/ctest")
set(CPACK_SOURCE_STRIP_FILES "") set(CPACK_SOURCE_STRIP_FILES "")
set(CPACK_PACKAGE_EXECUTABLES "ccmake" "CMake") set(CPACK_PACKAGE_EXECUTABLES "ccmake" "CMake")
endif(UNIX) endif()
# cygwin specific packaging stuff # cygwin specific packaging stuff
if(CYGWIN) if(CYGWIN)
@ -110,7 +110,7 @@ if(EXISTS "${CMAKE_ROOT}/Modules/CPack.cmake")
# configures some files and adds some install targets # configures some files and adds some install targets
# this file uses some of the package file name variables # this file uses some of the package file name variables
include(Utilities/Release/Cygwin/CMakeLists.txt) include(Utilities/Release/Cygwin/CMakeLists.txt)
endif(CYGWIN) endif()
# Set the options file that needs to be included inside CMakeCPackOptions.cmake # Set the options file that needs to be included inside CMakeCPackOptions.cmake
set(QT_DIALOG_CPACK_OPTIONS_FILE ${CMake_BINARY_DIR}/Source/QtDialog/QtDialogCPack.cmake) set(QT_DIALOG_CPACK_OPTIONS_FILE ${CMake_BINARY_DIR}/Source/QtDialog/QtDialogCPack.cmake)
@ -120,4 +120,4 @@ if(EXISTS "${CMAKE_ROOT}/Modules/CPack.cmake")
# include CPack model once all variables are set # include CPack model once all variables are set
include(CPack) include(CPack)
endif(EXISTS "${CMAKE_ROOT}/Modules/CPack.cmake") endif()

View File

@ -32,7 +32,7 @@ if(CPACK_GENERATOR MATCHES "NSIS")
set(CPACK_NSIS_URL_INFO_ABOUT "http://www.kitware.com") set(CPACK_NSIS_URL_INFO_ABOUT "http://www.kitware.com")
set(CPACK_NSIS_CONTACT @CPACK_PACKAGE_CONTACT@) set(CPACK_NSIS_CONTACT @CPACK_PACKAGE_CONTACT@)
set(CPACK_NSIS_MODIFY_PATH ON) set(CPACK_NSIS_MODIFY_PATH ON)
endif(CPACK_GENERATOR MATCHES "NSIS") endif()
# include the cpack options for qt dialog if they exisit # include the cpack options for qt dialog if they exisit
# they might not if qt was not enabled for the build # they might not if qt was not enabled for the build
@ -42,12 +42,12 @@ if(CPACK_GENERATOR MATCHES "CygwinSource")
# when packaging source make sure the .build directory is not included # when packaging source make sure the .build directory is not included
set(CPACK_SOURCE_IGNORE_FILES set(CPACK_SOURCE_IGNORE_FILES
"/CVS/" "/\\.build/" "/\\.svn/" "\\.swp$" "\\.#" "/#" "~$") "/CVS/" "/\\.build/" "/\\.svn/" "\\.swp$" "\\.#" "/#" "~$")
endif(CPACK_GENERATOR MATCHES "CygwinSource") endif()
if("${CPACK_GENERATOR}" STREQUAL "PackageMaker") if("${CPACK_GENERATOR}" STREQUAL "PackageMaker")
if(CMAKE_PACKAGE_QTGUI) if(CMAKE_PACKAGE_QTGUI)
set(CPACK_PACKAGE_DEFAULT_LOCATION "/Applications") set(CPACK_PACKAGE_DEFAULT_LOCATION "/Applications")
else(CMAKE_PACKAGE_QTGUI) else()
set(CPACK_PACKAGE_DEFAULT_LOCATION "/usr") set(CPACK_PACKAGE_DEFAULT_LOCATION "/usr")
endif(CMAKE_PACKAGE_QTGUI) endif()
endif("${CPACK_GENERATOR}" STREQUAL "PackageMaker") endif()

View File

@ -67,7 +67,7 @@ macro(CMAKE_HANDLE_SYSTEM_LIBRARIES)
else() else()
set(CMAKE_USE_SYSTEM_LIBRARY_${util} OFF) set(CMAKE_USE_SYSTEM_LIBRARY_${util} OFF)
endif() endif()
endforeach(util) endforeach()
if(CMAKE_BOOTSTRAP) if(CMAKE_BOOTSTRAP)
unset(CMAKE_USE_SYSTEM_LIBRARIES CACHE) unset(CMAKE_USE_SYSTEM_LIBRARIES CACHE)
endif() endif()
@ -87,15 +87,15 @@ macro(CMAKE_HANDLE_SYSTEM_LIBRARIES)
foreach(util ${UTILITIES}) foreach(util ${UTILITIES})
if(CMAKE_USE_SYSTEM_${util}) if(CMAKE_USE_SYSTEM_${util})
message(STATUS "Using system-installed ${util}") message(STATUS "Using system-installed ${util}")
endif(CMAKE_USE_SYSTEM_${util}) endif()
endforeach(util) endforeach()
# Inform utility library header wrappers whether to use system versions. # Inform utility library header wrappers whether to use system versions.
configure_file(${CMake_SOURCE_DIR}/Utilities/cmThirdParty.h.in configure_file(${CMake_SOURCE_DIR}/Utilities/cmThirdParty.h.in
${CMake_BINARY_DIR}/Utilities/cmThirdParty.h ${CMake_BINARY_DIR}/Utilities/cmThirdParty.h
@ONLY) @ONLY)
endmacro(CMAKE_HANDLE_SYSTEM_LIBRARIES) endmacro()
@ -103,7 +103,7 @@ endmacro(CMAKE_HANDLE_SYSTEM_LIBRARIES)
set(CMAKE_BUILD_ON_VISUAL_STUDIO 0) set(CMAKE_BUILD_ON_VISUAL_STUDIO 0)
if(WIN32 AND NOT UNIX AND NOT BORLAND AND NOT MINGW ) if(WIN32 AND NOT UNIX AND NOT BORLAND AND NOT MINGW )
set(CMAKE_BUILD_ON_VISUAL_STUDIO 1) set(CMAKE_BUILD_ON_VISUAL_STUDIO 1)
endif(WIN32 AND NOT UNIX AND NOT BORLAND AND NOT MINGW ) endif()
#----------------------------------------------------------------------- #-----------------------------------------------------------------------
@ -113,7 +113,7 @@ endif(WIN32 AND NOT UNIX AND NOT BORLAND AND NOT MINGW )
macro(CMAKE_SETUP_TESTING) macro(CMAKE_SETUP_TESTING)
if (NOT DART_ROOT) if (NOT DART_ROOT)
set(MAKEPROGRAM ${CMAKE_MAKE_PROGRAM}) set(MAKEPROGRAM ${CMAKE_MAKE_PROGRAM})
endif (NOT DART_ROOT) endif ()
if(BUILD_TESTING) if(BUILD_TESTING)
set(CMAKE_TEST_GENERATOR "" CACHE STRING set(CMAKE_TEST_GENERATOR "" CACHE STRING
@ -123,28 +123,28 @@ macro(CMAKE_SETUP_TESTING)
if(NOT CMAKE_TEST_GENERATOR) if(NOT CMAKE_TEST_GENERATOR)
set(CMAKE_TEST_GENERATOR "${CMAKE_GENERATOR}") set(CMAKE_TEST_GENERATOR "${CMAKE_GENERATOR}")
set(CMAKE_TEST_MAKEPROGRAM "${MAKEPROGRAM}") set(CMAKE_TEST_MAKEPROGRAM "${MAKEPROGRAM}")
else(NOT CMAKE_TEST_GENERATOR) else()
set(CMAKE_TEST_DIFFERENT_GENERATOR TRUE) set(CMAKE_TEST_DIFFERENT_GENERATOR TRUE)
endif(NOT CMAKE_TEST_GENERATOR) endif()
# Are we testing with the MSVC compiler? # Are we testing with the MSVC compiler?
set(CMAKE_TEST_MSVC 0) set(CMAKE_TEST_MSVC 0)
if(MSVC AND NOT CMAKE_TEST_DIFFERENT_GENERATOR) if(MSVC AND NOT CMAKE_TEST_DIFFERENT_GENERATOR)
set(CMAKE_TEST_MSVC 1) set(CMAKE_TEST_MSVC 1)
else(MSVC AND NOT CMAKE_TEST_DIFFERENT_GENERATOR) else()
if("${CMAKE_TEST_GENERATOR}" MATCHES "NMake" OR if("${CMAKE_TEST_GENERATOR}" MATCHES "NMake" OR
"${CMAKE_TEST_GENERATOR}" MATCHES "Visual Studio") "${CMAKE_TEST_GENERATOR}" MATCHES "Visual Studio")
set(CMAKE_TEST_MSVC 1) set(CMAKE_TEST_MSVC 1)
endif("${CMAKE_TEST_GENERATOR}" MATCHES "NMake" OR endif("${CMAKE_TEST_GENERATOR}" MATCHES "NMake" OR
"${CMAKE_TEST_GENERATOR}" MATCHES "Visual Studio") "${CMAKE_TEST_GENERATOR}" MATCHES "Visual Studio")
endif(MSVC AND NOT CMAKE_TEST_DIFFERENT_GENERATOR) endif()
set(CMAKE_TEST_SYSTEM_LIBRARIES 0) set(CMAKE_TEST_SYSTEM_LIBRARIES 0)
foreach(util CURL EXPAT XMLRPC ZLIB) foreach(util CURL EXPAT XMLRPC ZLIB)
if(CMAKE_USE_SYSTEM_${util}) if(CMAKE_USE_SYSTEM_${util})
set(CMAKE_TEST_SYSTEM_LIBRARIES 1) set(CMAKE_TEST_SYSTEM_LIBRARIES 1)
endif(CMAKE_USE_SYSTEM_${util}) endif()
endforeach(util) endforeach()
# This variable is set by cmake, however to # This variable is set by cmake, however to
# test cmake we want to make sure that # test cmake we want to make sure that
@ -154,7 +154,7 @@ macro(CMAKE_SETUP_TESTING)
set(CMAKE_CTEST_COMMAND "${CMake_BIN_DIR}/ctest") set(CMAKE_CTEST_COMMAND "${CMake_BIN_DIR}/ctest")
set(CMAKE_CMAKE_COMMAND "${CMake_BIN_DIR}/cmake") set(CMAKE_CMAKE_COMMAND "${CMake_BIN_DIR}/cmake")
set(CMAKE_CPACK_COMMAND "${CMake_BIN_DIR}/cpack") set(CMAKE_CPACK_COMMAND "${CMake_BIN_DIR}/cpack")
endif(BUILD_TESTING) endif()
# configure some files for testing # configure some files for testing
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/Templates/CTestScript.cmake.in" configure_file("${CMAKE_CURRENT_SOURCE_DIR}/Templates/CTestScript.cmake.in"
@ -171,10 +171,10 @@ macro(CMAKE_SETUP_TESTING)
if(BUILD_TESTING AND DART_ROOT) if(BUILD_TESTING AND DART_ROOT)
configure_file(${CMake_SOURCE_DIR}/CMakeLogo.gif configure_file(${CMake_SOURCE_DIR}/CMakeLogo.gif
${CMake_BINARY_DIR}/Testing/HTML/TestingResults/Icons/Logo.gif COPYONLY) ${CMake_BINARY_DIR}/Testing/HTML/TestingResults/Icons/Logo.gif COPYONLY)
endif(BUILD_TESTING AND DART_ROOT) endif()
mark_as_advanced(DART_ROOT) mark_as_advanced(DART_ROOT)
mark_as_advanced(CURL_TESTING) mark_as_advanced(CURL_TESTING)
endmacro(CMAKE_SETUP_TESTING) endmacro()
# Provide a way for Visual Studio Express users to turn OFF the new FOLDER # Provide a way for Visual Studio Express users to turn OFF the new FOLDER
@ -205,7 +205,7 @@ macro(CMAKE_SET_TARGET_FOLDER tgt folder)
else() else()
set_property(GLOBAL PROPERTY USE_FOLDERS OFF) set_property(GLOBAL PROPERTY USE_FOLDERS OFF)
endif() endif()
endmacro(CMAKE_SET_TARGET_FOLDER) endmacro()
#----------------------------------------------------------------------- #-----------------------------------------------------------------------
@ -266,15 +266,15 @@ macro (CMAKE_BUILD_UTILITIES)
if(NOT ZLIB_FOUND) if(NOT ZLIB_FOUND)
message(FATAL_ERROR message(FATAL_ERROR
"CMAKE_USE_SYSTEM_ZLIB is ON but a zlib is not found!") "CMAKE_USE_SYSTEM_ZLIB is ON but a zlib is not found!")
endif(NOT ZLIB_FOUND) endif()
set(CMAKE_ZLIB_INCLUDES ${ZLIB_INCLUDE_DIR}) set(CMAKE_ZLIB_INCLUDES ${ZLIB_INCLUDE_DIR})
set(CMAKE_ZLIB_LIBRARIES ${ZLIB_LIBRARIES}) set(CMAKE_ZLIB_LIBRARIES ${ZLIB_LIBRARIES})
else(CMAKE_USE_SYSTEM_ZLIB) else()
set(CMAKE_ZLIB_INCLUDES ${CMake_SOURCE_DIR}/Utilities) set(CMAKE_ZLIB_INCLUDES ${CMake_SOURCE_DIR}/Utilities)
set(CMAKE_ZLIB_LIBRARIES cmzlib) set(CMAKE_ZLIB_LIBRARIES cmzlib)
add_subdirectory(Utilities/cmzlib) add_subdirectory(Utilities/cmzlib)
CMAKE_SET_TARGET_FOLDER(cmzlib "Utilities/3rdParty") CMAKE_SET_TARGET_FOLDER(cmzlib "Utilities/3rdParty")
endif(CMAKE_USE_SYSTEM_ZLIB) endif()
#--------------------------------------------------------------------- #---------------------------------------------------------------------
# Build Curl library for CTest. # Build Curl library for CTest.
@ -283,26 +283,26 @@ macro (CMAKE_BUILD_UTILITIES)
if(NOT CURL_FOUND) if(NOT CURL_FOUND)
message(FATAL_ERROR message(FATAL_ERROR
"CMAKE_USE_SYSTEM_CURL is ON but a curl is not found!") "CMAKE_USE_SYSTEM_CURL is ON but a curl is not found!")
endif(NOT CURL_FOUND) endif()
set(CMAKE_CURL_INCLUDES ${CURL_INCLUDE_DIRS}) set(CMAKE_CURL_INCLUDES ${CURL_INCLUDE_DIRS})
set(CMAKE_CURL_LIBRARIES ${CURL_LIBRARIES}) set(CMAKE_CURL_LIBRARIES ${CURL_LIBRARIES})
else(CMAKE_USE_SYSTEM_CURL) else()
set(CURL_SPECIAL_ZLIB_H ${CMAKE_ZLIB_HEADER}) set(CURL_SPECIAL_ZLIB_H ${CMAKE_ZLIB_HEADER})
set(CURL_SPECIAL_LIBZ_INCLUDES ${CMAKE_ZLIB_INCLUDES}) set(CURL_SPECIAL_LIBZ_INCLUDES ${CMAKE_ZLIB_INCLUDES})
set(CURL_SPECIAL_LIBZ ${CMAKE_ZLIB_LIBRARIES}) set(CURL_SPECIAL_LIBZ ${CMAKE_ZLIB_LIBRARIES})
option(CMAKE_BUILD_CURL_SHARED "Should curl be built shared" FALSE) option(CMAKE_BUILD_CURL_SHARED "Should curl be built shared" FALSE)
if(NOT CMAKE_BUILD_CURL_SHARED) if(NOT CMAKE_BUILD_CURL_SHARED)
add_definitions(-DCURL_STATICLIB) add_definitions(-DCURL_STATICLIB)
endif(NOT CMAKE_BUILD_CURL_SHARED) endif()
set(CMAKE_CURL_INCLUDES) set(CMAKE_CURL_INCLUDES)
set(CMAKE_CURL_LIBRARIES cmcurl) set(CMAKE_CURL_LIBRARIES cmcurl)
if(CMAKE_TESTS_CDASH_SERVER) if(CMAKE_TESTS_CDASH_SERVER)
set(CMAKE_CURL_TEST_URL "${CMAKE_TESTS_CDASH_SERVER}/user.php") set(CMAKE_CURL_TEST_URL "${CMAKE_TESTS_CDASH_SERVER}/user.php")
endif(CMAKE_TESTS_CDASH_SERVER) endif()
add_subdirectory(Utilities/cmcurl) add_subdirectory(Utilities/cmcurl)
CMAKE_SET_TARGET_FOLDER(cmcurl "Utilities/3rdParty") CMAKE_SET_TARGET_FOLDER(cmcurl "Utilities/3rdParty")
CMAKE_SET_TARGET_FOLDER(LIBCURL "Utilities/3rdParty") CMAKE_SET_TARGET_FOLDER(LIBCURL "Utilities/3rdParty")
endif(CMAKE_USE_SYSTEM_CURL) endif()
#--------------------------------------------------------------------- #---------------------------------------------------------------------
# Build Compress library for CTest. # Build Compress library for CTest.
@ -334,7 +334,7 @@ macro (CMAKE_BUILD_UTILITIES)
endif() endif()
set(CMAKE_TAR_INCLUDES ${LibArchive_INCLUDE_DIRS}) set(CMAKE_TAR_INCLUDES ${LibArchive_INCLUDE_DIRS})
set(CMAKE_TAR_LIBRARIES ${LibArchive_LIBRARIES}) set(CMAKE_TAR_LIBRARIES ${LibArchive_LIBRARIES})
else(CMAKE_USE_SYSTEM_LIBARCHIVE) else()
set(ZLIB_INCLUDE_DIR ${CMAKE_ZLIB_INCLUDES}) set(ZLIB_INCLUDE_DIR ${CMAKE_ZLIB_INCLUDES})
set(ZLIB_LIBRARY ${CMAKE_ZLIB_LIBRARIES}) set(ZLIB_LIBRARY ${CMAKE_ZLIB_LIBRARIES})
add_definitions(-DLIBARCHIVE_STATIC) add_definitions(-DLIBARCHIVE_STATIC)
@ -346,7 +346,7 @@ macro (CMAKE_BUILD_UTILITIES)
add_subdirectory(Utilities/cmlibarchive) add_subdirectory(Utilities/cmlibarchive)
CMAKE_SET_TARGET_FOLDER(cmlibarchive "Utilities/3rdParty") CMAKE_SET_TARGET_FOLDER(cmlibarchive "Utilities/3rdParty")
set(CMAKE_TAR_LIBRARIES cmlibarchive ${BZIP2_LIBRARIES}) set(CMAKE_TAR_LIBRARIES cmlibarchive ${BZIP2_LIBRARIES})
endif(CMAKE_USE_SYSTEM_LIBARCHIVE) endif()
#--------------------------------------------------------------------- #---------------------------------------------------------------------
# Build expat library for CMake and CTest. # Build expat library for CMake and CTest.
@ -355,15 +355,15 @@ macro (CMAKE_BUILD_UTILITIES)
if(NOT EXPAT_FOUND) if(NOT EXPAT_FOUND)
message(FATAL_ERROR message(FATAL_ERROR
"CMAKE_USE_SYSTEM_EXPAT is ON but a expat is not found!") "CMAKE_USE_SYSTEM_EXPAT is ON but a expat is not found!")
endif(NOT EXPAT_FOUND) endif()
set(CMAKE_EXPAT_INCLUDES ${EXPAT_INCLUDE_DIRS}) set(CMAKE_EXPAT_INCLUDES ${EXPAT_INCLUDE_DIRS})
set(CMAKE_EXPAT_LIBRARIES ${EXPAT_LIBRARIES}) set(CMAKE_EXPAT_LIBRARIES ${EXPAT_LIBRARIES})
else(CMAKE_USE_SYSTEM_EXPAT) else()
set(CMAKE_EXPAT_INCLUDES) set(CMAKE_EXPAT_INCLUDES)
set(CMAKE_EXPAT_LIBRARIES cmexpat) set(CMAKE_EXPAT_LIBRARIES cmexpat)
add_subdirectory(Utilities/cmexpat) add_subdirectory(Utilities/cmexpat)
CMAKE_SET_TARGET_FOLDER(cmexpat "Utilities/3rdParty") CMAKE_SET_TARGET_FOLDER(cmexpat "Utilities/3rdParty")
endif(CMAKE_USE_SYSTEM_EXPAT) endif()
#--------------------------------------------------------------------- #---------------------------------------------------------------------
# Build XMLRPC library for CMake and CTest. # Build XMLRPC library for CMake and CTest.
@ -372,10 +372,10 @@ macro (CMAKE_BUILD_UTILITIES)
if(NOT XMLRPC_FOUND) if(NOT XMLRPC_FOUND)
message(FATAL_ERROR message(FATAL_ERROR
"CTEST_USE_XMLRPC is ON but xmlrpc is not found!") "CTEST_USE_XMLRPC is ON but xmlrpc is not found!")
endif(NOT XMLRPC_FOUND) endif()
set(CMAKE_XMLRPC_INCLUDES ${XMLRPC_INCLUDE_DIRS}) set(CMAKE_XMLRPC_INCLUDES ${XMLRPC_INCLUDE_DIRS})
set(CMAKE_XMLRPC_LIBRARIES ${XMLRPC_LIBRARIES}) set(CMAKE_XMLRPC_LIBRARIES ${XMLRPC_LIBRARIES})
endif(CTEST_USE_XMLRPC) endif()
#--------------------------------------------------------------------- #---------------------------------------------------------------------
# Use curses? # Use curses?
@ -386,20 +386,20 @@ macro (CMAKE_BUILD_UTILITIES)
find_package(Curses QUIET) find_package(Curses QUIET)
if (CURSES_LIBRARY) if (CURSES_LIBRARY)
option(BUILD_CursesDialog "Build the CMake Curses Dialog ccmake" ON) option(BUILD_CursesDialog "Build the CMake Curses Dialog ccmake" ON)
else (CURSES_LIBRARY) else ()
message("Curses libraries were not found. Curses GUI for CMake will not be built.") message("Curses libraries were not found. Curses GUI for CMake will not be built.")
set(BUILD_CursesDialog 0) set(BUILD_CursesDialog 0)
endif (CURSES_LIBRARY) endif ()
else(NOT "${CMAKE_SYSTEM_NAME}" MATCHES syllable) else()
set(BUILD_CursesDialog 0) set(BUILD_CursesDialog 0)
endif(NOT "${CMAKE_SYSTEM_NAME}" MATCHES syllable) endif()
else (UNIX) else ()
set(BUILD_CursesDialog 0) set(BUILD_CursesDialog 0)
endif (UNIX) endif ()
if(BUILD_CursesDialog) if(BUILD_CursesDialog)
add_subdirectory(Source/CursesDialog/form) add_subdirectory(Source/CursesDialog/form)
endif(BUILD_CursesDialog) endif()
endmacro (CMAKE_BUILD_UTILITIES) endmacro ()
#----------------------------------------------------------------------- #-----------------------------------------------------------------------
if(CMAKE_CXX_PLATFORM_ID MATCHES "OpenBSD") if(CMAKE_CXX_PLATFORM_ID MATCHES "OpenBSD")
@ -509,7 +509,7 @@ CHECK_SYMBOL_EXISTS(environ "stdlib.h" HAVE_ENVIRON_NOT_REQUIRE_PROTOTYPE)
# #
if("x${CMAKE_TESTS_CDASH_SERVER}" STREQUAL "x") if("x${CMAKE_TESTS_CDASH_SERVER}" STREQUAL "x")
set(CMAKE_TESTS_CDASH_SERVER "http://www.cdash.org/CDash") set(CMAKE_TESTS_CDASH_SERVER "http://www.cdash.org/CDash")
endif("x${CMAKE_TESTS_CDASH_SERVER}" STREQUAL "x") endif()
# build the utilities (a macro defined in this file) # build the utilities (a macro defined in this file)
CMAKE_BUILD_UTILITIES() CMAKE_BUILD_UTILITIES()
@ -524,8 +524,8 @@ if(BUILD_CursesDialog)
set(CURSES_NEED_RPATH FALSE) set(CURSES_NEED_RPATH FALSE)
if(NOT "${_CURSES_DIR}" STREQUAL "/lib" AND NOT "${_CURSES_DIR}" STREQUAL "/usr/lib" AND NOT "${_CURSES_DIR}" STREQUAL "/lib64" AND NOT "${_CURSES_DIR}" STREQUAL "/usr/lib64") if(NOT "${_CURSES_DIR}" STREQUAL "/lib" AND NOT "${_CURSES_DIR}" STREQUAL "/usr/lib" AND NOT "${_CURSES_DIR}" STREQUAL "/lib64" AND NOT "${_CURSES_DIR}" STREQUAL "/usr/lib64")
set(CURSES_NEED_RPATH TRUE) set(CURSES_NEED_RPATH TRUE)
endif(NOT "${_CURSES_DIR}" STREQUAL "/lib" AND NOT "${_CURSES_DIR}" STREQUAL "/usr/lib" AND NOT "${_CURSES_DIR}" STREQUAL "/lib64" AND NOT "${_CURSES_DIR}" STREQUAL "/usr/lib64") endif()
endif(BUILD_CursesDialog) endif()
if(BUILD_QtDialog) if(BUILD_QtDialog)
if(APPLE) if(APPLE)
@ -538,16 +538,16 @@ if(BUILD_QtDialog)
string(SUBSTRING "${CMAKE_INSTALL_PREFIX}" ${LEN} 1 ENDCH) string(SUBSTRING "${CMAKE_INSTALL_PREFIX}" ${LEN} 1 ENDCH)
if(NOT "${ENDCH}" STREQUAL "/") if(NOT "${ENDCH}" STREQUAL "/")
set(CMAKE_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}/") set(CMAKE_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}/")
endif(NOT "${ENDCH}" STREQUAL "/") endif()
set(CMAKE_INSTALL_PREFIX set(CMAKE_INSTALL_PREFIX
"${CMAKE_INSTALL_PREFIX}${CMAKE_BUNDLE_NAME}.app/Contents") "${CMAKE_INSTALL_PREFIX}${CMAKE_BUNDLE_NAME}.app/Contents")
endif(APPLE) endif()
set(QT_NEED_RPATH FALSE) set(QT_NEED_RPATH FALSE)
if(NOT "${QT_LIBRARY_DIR}" STREQUAL "/lib" AND NOT "${QT_LIBRARY_DIR}" STREQUAL "/usr/lib" AND NOT "${QT_LIBRARY_DIR}" STREQUAL "/lib64" AND NOT "${QT_LIBRARY_DIR}" STREQUAL "/usr/lib64") if(NOT "${QT_LIBRARY_DIR}" STREQUAL "/lib" AND NOT "${QT_LIBRARY_DIR}" STREQUAL "/usr/lib" AND NOT "${QT_LIBRARY_DIR}" STREQUAL "/lib64" AND NOT "${QT_LIBRARY_DIR}" STREQUAL "/usr/lib64")
set(QT_NEED_RPATH TRUE) set(QT_NEED_RPATH TRUE)
endif(NOT "${QT_LIBRARY_DIR}" STREQUAL "/lib" AND NOT "${QT_LIBRARY_DIR}" STREQUAL "/usr/lib" AND NOT "${QT_LIBRARY_DIR}" STREQUAL "/lib64" AND NOT "${QT_LIBRARY_DIR}" STREQUAL "/usr/lib64") endif()
endif(BUILD_QtDialog) endif()
# The same might be true on other systems for other libraries. # The same might be true on other systems for other libraries.
@ -563,7 +563,7 @@ if (UNIX)
set(CMAKE_BUILD_WITH_INSTALL_RPATH TRUE) set(CMAKE_BUILD_WITH_INSTALL_RPATH TRUE)
endif(CMAKE_USE_SYSTEM_CURL OR CMAKE_USE_SYSTEM_ZLIB endif(CMAKE_USE_SYSTEM_CURL OR CMAKE_USE_SYSTEM_ZLIB
OR CMAKE_USE_SYSTEM_EXPAT OR CTEST_USE_XMLRPC OR CURSES_NEED_RPATH OR QT_NEED_RPATH) OR CMAKE_USE_SYSTEM_EXPAT OR CTEST_USE_XMLRPC OR CURSES_NEED_RPATH OR QT_NEED_RPATH)
endif (UNIX) endif ()
# add the uninstall support # add the uninstall support

View File

@ -61,14 +61,14 @@ if(NOT "@CMAKE_GENERATOR@" MATCHES "Xcode")
${CTEST_CUSTOM_COVERAGE_EXCLUDE} ${CTEST_CUSTOM_COVERAGE_EXCLUDE}
"XCode" "XCode"
) )
endif (NOT "@CMAKE_GENERATOR@" MATCHES "Xcode") endif ()
if(NOT "@CMAKE_GENERATOR@" MATCHES "KDevelop") if(NOT "@CMAKE_GENERATOR@" MATCHES "KDevelop")
set(CTEST_CUSTOM_COVERAGE_EXCLUDE set(CTEST_CUSTOM_COVERAGE_EXCLUDE
${CTEST_CUSTOM_COVERAGE_EXCLUDE} ${CTEST_CUSTOM_COVERAGE_EXCLUDE}
"Kdevelop" "Kdevelop"
) )
endif (NOT "@CMAKE_GENERATOR@" MATCHES "KDevelop") endif ()
set(CTEST_CUSTOM_COVERAGE_EXCLUDE set(CTEST_CUSTOM_COVERAGE_EXCLUDE
${CTEST_CUSTOM_COVERAGE_EXCLUDE} ${CTEST_CUSTOM_COVERAGE_EXCLUDE}

View File

@ -15,10 +15,10 @@
# #
if(CMAKE_GENERATOR MATCHES "Visual Studio 7") if(CMAKE_GENERATOR MATCHES "Visual Studio 7")
set(CMAKE_SKIP_COMPATIBILITY_TESTS 1) set(CMAKE_SKIP_COMPATIBILITY_TESTS 1)
endif(CMAKE_GENERATOR MATCHES "Visual Studio 7") endif()
if(CMAKE_GENERATOR MATCHES "Visual Studio 6") if(CMAKE_GENERATOR MATCHES "Visual Studio 6")
set(CMAKE_SKIP_COMPATIBILITY_TESTS 1) set(CMAKE_SKIP_COMPATIBILITY_TESTS 1)
endif(CMAKE_GENERATOR MATCHES "Visual Studio 6") endif()
include (${CMAKE_ROOT}/Modules/CMakeBackwardCompatibilityCXX.cmake) include (${CMAKE_ROOT}/Modules/CMakeBackwardCompatibilityCXX.cmake)
if(WIN32 AND "${CMAKE_C_COMPILER_ID}" MATCHES "^(Intel)$") if(WIN32 AND "${CMAKE_C_COMPILER_ID}" MATCHES "^(Intel)$")
@ -38,27 +38,27 @@ endif()
if(CMAKE_SYSTEM MATCHES "AIX.*") if(CMAKE_SYSTEM MATCHES "AIX.*")
if(NOT CMAKE_COMPILER_IS_GNUCXX) if(NOT CMAKE_COMPILER_IS_GNUCXX)
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -bhalt:5 ") set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -bhalt:5 ")
endif(NOT CMAKE_COMPILER_IS_GNUCXX) endif()
endif(CMAKE_SYSTEM MATCHES "AIX.*") endif()
if(CMAKE_SYSTEM MATCHES "IRIX.*") if(CMAKE_SYSTEM MATCHES "IRIX.*")
if(NOT CMAKE_COMPILER_IS_GNUCXX) if(NOT CMAKE_COMPILER_IS_GNUCXX)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wl,-woff84 -no_auto_include") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wl,-woff84 -no_auto_include")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,-woff15") set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,-woff15")
endif(NOT CMAKE_COMPILER_IS_GNUCXX) endif()
endif(CMAKE_SYSTEM MATCHES "IRIX.*") endif()
if(CMAKE_SYSTEM MATCHES "OSF1-V.*") if(CMAKE_SYSTEM MATCHES "OSF1-V.*")
if(NOT CMAKE_COMPILER_IS_GNUCXX) if(NOT CMAKE_COMPILER_IS_GNUCXX)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -timplicit_local -no_implicit_include ") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -timplicit_local -no_implicit_include ")
endif(NOT CMAKE_COMPILER_IS_GNUCXX) endif()
endif(CMAKE_SYSTEM MATCHES "OSF1-V.*") endif()
# use the ansi CXX compile flag for building cmake # use the ansi CXX compile flag for building cmake
if (CMAKE_ANSI_CXXFLAGS) if (CMAKE_ANSI_CXXFLAGS)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CMAKE_ANSI_CXXFLAGS}") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CMAKE_ANSI_CXXFLAGS}")
endif (CMAKE_ANSI_CXXFLAGS) endif ()
if (CMAKE_ANSI_CFLAGS) if (CMAKE_ANSI_CFLAGS)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${CMAKE_ANSI_CFLAGS}") set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${CMAKE_ANSI_CFLAGS}")
endif (CMAKE_ANSI_CFLAGS) endif ()

View File

@ -20,10 +20,10 @@ macro(ADD_FILE_DEPENDENCIES _file)
get_source_file_property(_deps ${_file} OBJECT_DEPENDS) get_source_file_property(_deps ${_file} OBJECT_DEPENDS)
if (_deps) if (_deps)
set(_deps ${_deps} ${ARGN}) set(_deps ${_deps} ${ARGN})
else (_deps) else ()
set(_deps ${ARGN}) set(_deps ${ARGN})
endif (_deps) endif ()
set_source_files_properties(${_file} PROPERTIES OBJECT_DEPENDS "${_deps}") set_source_files_properties(${_file} PROPERTIES OBJECT_DEPENDS "${_deps}")
endmacro(ADD_FILE_DEPENDENCIES) endmacro()

View File

@ -184,17 +184,17 @@ function(get_bundle_main_executable bundle result_var)
if(line_is_main_executable) if(line_is_main_executable)
string(REGEX REPLACE "^.*<string>(.*)</string>.*$" "\\1" bundle_executable "${line}") string(REGEX REPLACE "^.*<string>(.*)</string>.*$" "\\1" bundle_executable "${line}")
break() break()
endif(line_is_main_executable) endif()
if(line MATCHES "^.*<key>CFBundleExecutable</key>.*$") if(line MATCHES "^.*<key>CFBundleExecutable</key>.*$")
set(line_is_main_executable 1) set(line_is_main_executable 1)
endif(line MATCHES "^.*<key>CFBundleExecutable</key>.*$") endif()
endforeach(line) endforeach()
if(NOT "${bundle_executable}" STREQUAL "") if(NOT "${bundle_executable}" STREQUAL "")
if(EXISTS "${bundle}/Contents/MacOS/${bundle_executable}") if(EXISTS "${bundle}/Contents/MacOS/${bundle_executable}")
set(result "${bundle}/Contents/MacOS/${bundle_executable}") set(result "${bundle}/Contents/MacOS/${bundle_executable}")
else(EXISTS "${bundle}/Contents/MacOS/${bundle_executable}") else()
# Ultimate goal: # Ultimate goal:
# If not in "Contents/MacOS" then scan the bundle for matching files. If # If not in "Contents/MacOS" then scan the bundle for matching files. If
@ -207,9 +207,9 @@ function(get_bundle_main_executable bundle result_var)
# for the bundle to be in Contents/MacOS, it's an error if it's not: # for the bundle to be in Contents/MacOS, it's an error if it's not:
# #
set(result "error: '${bundle}/Contents/MacOS/${bundle_executable}' does not exist") set(result "error: '${bundle}/Contents/MacOS/${bundle_executable}' does not exist")
endif(EXISTS "${bundle}/Contents/MacOS/${bundle_executable}") endif()
endif(NOT "${bundle_executable}" STREQUAL "") endif()
else(EXISTS "${bundle}/Contents/Info.plist") else()
# #
# More inclusive technique... (This one would work on Windows and Linux # More inclusive technique... (This one would work on Windows and Linux
# too, if a developer followed the typical Mac bundle naming convention...) # too, if a developer followed the typical Mac bundle naming convention...)
@ -217,10 +217,10 @@ function(get_bundle_main_executable bundle result_var)
# If there is no Info.plist file, try to find an executable with the same # If there is no Info.plist file, try to find an executable with the same
# base name as the .app directory: # base name as the .app directory:
# #
endif(EXISTS "${bundle}/Contents/Info.plist") endif()
set(${result_var} "${result}" PARENT_SCOPE) set(${result_var} "${result}" PARENT_SCOPE)
endfunction(get_bundle_main_executable) endfunction()
function(get_dotapp_dir exe dotapp_dir_var) function(get_dotapp_dir exe dotapp_dir_var)
@ -240,9 +240,9 @@ function(get_dotapp_dir exe dotapp_dir_var)
if(sname MATCHES "\\.app$") if(sname MATCHES "\\.app$")
set(done 1) set(done 1)
set(dotapp_dir "${sdir}/${sname}") set(dotapp_dir "${sdir}/${sname}")
endif(sname MATCHES "\\.app$") endif()
endwhile(NOT ${done}) endwhile()
else(s MATCHES "^.*/.*\\.app/.*$") else()
# Otherwise use a directory containing the exe # Otherwise use a directory containing the exe
# (typical of a non-bundle executable on Mac, Windows or Linux) # (typical of a non-bundle executable on Mac, Windows or Linux)
# #
@ -250,14 +250,14 @@ function(get_dotapp_dir exe dotapp_dir_var)
if(is_executable) if(is_executable)
get_filename_component(sdir "${s}" PATH) get_filename_component(sdir "${s}" PATH)
set(dotapp_dir "${sdir}") set(dotapp_dir "${sdir}")
else(is_executable) else()
set(dotapp_dir "${s}") set(dotapp_dir "${s}")
endif(is_executable) endif()
endif(s MATCHES "^.*/.*\\.app/.*$") endif()
set(${dotapp_dir_var} "${dotapp_dir}" PARENT_SCOPE) set(${dotapp_dir_var} "${dotapp_dir}" PARENT_SCOPE)
endfunction(get_dotapp_dir) endfunction()
function(get_bundle_and_executable app bundle_var executable_var valid_var) function(get_bundle_and_executable app bundle_var executable_var valid_var)
@ -273,13 +273,13 @@ function(get_bundle_and_executable app bundle_var executable_var valid_var)
set(${executable_var} "${executable}" PARENT_SCOPE) set(${executable_var} "${executable}" PARENT_SCOPE)
set(valid 1) set(valid 1)
#message(STATUS "info: handled .app directory case...") #message(STATUS "info: handled .app directory case...")
else(EXISTS "${app}" AND EXISTS "${executable}") else()
message(STATUS "warning: *NOT* handled - .app directory case...") message(STATUS "warning: *NOT* handled - .app directory case...")
endif(EXISTS "${app}" AND EXISTS "${executable}") endif()
else(app MATCHES "\\.app$") else()
message(STATUS "warning: *NOT* handled - directory but not .app case...") message(STATUS "warning: *NOT* handled - directory but not .app case...")
endif(app MATCHES "\\.app$") endif()
else(IS_DIRECTORY "${app}") else()
# Is it an executable file? # Is it an executable file?
is_file_executable("${app}" is_executable) is_file_executable("${app}" is_executable)
if(is_executable) if(is_executable)
@ -296,21 +296,21 @@ function(get_bundle_and_executable app bundle_var executable_var valid_var)
set(valid 1) set(valid 1)
#message(STATUS "info: handled executable file in any dir case...") #message(STATUS "info: handled executable file in any dir case...")
endif() endif()
else(is_executable) else()
message(STATUS "warning: *NOT* handled - not .app dir, not executable file...") message(STATUS "warning: *NOT* handled - not .app dir, not executable file...")
endif(is_executable) endif()
endif(IS_DIRECTORY "${app}") endif()
else(EXISTS "${app}") else()
message(STATUS "warning: *NOT* handled - directory/file does not exist...") message(STATUS "warning: *NOT* handled - directory/file does not exist...")
endif(EXISTS "${app}") endif()
if(NOT valid) if(NOT valid)
set(${bundle_var} "error: not a bundle" PARENT_SCOPE) set(${bundle_var} "error: not a bundle" PARENT_SCOPE)
set(${executable_var} "error: not a bundle" PARENT_SCOPE) set(${executable_var} "error: not a bundle" PARENT_SCOPE)
endif(NOT valid) endif()
set(${valid_var} ${valid} PARENT_SCOPE) set(${valid_var} ${valid} PARENT_SCOPE)
endfunction(get_bundle_and_executable) endfunction()
function(get_bundle_all_executables bundle exes_var) function(get_bundle_all_executables bundle exes_var)
@ -321,11 +321,11 @@ function(get_bundle_all_executables bundle exes_var)
is_file_executable("${f}" is_executable) is_file_executable("${f}" is_executable)
if(is_executable) if(is_executable)
set(exes ${exes} "${f}") set(exes ${exes} "${f}")
endif(is_executable) endif()
endforeach(f) endforeach()
set(${exes_var} "${exes}" PARENT_SCOPE) set(${exes_var} "${exes}" PARENT_SCOPE)
endfunction(get_bundle_all_executables) endfunction()
function(get_item_key item key_var) function(get_item_key item key_var)
@ -335,7 +335,7 @@ function(get_item_key item key_var)
endif() endif()
string(REGEX REPLACE "\\." "_" ${key_var} "${item_name}") string(REGEX REPLACE "\\." "_" ${key_var} "${item_name}")
set(${key_var} ${${key_var}} PARENT_SCOPE) set(${key_var} ${${key_var}} PARENT_SCOPE)
endfunction(get_item_key) endfunction()
function(clear_bundle_keys keys_var) function(clear_bundle_keys keys_var)
@ -346,9 +346,9 @@ function(clear_bundle_keys keys_var)
set(${key}_EMBEDDED_ITEM PARENT_SCOPE) set(${key}_EMBEDDED_ITEM PARENT_SCOPE)
set(${key}_RESOLVED_EMBEDDED_ITEM PARENT_SCOPE) set(${key}_RESOLVED_EMBEDDED_ITEM PARENT_SCOPE)
set(${key}_COPYFLAG PARENT_SCOPE) set(${key}_COPYFLAG PARENT_SCOPE)
endforeach(key) endforeach()
set(${keys_var} PARENT_SCOPE) set(${keys_var} PARENT_SCOPE)
endfunction(clear_bundle_keys) endfunction()
function(set_bundle_key_values keys_var context item exepath dirs copyflag) function(set_bundle_key_values keys_var context item exepath dirs copyflag)
@ -370,12 +370,12 @@ function(set_bundle_key_values keys_var context item exepath dirs copyflag)
# opening "${item_name}.framework/" to the closing "/${item_name}": # opening "${item_name}.framework/" to the closing "/${item_name}":
# #
string(REGEX REPLACE "^.*(${item_name}.framework/.*/${item_name}).*$" "${default_embedded_path}/\\1" embedded_item "${item}") string(REGEX REPLACE "^.*(${item_name}.framework/.*/${item_name}).*$" "${default_embedded_path}/\\1" embedded_item "${item}")
else(item MATCHES "[^/]+\\.framework/") else()
# For other items, just use the same name as the original, but in the # For other items, just use the same name as the original, but in the
# embedded path: # embedded path:
# #
set(embedded_item "${default_embedded_path}/${item_name}") set(embedded_item "${default_embedded_path}/${item_name}")
endif(item MATCHES "[^/]+\\.framework/") endif()
# Replace @executable_path and resolve ".." references: # Replace @executable_path and resolve ".." references:
# #
@ -391,7 +391,7 @@ function(set_bundle_key_values keys_var context item exepath dirs copyflag)
# #
if(NOT copyflag) if(NOT copyflag)
set(resolved_embedded_item "${resolved_item}") set(resolved_embedded_item "${resolved_item}")
endif(NOT copyflag) endif()
set(${keys_var} ${${keys_var}} PARENT_SCOPE) set(${keys_var} ${${keys_var}} PARENT_SCOPE)
set(${key}_ITEM "${item}" PARENT_SCOPE) set(${key}_ITEM "${item}" PARENT_SCOPE)
@ -400,10 +400,10 @@ function(set_bundle_key_values keys_var context item exepath dirs copyflag)
set(${key}_EMBEDDED_ITEM "${embedded_item}" PARENT_SCOPE) set(${key}_EMBEDDED_ITEM "${embedded_item}" PARENT_SCOPE)
set(${key}_RESOLVED_EMBEDDED_ITEM "${resolved_embedded_item}" PARENT_SCOPE) set(${key}_RESOLVED_EMBEDDED_ITEM "${resolved_embedded_item}" PARENT_SCOPE)
set(${key}_COPYFLAG "${copyflag}" PARENT_SCOPE) set(${key}_COPYFLAG "${copyflag}" PARENT_SCOPE)
else(NOT length_before EQUAL length_after) else()
#message("warning: item key '${key}' already in the list, subsequent references assumed identical to first") #message("warning: item key '${key}' already in the list, subsequent references assumed identical to first")
endif(NOT length_before EQUAL length_after) endif()
endfunction(set_bundle_key_values) endfunction()
function(get_bundle_keys app libs dirs keys_var) function(get_bundle_keys app libs dirs keys_var)
@ -432,8 +432,8 @@ function(get_bundle_keys app libs dirs keys_var)
get_prerequisites("${lib}" prereqs 1 1 "${exepath}" "${dirs}") get_prerequisites("${lib}" prereqs 1 1 "${exepath}" "${dirs}")
foreach(pr ${prereqs}) foreach(pr ${prereqs})
set_bundle_key_values(${keys_var} "${lib}" "${pr}" "${exepath}" "${dirs}" 1) set_bundle_key_values(${keys_var} "${lib}" "${pr}" "${exepath}" "${dirs}" 1)
endforeach(pr) endforeach()
endforeach(lib) endforeach()
# For each executable found in the bundle, accumulate keys as we go. # For each executable found in the bundle, accumulate keys as we go.
# The list of keys should be complete when all prerequisites of all # The list of keys should be complete when all prerequisites of all
@ -450,8 +450,8 @@ function(get_bundle_keys app libs dirs keys_var)
get_prerequisites("${exe}" prereqs 1 1 "${exepath}" "${dirs}") get_prerequisites("${exe}" prereqs 1 1 "${exepath}" "${dirs}")
foreach(pr ${prereqs}) foreach(pr ${prereqs})
set_bundle_key_values(${keys_var} "${exe}" "${pr}" "${exepath}" "${dirs}" 1) set_bundle_key_values(${keys_var} "${exe}" "${pr}" "${exepath}" "${dirs}" 1)
endforeach(pr) endforeach()
endforeach(exe) endforeach()
# Propagate values to caller's scope: # Propagate values to caller's scope:
# #
@ -463,9 +463,9 @@ function(get_bundle_keys app libs dirs keys_var)
set(${key}_EMBEDDED_ITEM "${${key}_EMBEDDED_ITEM}" PARENT_SCOPE) set(${key}_EMBEDDED_ITEM "${${key}_EMBEDDED_ITEM}" PARENT_SCOPE)
set(${key}_RESOLVED_EMBEDDED_ITEM "${${key}_RESOLVED_EMBEDDED_ITEM}" PARENT_SCOPE) set(${key}_RESOLVED_EMBEDDED_ITEM "${${key}_RESOLVED_EMBEDDED_ITEM}" PARENT_SCOPE)
set(${key}_COPYFLAG "${${key}_COPYFLAG}" PARENT_SCOPE) set(${key}_COPYFLAG "${${key}_COPYFLAG}" PARENT_SCOPE)
endforeach(key) endforeach()
endif(valid) endif()
endfunction(get_bundle_keys) endfunction()
function(copy_resolved_item_into_bundle resolved_item resolved_embedded_item) function(copy_resolved_item_into_bundle resolved_item resolved_embedded_item)
@ -485,10 +485,10 @@ function(copy_resolved_item_into_bundle resolved_item resolved_embedded_item)
execute_process(COMMAND ${CMAKE_COMMAND} -E copy "${resolved_item}" "${resolved_embedded_item}") execute_process(COMMAND ${CMAKE_COMMAND} -E copy "${resolved_item}" "${resolved_embedded_item}")
if(UNIX AND NOT APPLE) if(UNIX AND NOT APPLE)
file(RPATH_REMOVE FILE "${resolved_embedded_item}") file(RPATH_REMOVE FILE "${resolved_embedded_item}")
endif(UNIX AND NOT APPLE) endif()
endif() endif()
endfunction(copy_resolved_item_into_bundle) endfunction()
function(copy_resolved_framework_into_bundle resolved_item resolved_embedded_item) function(copy_resolved_framework_into_bundle resolved_item resolved_embedded_item)
@ -527,10 +527,10 @@ function(copy_resolved_framework_into_bundle resolved_item resolved_embedded_ite
endif() endif()
if(UNIX AND NOT APPLE) if(UNIX AND NOT APPLE)
file(RPATH_REMOVE FILE "${resolved_embedded_item}") file(RPATH_REMOVE FILE "${resolved_embedded_item}")
endif(UNIX AND NOT APPLE) endif()
endif() endif()
endfunction(copy_resolved_framework_into_bundle) endfunction()
function(fixup_bundle_item resolved_embedded_item exepath dirs) function(fixup_bundle_item resolved_embedded_item exepath dirs)
@ -580,10 +580,10 @@ function(fixup_bundle_item resolved_embedded_item exepath dirs)
if(NOT "${${rkey}_EMBEDDED_ITEM}" STREQUAL "") if(NOT "${${rkey}_EMBEDDED_ITEM}" STREQUAL "")
set(changes ${changes} "-change" "${pr}" "${${rkey}_EMBEDDED_ITEM}") set(changes ${changes} "-change" "${pr}" "${${rkey}_EMBEDDED_ITEM}")
else(NOT "${${rkey}_EMBEDDED_ITEM}" STREQUAL "") else()
message("warning: unexpected reference to '${pr}'") message("warning: unexpected reference to '${pr}'")
endif(NOT "${${rkey}_EMBEDDED_ITEM}" STREQUAL "") endif()
endforeach(pr) endforeach()
if(BU_CHMOD_BUNDLE_ITEMS) if(BU_CHMOD_BUNDLE_ITEMS)
execute_process(COMMAND chmod u+w "${resolved_embedded_item}") execute_process(COMMAND chmod u+w "${resolved_embedded_item}")
@ -595,7 +595,7 @@ function(fixup_bundle_item resolved_embedded_item exepath dirs)
execute_process(COMMAND install_name_tool execute_process(COMMAND install_name_tool
${changes} -id "${${ikey}_EMBEDDED_ITEM}" "${resolved_embedded_item}" ${changes} -id "${${ikey}_EMBEDDED_ITEM}" "${resolved_embedded_item}"
) )
endfunction(fixup_bundle_item) endfunction()
function(fixup_bundle app libs dirs) function(fixup_bundle app libs dirs)
@ -620,9 +620,9 @@ function(fixup_bundle app libs dirs)
math(EXPR i ${i}+1) math(EXPR i ${i}+1)
if(${${key}_COPYFLAG}) if(${${key}_COPYFLAG})
message(STATUS "${i}/${n}: copying '${${key}_RESOLVED_ITEM}'") message(STATUS "${i}/${n}: copying '${${key}_RESOLVED_ITEM}'")
else(${${key}_COPYFLAG}) else()
message(STATUS "${i}/${n}: *NOT* copying '${${key}_RESOLVED_ITEM}'") message(STATUS "${i}/${n}: *NOT* copying '${${key}_RESOLVED_ITEM}'")
endif(${${key}_COPYFLAG}) endif()
set(show_status 0) set(show_status 0)
if(show_status) if(show_status)
@ -634,7 +634,7 @@ function(fixup_bundle app libs dirs)
message(STATUS "resolved_embedded_item='${${key}_RESOLVED_EMBEDDED_ITEM}'") message(STATUS "resolved_embedded_item='${${key}_RESOLVED_EMBEDDED_ITEM}'")
message(STATUS "copyflag='${${key}_COPYFLAG}'") message(STATUS "copyflag='${${key}_COPYFLAG}'")
message(STATUS "") message(STATUS "")
endif(show_status) endif()
if(${${key}_COPYFLAG}) if(${${key}_COPYFLAG})
set(item "${${key}_ITEM}") set(item "${${key}_ITEM}")
@ -645,8 +645,8 @@ function(fixup_bundle app libs dirs)
copy_resolved_item_into_bundle("${${key}_RESOLVED_ITEM}" copy_resolved_item_into_bundle("${${key}_RESOLVED_ITEM}"
"${${key}_RESOLVED_EMBEDDED_ITEM}") "${${key}_RESOLVED_EMBEDDED_ITEM}")
endif() endif()
endif(${${key}_COPYFLAG}) endif()
endforeach(key) endforeach()
message(STATUS "fixup_bundle: fixing...") message(STATUS "fixup_bundle: fixing...")
foreach(key ${keys}) foreach(key ${keys})
@ -654,28 +654,28 @@ function(fixup_bundle app libs dirs)
if(APPLE) if(APPLE)
message(STATUS "${i}/${n}: fixing up '${${key}_RESOLVED_EMBEDDED_ITEM}'") message(STATUS "${i}/${n}: fixing up '${${key}_RESOLVED_EMBEDDED_ITEM}'")
fixup_bundle_item("${${key}_RESOLVED_EMBEDDED_ITEM}" "${exepath}" "${dirs}") fixup_bundle_item("${${key}_RESOLVED_EMBEDDED_ITEM}" "${exepath}" "${dirs}")
else(APPLE) else()
message(STATUS "${i}/${n}: fix-up not required on this platform '${${key}_RESOLVED_EMBEDDED_ITEM}'") message(STATUS "${i}/${n}: fix-up not required on this platform '${${key}_RESOLVED_EMBEDDED_ITEM}'")
endif(APPLE) endif()
endforeach(key) endforeach()
message(STATUS "fixup_bundle: cleaning up...") message(STATUS "fixup_bundle: cleaning up...")
clear_bundle_keys(keys) clear_bundle_keys(keys)
message(STATUS "fixup_bundle: verifying...") message(STATUS "fixup_bundle: verifying...")
verify_app("${app}") verify_app("${app}")
else(valid) else()
message(SEND_ERROR "error: fixup_bundle: not a valid bundle") message(SEND_ERROR "error: fixup_bundle: not a valid bundle")
endif(valid) endif()
message(STATUS "fixup_bundle: done") message(STATUS "fixup_bundle: done")
endfunction(fixup_bundle) endfunction()
function(copy_and_fixup_bundle src dst libs dirs) function(copy_and_fixup_bundle src dst libs dirs)
execute_process(COMMAND ${CMAKE_COMMAND} -E copy_directory "${src}" "${dst}") execute_process(COMMAND ${CMAKE_COMMAND} -E copy_directory "${src}" "${dst}")
fixup_bundle("${dst}" "${libs}" "${dirs}") fixup_bundle("${dst}" "${libs}" "${dirs}")
endfunction(copy_and_fixup_bundle) endfunction()
function(verify_bundle_prerequisites bundle result_var info_var) function(verify_bundle_prerequisites bundle result_var info_var)
@ -720,23 +720,23 @@ function(verify_bundle_prerequisites bundle result_var info_var)
set(external_prereqs ${external_prereqs} "${p}") set(external_prereqs ${external_prereqs} "${p}")
endif() endif()
endif() endif()
endforeach(p) endforeach()
if(external_prereqs) if(external_prereqs)
# Found non-system/somehow-unacceptable prerequisites: # Found non-system/somehow-unacceptable prerequisites:
set(result 0) set(result 0)
set(info ${info} "external prerequisites found:\nf='${f}'\nexternal_prereqs='${external_prereqs}'\n") set(info ${info} "external prerequisites found:\nf='${f}'\nexternal_prereqs='${external_prereqs}'\n")
endif(external_prereqs) endif()
endif(is_executable) endif()
endforeach(f) endforeach()
if(result) if(result)
set(info "Verified ${count} executable files in '${bundle}'") set(info "Verified ${count} executable files in '${bundle}'")
endif(result) endif()
set(${result_var} "${result}" PARENT_SCOPE) set(${result_var} "${result}" PARENT_SCOPE)
set(${info_var} "${info}" PARENT_SCOPE) set(${info_var} "${info}" PARENT_SCOPE)
endfunction(verify_bundle_prerequisites) endfunction()
function(verify_bundle_symlinks bundle result_var info_var) function(verify_bundle_symlinks bundle result_var info_var)
@ -749,7 +749,7 @@ function(verify_bundle_symlinks bundle result_var info_var)
set(${result_var} "${result}" PARENT_SCOPE) set(${result_var} "${result}" PARENT_SCOPE)
set(${info_var} "${info}" PARENT_SCOPE) set(${info_var} "${info}" PARENT_SCOPE)
endfunction(verify_bundle_symlinks) endfunction()
function(verify_app app) function(verify_app app)
@ -778,9 +778,9 @@ function(verify_app app)
message(STATUS "verified='${verified}'") message(STATUS "verified='${verified}'")
message(STATUS "info='${info}'") message(STATUS "info='${info}'")
message(STATUS "") message(STATUS "")
endif(verified) endif()
if(NOT verified) if(NOT verified)
message(FATAL_ERROR "error: verify_app failed") message(FATAL_ERROR "error: verify_app failed")
endif(NOT verified) endif()
endfunction(verify_app) endfunction()

View File

@ -14,9 +14,9 @@
if(UNIX) if(UNIX)
set(CMAKE_ASM${ASM_DIALECT}_OUTPUT_EXTENSION .o) set(CMAKE_ASM${ASM_DIALECT}_OUTPUT_EXTENSION .o)
else(UNIX) else()
set(CMAKE_ASM${ASM_DIALECT}_OUTPUT_EXTENSION .obj) set(CMAKE_ASM${ASM_DIALECT}_OUTPUT_EXTENSION .obj)
endif(UNIX) endif()
set(CMAKE_INCLUDE_FLAG_ASM${ASM_DIALECT} "-I") # -I set(CMAKE_INCLUDE_FLAG_ASM${ASM_DIALECT} "-I") # -I
set(CMAKE_BASE_NAME) set(CMAKE_BASE_NAME)
@ -24,36 +24,36 @@ get_filename_component(CMAKE_BASE_NAME "${CMAKE_ASM${ASM_DIALECT}_COMPILER}" NAM
if("${CMAKE_BASE_NAME}" STREQUAL "as") if("${CMAKE_BASE_NAME}" STREQUAL "as")
set(CMAKE_BASE_NAME gas) set(CMAKE_BASE_NAME gas)
endif("${CMAKE_BASE_NAME}" STREQUAL "as") endif()
# Load compiler-specific information. # Load compiler-specific information.
set(_INCLUDED_FILE "") set(_INCLUDED_FILE "")
if(CMAKE_ASM${ASM_DIALECT}_COMPILER_ID) if(CMAKE_ASM${ASM_DIALECT}_COMPILER_ID)
include(Compiler/${CMAKE_ASM${ASM_DIALECT}_COMPILER_ID}-ASM${ASM_DIALECT} OPTIONAL RESULT_VARIABLE _INCLUDED_FILE) include(Compiler/${CMAKE_ASM${ASM_DIALECT}_COMPILER_ID}-ASM${ASM_DIALECT} OPTIONAL RESULT_VARIABLE _INCLUDED_FILE)
endif(CMAKE_ASM${ASM_DIALECT}_COMPILER_ID) endif()
if(NOT _INCLUDED_FILE) if(NOT _INCLUDED_FILE)
if("ASM${ASM_DIALECT}" STREQUAL "ASM") if("ASM${ASM_DIALECT}" STREQUAL "ASM")
message(STATUS "Warning: Did not find file Compiler/${CMAKE_ASM${ASM_DIALECT}_COMPILER_ID}-ASM${ASM_DIALECT}") message(STATUS "Warning: Did not find file Compiler/${CMAKE_ASM${ASM_DIALECT}_COMPILER_ID}-ASM${ASM_DIALECT}")
endif("ASM${ASM_DIALECT}" STREQUAL "ASM") endif()
include(Platform/${CMAKE_BASE_NAME} OPTIONAL) include(Platform/${CMAKE_BASE_NAME} OPTIONAL)
endif(NOT _INCLUDED_FILE) endif()
if(CMAKE_SYSTEM_PROCESSOR) if(CMAKE_SYSTEM_PROCESSOR)
include(Platform/${CMAKE_SYSTEM_NAME}-${CMAKE_ASM${ASM_DIALECT}_COMPILER_ID}-ASM${ASM_DIALECT}-${CMAKE_SYSTEM_PROCESSOR} OPTIONAL RESULT_VARIABLE _INCLUDED_FILE) include(Platform/${CMAKE_SYSTEM_NAME}-${CMAKE_ASM${ASM_DIALECT}_COMPILER_ID}-ASM${ASM_DIALECT}-${CMAKE_SYSTEM_PROCESSOR} OPTIONAL RESULT_VARIABLE _INCLUDED_FILE)
if(NOT _INCLUDED_FILE) if(NOT _INCLUDED_FILE)
include(Platform/${CMAKE_SYSTEM_NAME}-${CMAKE_BASE_NAME}-${CMAKE_SYSTEM_PROCESSOR} OPTIONAL) include(Platform/${CMAKE_SYSTEM_NAME}-${CMAKE_BASE_NAME}-${CMAKE_SYSTEM_PROCESSOR} OPTIONAL)
endif(NOT _INCLUDED_FILE) endif()
endif(CMAKE_SYSTEM_PROCESSOR) endif()
include(Platform/${CMAKE_SYSTEM_NAME}-${CMAKE_ASM${ASM_DIALECT}_COMPILER_ID}-ASM${ASM_DIALECT} OPTIONAL RESULT_VARIABLE _INCLUDED_FILE) include(Platform/${CMAKE_SYSTEM_NAME}-${CMAKE_ASM${ASM_DIALECT}_COMPILER_ID}-ASM${ASM_DIALECT} OPTIONAL RESULT_VARIABLE _INCLUDED_FILE)
if(NOT _INCLUDED_FILE) if(NOT _INCLUDED_FILE)
include(Platform/${CMAKE_SYSTEM_NAME}-${CMAKE_BASE_NAME} OPTIONAL) include(Platform/${CMAKE_SYSTEM_NAME}-${CMAKE_BASE_NAME} OPTIONAL)
endif(NOT _INCLUDED_FILE) endif()
# Set default assembler file extensions: # Set default assembler file extensions:
if(NOT CMAKE_ASM${ASM_DIALECT}_SOURCE_FILE_EXTENSIONS) if(NOT CMAKE_ASM${ASM_DIALECT}_SOURCE_FILE_EXTENSIONS)
set(CMAKE_ASM${ASM_DIALECT}_SOURCE_FILE_EXTENSIONS s;S;asm) set(CMAKE_ASM${ASM_DIALECT}_SOURCE_FILE_EXTENSIONS s;S;asm)
endif(NOT CMAKE_ASM${ASM_DIALECT}_SOURCE_FILE_EXTENSIONS) endif()
# Support for CMAKE_ASM${ASM_DIALECT}_FLAGS_INIT and friends: # Support for CMAKE_ASM${ASM_DIALECT}_FLAGS_INIT and friends:
@ -61,7 +61,7 @@ set(CMAKE_ASM${ASM_DIALECT}_FLAGS_INIT "$ENV{ASM${ASM_DIALECT}FLAGS} ${CMAKE_ASM
# avoid just having a space as the initial value for the cache # avoid just having a space as the initial value for the cache
if(CMAKE_ASM${ASM_DIALECT}_FLAGS_INIT STREQUAL " ") if(CMAKE_ASM${ASM_DIALECT}_FLAGS_INIT STREQUAL " ")
set(CMAKE_ASM${ASM_DIALECT}_FLAGS_INIT) set(CMAKE_ASM${ASM_DIALECT}_FLAGS_INIT)
endif(CMAKE_ASM${ASM_DIALECT}_FLAGS_INIT STREQUAL " ") endif()
set (CMAKE_ASM${ASM_DIALECT}_FLAGS "${CMAKE_ASM${ASM_DIALECT}_FLAGS_INIT}" CACHE STRING set (CMAKE_ASM${ASM_DIALECT}_FLAGS "${CMAKE_ASM${ASM_DIALECT}_FLAGS_INIT}" CACHE STRING
"Flags used by the assembler during all build types.") "Flags used by the assembler during all build types.")
@ -70,7 +70,7 @@ if(NOT CMAKE_NOT_USING_CONFIG_FLAGS)
if(NOT CMAKE_NO_BUILD_TYPE) if(NOT CMAKE_NO_BUILD_TYPE)
set (CMAKE_BUILD_TYPE ${CMAKE_BUILD_TYPE_INIT} CACHE STRING set (CMAKE_BUILD_TYPE ${CMAKE_BUILD_TYPE_INIT} CACHE STRING
"Choose the type of build, options are: None, Debug Release RelWithDebInfo MinSizeRel.") "Choose the type of build, options are: None, Debug Release RelWithDebInfo MinSizeRel.")
endif(NOT CMAKE_NO_BUILD_TYPE) endif()
set (CMAKE_ASM${ASM_DIALECT}_FLAGS_DEBUG "${CMAKE_ASM${ASM_DIALECT}_FLAGS_DEBUG_INIT}" CACHE STRING set (CMAKE_ASM${ASM_DIALECT}_FLAGS_DEBUG "${CMAKE_ASM${ASM_DIALECT}_FLAGS_DEBUG_INIT}" CACHE STRING
"Flags used by the assembler during debug builds.") "Flags used by the assembler during debug builds.")
set (CMAKE_ASM${ASM_DIALECT}_FLAGS_MINSIZEREL "${CMAKE_ASM${ASM_DIALECT}_FLAGS_MINSIZEREL_INIT}" CACHE STRING set (CMAKE_ASM${ASM_DIALECT}_FLAGS_MINSIZEREL "${CMAKE_ASM${ASM_DIALECT}_FLAGS_MINSIZEREL_INIT}" CACHE STRING
@ -79,7 +79,7 @@ if(NOT CMAKE_NOT_USING_CONFIG_FLAGS)
"Flags used by the assembler during release builds.") "Flags used by the assembler during release builds.")
set (CMAKE_ASM${ASM_DIALECT}_FLAGS_RELWITHDEBINFO "${CMAKE_ASM${ASM_DIALECT}_FLAGS_RELWITHDEBINFO_INIT}" CACHE STRING set (CMAKE_ASM${ASM_DIALECT}_FLAGS_RELWITHDEBINFO "${CMAKE_ASM${ASM_DIALECT}_FLAGS_RELWITHDEBINFO_INIT}" CACHE STRING
"Flags used by the assembler during Release with Debug Info builds.") "Flags used by the assembler during Release with Debug Info builds.")
endif(NOT CMAKE_NOT_USING_CONFIG_FLAGS) endif()
mark_as_advanced(CMAKE_ASM${ASM_DIALECT}_FLAGS mark_as_advanced(CMAKE_ASM${ASM_DIALECT}_FLAGS
CMAKE_ASM${ASM_DIALECT}_FLAGS_DEBUG CMAKE_ASM${ASM_DIALECT}_FLAGS_DEBUG
@ -91,18 +91,18 @@ mark_as_advanced(CMAKE_ASM${ASM_DIALECT}_FLAGS
if(NOT CMAKE_ASM${ASM_DIALECT}_COMPILE_OBJECT) if(NOT CMAKE_ASM${ASM_DIALECT}_COMPILE_OBJECT)
set(CMAKE_ASM${ASM_DIALECT}_COMPILE_OBJECT "<CMAKE_ASM${ASM_DIALECT}_COMPILER> <DEFINES> <FLAGS> -o <OBJECT> -c <SOURCE>") set(CMAKE_ASM${ASM_DIALECT}_COMPILE_OBJECT "<CMAKE_ASM${ASM_DIALECT}_COMPILER> <DEFINES> <FLAGS> -o <OBJECT> -c <SOURCE>")
endif(NOT CMAKE_ASM${ASM_DIALECT}_COMPILE_OBJECT) endif()
if(NOT CMAKE_ASM${ASM_DIALECT}_CREATE_STATIC_LIBRARY) if(NOT CMAKE_ASM${ASM_DIALECT}_CREATE_STATIC_LIBRARY)
set(CMAKE_ASM${ASM_DIALECT}_CREATE_STATIC_LIBRARY set(CMAKE_ASM${ASM_DIALECT}_CREATE_STATIC_LIBRARY
"<CMAKE_AR> cr <TARGET> <LINK_FLAGS> <OBJECTS> " "<CMAKE_AR> cr <TARGET> <LINK_FLAGS> <OBJECTS> "
"<CMAKE_RANLIB> <TARGET> ") "<CMAKE_RANLIB> <TARGET> ")
endif(NOT CMAKE_ASM${ASM_DIALECT}_CREATE_STATIC_LIBRARY) endif()
if(NOT CMAKE_ASM${ASM_DIALECT}_LINK_EXECUTABLE) if(NOT CMAKE_ASM${ASM_DIALECT}_LINK_EXECUTABLE)
set(CMAKE_ASM${ASM_DIALECT}_LINK_EXECUTABLE set(CMAKE_ASM${ASM_DIALECT}_LINK_EXECUTABLE
"<CMAKE_ASM${ASM_DIALECT}_COMPILER> <FLAGS> <CMAKE_ASM${ASM_DIALECT}_LINK_FLAGS> <LINK_FLAGS> <OBJECTS> -o <TARGET> <LINK_LIBRARIES>") "<CMAKE_ASM${ASM_DIALECT}_COMPILER> <FLAGS> <CMAKE_ASM${ASM_DIALECT}_LINK_FLAGS> <LINK_FLAGS> <OBJECTS> -o <TARGET> <LINK_LIBRARIES>")
endif(NOT CMAKE_ASM${ASM_DIALECT}_LINK_EXECUTABLE) endif()
if(NOT CMAKE_EXECUTABLE_RUNTIME_ASM${ASM_DIALECT}_FLAG) if(NOT CMAKE_EXECUTABLE_RUNTIME_ASM${ASM_DIALECT}_FLAG)
set(CMAKE_EXECUTABLE_RUNTIME_ASM${ASM_DIALECT}_FLAG ${CMAKE_SHARED_LIBRARY_RUNTIME_ASM${ASM_DIALECT}_FLAG}) set(CMAKE_EXECUTABLE_RUNTIME_ASM${ASM_DIALECT}_FLAG ${CMAKE_SHARED_LIBRARY_RUNTIME_ASM${ASM_DIALECT}_FLAG})
@ -119,11 +119,11 @@ endif()
# to be done # to be done
if(NOT CMAKE_ASM${ASM_DIALECT}_CREATE_SHARED_LIBRARY) if(NOT CMAKE_ASM${ASM_DIALECT}_CREATE_SHARED_LIBRARY)
set(CMAKE_ASM${ASM_DIALECT}_CREATE_SHARED_LIBRARY) set(CMAKE_ASM${ASM_DIALECT}_CREATE_SHARED_LIBRARY)
endif(NOT CMAKE_ASM${ASM_DIALECT}_CREATE_SHARED_LIBRARY) endif()
if(NOT CMAKE_ASM${ASM_DIALECT}_CREATE_SHARED_MODULE) if(NOT CMAKE_ASM${ASM_DIALECT}_CREATE_SHARED_MODULE)
set(CMAKE_ASM${ASM_DIALECT}_CREATE_SHARED_MODULE) set(CMAKE_ASM${ASM_DIALECT}_CREATE_SHARED_MODULE)
endif(NOT CMAKE_ASM${ASM_DIALECT}_CREATE_SHARED_MODULE) endif()
set(CMAKE_ASM${ASM_DIALECT}_INFOMATION_LOADED 1) set(CMAKE_ASM${ASM_DIALECT}_INFOMATION_LOADED 1)

View File

@ -16,11 +16,11 @@
if(CMAKE_GENERATOR MATCHES "Visual Studio 7") if(CMAKE_GENERATOR MATCHES "Visual Studio 7")
include(CMakeVS7BackwardCompatibility) include(CMakeVS7BackwardCompatibility)
set(CMAKE_SKIP_COMPATIBILITY_TESTS 1) set(CMAKE_SKIP_COMPATIBILITY_TESTS 1)
endif(CMAKE_GENERATOR MATCHES "Visual Studio 7") endif()
if(CMAKE_GENERATOR MATCHES "Visual Studio 6") if(CMAKE_GENERATOR MATCHES "Visual Studio 6")
include(CMakeVS6BackwardCompatibility) include(CMakeVS6BackwardCompatibility)
set(CMAKE_SKIP_COMPATIBILITY_TESTS 1) set(CMAKE_SKIP_COMPATIBILITY_TESTS 1)
endif(CMAKE_GENERATOR MATCHES "Visual Studio 6") endif()
if(NOT CMAKE_SKIP_COMPATIBILITY_TESTS) if(NOT CMAKE_SKIP_COMPATIBILITY_TESTS)
# Old CMake versions did not support OS X universal binaries anyway, # Old CMake versions did not support OS X universal binaries anyway,
@ -57,10 +57,10 @@ if(NOT CMAKE_SKIP_COMPATIBILITY_TESTS)
if("${X11_X11_INCLUDE_PATH}" MATCHES "^/usr/include$") if("${X11_X11_INCLUDE_PATH}" MATCHES "^/usr/include$")
set (CMAKE_X_CFLAGS "" CACHE STRING "X11 extra flags.") set (CMAKE_X_CFLAGS "" CACHE STRING "X11 extra flags.")
else("${X11_X11_INCLUDE_PATH}" MATCHES "^/usr/include$") else()
set (CMAKE_X_CFLAGS "-I${X11_X11_INCLUDE_PATH}" CACHE STRING set (CMAKE_X_CFLAGS "-I${X11_X11_INCLUDE_PATH}" CACHE STRING
"X11 extra flags.") "X11 extra flags.")
endif("${X11_X11_INCLUDE_PATH}" MATCHES "^/usr/include$") endif()
set (CMAKE_X_LIBS "${X11_LIBRARIES}" CACHE STRING set (CMAKE_X_LIBS "${X11_LIBRARIES}" CACHE STRING
"Libraries and options used in X11 programs.") "Libraries and options used in X11 programs.")
set (CMAKE_HAS_X "${X11_FOUND}" CACHE INTERNAL "Is X11 around.") set (CMAKE_HAS_X "${X11_FOUND}" CACHE INTERNAL "Is X11 around.")
@ -86,7 +86,7 @@ if(NOT CMAKE_SKIP_COMPATIBILITY_TESTS)
set(CMAKE_TRY_COMPILE_OSX_ARCHITECTURES) set(CMAKE_TRY_COMPILE_OSX_ARCHITECTURES)
set(__ERASE_CMAKE_TRY_COMPILE_OSX_ARCHITECTURES) set(__ERASE_CMAKE_TRY_COMPILE_OSX_ARCHITECTURES)
endif() endif()
endif(NOT CMAKE_SKIP_COMPATIBILITY_TESTS) endif()
mark_as_advanced( mark_as_advanced(
CMAKE_HP_PTHREADS CMAKE_HP_PTHREADS

View File

@ -26,10 +26,10 @@ if(NOT CMAKE_SKIP_COMPATIBILITY_TESTS)
set(CMAKE_TRY_ANSI_CXX_FLAGS "") set(CMAKE_TRY_ANSI_CXX_FLAGS "")
if(CMAKE_SYSTEM MATCHES "IRIX.*") if(CMAKE_SYSTEM MATCHES "IRIX.*")
set(CMAKE_TRY_ANSI_CXX_FLAGS "-LANG:std") set(CMAKE_TRY_ANSI_CXX_FLAGS "-LANG:std")
endif(CMAKE_SYSTEM MATCHES "IRIX.*") endif()
if(CMAKE_SYSTEM MATCHES "OSF.*") if(CMAKE_SYSTEM MATCHES "OSF.*")
set(CMAKE_TRY_ANSI_CXX_FLAGS "-std strict_ansi -nopure_cname") set(CMAKE_TRY_ANSI_CXX_FLAGS "-std strict_ansi -nopure_cname")
endif(CMAKE_SYSTEM MATCHES "OSF.*") endif()
# if CMAKE_TRY_ANSI_CXX_FLAGS has something in it, see # if CMAKE_TRY_ANSI_CXX_FLAGS has something in it, see
# if the compiler accepts it # if the compiler accepts it
if( CMAKE_TRY_ANSI_CXX_FLAGS MATCHES ".+") if( CMAKE_TRY_ANSI_CXX_FLAGS MATCHES ".+")
@ -39,9 +39,9 @@ if(NOT CMAKE_SKIP_COMPATIBILITY_TESTS)
if(CMAKE_CXX_ACCEPTS_FLAGS) if(CMAKE_CXX_ACCEPTS_FLAGS)
set(CMAKE_ANSI_CXXFLAGS ${CMAKE_TRY_ANSI_CXX_FLAGS} CACHE INTERNAL set(CMAKE_ANSI_CXXFLAGS ${CMAKE_TRY_ANSI_CXX_FLAGS} CACHE INTERNAL
"What flags are required by the c++ compiler to make it ansi." ) "What flags are required by the c++ compiler to make it ansi." )
endif(CMAKE_CXX_ACCEPTS_FLAGS) endif()
endif( CMAKE_TRY_ANSI_CXX_FLAGS MATCHES ".+") endif()
endif(NOT CMAKE_COMPILER_IS_GNUCXX) endif()
set(CMAKE_CXX_FLAGS_SAVE ${CMAKE_CXX_FLAGS}) set(CMAKE_CXX_FLAGS_SAVE ${CMAKE_CXX_FLAGS})
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CMAKE_ANSI_CXXFLAGS}") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CMAKE_ANSI_CXXFLAGS}")
include(TestForANSIStreamHeaders) include(TestForANSIStreamHeaders)
@ -50,5 +50,5 @@ if(NOT CMAKE_SKIP_COMPATIBILITY_TESTS)
include(TestForANSIForScope) include(TestForANSIForScope)
include(TestForSSTREAM) include(TestForSSTREAM)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS_SAVE}") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS_SAVE}")
endif(NOT CMAKE_SKIP_COMPATIBILITY_TESTS) endif()

View File

@ -14,13 +14,13 @@ set(CMAKE_COMPILER_IS_CYGWIN @CMAKE_COMPILER_IS_CYGWIN@)
if(CMAKE_COMPILER_IS_CYGWIN) if(CMAKE_COMPILER_IS_CYGWIN)
set(CYGWIN 1) set(CYGWIN 1)
set(UNIX 1) set(UNIX 1)
endif(CMAKE_COMPILER_IS_CYGWIN) endif()
set(CMAKE_C_COMPILER_ENV_VAR "CC") set(CMAKE_C_COMPILER_ENV_VAR "CC")
if(CMAKE_COMPILER_IS_MINGW) if(CMAKE_COMPILER_IS_MINGW)
set(MINGW 1) set(MINGW 1)
endif(CMAKE_COMPILER_IS_MINGW) endif()
set(CMAKE_C_COMPILER_ID_RUN 1) set(CMAKE_C_COMPILER_ID_RUN 1)
set(CMAKE_C_SOURCE_FILE_EXTENSIONS c) set(CMAKE_C_SOURCE_FILE_EXTENSIONS c)
set(CMAKE_C_IGNORE_EXTENSIONS h;H;o;O;obj;OBJ;def;DEF;rc;RC) set(CMAKE_C_IGNORE_EXTENSIONS h;H;o;O;obj;OBJ;def;DEF;rc;RC)
@ -33,11 +33,11 @@ set(CMAKE_C_LIBRARY_ARCHITECTURE "@CMAKE_C_LIBRARY_ARCHITECTURE@")
if(CMAKE_C_SIZEOF_DATA_PTR) if(CMAKE_C_SIZEOF_DATA_PTR)
set(CMAKE_SIZEOF_VOID_P "${CMAKE_C_SIZEOF_DATA_PTR}") set(CMAKE_SIZEOF_VOID_P "${CMAKE_C_SIZEOF_DATA_PTR}")
endif(CMAKE_C_SIZEOF_DATA_PTR) endif()
if(CMAKE_C_COMPILER_ABI) if(CMAKE_C_COMPILER_ABI)
set(CMAKE_INTERNAL_PLATFORM_ABI "${CMAKE_C_COMPILER_ABI}") set(CMAKE_INTERNAL_PLATFORM_ABI "${CMAKE_C_COMPILER_ABI}")
endif(CMAKE_C_COMPILER_ABI) endif()
if(CMAKE_C_LIBRARY_ARCHITECTURE) if(CMAKE_C_LIBRARY_ARCHITECTURE)
set(CMAKE_LIBRARY_ARCHITECTURE "@CMAKE_C_LIBRARY_ARCHITECTURE@") set(CMAKE_LIBRARY_ARCHITECTURE "@CMAKE_C_LIBRARY_ARCHITECTURE@")

View File

@ -22,51 +22,51 @@
# so set the extension here first so it can be overridden by the compiler specific file # so set the extension here first so it can be overridden by the compiler specific file
if(UNIX) if(UNIX)
set(CMAKE_C_OUTPUT_EXTENSION .o) set(CMAKE_C_OUTPUT_EXTENSION .o)
else(UNIX) else()
set(CMAKE_C_OUTPUT_EXTENSION .obj) set(CMAKE_C_OUTPUT_EXTENSION .obj)
endif(UNIX) endif()
set(_INCLUDED_FILE 0) set(_INCLUDED_FILE 0)
# Load compiler-specific information. # Load compiler-specific information.
if(CMAKE_C_COMPILER_ID) if(CMAKE_C_COMPILER_ID)
include(Compiler/${CMAKE_C_COMPILER_ID}-C OPTIONAL) include(Compiler/${CMAKE_C_COMPILER_ID}-C OPTIONAL)
endif(CMAKE_C_COMPILER_ID) endif()
set(CMAKE_BASE_NAME) set(CMAKE_BASE_NAME)
get_filename_component(CMAKE_BASE_NAME ${CMAKE_C_COMPILER} NAME_WE) get_filename_component(CMAKE_BASE_NAME ${CMAKE_C_COMPILER} NAME_WE)
if(CMAKE_COMPILER_IS_GNUCC) if(CMAKE_COMPILER_IS_GNUCC)
set(CMAKE_BASE_NAME gcc) set(CMAKE_BASE_NAME gcc)
endif(CMAKE_COMPILER_IS_GNUCC) endif()
# load a hardware specific file, mostly useful for embedded compilers # load a hardware specific file, mostly useful for embedded compilers
if(CMAKE_SYSTEM_PROCESSOR) if(CMAKE_SYSTEM_PROCESSOR)
if(CMAKE_C_COMPILER_ID) if(CMAKE_C_COMPILER_ID)
include(Platform/${CMAKE_SYSTEM_NAME}-${CMAKE_C_COMPILER_ID}-C-${CMAKE_SYSTEM_PROCESSOR} OPTIONAL RESULT_VARIABLE _INCLUDED_FILE) include(Platform/${CMAKE_SYSTEM_NAME}-${CMAKE_C_COMPILER_ID}-C-${CMAKE_SYSTEM_PROCESSOR} OPTIONAL RESULT_VARIABLE _INCLUDED_FILE)
endif(CMAKE_C_COMPILER_ID) endif()
if (NOT _INCLUDED_FILE) if (NOT _INCLUDED_FILE)
include(Platform/${CMAKE_SYSTEM_NAME}-${CMAKE_BASE_NAME}-${CMAKE_SYSTEM_PROCESSOR} OPTIONAL) include(Platform/${CMAKE_SYSTEM_NAME}-${CMAKE_BASE_NAME}-${CMAKE_SYSTEM_PROCESSOR} OPTIONAL)
endif (NOT _INCLUDED_FILE) endif ()
endif(CMAKE_SYSTEM_PROCESSOR) endif()
# load the system- and compiler specific files # load the system- and compiler specific files
if(CMAKE_C_COMPILER_ID) if(CMAKE_C_COMPILER_ID)
include(Platform/${CMAKE_SYSTEM_NAME}-${CMAKE_C_COMPILER_ID}-C include(Platform/${CMAKE_SYSTEM_NAME}-${CMAKE_C_COMPILER_ID}-C
OPTIONAL RESULT_VARIABLE _INCLUDED_FILE) OPTIONAL RESULT_VARIABLE _INCLUDED_FILE)
endif(CMAKE_C_COMPILER_ID) endif()
if (NOT _INCLUDED_FILE) if (NOT _INCLUDED_FILE)
include(Platform/${CMAKE_SYSTEM_NAME}-${CMAKE_BASE_NAME} include(Platform/${CMAKE_SYSTEM_NAME}-${CMAKE_BASE_NAME}
OPTIONAL RESULT_VARIABLE _INCLUDED_FILE) OPTIONAL RESULT_VARIABLE _INCLUDED_FILE)
endif (NOT _INCLUDED_FILE) endif ()
# We specify the compiler information in the system file for some # We specify the compiler information in the system file for some
# platforms, but this language may not have been enabled when the file # platforms, but this language may not have been enabled when the file
# was first included. Include it again to get the language info. # was first included. Include it again to get the language info.
# Remove this when all compiler info is removed from system files. # Remove this when all compiler info is removed from system files.
if (NOT _INCLUDED_FILE) if (NOT _INCLUDED_FILE)
include(Platform/${CMAKE_SYSTEM_NAME} OPTIONAL) include(Platform/${CMAKE_SYSTEM_NAME} OPTIONAL)
endif (NOT _INCLUDED_FILE) endif ()
if(CMAKE_C_SIZEOF_DATA_PTR) if(CMAKE_C_SIZEOF_DATA_PTR)
foreach(f ${CMAKE_C_ABI_FILES}) foreach(f ${CMAKE_C_ABI_FILES})
@ -100,13 +100,13 @@ endif()
if(NOT CMAKE_MODULE_EXISTS) if(NOT CMAKE_MODULE_EXISTS)
set(CMAKE_SHARED_MODULE_C_FLAGS ${CMAKE_SHARED_LIBRARY_C_FLAGS}) set(CMAKE_SHARED_MODULE_C_FLAGS ${CMAKE_SHARED_LIBRARY_C_FLAGS})
set(CMAKE_SHARED_MODULE_CREATE_C_FLAGS ${CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS}) set(CMAKE_SHARED_MODULE_CREATE_C_FLAGS ${CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS})
endif(NOT CMAKE_MODULE_EXISTS) endif()
set(CMAKE_C_FLAGS_INIT "$ENV{CFLAGS} ${CMAKE_C_FLAGS_INIT}") set(CMAKE_C_FLAGS_INIT "$ENV{CFLAGS} ${CMAKE_C_FLAGS_INIT}")
# avoid just having a space as the initial value for the cache # avoid just having a space as the initial value for the cache
if(CMAKE_C_FLAGS_INIT STREQUAL " ") if(CMAKE_C_FLAGS_INIT STREQUAL " ")
set(CMAKE_C_FLAGS_INIT) set(CMAKE_C_FLAGS_INIT)
endif(CMAKE_C_FLAGS_INIT STREQUAL " ") endif()
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS_INIT}" CACHE STRING set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS_INIT}" CACHE STRING
"Flags used by the compiler during all build types.") "Flags used by the compiler during all build types.")
@ -115,7 +115,7 @@ if(NOT CMAKE_NOT_USING_CONFIG_FLAGS)
if(NOT CMAKE_NO_BUILD_TYPE) if(NOT CMAKE_NO_BUILD_TYPE)
set (CMAKE_BUILD_TYPE ${CMAKE_BUILD_TYPE_INIT} CACHE STRING set (CMAKE_BUILD_TYPE ${CMAKE_BUILD_TYPE_INIT} CACHE STRING
"Choose the type of build, options are: None(CMAKE_CXX_FLAGS or CMAKE_C_FLAGS used) Debug Release RelWithDebInfo MinSizeRel.") "Choose the type of build, options are: None(CMAKE_CXX_FLAGS or CMAKE_C_FLAGS used) Debug Release RelWithDebInfo MinSizeRel.")
endif(NOT CMAKE_NO_BUILD_TYPE) endif()
set (CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG_INIT}" CACHE STRING set (CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG_INIT}" CACHE STRING
"Flags used by the compiler during debug builds.") "Flags used by the compiler during debug builds.")
set (CMAKE_C_FLAGS_MINSIZEREL "${CMAKE_C_FLAGS_MINSIZEREL_INIT}" CACHE STRING set (CMAKE_C_FLAGS_MINSIZEREL "${CMAKE_C_FLAGS_MINSIZEREL_INIT}" CACHE STRING
@ -124,13 +124,13 @@ if(NOT CMAKE_NOT_USING_CONFIG_FLAGS)
"Flags used by the compiler during release builds (/MD /Ob1 /Oi /Ot /Oy /Gs will produce slightly less optimized but smaller files).") "Flags used by the compiler during release builds (/MD /Ob1 /Oi /Ot /Oy /Gs will produce slightly less optimized but smaller files).")
set (CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO_INIT}" CACHE STRING set (CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO_INIT}" CACHE STRING
"Flags used by the compiler during Release with Debug Info builds.") "Flags used by the compiler during Release with Debug Info builds.")
endif(NOT CMAKE_NOT_USING_CONFIG_FLAGS) endif()
if(CMAKE_C_STANDARD_LIBRARIES_INIT) if(CMAKE_C_STANDARD_LIBRARIES_INIT)
set(CMAKE_C_STANDARD_LIBRARIES "${CMAKE_C_STANDARD_LIBRARIES_INIT}" set(CMAKE_C_STANDARD_LIBRARIES "${CMAKE_C_STANDARD_LIBRARIES_INIT}"
CACHE STRING "Libraries linked by defalut with all C applications.") CACHE STRING "Libraries linked by defalut with all C applications.")
mark_as_advanced(CMAKE_C_STANDARD_LIBRARIES) mark_as_advanced(CMAKE_C_STANDARD_LIBRARIES)
endif(CMAKE_C_STANDARD_LIBRARIES_INIT) endif()
include(CMakeCommonLanguageInclude) include(CMakeCommonLanguageInclude)
@ -165,12 +165,12 @@ include(CMakeCommonLanguageInclude)
if(NOT CMAKE_C_CREATE_SHARED_LIBRARY) if(NOT CMAKE_C_CREATE_SHARED_LIBRARY)
set(CMAKE_C_CREATE_SHARED_LIBRARY set(CMAKE_C_CREATE_SHARED_LIBRARY
"<CMAKE_C_COMPILER> <CMAKE_SHARED_LIBRARY_C_FLAGS> <LANGUAGE_COMPILE_FLAGS> <LINK_FLAGS> <CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS> <SONAME_FLAG><TARGET_SONAME> -o <TARGET> <OBJECTS> <LINK_LIBRARIES>") "<CMAKE_C_COMPILER> <CMAKE_SHARED_LIBRARY_C_FLAGS> <LANGUAGE_COMPILE_FLAGS> <LINK_FLAGS> <CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS> <SONAME_FLAG><TARGET_SONAME> -o <TARGET> <OBJECTS> <LINK_LIBRARIES>")
endif(NOT CMAKE_C_CREATE_SHARED_LIBRARY) endif()
# create a C shared module just copy the shared library rule # create a C shared module just copy the shared library rule
if(NOT CMAKE_C_CREATE_SHARED_MODULE) if(NOT CMAKE_C_CREATE_SHARED_MODULE)
set(CMAKE_C_CREATE_SHARED_MODULE ${CMAKE_C_CREATE_SHARED_LIBRARY}) set(CMAKE_C_CREATE_SHARED_MODULE ${CMAKE_C_CREATE_SHARED_LIBRARY})
endif(NOT CMAKE_C_CREATE_SHARED_MODULE) endif()
# Create a static archive incrementally for large object file counts. # Create a static archive incrementally for large object file counts.
# If CMAKE_C_CREATE_STATIC_LIBRARY is set it will override these. # If CMAKE_C_CREATE_STATIC_LIBRARY is set it will override these.
@ -188,24 +188,24 @@ endif()
if(NOT CMAKE_C_COMPILE_OBJECT) if(NOT CMAKE_C_COMPILE_OBJECT)
set(CMAKE_C_COMPILE_OBJECT set(CMAKE_C_COMPILE_OBJECT
"<CMAKE_C_COMPILER> <DEFINES> <FLAGS> -o <OBJECT> -c <SOURCE>") "<CMAKE_C_COMPILER> <DEFINES> <FLAGS> -o <OBJECT> -c <SOURCE>")
endif(NOT CMAKE_C_COMPILE_OBJECT) endif()
if(NOT CMAKE_C_LINK_EXECUTABLE) if(NOT CMAKE_C_LINK_EXECUTABLE)
set(CMAKE_C_LINK_EXECUTABLE set(CMAKE_C_LINK_EXECUTABLE
"<CMAKE_C_COMPILER> <FLAGS> <CMAKE_C_LINK_FLAGS> <LINK_FLAGS> <OBJECTS> -o <TARGET> <LINK_LIBRARIES>") "<CMAKE_C_COMPILER> <FLAGS> <CMAKE_C_LINK_FLAGS> <LINK_FLAGS> <OBJECTS> -o <TARGET> <LINK_LIBRARIES>")
endif(NOT CMAKE_C_LINK_EXECUTABLE) endif()
if(NOT CMAKE_EXECUTABLE_RUNTIME_C_FLAG) if(NOT CMAKE_EXECUTABLE_RUNTIME_C_FLAG)
set(CMAKE_EXECUTABLE_RUNTIME_C_FLAG ${CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG}) set(CMAKE_EXECUTABLE_RUNTIME_C_FLAG ${CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG})
endif(NOT CMAKE_EXECUTABLE_RUNTIME_C_FLAG) endif()
if(NOT CMAKE_EXECUTABLE_RUNTIME_C_FLAG_SEP) if(NOT CMAKE_EXECUTABLE_RUNTIME_C_FLAG_SEP)
set(CMAKE_EXECUTABLE_RUNTIME_C_FLAG_SEP ${CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG_SEP}) set(CMAKE_EXECUTABLE_RUNTIME_C_FLAG_SEP ${CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG_SEP})
endif(NOT CMAKE_EXECUTABLE_RUNTIME_C_FLAG_SEP) endif()
if(NOT CMAKE_EXECUTABLE_RPATH_LINK_C_FLAG) if(NOT CMAKE_EXECUTABLE_RPATH_LINK_C_FLAG)
set(CMAKE_EXECUTABLE_RPATH_LINK_C_FLAG ${CMAKE_SHARED_LIBRARY_RPATH_LINK_C_FLAG}) set(CMAKE_EXECUTABLE_RPATH_LINK_C_FLAG ${CMAKE_SHARED_LIBRARY_RPATH_LINK_C_FLAG})
endif(NOT CMAKE_EXECUTABLE_RPATH_LINK_C_FLAG) endif()
mark_as_advanced( mark_as_advanced(
CMAKE_C_FLAGS CMAKE_C_FLAGS

View File

@ -14,13 +14,13 @@ set(CMAKE_COMPILER_IS_CYGWIN @CMAKE_COMPILER_IS_CYGWIN@)
if(CMAKE_COMPILER_IS_CYGWIN) if(CMAKE_COMPILER_IS_CYGWIN)
set(CYGWIN 1) set(CYGWIN 1)
set(UNIX 1) set(UNIX 1)
endif(CMAKE_COMPILER_IS_CYGWIN) endif()
set(CMAKE_CXX_COMPILER_ENV_VAR "CXX") set(CMAKE_CXX_COMPILER_ENV_VAR "CXX")
if(CMAKE_COMPILER_IS_MINGW) if(CMAKE_COMPILER_IS_MINGW)
set(MINGW 1) set(MINGW 1)
endif(CMAKE_COMPILER_IS_MINGW) endif()
set(CMAKE_CXX_COMPILER_ID_RUN 1) set(CMAKE_CXX_COMPILER_ID_RUN 1)
set(CMAKE_CXX_IGNORE_EXTENSIONS inl;h;hpp;HPP;H;o;O;obj;OBJ;def;DEF;rc;RC) set(CMAKE_CXX_IGNORE_EXTENSIONS inl;h;hpp;HPP;H;o;O;obj;OBJ;def;DEF;rc;RC)
set(CMAKE_CXX_SOURCE_FILE_EXTENSIONS C;M;c++;cc;cpp;cxx;m;mm;CPP) set(CMAKE_CXX_SOURCE_FILE_EXTENSIONS C;M;c++;cc;cpp;cxx;m;mm;CPP)
@ -34,11 +34,11 @@ set(CMAKE_CXX_LIBRARY_ARCHITECTURE "@CMAKE_CXX_LIBRARY_ARCHITECTURE@")
if(CMAKE_CXX_SIZEOF_DATA_PTR) if(CMAKE_CXX_SIZEOF_DATA_PTR)
set(CMAKE_SIZEOF_VOID_P "${CMAKE_CXX_SIZEOF_DATA_PTR}") set(CMAKE_SIZEOF_VOID_P "${CMAKE_CXX_SIZEOF_DATA_PTR}")
endif(CMAKE_CXX_SIZEOF_DATA_PTR) endif()
if(CMAKE_CXX_COMPILER_ABI) if(CMAKE_CXX_COMPILER_ABI)
set(CMAKE_INTERNAL_PLATFORM_ABI "${CMAKE_CXX_COMPILER_ABI}") set(CMAKE_INTERNAL_PLATFORM_ABI "${CMAKE_CXX_COMPILER_ABI}")
endif(CMAKE_CXX_COMPILER_ABI) endif()
if(CMAKE_CXX_LIBRARY_ARCHITECTURE) if(CMAKE_CXX_LIBRARY_ARCHITECTURE)
set(CMAKE_LIBRARY_ARCHITECTURE "@CMAKE_CXX_LIBRARY_ARCHITECTURE@") set(CMAKE_LIBRARY_ARCHITECTURE "@CMAKE_CXX_LIBRARY_ARCHITECTURE@")

View File

@ -22,50 +22,50 @@
# so set the extension here first so it can be overridden by the compiler specific file # so set the extension here first so it can be overridden by the compiler specific file
if(UNIX) if(UNIX)
set(CMAKE_CXX_OUTPUT_EXTENSION .o) set(CMAKE_CXX_OUTPUT_EXTENSION .o)
else(UNIX) else()
set(CMAKE_CXX_OUTPUT_EXTENSION .obj) set(CMAKE_CXX_OUTPUT_EXTENSION .obj)
endif(UNIX) endif()
set(_INCLUDED_FILE 0) set(_INCLUDED_FILE 0)
# Load compiler-specific information. # Load compiler-specific information.
if(CMAKE_CXX_COMPILER_ID) if(CMAKE_CXX_COMPILER_ID)
include(Compiler/${CMAKE_CXX_COMPILER_ID}-CXX OPTIONAL) include(Compiler/${CMAKE_CXX_COMPILER_ID}-CXX OPTIONAL)
endif(CMAKE_CXX_COMPILER_ID) endif()
set(CMAKE_BASE_NAME) set(CMAKE_BASE_NAME)
get_filename_component(CMAKE_BASE_NAME ${CMAKE_CXX_COMPILER} NAME_WE) get_filename_component(CMAKE_BASE_NAME ${CMAKE_CXX_COMPILER} NAME_WE)
# since the gnu compiler has several names force g++ # since the gnu compiler has several names force g++
if(CMAKE_COMPILER_IS_GNUCXX) if(CMAKE_COMPILER_IS_GNUCXX)
set(CMAKE_BASE_NAME g++) set(CMAKE_BASE_NAME g++)
endif(CMAKE_COMPILER_IS_GNUCXX) endif()
# load a hardware specific file, mostly useful for embedded compilers # load a hardware specific file, mostly useful for embedded compilers
if(CMAKE_SYSTEM_PROCESSOR) if(CMAKE_SYSTEM_PROCESSOR)
if(CMAKE_CXX_COMPILER_ID) if(CMAKE_CXX_COMPILER_ID)
include(Platform/${CMAKE_SYSTEM_NAME}-${CMAKE_CXX_COMPILER_ID}-CXX-${CMAKE_SYSTEM_PROCESSOR} OPTIONAL RESULT_VARIABLE _INCLUDED_FILE) include(Platform/${CMAKE_SYSTEM_NAME}-${CMAKE_CXX_COMPILER_ID}-CXX-${CMAKE_SYSTEM_PROCESSOR} OPTIONAL RESULT_VARIABLE _INCLUDED_FILE)
endif(CMAKE_CXX_COMPILER_ID) endif()
if (NOT _INCLUDED_FILE) if (NOT _INCLUDED_FILE)
include(Platform/${CMAKE_SYSTEM_NAME}-${CMAKE_BASE_NAME}-${CMAKE_SYSTEM_PROCESSOR} OPTIONAL) include(Platform/${CMAKE_SYSTEM_NAME}-${CMAKE_BASE_NAME}-${CMAKE_SYSTEM_PROCESSOR} OPTIONAL)
endif (NOT _INCLUDED_FILE) endif ()
endif(CMAKE_SYSTEM_PROCESSOR) endif()
# load the system- and compiler specific files # load the system- and compiler specific files
if(CMAKE_CXX_COMPILER_ID) if(CMAKE_CXX_COMPILER_ID)
include(Platform/${CMAKE_SYSTEM_NAME}-${CMAKE_CXX_COMPILER_ID}-CXX OPTIONAL RESULT_VARIABLE _INCLUDED_FILE) include(Platform/${CMAKE_SYSTEM_NAME}-${CMAKE_CXX_COMPILER_ID}-CXX OPTIONAL RESULT_VARIABLE _INCLUDED_FILE)
endif(CMAKE_CXX_COMPILER_ID) endif()
if (NOT _INCLUDED_FILE) if (NOT _INCLUDED_FILE)
include(Platform/${CMAKE_SYSTEM_NAME}-${CMAKE_BASE_NAME} OPTIONAL include(Platform/${CMAKE_SYSTEM_NAME}-${CMAKE_BASE_NAME} OPTIONAL
RESULT_VARIABLE _INCLUDED_FILE) RESULT_VARIABLE _INCLUDED_FILE)
endif (NOT _INCLUDED_FILE) endif ()
# We specify the compiler information in the system file for some # We specify the compiler information in the system file for some
# platforms, but this language may not have been enabled when the file # platforms, but this language may not have been enabled when the file
# was first included. Include it again to get the language info. # was first included. Include it again to get the language info.
# Remove this when all compiler info is removed from system files. # Remove this when all compiler info is removed from system files.
if (NOT _INCLUDED_FILE) if (NOT _INCLUDED_FILE)
include(Platform/${CMAKE_SYSTEM_NAME} OPTIONAL) include(Platform/${CMAKE_SYSTEM_NAME} OPTIONAL)
endif (NOT _INCLUDED_FILE) endif ()
if(CMAKE_CXX_SIZEOF_DATA_PTR) if(CMAKE_CXX_SIZEOF_DATA_PTR)
foreach(f ${CMAKE_CXX_ABI_FILES}) foreach(f ${CMAKE_CXX_ABI_FILES})
@ -98,39 +98,39 @@ endif()
# so if these are not set just copy the flags from the c version # so if these are not set just copy the flags from the c version
if(NOT CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS) if(NOT CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS)
set(CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS ${CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS}) set(CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS ${CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS})
endif(NOT CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS) endif()
if(NOT CMAKE_CXX_COMPILE_OPTIONS_PIC) if(NOT CMAKE_CXX_COMPILE_OPTIONS_PIC)
set(CMAKE_CXX_COMPILE_OPTIONS_PIC ${CMAKE_C_COMPILE_OPTIONS_PIC}) set(CMAKE_CXX_COMPILE_OPTIONS_PIC ${CMAKE_C_COMPILE_OPTIONS_PIC})
endif(NOT CMAKE_CXX_COMPILE_OPTIONS_PIC) endif()
if(NOT CMAKE_CXX_COMPILE_OPTIONS_PIE) if(NOT CMAKE_CXX_COMPILE_OPTIONS_PIE)
set(CMAKE_CXX_COMPILE_OPTIONS_PIE ${CMAKE_C_COMPILE_OPTIONS_PIE}) set(CMAKE_CXX_COMPILE_OPTIONS_PIE ${CMAKE_C_COMPILE_OPTIONS_PIE})
endif(NOT CMAKE_CXX_COMPILE_OPTIONS_PIE) endif()
if(NOT CMAKE_CXX_COMPILE_OPTIONS_DLL) if(NOT CMAKE_CXX_COMPILE_OPTIONS_DLL)
set(CMAKE_CXX_COMPILE_OPTIONS_DLL ${CMAKE_C_COMPILE_OPTIONS_DLL}) set(CMAKE_CXX_COMPILE_OPTIONS_DLL ${CMAKE_C_COMPILE_OPTIONS_DLL})
endif(NOT CMAKE_CXX_COMPILE_OPTIONS_DLL) endif()
if(NOT CMAKE_SHARED_LIBRARY_CXX_FLAGS) if(NOT CMAKE_SHARED_LIBRARY_CXX_FLAGS)
set(CMAKE_SHARED_LIBRARY_CXX_FLAGS ${CMAKE_SHARED_LIBRARY_C_FLAGS}) set(CMAKE_SHARED_LIBRARY_CXX_FLAGS ${CMAKE_SHARED_LIBRARY_C_FLAGS})
endif(NOT CMAKE_SHARED_LIBRARY_CXX_FLAGS) endif()
if(NOT DEFINED CMAKE_SHARED_LIBRARY_LINK_CXX_FLAGS) if(NOT DEFINED CMAKE_SHARED_LIBRARY_LINK_CXX_FLAGS)
set(CMAKE_SHARED_LIBRARY_LINK_CXX_FLAGS ${CMAKE_SHARED_LIBRARY_LINK_C_FLAGS}) set(CMAKE_SHARED_LIBRARY_LINK_CXX_FLAGS ${CMAKE_SHARED_LIBRARY_LINK_C_FLAGS})
endif(NOT DEFINED CMAKE_SHARED_LIBRARY_LINK_CXX_FLAGS) endif()
if(NOT CMAKE_SHARED_LIBRARY_RUNTIME_CXX_FLAG) if(NOT CMAKE_SHARED_LIBRARY_RUNTIME_CXX_FLAG)
set(CMAKE_SHARED_LIBRARY_RUNTIME_CXX_FLAG ${CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG}) set(CMAKE_SHARED_LIBRARY_RUNTIME_CXX_FLAG ${CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG})
endif(NOT CMAKE_SHARED_LIBRARY_RUNTIME_CXX_FLAG) endif()
if(NOT CMAKE_SHARED_LIBRARY_RUNTIME_CXX_FLAG_SEP) if(NOT CMAKE_SHARED_LIBRARY_RUNTIME_CXX_FLAG_SEP)
set(CMAKE_SHARED_LIBRARY_RUNTIME_CXX_FLAG_SEP ${CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG_SEP}) set(CMAKE_SHARED_LIBRARY_RUNTIME_CXX_FLAG_SEP ${CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG_SEP})
endif(NOT CMAKE_SHARED_LIBRARY_RUNTIME_CXX_FLAG_SEP) endif()
if(NOT CMAKE_SHARED_LIBRARY_RPATH_LINK_CXX_FLAG) if(NOT CMAKE_SHARED_LIBRARY_RPATH_LINK_CXX_FLAG)
set(CMAKE_SHARED_LIBRARY_RPATH_LINK_CXX_FLAG ${CMAKE_SHARED_LIBRARY_RPATH_LINK_C_FLAG}) set(CMAKE_SHARED_LIBRARY_RPATH_LINK_CXX_FLAG ${CMAKE_SHARED_LIBRARY_RPATH_LINK_C_FLAG})
endif(NOT CMAKE_SHARED_LIBRARY_RPATH_LINK_CXX_FLAG) endif()
if(NOT DEFINED CMAKE_EXE_EXPORTS_CXX_FLAG) if(NOT DEFINED CMAKE_EXE_EXPORTS_CXX_FLAG)
set(CMAKE_EXE_EXPORTS_CXX_FLAG ${CMAKE_EXE_EXPORTS_C_FLAG}) set(CMAKE_EXE_EXPORTS_CXX_FLAG ${CMAKE_EXE_EXPORTS_C_FLAG})
@ -142,27 +142,27 @@ endif()
if(NOT CMAKE_EXECUTABLE_RUNTIME_CXX_FLAG) if(NOT CMAKE_EXECUTABLE_RUNTIME_CXX_FLAG)
set(CMAKE_EXECUTABLE_RUNTIME_CXX_FLAG ${CMAKE_SHARED_LIBRARY_RUNTIME_CXX_FLAG}) set(CMAKE_EXECUTABLE_RUNTIME_CXX_FLAG ${CMAKE_SHARED_LIBRARY_RUNTIME_CXX_FLAG})
endif(NOT CMAKE_EXECUTABLE_RUNTIME_CXX_FLAG) endif()
if(NOT CMAKE_EXECUTABLE_RUNTIME_CXX_FLAG_SEP) if(NOT CMAKE_EXECUTABLE_RUNTIME_CXX_FLAG_SEP)
set(CMAKE_EXECUTABLE_RUNTIME_CXX_FLAG_SEP ${CMAKE_SHARED_LIBRARY_RUNTIME_CXX_FLAG_SEP}) set(CMAKE_EXECUTABLE_RUNTIME_CXX_FLAG_SEP ${CMAKE_SHARED_LIBRARY_RUNTIME_CXX_FLAG_SEP})
endif(NOT CMAKE_EXECUTABLE_RUNTIME_CXX_FLAG_SEP) endif()
if(NOT CMAKE_EXECUTABLE_RPATH_LINK_CXX_FLAG) if(NOT CMAKE_EXECUTABLE_RPATH_LINK_CXX_FLAG)
set(CMAKE_EXECUTABLE_RPATH_LINK_CXX_FLAG ${CMAKE_SHARED_LIBRARY_RPATH_LINK_CXX_FLAG}) set(CMAKE_EXECUTABLE_RPATH_LINK_CXX_FLAG ${CMAKE_SHARED_LIBRARY_RPATH_LINK_CXX_FLAG})
endif(NOT CMAKE_EXECUTABLE_RPATH_LINK_CXX_FLAG) endif()
if(NOT DEFINED CMAKE_SHARED_LIBRARY_LINK_CXX_WITH_RUNTIME_PATH) if(NOT DEFINED CMAKE_SHARED_LIBRARY_LINK_CXX_WITH_RUNTIME_PATH)
set(CMAKE_SHARED_LIBRARY_LINK_CXX_WITH_RUNTIME_PATH ${CMAKE_SHARED_LIBRARY_LINK_C_WITH_RUNTIME_PATH}) set(CMAKE_SHARED_LIBRARY_LINK_CXX_WITH_RUNTIME_PATH ${CMAKE_SHARED_LIBRARY_LINK_C_WITH_RUNTIME_PATH})
endif(NOT DEFINED CMAKE_SHARED_LIBRARY_LINK_CXX_WITH_RUNTIME_PATH) endif()
if(NOT CMAKE_INCLUDE_FLAG_CXX) if(NOT CMAKE_INCLUDE_FLAG_CXX)
set(CMAKE_INCLUDE_FLAG_CXX ${CMAKE_INCLUDE_FLAG_C}) set(CMAKE_INCLUDE_FLAG_CXX ${CMAKE_INCLUDE_FLAG_C})
endif(NOT CMAKE_INCLUDE_FLAG_CXX) endif()
if(NOT CMAKE_INCLUDE_FLAG_SEP_CXX) if(NOT CMAKE_INCLUDE_FLAG_SEP_CXX)
set(CMAKE_INCLUDE_FLAG_SEP_CXX ${CMAKE_INCLUDE_FLAG_SEP_C}) set(CMAKE_INCLUDE_FLAG_SEP_CXX ${CMAKE_INCLUDE_FLAG_SEP_C})
endif(NOT CMAKE_INCLUDE_FLAG_SEP_CXX) endif()
# for most systems a module is the same as a shared library # for most systems a module is the same as a shared library
# so unless the variable CMAKE_MODULE_EXISTS is set just # so unless the variable CMAKE_MODULE_EXISTS is set just
@ -170,28 +170,28 @@ endif(NOT CMAKE_INCLUDE_FLAG_SEP_CXX)
if(NOT CMAKE_MODULE_EXISTS) if(NOT CMAKE_MODULE_EXISTS)
set(CMAKE_SHARED_MODULE_CXX_FLAGS ${CMAKE_SHARED_LIBRARY_CXX_FLAGS}) set(CMAKE_SHARED_MODULE_CXX_FLAGS ${CMAKE_SHARED_LIBRARY_CXX_FLAGS})
set(CMAKE_SHARED_MODULE_CREATE_CXX_FLAGS ${CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS}) set(CMAKE_SHARED_MODULE_CREATE_CXX_FLAGS ${CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS})
endif(NOT CMAKE_MODULE_EXISTS) endif()
# repeat for modules # repeat for modules
if(NOT CMAKE_SHARED_MODULE_CREATE_CXX_FLAGS) if(NOT CMAKE_SHARED_MODULE_CREATE_CXX_FLAGS)
set(CMAKE_SHARED_MODULE_CREATE_CXX_FLAGS ${CMAKE_SHARED_MODULE_CREATE_C_FLAGS}) set(CMAKE_SHARED_MODULE_CREATE_CXX_FLAGS ${CMAKE_SHARED_MODULE_CREATE_C_FLAGS})
endif(NOT CMAKE_SHARED_MODULE_CREATE_CXX_FLAGS) endif()
if(NOT CMAKE_SHARED_MODULE_CXX_FLAGS) if(NOT CMAKE_SHARED_MODULE_CXX_FLAGS)
set(CMAKE_SHARED_MODULE_CXX_FLAGS ${CMAKE_SHARED_MODULE_C_FLAGS}) set(CMAKE_SHARED_MODULE_CXX_FLAGS ${CMAKE_SHARED_MODULE_C_FLAGS})
endif(NOT CMAKE_SHARED_MODULE_CXX_FLAGS) endif()
# Initialize CXX link type selection flags from C versions. # Initialize CXX link type selection flags from C versions.
foreach(type SHARED_LIBRARY SHARED_MODULE EXE) foreach(type SHARED_LIBRARY SHARED_MODULE EXE)
if(NOT CMAKE_${type}_LINK_STATIC_CXX_FLAGS) if(NOT CMAKE_${type}_LINK_STATIC_CXX_FLAGS)
set(CMAKE_${type}_LINK_STATIC_CXX_FLAGS set(CMAKE_${type}_LINK_STATIC_CXX_FLAGS
${CMAKE_${type}_LINK_STATIC_C_FLAGS}) ${CMAKE_${type}_LINK_STATIC_C_FLAGS})
endif(NOT CMAKE_${type}_LINK_STATIC_CXX_FLAGS) endif()
if(NOT CMAKE_${type}_LINK_DYNAMIC_CXX_FLAGS) if(NOT CMAKE_${type}_LINK_DYNAMIC_CXX_FLAGS)
set(CMAKE_${type}_LINK_DYNAMIC_CXX_FLAGS set(CMAKE_${type}_LINK_DYNAMIC_CXX_FLAGS
${CMAKE_${type}_LINK_DYNAMIC_C_FLAGS}) ${CMAKE_${type}_LINK_DYNAMIC_C_FLAGS})
endif(NOT CMAKE_${type}_LINK_DYNAMIC_CXX_FLAGS) endif()
endforeach(type) endforeach()
# add the flags to the cache based # add the flags to the cache based
# on the initial values computed in the platform/*.cmake files # on the initial values computed in the platform/*.cmake files
@ -201,7 +201,7 @@ set(CMAKE_CXX_FLAGS_INIT "$ENV{CXXFLAGS} ${CMAKE_CXX_FLAGS_INIT}")
# avoid just having a space as the initial value for the cache # avoid just having a space as the initial value for the cache
if(CMAKE_CXX_FLAGS_INIT STREQUAL " ") if(CMAKE_CXX_FLAGS_INIT STREQUAL " ")
set(CMAKE_CXX_FLAGS_INIT) set(CMAKE_CXX_FLAGS_INIT)
endif(CMAKE_CXX_FLAGS_INIT STREQUAL " ") endif()
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS_INIT}" CACHE STRING set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS_INIT}" CACHE STRING
"Flags used by the compiler during all build types.") "Flags used by the compiler during all build types.")
@ -215,13 +215,13 @@ if(NOT CMAKE_NOT_USING_CONFIG_FLAGS)
set (CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO_INIT}" CACHE STRING set (CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO_INIT}" CACHE STRING
"Flags used by the compiler during Release with Debug Info builds.") "Flags used by the compiler during Release with Debug Info builds.")
endif(NOT CMAKE_NOT_USING_CONFIG_FLAGS) endif()
if(CMAKE_CXX_STANDARD_LIBRARIES_INIT) if(CMAKE_CXX_STANDARD_LIBRARIES_INIT)
set(CMAKE_CXX_STANDARD_LIBRARIES "${CMAKE_CXX_STANDARD_LIBRARIES_INIT}" set(CMAKE_CXX_STANDARD_LIBRARIES "${CMAKE_CXX_STANDARD_LIBRARIES_INIT}"
CACHE STRING "Libraries linked by defalut with all C++ applications.") CACHE STRING "Libraries linked by defalut with all C++ applications.")
mark_as_advanced(CMAKE_CXX_STANDARD_LIBRARIES) mark_as_advanced(CMAKE_CXX_STANDARD_LIBRARIES)
endif(CMAKE_CXX_STANDARD_LIBRARIES_INIT) endif()
include(CMakeCommonLanguageInclude) include(CMakeCommonLanguageInclude)
@ -255,12 +255,12 @@ include(CMakeCommonLanguageInclude)
if(NOT CMAKE_CXX_CREATE_SHARED_LIBRARY) if(NOT CMAKE_CXX_CREATE_SHARED_LIBRARY)
set(CMAKE_CXX_CREATE_SHARED_LIBRARY set(CMAKE_CXX_CREATE_SHARED_LIBRARY
"<CMAKE_CXX_COMPILER> <CMAKE_SHARED_LIBRARY_CXX_FLAGS> <LANGUAGE_COMPILE_FLAGS> <LINK_FLAGS> <CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS> <SONAME_FLAG><TARGET_SONAME> -o <TARGET> <OBJECTS> <LINK_LIBRARIES>") "<CMAKE_CXX_COMPILER> <CMAKE_SHARED_LIBRARY_CXX_FLAGS> <LANGUAGE_COMPILE_FLAGS> <LINK_FLAGS> <CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS> <SONAME_FLAG><TARGET_SONAME> -o <TARGET> <OBJECTS> <LINK_LIBRARIES>")
endif(NOT CMAKE_CXX_CREATE_SHARED_LIBRARY) endif()
# create a c++ shared module copy the shared library rule by default # create a c++ shared module copy the shared library rule by default
if(NOT CMAKE_CXX_CREATE_SHARED_MODULE) if(NOT CMAKE_CXX_CREATE_SHARED_MODULE)
set(CMAKE_CXX_CREATE_SHARED_MODULE ${CMAKE_CXX_CREATE_SHARED_LIBRARY}) set(CMAKE_CXX_CREATE_SHARED_MODULE ${CMAKE_CXX_CREATE_SHARED_LIBRARY})
endif(NOT CMAKE_CXX_CREATE_SHARED_MODULE) endif()
# Create a static archive incrementally for large object file counts. # Create a static archive incrementally for large object file counts.
@ -279,12 +279,12 @@ endif()
if(NOT CMAKE_CXX_COMPILE_OBJECT) if(NOT CMAKE_CXX_COMPILE_OBJECT)
set(CMAKE_CXX_COMPILE_OBJECT set(CMAKE_CXX_COMPILE_OBJECT
"<CMAKE_CXX_COMPILER> <DEFINES> <FLAGS> -o <OBJECT> -c <SOURCE>") "<CMAKE_CXX_COMPILER> <DEFINES> <FLAGS> -o <OBJECT> -c <SOURCE>")
endif(NOT CMAKE_CXX_COMPILE_OBJECT) endif()
if(NOT CMAKE_CXX_LINK_EXECUTABLE) if(NOT CMAKE_CXX_LINK_EXECUTABLE)
set(CMAKE_CXX_LINK_EXECUTABLE set(CMAKE_CXX_LINK_EXECUTABLE
"<CMAKE_CXX_COMPILER> <FLAGS> <CMAKE_CXX_LINK_FLAGS> <LINK_FLAGS> <OBJECTS> -o <TARGET> <LINK_LIBRARIES>") "<CMAKE_CXX_COMPILER> <FLAGS> <CMAKE_CXX_LINK_FLAGS> <LINK_FLAGS> <OBJECTS> -o <TARGET> <LINK_LIBRARIES>")
endif(NOT CMAKE_CXX_LINK_EXECUTABLE) endif()
mark_as_advanced( mark_as_advanced(
CMAKE_BUILD_TOOL CMAKE_BUILD_TOOL

View File

@ -25,7 +25,7 @@ if(NOT CMAKE_NOT_USING_CONFIG_FLAGS)
if(NOT CMAKE_NO_BUILD_TYPE) if(NOT CMAKE_NO_BUILD_TYPE)
set (CMAKE_BUILD_TYPE ${CMAKE_BUILD_TYPE_INIT} CACHE STRING set (CMAKE_BUILD_TYPE ${CMAKE_BUILD_TYPE_INIT} CACHE STRING
"Choose the type of build, options are: None(CMAKE_CXX_FLAGS or CMAKE_C_FLAGS used) Debug Release RelWithDebInfo MinSizeRel.") "Choose the type of build, options are: None(CMAKE_CXX_FLAGS or CMAKE_C_FLAGS used) Debug Release RelWithDebInfo MinSizeRel.")
endif(NOT CMAKE_NO_BUILD_TYPE) endif()
set (CMAKE_EXE_LINKER_FLAGS_DEBUG ${CMAKE_EXE_LINKER_FLAGS_DEBUG_INIT} CACHE STRING set (CMAKE_EXE_LINKER_FLAGS_DEBUG ${CMAKE_EXE_LINKER_FLAGS_DEBUG_INIT} CACHE STRING
"Flags used by the linker during debug builds.") "Flags used by the linker during debug builds.")
@ -68,7 +68,7 @@ if(NOT CMAKE_NOT_USING_CONFIG_FLAGS)
${CMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO_INIT} CACHE STRING ${CMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO_INIT} CACHE STRING
"Flags used by the linker during Release with Debug Info builds.") "Flags used by the linker during Release with Debug Info builds.")
endif(NOT CMAKE_NOT_USING_CONFIG_FLAGS) endif()
# shared linker flags # shared linker flags
set (CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS_INIT} $ENV{LDFLAGS}" set (CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS_INIT} $ENV{LDFLAGS}"
CACHE STRING "Flags used by the linker during the creation of dll's.") CACHE STRING "Flags used by the linker during the creation of dll's.")

View File

@ -31,21 +31,21 @@ macro(CMAKE_DEPENDENT_OPTION option doc default depends force)
foreach(d ${depends}) foreach(d ${depends})
string(REGEX REPLACE " +" ";" CMAKE_DEPENDENT_OPTION_DEP "${d}") string(REGEX REPLACE " +" ";" CMAKE_DEPENDENT_OPTION_DEP "${d}")
if(${CMAKE_DEPENDENT_OPTION_DEP}) if(${CMAKE_DEPENDENT_OPTION_DEP})
else(${CMAKE_DEPENDENT_OPTION_DEP}) else()
set(${option}_AVAILABLE 0) set(${option}_AVAILABLE 0)
endif(${CMAKE_DEPENDENT_OPTION_DEP}) endif()
endforeach(d) endforeach()
if(${option}_AVAILABLE) if(${option}_AVAILABLE)
option(${option} "${doc}" "${default}") option(${option} "${doc}" "${default}")
set(${option} "${${option}}" CACHE BOOL "${doc}" FORCE) set(${option} "${${option}}" CACHE BOOL "${doc}" FORCE)
else(${option}_AVAILABLE) else()
if(${option} MATCHES "^${option}$") if(${option} MATCHES "^${option}$")
else(${option} MATCHES "^${option}$") else()
set(${option} "${${option}}" CACHE INTERNAL "${doc}") set(${option} "${${option}}" CACHE INTERNAL "${doc}")
endif(${option} MATCHES "^${option}$") endif()
set(${option} ${force}) set(${option} ${force})
endif(${option}_AVAILABLE) endif()
else(${option}_ISSET MATCHES "^${option}_ISSET$") else()
set(${option} "${${option}_ISSET}") set(${option} "${${option}_ISSET}")
endif(${option}_ISSET MATCHES "^${option}_ISSET$") endif()
endmacro(CMAKE_DEPENDENT_OPTION) endmacro()

View File

@ -20,7 +20,7 @@ if(NOT CMAKE_ASM${ASM_DIALECT}_COMPILER)
# prefer the environment variable ASM # prefer the environment variable ASM
if($ENV{ASM${ASM_DIALECT}} MATCHES ".+") if($ENV{ASM${ASM_DIALECT}} MATCHES ".+")
set(CMAKE_ASM${ASM_DIALECT}_COMPILER_INIT "$ENV{ASM${ASM_DIALECT}}") set(CMAKE_ASM${ASM_DIALECT}_COMPILER_INIT "$ENV{ASM${ASM_DIALECT}}")
endif($ENV{ASM${ASM_DIALECT}} MATCHES ".+") endif()
# finally list compilers to try # finally list compilers to try
if("ASM${ASM_DIALECT}" STREQUAL "ASM") # the generic assembler support if("ASM${ASM_DIALECT}" STREQUAL "ASM") # the generic assembler support
@ -47,7 +47,7 @@ if(NOT CMAKE_ASM${ASM_DIALECT}_COMPILER)
# Find the compiler. # Find the compiler.
_cmake_find_compiler(ASM${ASM_DIALECT}) _cmake_find_compiler(ASM${ASM_DIALECT})
else(NOT CMAKE_ASM${ASM_DIALECT}_COMPILER) else()
# we only get here if CMAKE_ASM${ASM_DIALECT}_COMPILER was specified using -D or a pre-made CMakeCache.txt # we only get here if CMAKE_ASM${ASM_DIALECT}_COMPILER was specified using -D or a pre-made CMakeCache.txt
# (e.g. via ctest) or set in CMAKE_TOOLCHAIN_FILE # (e.g. via ctest) or set in CMAKE_TOOLCHAIN_FILE
@ -62,14 +62,14 @@ else(NOT CMAKE_ASM${ASM_DIALECT}_COMPILER)
mark_as_advanced(CMAKE_ASM${ASM_DIALECT}_COMPILER_WITH_PATH) mark_as_advanced(CMAKE_ASM${ASM_DIALECT}_COMPILER_WITH_PATH)
if(CMAKE_ASM${ASM_DIALECT}_COMPILER_WITH_PATH) if(CMAKE_ASM${ASM_DIALECT}_COMPILER_WITH_PATH)
set(CMAKE_ASM${ASM_DIALECT}_COMPILER ${CMAKE_ASM${ASM_DIALECT}_COMPILER_WITH_PATH} CACHE FILEPATH "Assembler" FORCE) set(CMAKE_ASM${ASM_DIALECT}_COMPILER ${CMAKE_ASM${ASM_DIALECT}_COMPILER_WITH_PATH} CACHE FILEPATH "Assembler" FORCE)
endif(CMAKE_ASM${ASM_DIALECT}_COMPILER_WITH_PATH) endif()
endif(NOT _CMAKE_USER_ASM${ASM_DIALECT}_COMPILER_PATH) endif()
endif(NOT CMAKE_ASM${ASM_DIALECT}_COMPILER) endif()
mark_as_advanced(CMAKE_ASM${ASM_DIALECT}_COMPILER) mark_as_advanced(CMAKE_ASM${ASM_DIALECT}_COMPILER)
if (NOT _CMAKE_TOOLCHAIN_LOCATION) if (NOT _CMAKE_TOOLCHAIN_LOCATION)
get_filename_component(_CMAKE_TOOLCHAIN_LOCATION "${CMAKE_ASM${ASM_DIALECT}_COMPILER}" PATH) get_filename_component(_CMAKE_TOOLCHAIN_LOCATION "${CMAKE_ASM${ASM_DIALECT}_COMPILER}" PATH)
endif (NOT _CMAKE_TOOLCHAIN_LOCATION) endif ()
if(NOT CMAKE_ASM${ASM_DIALECT}_COMPILER_ID) if(NOT CMAKE_ASM${ASM_DIALECT}_COMPILER_ID)
@ -110,9 +110,9 @@ endif()
if(CMAKE_ASM${ASM_DIALECT}_COMPILER_ID) if(CMAKE_ASM${ASM_DIALECT}_COMPILER_ID)
message(STATUS "The ASM${ASM_DIALECT} compiler identification is ${CMAKE_ASM${ASM_DIALECT}_COMPILER_ID}") message(STATUS "The ASM${ASM_DIALECT} compiler identification is ${CMAKE_ASM${ASM_DIALECT}_COMPILER_ID}")
else(CMAKE_ASM${ASM_DIALECT}_COMPILER_ID) else()
message(STATUS "The ASM${ASM_DIALECT} compiler identification is unknown") message(STATUS "The ASM${ASM_DIALECT} compiler identification is unknown")
endif(CMAKE_ASM${ASM_DIALECT}_COMPILER_ID) endif()
@ -127,22 +127,22 @@ if (NOT _CMAKE_TOOLCHAIN_PREFIX)
get_filename_component(COMPILER_BASENAME "${CMAKE_ASM${ASM_DIALECT}_COMPILER}" NAME) get_filename_component(COMPILER_BASENAME "${CMAKE_ASM${ASM_DIALECT}_COMPILER}" NAME)
if (COMPILER_BASENAME MATCHES "^(.+-)g?as(-[0-9]+\\.[0-9]+\\.[0-9]+)?(\\.exe)?$") if (COMPILER_BASENAME MATCHES "^(.+-)g?as(-[0-9]+\\.[0-9]+\\.[0-9]+)?(\\.exe)?$")
set(_CMAKE_TOOLCHAIN_PREFIX ${CMAKE_MATCH_1}) set(_CMAKE_TOOLCHAIN_PREFIX ${CMAKE_MATCH_1})
endif (COMPILER_BASENAME MATCHES "^(.+-)g?as(-[0-9]+\\.[0-9]+\\.[0-9]+)?(\\.exe)?$") endif ()
endif (NOT _CMAKE_TOOLCHAIN_PREFIX) endif ()
# Now try the C compiler regexp: # Now try the C compiler regexp:
if (NOT _CMAKE_TOOLCHAIN_PREFIX) if (NOT _CMAKE_TOOLCHAIN_PREFIX)
if (COMPILER_BASENAME MATCHES "^(.+-)g?cc(-[0-9]+\\.[0-9]+\\.[0-9]+)?(\\.exe)?$") if (COMPILER_BASENAME MATCHES "^(.+-)g?cc(-[0-9]+\\.[0-9]+\\.[0-9]+)?(\\.exe)?$")
set(_CMAKE_TOOLCHAIN_PREFIX ${CMAKE_MATCH_1}) set(_CMAKE_TOOLCHAIN_PREFIX ${CMAKE_MATCH_1})
endif (COMPILER_BASENAME MATCHES "^(.+-)g?cc(-[0-9]+\\.[0-9]+\\.[0-9]+)?(\\.exe)?$") endif ()
endif (NOT _CMAKE_TOOLCHAIN_PREFIX) endif ()
# Finally try the CXX compiler regexp: # Finally try the CXX compiler regexp:
if (NOT _CMAKE_TOOLCHAIN_PREFIX) if (NOT _CMAKE_TOOLCHAIN_PREFIX)
if (COMPILER_BASENAME MATCHES "^(.+-)[gc]\\+\\+(-[0-9]+\\.[0-9]+\\.[0-9]+)?(\\.exe)?$") if (COMPILER_BASENAME MATCHES "^(.+-)[gc]\\+\\+(-[0-9]+\\.[0-9]+\\.[0-9]+)?(\\.exe)?$")
set(_CMAKE_TOOLCHAIN_PREFIX ${CMAKE_MATCH_1}) set(_CMAKE_TOOLCHAIN_PREFIX ${CMAKE_MATCH_1})
endif (COMPILER_BASENAME MATCHES "^(.+-)[gc]\\+\\+(-[0-9]+\\.[0-9]+\\.[0-9]+)?(\\.exe)?$") endif ()
endif (NOT _CMAKE_TOOLCHAIN_PREFIX) endif ()
include(CMakeFindBinUtils) include(CMakeFindBinUtils)
@ -151,9 +151,9 @@ set(CMAKE_ASM${ASM_DIALECT}_COMPILER_ENV_VAR "ASM${ASM_DIALECT}")
if(CMAKE_ASM${ASM_DIALECT}_COMPILER) if(CMAKE_ASM${ASM_DIALECT}_COMPILER)
message(STATUS "Found assembler: ${CMAKE_ASM${ASM_DIALECT}_COMPILER}") message(STATUS "Found assembler: ${CMAKE_ASM${ASM_DIALECT}_COMPILER}")
else(CMAKE_ASM${ASM_DIALECT}_COMPILER) else()
message(STATUS "Didn't find assembler") message(STATUS "Didn't find assembler")
endif(CMAKE_ASM${ASM_DIALECT}_COMPILER) endif()
set(_CMAKE_ASM_COMPILER "${CMAKE_ASM${ASM_DIALECT}_COMPILER}") set(_CMAKE_ASM_COMPILER "${CMAKE_ASM${ASM_DIALECT}_COMPILER}")

View File

@ -19,9 +19,9 @@ set(ASM_DIALECT "_MASM")
# if we are using the 64bit cl compiler, assume we also want the 64bit assembler # if we are using the 64bit cl compiler, assume we also want the 64bit assembler
if(CMAKE_CL_64) if(CMAKE_CL_64)
set(CMAKE_ASM${ASM_DIALECT}_COMPILER_INIT ml64) set(CMAKE_ASM${ASM_DIALECT}_COMPILER_INIT ml64)
else(CMAKE_CL_64) else()
set(CMAKE_ASM${ASM_DIALECT}_COMPILER_INIT ml) set(CMAKE_ASM${ASM_DIALECT}_COMPILER_INIT ml)
endif(CMAKE_CL_64) endif()
include(CMakeDetermineASMCompiler) include(CMakeDetermineASMCompiler)
set(ASM_DIALECT) set(ASM_DIALECT)

View File

@ -19,7 +19,7 @@ set(CMAKE_ASM_NASM_COMPILER_INIT nasm yasm)
if(NOT CMAKE_ASM_NASM_COMPILER) if(NOT CMAKE_ASM_NASM_COMPILER)
find_program(CMAKE_ASM_NASM_COMPILER nasm find_program(CMAKE_ASM_NASM_COMPILER nasm
"$ENV{ProgramFiles}/NASM") "$ENV{ProgramFiles}/NASM")
endif(NOT CMAKE_ASM_NASM_COMPILER) endif()
# Load the generic DetermineASM compiler file with the DIALECT set properly: # Load the generic DetermineASM compiler file with the DIALECT set properly:
set(ASM_DIALECT "_NASM") set(ASM_DIALECT "_NASM")

View File

@ -47,18 +47,18 @@ if(NOT CMAKE_C_COMPILER)
get_filename_component(CMAKE_C_COMPILER_INIT $ENV{CC} PROGRAM PROGRAM_ARGS CMAKE_C_FLAGS_ENV_INIT) get_filename_component(CMAKE_C_COMPILER_INIT $ENV{CC} PROGRAM PROGRAM_ARGS CMAKE_C_FLAGS_ENV_INIT)
if(CMAKE_C_FLAGS_ENV_INIT) if(CMAKE_C_FLAGS_ENV_INIT)
set(CMAKE_C_COMPILER_ARG1 "${CMAKE_C_FLAGS_ENV_INIT}" CACHE STRING "First argument to C compiler") set(CMAKE_C_COMPILER_ARG1 "${CMAKE_C_FLAGS_ENV_INIT}" CACHE STRING "First argument to C compiler")
endif(CMAKE_C_FLAGS_ENV_INIT) endif()
if(NOT EXISTS ${CMAKE_C_COMPILER_INIT}) if(NOT EXISTS ${CMAKE_C_COMPILER_INIT})
message(FATAL_ERROR "Could not find compiler set in environment variable CC:\n$ENV{CC}.") message(FATAL_ERROR "Could not find compiler set in environment variable CC:\n$ENV{CC}.")
endif(NOT EXISTS ${CMAKE_C_COMPILER_INIT}) endif()
endif($ENV{CC} MATCHES ".+") endif()
# next try prefer the compiler specified by the generator # next try prefer the compiler specified by the generator
if(CMAKE_GENERATOR_CC) if(CMAKE_GENERATOR_CC)
if(NOT CMAKE_C_COMPILER_INIT) if(NOT CMAKE_C_COMPILER_INIT)
set(CMAKE_C_COMPILER_INIT ${CMAKE_GENERATOR_CC}) set(CMAKE_C_COMPILER_INIT ${CMAKE_GENERATOR_CC})
endif(NOT CMAKE_C_COMPILER_INIT) endif()
endif(CMAKE_GENERATOR_CC) endif()
# finally list compilers to try # finally list compilers to try
if(NOT CMAKE_C_COMPILER_INIT) if(NOT CMAKE_C_COMPILER_INIT)
@ -67,7 +67,7 @@ if(NOT CMAKE_C_COMPILER)
_cmake_find_compiler(C) _cmake_find_compiler(C)
else(NOT CMAKE_C_COMPILER) else()
# we only get here if CMAKE_C_COMPILER was specified using -D or a pre-made CMakeCache.txt # we only get here if CMAKE_C_COMPILER was specified using -D or a pre-made CMakeCache.txt
# (e.g. via ctest) or set in CMAKE_TOOLCHAIN_FILE # (e.g. via ctest) or set in CMAKE_TOOLCHAIN_FILE
@ -78,7 +78,7 @@ else(NOT CMAKE_C_COMPILER)
if("${_CMAKE_C_COMPILER_LIST_LENGTH}" EQUAL 2) if("${_CMAKE_C_COMPILER_LIST_LENGTH}" EQUAL 2)
list(GET CMAKE_C_COMPILER 1 CMAKE_C_COMPILER_ARG1) list(GET CMAKE_C_COMPILER 1 CMAKE_C_COMPILER_ARG1)
list(GET CMAKE_C_COMPILER 0 CMAKE_C_COMPILER) list(GET CMAKE_C_COMPILER 0 CMAKE_C_COMPILER)
endif("${_CMAKE_C_COMPILER_LIST_LENGTH}" EQUAL 2) endif()
# if a compiler was specified by the user but without path, # if a compiler was specified by the user but without path,
# now try to find it with the full path # now try to find it with the full path
@ -91,21 +91,21 @@ else(NOT CMAKE_C_COMPILER)
mark_as_advanced(CMAKE_C_COMPILER_WITH_PATH) mark_as_advanced(CMAKE_C_COMPILER_WITH_PATH)
if(CMAKE_C_COMPILER_WITH_PATH) if(CMAKE_C_COMPILER_WITH_PATH)
set(CMAKE_C_COMPILER ${CMAKE_C_COMPILER_WITH_PATH} CACHE STRING "C compiler" FORCE) set(CMAKE_C_COMPILER ${CMAKE_C_COMPILER_WITH_PATH} CACHE STRING "C compiler" FORCE)
endif(CMAKE_C_COMPILER_WITH_PATH) endif()
endif(NOT _CMAKE_USER_C_COMPILER_PATH) endif()
endif(NOT CMAKE_C_COMPILER) endif()
mark_as_advanced(CMAKE_C_COMPILER) mark_as_advanced(CMAKE_C_COMPILER)
if (NOT _CMAKE_TOOLCHAIN_LOCATION) if (NOT _CMAKE_TOOLCHAIN_LOCATION)
get_filename_component(_CMAKE_TOOLCHAIN_LOCATION "${CMAKE_C_COMPILER}" PATH) get_filename_component(_CMAKE_TOOLCHAIN_LOCATION "${CMAKE_C_COMPILER}" PATH)
endif (NOT _CMAKE_TOOLCHAIN_LOCATION) endif ()
# Build a small source file to identify the compiler. # Build a small source file to identify the compiler.
if(${CMAKE_GENERATOR} MATCHES "Visual Studio") if(${CMAKE_GENERATOR} MATCHES "Visual Studio")
set(CMAKE_C_COMPILER_ID_RUN 1) set(CMAKE_C_COMPILER_ID_RUN 1)
set(CMAKE_C_PLATFORM_ID "Windows") set(CMAKE_C_PLATFORM_ID "Windows")
set(CMAKE_C_COMPILER_ID "MSVC") set(CMAKE_C_COMPILER_ID "MSVC")
endif(${CMAKE_GENERATOR} MATCHES "Visual Studio") endif()
if(NOT CMAKE_C_COMPILER_ID_RUN) if(NOT CMAKE_C_COMPILER_ID_RUN)
set(CMAKE_C_COMPILER_ID_RUN 1) set(CMAKE_C_COMPILER_ID_RUN 1)
@ -131,13 +131,13 @@ if(NOT CMAKE_C_COMPILER_ID_RUN)
# Set old compiler and platform id variables. # Set old compiler and platform id variables.
if("${CMAKE_C_COMPILER_ID}" MATCHES "GNU") if("${CMAKE_C_COMPILER_ID}" MATCHES "GNU")
set(CMAKE_COMPILER_IS_GNUCC 1) set(CMAKE_COMPILER_IS_GNUCC 1)
endif("${CMAKE_C_COMPILER_ID}" MATCHES "GNU") endif()
if("${CMAKE_C_PLATFORM_ID}" MATCHES "MinGW") if("${CMAKE_C_PLATFORM_ID}" MATCHES "MinGW")
set(CMAKE_COMPILER_IS_MINGW 1) set(CMAKE_COMPILER_IS_MINGW 1)
elseif("${CMAKE_C_PLATFORM_ID}" MATCHES "Cygwin") elseif("${CMAKE_C_PLATFORM_ID}" MATCHES "Cygwin")
set(CMAKE_COMPILER_IS_CYGWIN 1) set(CMAKE_COMPILER_IS_CYGWIN 1)
endif("${CMAKE_C_PLATFORM_ID}" MATCHES "MinGW") endif()
endif(NOT CMAKE_C_COMPILER_ID_RUN) endif()
# If we have a gcc cross compiler, they have usually some prefix, like # If we have a gcc cross compiler, they have usually some prefix, like
# e.g. powerpc-linux-gcc, arm-elf-gcc or i586-mingw32msvc-gcc, optionally # e.g. powerpc-linux-gcc, arm-elf-gcc or i586-mingw32msvc-gcc, optionally
@ -152,13 +152,13 @@ if (CMAKE_CROSSCOMPILING
get_filename_component(COMPILER_BASENAME "${CMAKE_C_COMPILER}" NAME) get_filename_component(COMPILER_BASENAME "${CMAKE_C_COMPILER}" NAME)
if (COMPILER_BASENAME MATCHES "^(.+-)g?cc(-[0-9]+\\.[0-9]+\\.[0-9]+)?(\\.exe)?$") if (COMPILER_BASENAME MATCHES "^(.+-)g?cc(-[0-9]+\\.[0-9]+\\.[0-9]+)?(\\.exe)?$")
set(_CMAKE_TOOLCHAIN_PREFIX ${CMAKE_MATCH_1}) set(_CMAKE_TOOLCHAIN_PREFIX ${CMAKE_MATCH_1})
endif (COMPILER_BASENAME MATCHES "^(.+-)g?cc(-[0-9]+\\.[0-9]+\\.[0-9]+)?(\\.exe)?$") endif ()
# if "llvm-" is part of the prefix, remove it, since llvm doesn't have its own binutils # if "llvm-" is part of the prefix, remove it, since llvm doesn't have its own binutils
# but uses the regular ar, objcopy, etc. (instead of llvm-objcopy etc.) # but uses the regular ar, objcopy, etc. (instead of llvm-objcopy etc.)
if ("${_CMAKE_TOOLCHAIN_PREFIX}" MATCHES "(.+-)?llvm-$") if ("${_CMAKE_TOOLCHAIN_PREFIX}" MATCHES "(.+-)?llvm-$")
set(_CMAKE_TOOLCHAIN_PREFIX ${CMAKE_MATCH_1}) set(_CMAKE_TOOLCHAIN_PREFIX ${CMAKE_MATCH_1})
endif ("${_CMAKE_TOOLCHAIN_PREFIX}" MATCHES "(.+-)?llvm-$") endif ()
endif (CMAKE_CROSSCOMPILING endif (CMAKE_CROSSCOMPILING
AND "${CMAKE_C_COMPILER_ID}" MATCHES "GNU" AND "${CMAKE_C_COMPILER_ID}" MATCHES "GNU"
@ -169,7 +169,7 @@ include(CMakeFindBinUtils)
if(MSVC_C_ARCHITECTURE_ID) if(MSVC_C_ARCHITECTURE_ID)
set(SET_MSVC_C_ARCHITECTURE_ID set(SET_MSVC_C_ARCHITECTURE_ID
"set(MSVC_C_ARCHITECTURE_ID ${MSVC_C_ARCHITECTURE_ID})") "set(MSVC_C_ARCHITECTURE_ID ${MSVC_C_ARCHITECTURE_ID})")
endif(MSVC_C_ARCHITECTURE_ID) endif()
# configure variables set in this file for fast reload later on # configure variables set in this file for fast reload later on
configure_file(${CMAKE_ROOT}/Modules/CMakeCCompiler.cmake.in configure_file(${CMAKE_ROOT}/Modules/CMakeCCompiler.cmake.in
"${CMAKE_PLATFORM_ROOT_BIN}/CMakeCCompiler.cmake" "${CMAKE_PLATFORM_ROOT_BIN}/CMakeCCompiler.cmake"

View File

@ -46,18 +46,18 @@ if(NOT CMAKE_CXX_COMPILER)
get_filename_component(CMAKE_CXX_COMPILER_INIT $ENV{CXX} PROGRAM PROGRAM_ARGS CMAKE_CXX_FLAGS_ENV_INIT) get_filename_component(CMAKE_CXX_COMPILER_INIT $ENV{CXX} PROGRAM PROGRAM_ARGS CMAKE_CXX_FLAGS_ENV_INIT)
if(CMAKE_CXX_FLAGS_ENV_INIT) if(CMAKE_CXX_FLAGS_ENV_INIT)
set(CMAKE_CXX_COMPILER_ARG1 "${CMAKE_CXX_FLAGS_ENV_INIT}" CACHE STRING "First argument to CXX compiler") set(CMAKE_CXX_COMPILER_ARG1 "${CMAKE_CXX_FLAGS_ENV_INIT}" CACHE STRING "First argument to CXX compiler")
endif(CMAKE_CXX_FLAGS_ENV_INIT) endif()
if(NOT EXISTS ${CMAKE_CXX_COMPILER_INIT}) if(NOT EXISTS ${CMAKE_CXX_COMPILER_INIT})
message(FATAL_ERROR "Could not find compiler set in environment variable CXX:\n$ENV{CXX}.\n${CMAKE_CXX_COMPILER_INIT}") message(FATAL_ERROR "Could not find compiler set in environment variable CXX:\n$ENV{CXX}.\n${CMAKE_CXX_COMPILER_INIT}")
endif(NOT EXISTS ${CMAKE_CXX_COMPILER_INIT}) endif()
endif($ENV{CXX} MATCHES ".+") endif()
# next prefer the generator specified compiler # next prefer the generator specified compiler
if(CMAKE_GENERATOR_CXX) if(CMAKE_GENERATOR_CXX)
if(NOT CMAKE_CXX_COMPILER_INIT) if(NOT CMAKE_CXX_COMPILER_INIT)
set(CMAKE_CXX_COMPILER_INIT ${CMAKE_GENERATOR_CXX}) set(CMAKE_CXX_COMPILER_INIT ${CMAKE_GENERATOR_CXX})
endif(NOT CMAKE_CXX_COMPILER_INIT) endif()
endif(CMAKE_GENERATOR_CXX) endif()
# finally list compilers to try # finally list compilers to try
if(NOT CMAKE_CXX_COMPILER_INIT) if(NOT CMAKE_CXX_COMPILER_INIT)
@ -65,7 +65,7 @@ if(NOT CMAKE_CXX_COMPILER)
endif() endif()
_cmake_find_compiler(CXX) _cmake_find_compiler(CXX)
else(NOT CMAKE_CXX_COMPILER) else()
# we only get here if CMAKE_CXX_COMPILER was specified using -D or a pre-made CMakeCache.txt # we only get here if CMAKE_CXX_COMPILER was specified using -D or a pre-made CMakeCache.txt
# (e.g. via ctest) or set in CMAKE_TOOLCHAIN_FILE # (e.g. via ctest) or set in CMAKE_TOOLCHAIN_FILE
@ -77,7 +77,7 @@ else(NOT CMAKE_CXX_COMPILER)
if("${_CMAKE_CXX_COMPILER_LIST_LENGTH}" EQUAL 2) if("${_CMAKE_CXX_COMPILER_LIST_LENGTH}" EQUAL 2)
list(GET CMAKE_CXX_COMPILER 1 CMAKE_CXX_COMPILER_ARG1) list(GET CMAKE_CXX_COMPILER 1 CMAKE_CXX_COMPILER_ARG1)
list(GET CMAKE_CXX_COMPILER 0 CMAKE_CXX_COMPILER) list(GET CMAKE_CXX_COMPILER 0 CMAKE_CXX_COMPILER)
endif("${_CMAKE_CXX_COMPILER_LIST_LENGTH}" EQUAL 2) endif()
# if a compiler was specified by the user but without path, # if a compiler was specified by the user but without path,
# now try to find it with the full path # now try to find it with the full path
@ -90,14 +90,14 @@ else(NOT CMAKE_CXX_COMPILER)
mark_as_advanced(CMAKE_CXX_COMPILER_WITH_PATH) mark_as_advanced(CMAKE_CXX_COMPILER_WITH_PATH)
if(CMAKE_CXX_COMPILER_WITH_PATH) if(CMAKE_CXX_COMPILER_WITH_PATH)
set(CMAKE_CXX_COMPILER ${CMAKE_CXX_COMPILER_WITH_PATH} CACHE STRING "CXX compiler" FORCE) set(CMAKE_CXX_COMPILER ${CMAKE_CXX_COMPILER_WITH_PATH} CACHE STRING "CXX compiler" FORCE)
endif(CMAKE_CXX_COMPILER_WITH_PATH) endif()
endif(NOT _CMAKE_USER_CXX_COMPILER_PATH) endif()
endif(NOT CMAKE_CXX_COMPILER) endif()
mark_as_advanced(CMAKE_CXX_COMPILER) mark_as_advanced(CMAKE_CXX_COMPILER)
if (NOT _CMAKE_TOOLCHAIN_LOCATION) if (NOT _CMAKE_TOOLCHAIN_LOCATION)
get_filename_component(_CMAKE_TOOLCHAIN_LOCATION "${CMAKE_CXX_COMPILER}" PATH) get_filename_component(_CMAKE_TOOLCHAIN_LOCATION "${CMAKE_CXX_COMPILER}" PATH)
endif (NOT _CMAKE_TOOLCHAIN_LOCATION) endif ()
# This block was used before the compiler was identified by building a # This block was used before the compiler was identified by building a
# source file. Unless g++ crashes when building a small C++ # source file. Unless g++ crashes when building a small C++
@ -109,14 +109,14 @@ endif (NOT _CMAKE_TOOLCHAIN_LOCATION)
# if(BEOS) # if(BEOS)
# set(CMAKE_COMPILER_IS_GNUCXX 1) # set(CMAKE_COMPILER_IS_GNUCXX 1)
# set(CMAKE_COMPILER_IS_GNUCXX_RUN 1) # set(CMAKE_COMPILER_IS_GNUCXX_RUN 1)
# endif(BEOS) # endif()
# Build a small source file to identify the compiler. # Build a small source file to identify the compiler.
if(${CMAKE_GENERATOR} MATCHES "Visual Studio") if(${CMAKE_GENERATOR} MATCHES "Visual Studio")
set(CMAKE_CXX_COMPILER_ID_RUN 1) set(CMAKE_CXX_COMPILER_ID_RUN 1)
set(CMAKE_CXX_PLATFORM_ID "Windows") set(CMAKE_CXX_PLATFORM_ID "Windows")
set(CMAKE_CXX_COMPILER_ID "MSVC") set(CMAKE_CXX_COMPILER_ID "MSVC")
endif(${CMAKE_GENERATOR} MATCHES "Visual Studio") endif()
if(NOT CMAKE_CXX_COMPILER_ID_RUN) if(NOT CMAKE_CXX_COMPILER_ID_RUN)
set(CMAKE_CXX_COMPILER_ID_RUN 1) set(CMAKE_CXX_COMPILER_ID_RUN 1)
@ -138,13 +138,13 @@ if(NOT CMAKE_CXX_COMPILER_ID_RUN)
# Set old compiler and platform id variables. # Set old compiler and platform id variables.
if("${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU") if("${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU")
set(CMAKE_COMPILER_IS_GNUCXX 1) set(CMAKE_COMPILER_IS_GNUCXX 1)
endif("${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU") endif()
if("${CMAKE_CXX_PLATFORM_ID}" MATCHES "MinGW") if("${CMAKE_CXX_PLATFORM_ID}" MATCHES "MinGW")
set(CMAKE_COMPILER_IS_MINGW 1) set(CMAKE_COMPILER_IS_MINGW 1)
elseif("${CMAKE_CXX_PLATFORM_ID}" MATCHES "Cygwin") elseif("${CMAKE_CXX_PLATFORM_ID}" MATCHES "Cygwin")
set(CMAKE_COMPILER_IS_CYGWIN 1) set(CMAKE_COMPILER_IS_CYGWIN 1)
endif("${CMAKE_CXX_PLATFORM_ID}" MATCHES "MinGW") endif()
endif(NOT CMAKE_CXX_COMPILER_ID_RUN) endif()
# if we have a g++ cross compiler, they have usually some prefix, like # if we have a g++ cross compiler, they have usually some prefix, like
# e.g. powerpc-linux-g++, arm-elf-g++ or i586-mingw32msvc-g++ , optionally # e.g. powerpc-linux-g++, arm-elf-g++ or i586-mingw32msvc-g++ , optionally
@ -159,13 +159,13 @@ if (CMAKE_CROSSCOMPILING
get_filename_component(COMPILER_BASENAME "${CMAKE_CXX_COMPILER}" NAME) get_filename_component(COMPILER_BASENAME "${CMAKE_CXX_COMPILER}" NAME)
if (COMPILER_BASENAME MATCHES "^(.+-)[gc]\\+\\+(-[0-9]+\\.[0-9]+\\.[0-9]+)?(\\.exe)?$") if (COMPILER_BASENAME MATCHES "^(.+-)[gc]\\+\\+(-[0-9]+\\.[0-9]+\\.[0-9]+)?(\\.exe)?$")
set(_CMAKE_TOOLCHAIN_PREFIX ${CMAKE_MATCH_1}) set(_CMAKE_TOOLCHAIN_PREFIX ${CMAKE_MATCH_1})
endif (COMPILER_BASENAME MATCHES "^(.+-)[gc]\\+\\+(-[0-9]+\\.[0-9]+\\.[0-9]+)?(\\.exe)?$") endif ()
# if "llvm-" is part of the prefix, remove it, since llvm doesn't have its own binutils # if "llvm-" is part of the prefix, remove it, since llvm doesn't have its own binutils
# but uses the regular ar, objcopy, etc. (instead of llvm-objcopy etc.) # but uses the regular ar, objcopy, etc. (instead of llvm-objcopy etc.)
if ("${_CMAKE_TOOLCHAIN_PREFIX}" MATCHES "(.+-)?llvm-$") if ("${_CMAKE_TOOLCHAIN_PREFIX}" MATCHES "(.+-)?llvm-$")
set(_CMAKE_TOOLCHAIN_PREFIX ${CMAKE_MATCH_1}) set(_CMAKE_TOOLCHAIN_PREFIX ${CMAKE_MATCH_1})
endif ("${_CMAKE_TOOLCHAIN_PREFIX}" MATCHES "(.+-)?llvm-$") endif ()
endif (CMAKE_CROSSCOMPILING endif (CMAKE_CROSSCOMPILING
AND "${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU" AND "${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU"
@ -176,7 +176,7 @@ include(CMakeFindBinUtils)
if(MSVC_CXX_ARCHITECTURE_ID) if(MSVC_CXX_ARCHITECTURE_ID)
set(SET_MSVC_CXX_ARCHITECTURE_ID set(SET_MSVC_CXX_ARCHITECTURE_ID
"set(MSVC_CXX_ARCHITECTURE_ID ${MSVC_CXX_ARCHITECTURE_ID})") "set(MSVC_CXX_ARCHITECTURE_ID ${MSVC_CXX_ARCHITECTURE_ID})")
endif(MSVC_CXX_ARCHITECTURE_ID) endif()
# configure all variables set in this file # configure all variables set in this file
configure_file(${CMAKE_ROOT}/Modules/CMakeCXXCompiler.cmake.in configure_file(${CMAKE_ROOT}/Modules/CMakeCXXCompiler.cmake.in
${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeCXXCompiler.cmake ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeCXXCompiler.cmake

View File

@ -49,21 +49,21 @@ function(CMAKE_DETERMINE_COMPILER_ABI lang src)
foreach(info ${ABI_STRINGS}) foreach(info ${ABI_STRINGS})
if("${info}" MATCHES ".*INFO:sizeof_dptr\\[0*([^]]*)\\].*") if("${info}" MATCHES ".*INFO:sizeof_dptr\\[0*([^]]*)\\].*")
string(REGEX REPLACE ".*INFO:sizeof_dptr\\[0*([^]]*)\\].*" "\\1" ABI_SIZEOF_DPTR "${info}") string(REGEX REPLACE ".*INFO:sizeof_dptr\\[0*([^]]*)\\].*" "\\1" ABI_SIZEOF_DPTR "${info}")
endif("${info}" MATCHES ".*INFO:sizeof_dptr\\[0*([^]]*)\\].*") endif()
if("${info}" MATCHES ".*INFO:abi\\[([^]]*)\\].*") if("${info}" MATCHES ".*INFO:abi\\[([^]]*)\\].*")
string(REGEX REPLACE ".*INFO:abi\\[([^]]*)\\].*" "\\1" ABI_NAME "${info}") string(REGEX REPLACE ".*INFO:abi\\[([^]]*)\\].*" "\\1" ABI_NAME "${info}")
endif("${info}" MATCHES ".*INFO:abi\\[([^]]*)\\].*") endif()
endforeach(info) endforeach()
if(ABI_SIZEOF_DPTR) if(ABI_SIZEOF_DPTR)
set(CMAKE_${lang}_SIZEOF_DATA_PTR "${ABI_SIZEOF_DPTR}" PARENT_SCOPE) set(CMAKE_${lang}_SIZEOF_DATA_PTR "${ABI_SIZEOF_DPTR}" PARENT_SCOPE)
elseif(CMAKE_${lang}_SIZEOF_DATA_PTR_DEFAULT) elseif(CMAKE_${lang}_SIZEOF_DATA_PTR_DEFAULT)
set(CMAKE_${lang}_SIZEOF_DATA_PTR "${CMAKE_${lang}_SIZEOF_DATA_PTR_DEFAULT}" PARENT_SCOPE) set(CMAKE_${lang}_SIZEOF_DATA_PTR "${CMAKE_${lang}_SIZEOF_DATA_PTR_DEFAULT}" PARENT_SCOPE)
endif(ABI_SIZEOF_DPTR) endif()
if(ABI_NAME) if(ABI_NAME)
set(CMAKE_${lang}_COMPILER_ABI "${ABI_NAME}" PARENT_SCOPE) set(CMAKE_${lang}_COMPILER_ABI "${ABI_NAME}" PARENT_SCOPE)
endif(ABI_NAME) endif()
# Parse implicit linker information for this language, if available. # Parse implicit linker information for this language, if available.
set(implicit_dirs "") set(implicit_dirs "")
@ -122,10 +122,10 @@ function(CMAKE_DETERMINE_COMPILER_ABI lang src)
endforeach() endforeach()
endif() endif()
else(CMAKE_DETERMINE_${lang}_ABI_COMPILED) else()
message(STATUS "Detecting ${lang} compiler ABI info - failed") message(STATUS "Detecting ${lang} compiler ABI info - failed")
file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
"Detecting ${lang} compiler ABI info failed to compile with the following output:\n${OUTPUT}\n\n") "Detecting ${lang} compiler ABI info failed to compile with the following output:\n${OUTPUT}\n\n")
endif(CMAKE_DETERMINE_${lang}_ABI_COMPILED) endif()
endif(NOT DEFINED CMAKE_DETERMINE_${lang}_ABI_COMPILED) endif()
endfunction(CMAKE_DETERMINE_COMPILER_ABI) endfunction()

View File

@ -24,9 +24,9 @@ function(CMAKE_DETERMINE_COMPILER_ID lang flagvar src)
# Make sure user-specified compiler flags are used. # Make sure user-specified compiler flags are used.
if(CMAKE_${lang}_FLAGS) if(CMAKE_${lang}_FLAGS)
set(CMAKE_${lang}_COMPILER_ID_FLAGS ${CMAKE_${lang}_FLAGS}) set(CMAKE_${lang}_COMPILER_ID_FLAGS ${CMAKE_${lang}_FLAGS})
else(CMAKE_${lang}_FLAGS) else()
set(CMAKE_${lang}_COMPILER_ID_FLAGS $ENV{${flagvar}}) set(CMAKE_${lang}_COMPILER_ID_FLAGS $ENV{${flagvar}})
endif(CMAKE_${lang}_FLAGS) endif()
string(REGEX REPLACE " " ";" CMAKE_${lang}_COMPILER_ID_FLAGS_LIST "${CMAKE_${lang}_COMPILER_ID_FLAGS}") string(REGEX REPLACE " " ";" CMAKE_${lang}_COMPILER_ID_FLAGS_LIST "${CMAKE_${lang}_COMPILER_ID_FLAGS}")
# Compute the directory in which to run the test. # Compute the directory in which to run the test.
@ -39,9 +39,9 @@ function(CMAKE_DETERMINE_COMPILER_ID lang flagvar src)
CMAKE_DETERMINE_COMPILER_ID_BUILD("${lang}" "${flags}" "${src}") CMAKE_DETERMINE_COMPILER_ID_BUILD("${lang}" "${flags}" "${src}")
foreach(file ${COMPILER_${lang}_PRODUCED_FILES}) foreach(file ${COMPILER_${lang}_PRODUCED_FILES})
CMAKE_DETERMINE_COMPILER_ID_CHECK("${lang}" "${CMAKE_${lang}_COMPILER_ID_DIR}/${file}" "${src}") CMAKE_DETERMINE_COMPILER_ID_CHECK("${lang}" "${CMAKE_${lang}_COMPILER_ID_DIR}/${file}" "${src}")
endforeach(file) endforeach()
endif(NOT CMAKE_${lang}_COMPILER_ID) endif()
endforeach(flags) endforeach()
# If the compiler is still unknown, try to query its vendor. # If the compiler is still unknown, try to query its vendor.
if(NOT CMAKE_${lang}_COMPILER_ID) if(NOT CMAKE_${lang}_COMPILER_ID)
@ -51,7 +51,7 @@ function(CMAKE_DETERMINE_COMPILER_ID lang flagvar src)
# if the format is unknown after all files have been checked, put "Unknown" in the cache # if the format is unknown after all files have been checked, put "Unknown" in the cache
if(NOT CMAKE_EXECUTABLE_FORMAT) if(NOT CMAKE_EXECUTABLE_FORMAT)
set(CMAKE_EXECUTABLE_FORMAT "Unknown" CACHE INTERNAL "Executable file format") set(CMAKE_EXECUTABLE_FORMAT "Unknown" CACHE INTERNAL "Executable file format")
endif(NOT CMAKE_EXECUTABLE_FORMAT) endif()
# Display the final identification result. # Display the final identification result.
if(CMAKE_${lang}_COMPILER_ID) if(CMAKE_${lang}_COMPILER_ID)
@ -62,16 +62,16 @@ function(CMAKE_DETERMINE_COMPILER_ID lang flagvar src)
endif() endif()
message(STATUS "The ${lang} compiler identification is " message(STATUS "The ${lang} compiler identification is "
"${CMAKE_${lang}_COMPILER_ID}${_version}") "${CMAKE_${lang}_COMPILER_ID}${_version}")
else(CMAKE_${lang}_COMPILER_ID) else()
message(STATUS "The ${lang} compiler identification is unknown") message(STATUS "The ${lang} compiler identification is unknown")
endif(CMAKE_${lang}_COMPILER_ID) endif()
set(CMAKE_${lang}_COMPILER_ID "${CMAKE_${lang}_COMPILER_ID}" PARENT_SCOPE) set(CMAKE_${lang}_COMPILER_ID "${CMAKE_${lang}_COMPILER_ID}" PARENT_SCOPE)
set(CMAKE_${lang}_PLATFORM_ID "${CMAKE_${lang}_PLATFORM_ID}" PARENT_SCOPE) set(CMAKE_${lang}_PLATFORM_ID "${CMAKE_${lang}_PLATFORM_ID}" PARENT_SCOPE)
set(MSVC_${lang}_ARCHITECTURE_ID "${MSVC_${lang}_ARCHITECTURE_ID}" set(MSVC_${lang}_ARCHITECTURE_ID "${MSVC_${lang}_ARCHITECTURE_ID}"
PARENT_SCOPE) PARENT_SCOPE)
set(CMAKE_${lang}_COMPILER_VERSION "${CMAKE_${lang}_COMPILER_VERSION}" PARENT_SCOPE) set(CMAKE_${lang}_COMPILER_VERSION "${CMAKE_${lang}_COMPILER_VERSION}" PARENT_SCOPE)
endfunction(CMAKE_DETERMINE_COMPILER_ID) endfunction()
#----------------------------------------------------------------------------- #-----------------------------------------------------------------------------
# Function to write the compiler id source file. # Function to write the compiler id source file.
@ -79,7 +79,7 @@ function(CMAKE_DETERMINE_COMPILER_ID_WRITE lang src)
file(READ ${CMAKE_ROOT}/Modules/${src}.in ID_CONTENT_IN) file(READ ${CMAKE_ROOT}/Modules/${src}.in ID_CONTENT_IN)
string(CONFIGURE "${ID_CONTENT_IN}" ID_CONTENT_OUT @ONLY) string(CONFIGURE "${ID_CONTENT_IN}" ID_CONTENT_OUT @ONLY)
file(WRITE ${CMAKE_${lang}_COMPILER_ID_DIR}/${src} "${ID_CONTENT_OUT}") file(WRITE ${CMAKE_${lang}_COMPILER_ID_DIR}/${src} "${ID_CONTENT_OUT}")
endfunction(CMAKE_DETERMINE_COMPILER_ID_WRITE) endfunction()
#----------------------------------------------------------------------------- #-----------------------------------------------------------------------------
# Function to build the compiler id source file and look for output # Function to build the compiler id source file and look for output
@ -110,7 +110,7 @@ Id flags: ${testflags}
ERROR_VARIABLE CMAKE_${lang}_COMPILER_ID_OUTPUT ERROR_VARIABLE CMAKE_${lang}_COMPILER_ID_OUTPUT
RESULT_VARIABLE CMAKE_${lang}_COMPILER_ID_RESULT RESULT_VARIABLE CMAKE_${lang}_COMPILER_ID_RESULT
) )
else(COMMAND EXECUTE_PROCESS) else()
exec_program( exec_program(
${CMAKE_${lang}_COMPILER} ${CMAKE_${lang}_COMPILER_ID_DIR} ${CMAKE_${lang}_COMPILER} ${CMAKE_${lang}_COMPILER_ID_DIR}
ARGS ${CMAKE_${lang}_COMPILER_ID_ARG1} ARGS ${CMAKE_${lang}_COMPILER_ID_ARG1}
@ -120,7 +120,7 @@ Id flags: ${testflags}
OUTPUT_VARIABLE CMAKE_${lang}_COMPILER_ID_OUTPUT OUTPUT_VARIABLE CMAKE_${lang}_COMPILER_ID_OUTPUT
RETURN_VALUE CMAKE_${lang}_COMPILER_ID_RESULT RETURN_VALUE CMAKE_${lang}_COMPILER_ID_RESULT
) )
endif(COMMAND EXECUTE_PROCESS) endif()
# Check the result of compilation. # Check the result of compilation.
if(CMAKE_${lang}_COMPILER_ID_RESULT) if(CMAKE_${lang}_COMPILER_ID_RESULT)
@ -136,11 +136,11 @@ ${CMAKE_${lang}_COMPILER_ID_OUTPUT}
file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log "${MSG}") file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log "${MSG}")
#if(NOT CMAKE_${lang}_COMPILER_ID_ALLOW_FAIL) #if(NOT CMAKE_${lang}_COMPILER_ID_ALLOW_FAIL)
# message(FATAL_ERROR "${MSG}") # message(FATAL_ERROR "${MSG}")
#endif(NOT CMAKE_${lang}_COMPILER_ID_ALLOW_FAIL) #endif()
# No output files should be inspected. # No output files should be inspected.
set(COMPILER_${lang}_PRODUCED_FILES) set(COMPILER_${lang}_PRODUCED_FILES)
else(CMAKE_${lang}_COMPILER_ID_RESULT) else()
# Compilation succeeded. # Compilation succeeded.
file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
"Compiling the ${lang} compiler identification source file \"${src}\" succeeded. "Compiling the ${lang} compiler identification source file \"${src}\" succeeded.
@ -161,7 +161,7 @@ ${CMAKE_${lang}_COMPILER_ID_OUTPUT}
file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
"Compilation of the ${lang} compiler identification source \"" "Compilation of the ${lang} compiler identification source \""
"${src}\" produced \"${file}\"\n\n") "${src}\" produced \"${file}\"\n\n")
endforeach(file) endforeach()
if(NOT COMPILER_${lang}_PRODUCED_FILES) if(NOT COMPILER_${lang}_PRODUCED_FILES)
# No executable was found. # No executable was found.
@ -169,12 +169,12 @@ ${CMAKE_${lang}_COMPILER_ID_OUTPUT}
"Compilation of the ${lang} compiler identification source \"" "Compilation of the ${lang} compiler identification source \""
"${src}\" did not produce an executable in \"" "${src}\" did not produce an executable in \""
"${CMAKE_${lang}_COMPILER_ID_DIR}\".\n\n") "${CMAKE_${lang}_COMPILER_ID_DIR}\".\n\n")
endif(NOT COMPILER_${lang}_PRODUCED_FILES) endif()
endif(CMAKE_${lang}_COMPILER_ID_RESULT) endif()
# Return the files produced by the compilation. # Return the files produced by the compilation.
set(COMPILER_${lang}_PRODUCED_FILES "${COMPILER_${lang}_PRODUCED_FILES}" PARENT_SCOPE) set(COMPILER_${lang}_PRODUCED_FILES "${COMPILER_${lang}_PRODUCED_FILES}" PARENT_SCOPE)
endfunction(CMAKE_DETERMINE_COMPILER_ID_BUILD lang testflags src) endfunction()
#----------------------------------------------------------------------------- #-----------------------------------------------------------------------------
# Function to extract the compiler id from an executable. # Function to extract the compiler id from an executable.
@ -192,24 +192,24 @@ function(CMAKE_DETERMINE_COMPILER_ID_CHECK lang file)
if("${info}" MATCHES ".*INFO:compiler\\[([^]\"]*)\\].*") if("${info}" MATCHES ".*INFO:compiler\\[([^]\"]*)\\].*")
if(COMPILER_ID) if(COMPILER_ID)
set(COMPILER_ID_TWICE 1) set(COMPILER_ID_TWICE 1)
endif(COMPILER_ID) endif()
string(REGEX REPLACE ".*INFO:compiler\\[([^]]*)\\].*" "\\1" string(REGEX REPLACE ".*INFO:compiler\\[([^]]*)\\].*" "\\1"
COMPILER_ID "${info}") COMPILER_ID "${info}")
endif("${info}" MATCHES ".*INFO:compiler\\[([^]\"]*)\\].*") endif()
if("${info}" MATCHES ".*INFO:platform\\[([^]\"]*)\\].*") if("${info}" MATCHES ".*INFO:platform\\[([^]\"]*)\\].*")
string(REGEX REPLACE ".*INFO:platform\\[([^]]*)\\].*" "\\1" string(REGEX REPLACE ".*INFO:platform\\[([^]]*)\\].*" "\\1"
PLATFORM_ID "${info}") PLATFORM_ID "${info}")
endif("${info}" MATCHES ".*INFO:platform\\[([^]\"]*)\\].*") endif()
if("${info}" MATCHES ".*INFO:arch\\[([^]\"]*)\\].*") if("${info}" MATCHES ".*INFO:arch\\[([^]\"]*)\\].*")
string(REGEX REPLACE ".*INFO:arch\\[([^]]*)\\].*" "\\1" string(REGEX REPLACE ".*INFO:arch\\[([^]]*)\\].*" "\\1"
ARCHITECTURE_ID "${info}") ARCHITECTURE_ID "${info}")
endif("${info}" MATCHES ".*INFO:arch\\[([^]\"]*)\\].*") endif()
if("${info}" MATCHES ".*INFO:compiler_version\\[([^]\"]*)\\].*") if("${info}" MATCHES ".*INFO:compiler_version\\[([^]\"]*)\\].*")
string(REGEX REPLACE ".*INFO:compiler_version\\[([^]]*)\\].*" "\\1" COMPILER_VERSION "${info}") string(REGEX REPLACE ".*INFO:compiler_version\\[([^]]*)\\].*" "\\1" COMPILER_VERSION "${info}")
string(REGEX REPLACE "^0+([0-9])" "\\1" COMPILER_VERSION "${COMPILER_VERSION}") string(REGEX REPLACE "^0+([0-9])" "\\1" COMPILER_VERSION "${COMPILER_VERSION}")
string(REGEX REPLACE "\\.0+([0-9])" ".\\1" COMPILER_VERSION "${COMPILER_VERSION}") string(REGEX REPLACE "\\.0+([0-9])" ".\\1" COMPILER_VERSION "${COMPILER_VERSION}")
endif("${info}" MATCHES ".*INFO:compiler_version\\[([^]\"]*)\\].*") endif()
endforeach(info) endforeach()
# Check if a valid compiler and platform were found. # Check if a valid compiler and platform were found.
if(COMPILER_ID AND NOT COMPILER_ID_TWICE) if(COMPILER_ID AND NOT COMPILER_ID_TWICE)
@ -217,7 +217,7 @@ function(CMAKE_DETERMINE_COMPILER_ID_CHECK lang file)
set(CMAKE_${lang}_PLATFORM_ID "${PLATFORM_ID}") set(CMAKE_${lang}_PLATFORM_ID "${PLATFORM_ID}")
set(MSVC_${lang}_ARCHITECTURE_ID "${ARCHITECTURE_ID}") set(MSVC_${lang}_ARCHITECTURE_ID "${ARCHITECTURE_ID}")
set(CMAKE_${lang}_COMPILER_VERSION "${COMPILER_VERSION}") set(CMAKE_${lang}_COMPILER_VERSION "${COMPILER_VERSION}")
endif(COMPILER_ID AND NOT COMPILER_ID_TWICE) endif()
# Check the compiler identification string. # Check the compiler identification string.
if(CMAKE_${lang}_COMPILER_ID) if(CMAKE_${lang}_COMPILER_ID)
@ -225,13 +225,13 @@ function(CMAKE_DETERMINE_COMPILER_ID_CHECK lang file)
file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
"The ${lang} compiler identification is ${CMAKE_${lang}_COMPILER_ID}, found in \"" "The ${lang} compiler identification is ${CMAKE_${lang}_COMPILER_ID}, found in \""
"${file}\"\n\n") "${file}\"\n\n")
else(CMAKE_${lang}_COMPILER_ID) else()
# The compiler identification could not be found. # The compiler identification could not be found.
file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
"The ${lang} compiler identification could not be found in \"" "The ${lang} compiler identification could not be found in \""
"${file}\"\n\n") "${file}\"\n\n")
endif(CMAKE_${lang}_COMPILER_ID) endif()
endif(NOT CMAKE_${lang}_COMPILER_ID) endif()
# try to figure out the executable format: ELF, COFF, Mach-O # try to figure out the executable format: ELF, COFF, Mach-O
if(NOT CMAKE_EXECUTABLE_FORMAT) if(NOT CMAKE_EXECUTABLE_FORMAT)
@ -240,22 +240,22 @@ function(CMAKE_DETERMINE_COMPILER_ID_CHECK lang file)
# ELF files start with 0x7f"ELF" # ELF files start with 0x7f"ELF"
if("${CMAKE_EXECUTABLE_MAGIC}" STREQUAL "7f454c46") if("${CMAKE_EXECUTABLE_MAGIC}" STREQUAL "7f454c46")
set(CMAKE_EXECUTABLE_FORMAT "ELF" CACHE INTERNAL "Executable file format") set(CMAKE_EXECUTABLE_FORMAT "ELF" CACHE INTERNAL "Executable file format")
endif("${CMAKE_EXECUTABLE_MAGIC}" STREQUAL "7f454c46") endif()
# # COFF (.exe) files start with "MZ" # # COFF (.exe) files start with "MZ"
# if("${CMAKE_EXECUTABLE_MAGIC}" MATCHES "4d5a....") # if("${CMAKE_EXECUTABLE_MAGIC}" MATCHES "4d5a....")
# set(CMAKE_EXECUTABLE_FORMAT "COFF" CACHE STRING "Executable file format") # set(CMAKE_EXECUTABLE_FORMAT "COFF" CACHE STRING "Executable file format")
# endif("${CMAKE_EXECUTABLE_MAGIC}" MATCHES "4d5a....") # endif()
# #
# # Mach-O files start with CAFEBABE or FEEDFACE, according to http://radio.weblogs.com/0100490/2003/01/28.html # # Mach-O files start with CAFEBABE or FEEDFACE, according to http://radio.weblogs.com/0100490/2003/01/28.html
# if("${CMAKE_EXECUTABLE_MAGIC}" MATCHES "cafebabe") # if("${CMAKE_EXECUTABLE_MAGIC}" MATCHES "cafebabe")
# set(CMAKE_EXECUTABLE_FORMAT "MACHO" CACHE STRING "Executable file format") # set(CMAKE_EXECUTABLE_FORMAT "MACHO" CACHE STRING "Executable file format")
# endif("${CMAKE_EXECUTABLE_MAGIC}" MATCHES "cafebabe") # endif()
# if("${CMAKE_EXECUTABLE_MAGIC}" MATCHES "feedface") # if("${CMAKE_EXECUTABLE_MAGIC}" MATCHES "feedface")
# set(CMAKE_EXECUTABLE_FORMAT "MACHO" CACHE STRING "Executable file format") # set(CMAKE_EXECUTABLE_FORMAT "MACHO" CACHE STRING "Executable file format")
# endif("${CMAKE_EXECUTABLE_MAGIC}" MATCHES "feedface") # endif()
endif(NOT CMAKE_EXECUTABLE_FORMAT) endif()
if(NOT DEFINED CMAKE_EXECUTABLE_FORMAT) if(NOT DEFINED CMAKE_EXECUTABLE_FORMAT)
set(CMAKE_EXECUTABLE_FORMAT) set(CMAKE_EXECUTABLE_FORMAT)
endif() endif()
@ -266,7 +266,7 @@ function(CMAKE_DETERMINE_COMPILER_ID_CHECK lang file)
PARENT_SCOPE) PARENT_SCOPE)
set(CMAKE_${lang}_COMPILER_VERSION "${CMAKE_${lang}_COMPILER_VERSION}" PARENT_SCOPE) set(CMAKE_${lang}_COMPILER_VERSION "${CMAKE_${lang}_COMPILER_VERSION}" PARENT_SCOPE)
set(CMAKE_EXECUTABLE_FORMAT "${CMAKE_EXECUTABLE_FORMAT}" PARENT_SCOPE) set(CMAKE_EXECUTABLE_FORMAT "${CMAKE_EXECUTABLE_FORMAT}" PARENT_SCOPE)
endfunction(CMAKE_DETERMINE_COMPILER_ID_CHECK lang) endfunction()
#----------------------------------------------------------------------------- #-----------------------------------------------------------------------------
# Function to query the compiler vendor. # Function to query the compiler vendor.
@ -285,7 +285,7 @@ function(CMAKE_DETERMINE_COMPILER_ID_VENDOR lang)
set(CMAKE_${lang}_COMPILER_ID_DIR ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CompilerId${lang}) set(CMAKE_${lang}_COMPILER_ID_DIR ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CompilerId${lang})
file(REMOVE_RECURSE ${CMAKE_${lang}_COMPILER_ID_DIR}) file(REMOVE_RECURSE ${CMAKE_${lang}_COMPILER_ID_DIR})
file(MAKE_DIRECTORY ${CMAKE_${lang}_COMPILER_ID_DIR}) file(MAKE_DIRECTORY ${CMAKE_${lang}_COMPILER_ID_DIR})
endif(NOT CMAKE_${lang}_COMPILER_ID_DIR) endif()
foreach(vendor ${CMAKE_${lang}_COMPILER_ID_VENDORS}) foreach(vendor ${CMAKE_${lang}_COMPILER_ID_VENDORS})
@ -320,4 +320,4 @@ function(CMAKE_DETERMINE_COMPILER_ID_VENDOR lang)
endif() endif()
endif() endif()
endforeach() endforeach()
endfunction(CMAKE_DETERMINE_COMPILER_ID_VENDOR) endfunction()

View File

@ -31,19 +31,19 @@ if(NOT CMAKE_Fortran_COMPILER)
get_filename_component(CMAKE_Fortran_COMPILER_INIT $ENV{FC} PROGRAM PROGRAM_ARGS CMAKE_Fortran_FLAGS_ENV_INIT) get_filename_component(CMAKE_Fortran_COMPILER_INIT $ENV{FC} PROGRAM PROGRAM_ARGS CMAKE_Fortran_FLAGS_ENV_INIT)
if(CMAKE_Fortran_FLAGS_ENV_INIT) if(CMAKE_Fortran_FLAGS_ENV_INIT)
set(CMAKE_Fortran_COMPILER_ARG1 "${CMAKE_Fortran_FLAGS_ENV_INIT}" CACHE STRING "First argument to Fortran compiler") set(CMAKE_Fortran_COMPILER_ARG1 "${CMAKE_Fortran_FLAGS_ENV_INIT}" CACHE STRING "First argument to Fortran compiler")
endif(CMAKE_Fortran_FLAGS_ENV_INIT) endif()
if(EXISTS ${CMAKE_Fortran_COMPILER_INIT}) if(EXISTS ${CMAKE_Fortran_COMPILER_INIT})
else(EXISTS ${CMAKE_Fortran_COMPILER_INIT}) else()
message(FATAL_ERROR "Could not find compiler set in environment variable FC:\n$ENV{FC}.") message(FATAL_ERROR "Could not find compiler set in environment variable FC:\n$ENV{FC}.")
endif(EXISTS ${CMAKE_Fortran_COMPILER_INIT}) endif()
endif($ENV{FC} MATCHES ".+") endif()
# next try prefer the compiler specified by the generator # next try prefer the compiler specified by the generator
if(CMAKE_GENERATOR_FC) if(CMAKE_GENERATOR_FC)
if(NOT CMAKE_Fortran_COMPILER_INIT) if(NOT CMAKE_Fortran_COMPILER_INIT)
set(CMAKE_Fortran_COMPILER_INIT ${CMAKE_GENERATOR_FC}) set(CMAKE_Fortran_COMPILER_INIT ${CMAKE_GENERATOR_FC})
endif(NOT CMAKE_Fortran_COMPILER_INIT) endif()
endif(CMAKE_GENERATOR_FC) endif()
# finally list compilers to try # finally list compilers to try
if(NOT CMAKE_Fortran_COMPILER_INIT) if(NOT CMAKE_Fortran_COMPILER_INIT)
@ -85,7 +85,7 @@ if(NOT CMAKE_Fortran_COMPILER)
_cmake_find_compiler(Fortran) _cmake_find_compiler(Fortran)
else(NOT CMAKE_Fortran_COMPILER) else()
# we only get here if CMAKE_Fortran_COMPILER was specified using -D or a pre-made CMakeCache.txt # we only get here if CMAKE_Fortran_COMPILER was specified using -D or a pre-made CMakeCache.txt
# (e.g. via ctest) or set in CMAKE_TOOLCHAIN_FILE # (e.g. via ctest) or set in CMAKE_TOOLCHAIN_FILE
# if CMAKE_Fortran_COMPILER is a list of length 2, use the first item as # if CMAKE_Fortran_COMPILER is a list of length 2, use the first item as
@ -95,7 +95,7 @@ else(NOT CMAKE_Fortran_COMPILER)
if("${_CMAKE_Fortran_COMPILER_LIST_LENGTH}" EQUAL 2) if("${_CMAKE_Fortran_COMPILER_LIST_LENGTH}" EQUAL 2)
list(GET CMAKE_Fortran_COMPILER 1 CMAKE_Fortran_COMPILER_ARG1) list(GET CMAKE_Fortran_COMPILER 1 CMAKE_Fortran_COMPILER_ARG1)
list(GET CMAKE_Fortran_COMPILER 0 CMAKE_Fortran_COMPILER) list(GET CMAKE_Fortran_COMPILER 0 CMAKE_Fortran_COMPILER)
endif("${_CMAKE_Fortran_COMPILER_LIST_LENGTH}" EQUAL 2) endif()
# if a compiler was specified by the user but without path, # if a compiler was specified by the user but without path,
# now try to find it with the full path # now try to find it with the full path
@ -109,9 +109,9 @@ else(NOT CMAKE_Fortran_COMPILER)
if(CMAKE_Fortran_COMPILER_WITH_PATH) if(CMAKE_Fortran_COMPILER_WITH_PATH)
set(CMAKE_Fortran_COMPILER ${CMAKE_Fortran_COMPILER_WITH_PATH} set(CMAKE_Fortran_COMPILER ${CMAKE_Fortran_COMPILER_WITH_PATH}
CACHE STRING "Fortran compiler" FORCE) CACHE STRING "Fortran compiler" FORCE)
endif(CMAKE_Fortran_COMPILER_WITH_PATH) endif()
endif(NOT _CMAKE_USER_Fortran_COMPILER_PATH) endif()
endif(NOT CMAKE_Fortran_COMPILER) endif()
mark_as_advanced(CMAKE_Fortran_COMPILER) mark_as_advanced(CMAKE_Fortran_COMPILER)
@ -120,7 +120,7 @@ if(${CMAKE_GENERATOR} MATCHES "Visual Studio")
set(CMAKE_Fortran_COMPILER_ID_RUN 1) set(CMAKE_Fortran_COMPILER_ID_RUN 1)
set(CMAKE_Fortran_PLATFORM_ID "Windows") set(CMAKE_Fortran_PLATFORM_ID "Windows")
set(CMAKE_Fortran_COMPILER_ID "Intel") set(CMAKE_Fortran_COMPILER_ID "Intel")
endif(${CMAKE_GENERATOR} MATCHES "Visual Studio") endif()
if(NOT CMAKE_Fortran_COMPILER_ID_RUN) if(NOT CMAKE_Fortran_COMPILER_ID_RUN)
set(CMAKE_Fortran_COMPILER_ID_RUN 1) set(CMAKE_Fortran_COMPILER_ID_RUN 1)
@ -160,32 +160,32 @@ if(NOT CMAKE_Fortran_COMPILER_ID_RUN)
file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
"Determining if the Fortran compiler is GNU succeeded with " "Determining if the Fortran compiler is GNU succeeded with "
"the following output:\n${CMAKE_COMPILER_OUTPUT}\n\n") "the following output:\n${CMAKE_COMPILER_OUTPUT}\n\n")
else("${CMAKE_COMPILER_OUTPUT}" MATCHES ".*THIS_IS_GNU.*" ) else()
file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
"Determining if the Fortran compiler is GNU failed with " "Determining if the Fortran compiler is GNU failed with "
"the following output:\n${CMAKE_COMPILER_OUTPUT}\n\n") "the following output:\n${CMAKE_COMPILER_OUTPUT}\n\n")
endif("${CMAKE_COMPILER_OUTPUT}" MATCHES ".*THIS_IS_GNU.*" ) endif()
if(NOT CMAKE_Fortran_PLATFORM_ID) if(NOT CMAKE_Fortran_PLATFORM_ID)
if("${CMAKE_COMPILER_OUTPUT}" MATCHES ".*THIS_IS_MINGW.*" ) if("${CMAKE_COMPILER_OUTPUT}" MATCHES ".*THIS_IS_MINGW.*" )
set(CMAKE_Fortran_PLATFORM_ID "MinGW") set(CMAKE_Fortran_PLATFORM_ID "MinGW")
endif("${CMAKE_COMPILER_OUTPUT}" MATCHES ".*THIS_IS_MINGW.*" ) endif()
if("${CMAKE_COMPILER_OUTPUT}" MATCHES ".*THIS_IS_CYGWIN.*" ) if("${CMAKE_COMPILER_OUTPUT}" MATCHES ".*THIS_IS_CYGWIN.*" )
set(CMAKE_Fortran_PLATFORM_ID "Cygwin") set(CMAKE_Fortran_PLATFORM_ID "Cygwin")
endif("${CMAKE_COMPILER_OUTPUT}" MATCHES ".*THIS_IS_CYGWIN.*" ) endif()
endif(NOT CMAKE_Fortran_PLATFORM_ID) endif()
endif(NOT CMAKE_COMPILER_RETURN) endif()
endif(NOT CMAKE_Fortran_COMPILER_ID) endif()
# Set old compiler and platform id variables. # Set old compiler and platform id variables.
if("${CMAKE_Fortran_COMPILER_ID}" MATCHES "GNU") if("${CMAKE_Fortran_COMPILER_ID}" MATCHES "GNU")
set(CMAKE_COMPILER_IS_GNUG77 1) set(CMAKE_COMPILER_IS_GNUG77 1)
endif("${CMAKE_Fortran_COMPILER_ID}" MATCHES "GNU") endif()
if("${CMAKE_Fortran_PLATFORM_ID}" MATCHES "MinGW") if("${CMAKE_Fortran_PLATFORM_ID}" MATCHES "MinGW")
set(CMAKE_COMPILER_IS_MINGW 1) set(CMAKE_COMPILER_IS_MINGW 1)
elseif("${CMAKE_Fortran_PLATFORM_ID}" MATCHES "Cygwin") elseif("${CMAKE_Fortran_PLATFORM_ID}" MATCHES "Cygwin")
set(CMAKE_COMPILER_IS_CYGWIN 1) set(CMAKE_COMPILER_IS_CYGWIN 1)
endif("${CMAKE_Fortran_PLATFORM_ID}" MATCHES "MinGW") endif()
endif(NOT CMAKE_Fortran_COMPILER_ID_RUN) endif()
include(CMakeFindBinUtils) include(CMakeFindBinUtils)

View File

@ -22,25 +22,25 @@ if(NOT CMAKE_Java_COMPILER)
get_filename_component(CMAKE_Java_COMPILER_INIT $ENV{JAVA_COMPILER} PROGRAM PROGRAM_ARGS CMAKE_Java_FLAGS_ENV_INIT) get_filename_component(CMAKE_Java_COMPILER_INIT $ENV{JAVA_COMPILER} PROGRAM PROGRAM_ARGS CMAKE_Java_FLAGS_ENV_INIT)
if(CMAKE_Java_FLAGS_ENV_INIT) if(CMAKE_Java_FLAGS_ENV_INIT)
set(CMAKE_Java_COMPILER_ARG1 "${CMAKE_Java_FLAGS_ENV_INIT}" CACHE STRING "First argument to Java compiler") set(CMAKE_Java_COMPILER_ARG1 "${CMAKE_Java_FLAGS_ENV_INIT}" CACHE STRING "First argument to Java compiler")
endif(CMAKE_Java_FLAGS_ENV_INIT) endif()
if(NOT EXISTS ${CMAKE_Java_COMPILER_INIT}) if(NOT EXISTS ${CMAKE_Java_COMPILER_INIT})
message(SEND_ERROR "Could not find compiler set in environment variable JAVA_COMPILER:\n$ENV{JAVA_COMPILER}.") message(SEND_ERROR "Could not find compiler set in environment variable JAVA_COMPILER:\n$ENV{JAVA_COMPILER}.")
endif(NOT EXISTS ${CMAKE_Java_COMPILER_INIT}) endif()
endif($ENV{JAVA_COMPILER} MATCHES ".+") endif()
if($ENV{JAVA_RUNTIME} MATCHES ".+") if($ENV{JAVA_RUNTIME} MATCHES ".+")
get_filename_component(CMAKE_Java_RUNTIME_INIT $ENV{JAVA_RUNTIME} PROGRAM PROGRAM_ARGS CMAKE_Java_FLAGS_ENV_INIT) get_filename_component(CMAKE_Java_RUNTIME_INIT $ENV{JAVA_RUNTIME} PROGRAM PROGRAM_ARGS CMAKE_Java_FLAGS_ENV_INIT)
if(NOT EXISTS ${CMAKE_Java_RUNTIME_INIT}) if(NOT EXISTS ${CMAKE_Java_RUNTIME_INIT})
message(SEND_ERROR "Could not find compiler set in environment variable JAVA_RUNTIME:\n$ENV{JAVA_RUNTIME}.") message(SEND_ERROR "Could not find compiler set in environment variable JAVA_RUNTIME:\n$ENV{JAVA_RUNTIME}.")
endif(NOT EXISTS ${CMAKE_Java_RUNTIME_INIT}) endif()
endif($ENV{JAVA_RUNTIME} MATCHES ".+") endif()
if($ENV{JAVA_ARCHIVE} MATCHES ".+") if($ENV{JAVA_ARCHIVE} MATCHES ".+")
get_filename_component(CMAKE_Java_ARCHIVE_INIT $ENV{JAVA_ARCHIVE} PROGRAM PROGRAM_ARGS CMAKE_Java_FLAGS_ENV_INIT) get_filename_component(CMAKE_Java_ARCHIVE_INIT $ENV{JAVA_ARCHIVE} PROGRAM PROGRAM_ARGS CMAKE_Java_FLAGS_ENV_INIT)
if(NOT EXISTS ${CMAKE_Java_ARCHIVE_INIT}) if(NOT EXISTS ${CMAKE_Java_ARCHIVE_INIT})
message(SEND_ERROR "Could not find compiler set in environment variable JAVA_ARCHIVE:\n$ENV{JAVA_ARCHIVE}.") message(SEND_ERROR "Could not find compiler set in environment variable JAVA_ARCHIVE:\n$ENV{JAVA_ARCHIVE}.")
endif(NOT EXISTS ${CMAKE_Java_ARCHIVE_INIT}) endif()
endif($ENV{JAVA_ARCHIVE} MATCHES ".+") endif()
set(Java_BIN_PATH set(Java_BIN_PATH
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\JavaSoft\\Java Development Kit\\2.0;JavaHome]/bin" "[HKEY_LOCAL_MACHINE\\SOFTWARE\\JavaSoft\\Java Development Kit\\2.0;JavaHome]/bin"
@ -67,33 +67,33 @@ if(NOT CMAKE_Java_COMPILER)
# if no compiler has been specified yet, then look for one # if no compiler has been specified yet, then look for one
if(CMAKE_Java_COMPILER_INIT) if(CMAKE_Java_COMPILER_INIT)
set(CMAKE_Java_COMPILER ${CMAKE_Java_COMPILER_INIT} CACHE PATH "Java Compiler") set(CMAKE_Java_COMPILER ${CMAKE_Java_COMPILER_INIT} CACHE PATH "Java Compiler")
else(CMAKE_Java_COMPILER_INIT) else()
find_program(CMAKE_Java_COMPILER find_program(CMAKE_Java_COMPILER
NAMES javac NAMES javac
PATHS ${Java_BIN_PATH} PATHS ${Java_BIN_PATH}
) )
endif(CMAKE_Java_COMPILER_INIT) endif()
# if no runtime has been specified yet, then look for one # if no runtime has been specified yet, then look for one
if(CMAKE_Java_RUNTIME_INIT) if(CMAKE_Java_RUNTIME_INIT)
set(CMAKE_Java_RUNTIME ${CMAKE_Java_RUNTIME_INIT} CACHE PATH "Java Compiler") set(CMAKE_Java_RUNTIME ${CMAKE_Java_RUNTIME_INIT} CACHE PATH "Java Compiler")
else(CMAKE_Java_RUNTIME_INIT) else()
find_program(CMAKE_Java_RUNTIME find_program(CMAKE_Java_RUNTIME
NAMES java NAMES java
PATHS ${Java_BIN_PATH} PATHS ${Java_BIN_PATH}
) )
endif(CMAKE_Java_RUNTIME_INIT) endif()
# if no archive has been specified yet, then look for one # if no archive has been specified yet, then look for one
if(CMAKE_Java_ARCHIVE_INIT) if(CMAKE_Java_ARCHIVE_INIT)
set(CMAKE_Java_ARCHIVE ${CMAKE_Java_ARCHIVE_INIT} CACHE PATH "Java Compiler") set(CMAKE_Java_ARCHIVE ${CMAKE_Java_ARCHIVE_INIT} CACHE PATH "Java Compiler")
else(CMAKE_Java_ARCHIVE_INIT) else()
find_program(CMAKE_Java_ARCHIVE find_program(CMAKE_Java_ARCHIVE
NAMES jar NAMES jar
PATHS ${Java_BIN_PATH} PATHS ${Java_BIN_PATH}
) )
endif(CMAKE_Java_ARCHIVE_INIT) endif()
endif(NOT CMAKE_Java_COMPILER) endif()
mark_as_advanced(CMAKE_Java_COMPILER) mark_as_advanced(CMAKE_Java_COMPILER)
# configure variables set in this file for fast reload later on # configure variables set in this file for fast reload later on

View File

@ -24,33 +24,33 @@ if(NOT CMAKE_RC_COMPILER)
get_filename_component(CMAKE_RC_COMPILER_INIT $ENV{RC} PROGRAM PROGRAM_ARGS CMAKE_RC_FLAGS_ENV_INIT) get_filename_component(CMAKE_RC_COMPILER_INIT $ENV{RC} PROGRAM PROGRAM_ARGS CMAKE_RC_FLAGS_ENV_INIT)
if(CMAKE_RC_FLAGS_ENV_INIT) if(CMAKE_RC_FLAGS_ENV_INIT)
set(CMAKE_RC_COMPILER_ARG1 "${CMAKE_RC_FLAGS_ENV_INIT}" CACHE STRING "First argument to RC compiler") set(CMAKE_RC_COMPILER_ARG1 "${CMAKE_RC_FLAGS_ENV_INIT}" CACHE STRING "First argument to RC compiler")
endif(CMAKE_RC_FLAGS_ENV_INIT) endif()
if(EXISTS ${CMAKE_RC_COMPILER_INIT}) if(EXISTS ${CMAKE_RC_COMPILER_INIT})
else(EXISTS ${CMAKE_RC_COMPILER_INIT}) else()
message(FATAL_ERROR "Could not find compiler set in environment variable RC:\n$ENV{RC}.") message(FATAL_ERROR "Could not find compiler set in environment variable RC:\n$ENV{RC}.")
endif(EXISTS ${CMAKE_RC_COMPILER_INIT}) endif()
endif($ENV{RC} MATCHES ".+") endif()
# next try prefer the compiler specified by the generator # next try prefer the compiler specified by the generator
if(CMAKE_GENERATOR_RC) if(CMAKE_GENERATOR_RC)
if(NOT CMAKE_RC_COMPILER_INIT) if(NOT CMAKE_RC_COMPILER_INIT)
set(CMAKE_RC_COMPILER_INIT ${CMAKE_GENERATOR_RC}) set(CMAKE_RC_COMPILER_INIT ${CMAKE_GENERATOR_RC})
endif(NOT CMAKE_RC_COMPILER_INIT) endif()
endif(CMAKE_GENERATOR_RC) endif()
# finally list compilers to try # finally list compilers to try
if(CMAKE_RC_COMPILER_INIT) if(CMAKE_RC_COMPILER_INIT)
set(CMAKE_RC_COMPILER_LIST ${CMAKE_RC_COMPILER_INIT}) set(CMAKE_RC_COMPILER_LIST ${CMAKE_RC_COMPILER_INIT})
else(CMAKE_RC_COMPILER_INIT) else()
set(CMAKE_RC_COMPILER_LIST rc) set(CMAKE_RC_COMPILER_LIST rc)
endif(CMAKE_RC_COMPILER_INIT) endif()
# Find the compiler. # Find the compiler.
find_program(CMAKE_RC_COMPILER NAMES ${CMAKE_RC_COMPILER_LIST} DOC "RC compiler") find_program(CMAKE_RC_COMPILER NAMES ${CMAKE_RC_COMPILER_LIST} DOC "RC compiler")
if(CMAKE_RC_COMPILER_INIT AND NOT CMAKE_RC_COMPILER) if(CMAKE_RC_COMPILER_INIT AND NOT CMAKE_RC_COMPILER)
set(CMAKE_RC_COMPILER "${CMAKE_RC_COMPILER_INIT}" CACHE FILEPATH "RC compiler" FORCE) set(CMAKE_RC_COMPILER "${CMAKE_RC_COMPILER_INIT}" CACHE FILEPATH "RC compiler" FORCE)
endif(CMAKE_RC_COMPILER_INIT AND NOT CMAKE_RC_COMPILER) endif()
endif(NOT CMAKE_RC_COMPILER) endif()
mark_as_advanced(CMAKE_RC_COMPILER) mark_as_advanced(CMAKE_RC_COMPILER)

View File

@ -59,23 +59,23 @@ if(CMAKE_HOST_UNIX)
if("${val}" GREATER 0) if("${val}" GREATER 0)
exec_program(uname ARGS -m OUTPUT_VARIABLE CMAKE_HOST_SYSTEM_PROCESSOR exec_program(uname ARGS -m OUTPUT_VARIABLE CMAKE_HOST_SYSTEM_PROCESSOR
RETURN_VALUE val) RETURN_VALUE val)
endif("${val}" GREATER 0) endif()
endif() endif()
# check the return of the last uname -m or -p # check the return of the last uname -m or -p
if("${val}" GREATER 0) if("${val}" GREATER 0)
set(CMAKE_HOST_SYSTEM_PROCESSOR "unknown") set(CMAKE_HOST_SYSTEM_PROCESSOR "unknown")
endif("${val}" GREATER 0) endif()
set(CMAKE_UNAME ${CMAKE_UNAME} CACHE INTERNAL "uname command") set(CMAKE_UNAME ${CMAKE_UNAME} CACHE INTERNAL "uname command")
# processor may have double quote in the name, and that needs to be removed # processor may have double quote in the name, and that needs to be removed
string(REGEX REPLACE "\"" "" CMAKE_HOST_SYSTEM_PROCESSOR "${CMAKE_HOST_SYSTEM_PROCESSOR}") string(REGEX REPLACE "\"" "" CMAKE_HOST_SYSTEM_PROCESSOR "${CMAKE_HOST_SYSTEM_PROCESSOR}")
string(REGEX REPLACE "/" "_" CMAKE_HOST_SYSTEM_PROCESSOR "${CMAKE_HOST_SYSTEM_PROCESSOR}") string(REGEX REPLACE "/" "_" CMAKE_HOST_SYSTEM_PROCESSOR "${CMAKE_HOST_SYSTEM_PROCESSOR}")
endif(CMAKE_UNAME) endif()
else(CMAKE_HOST_UNIX) else()
if(CMAKE_HOST_WIN32) if(CMAKE_HOST_WIN32)
set (CMAKE_HOST_SYSTEM_NAME "Windows") set (CMAKE_HOST_SYSTEM_NAME "Windows")
set (CMAKE_HOST_SYSTEM_PROCESSOR "$ENV{PROCESSOR_ARCHITECTURE}") set (CMAKE_HOST_SYSTEM_PROCESSOR "$ENV{PROCESSOR_ARCHITECTURE}")
endif(CMAKE_HOST_WIN32) endif()
endif(CMAKE_HOST_UNIX) endif()
# if a toolchain file is used, the user wants to cross compile. # if a toolchain file is used, the user wants to cross compile.
# in this case read the toolchain file and keep the CMAKE_HOST_SYSTEM_* # in this case read the toolchain file and keep the CMAKE_HOST_SYSTEM_*
@ -87,15 +87,15 @@ if(CMAKE_TOOLCHAIN_FILE)
if(NOT _INCLUDED_TOOLCHAIN_FILE) if(NOT _INCLUDED_TOOLCHAIN_FILE)
# if the file isn't found there, check the default locations # if the file isn't found there, check the default locations
include("${CMAKE_TOOLCHAIN_FILE}" OPTIONAL RESULT_VARIABLE _INCLUDED_TOOLCHAIN_FILE) include("${CMAKE_TOOLCHAIN_FILE}" OPTIONAL RESULT_VARIABLE _INCLUDED_TOOLCHAIN_FILE)
endif(NOT _INCLUDED_TOOLCHAIN_FILE) endif()
if(_INCLUDED_TOOLCHAIN_FILE) if(_INCLUDED_TOOLCHAIN_FILE)
set(CMAKE_TOOLCHAIN_FILE "${_INCLUDED_TOOLCHAIN_FILE}" CACHE FILEPATH "The CMake toolchain file" FORCE) set(CMAKE_TOOLCHAIN_FILE "${_INCLUDED_TOOLCHAIN_FILE}" CACHE FILEPATH "The CMake toolchain file" FORCE)
else(_INCLUDED_TOOLCHAIN_FILE) else()
message(FATAL_ERROR "Could not find toolchain file: ${CMAKE_TOOLCHAIN_FILE}") message(FATAL_ERROR "Could not find toolchain file: ${CMAKE_TOOLCHAIN_FILE}")
set(CMAKE_TOOLCHAIN_FILE "NOTFOUND" CACHE FILEPATH "The CMake toolchain file" FORCE) set(CMAKE_TOOLCHAIN_FILE "NOTFOUND" CACHE FILEPATH "The CMake toolchain file" FORCE)
endif(_INCLUDED_TOOLCHAIN_FILE) endif()
endif(CMAKE_TOOLCHAIN_FILE) endif()
# if CMAKE_SYSTEM_NAME is here already set, either it comes from a toolchain file # if CMAKE_SYSTEM_NAME is here already set, either it comes from a toolchain file
@ -104,45 +104,45 @@ endif(CMAKE_TOOLCHAIN_FILE)
if(CMAKE_SYSTEM_NAME) if(CMAKE_SYSTEM_NAME)
if(NOT DEFINED CMAKE_CROSSCOMPILING) if(NOT DEFINED CMAKE_CROSSCOMPILING)
set(CMAKE_CROSSCOMPILING TRUE) set(CMAKE_CROSSCOMPILING TRUE)
endif(NOT DEFINED CMAKE_CROSSCOMPILING) endif()
set(PRESET_CMAKE_SYSTEM_NAME TRUE) set(PRESET_CMAKE_SYSTEM_NAME TRUE)
else(CMAKE_SYSTEM_NAME) else()
set(CMAKE_SYSTEM_NAME "${CMAKE_HOST_SYSTEM_NAME}") set(CMAKE_SYSTEM_NAME "${CMAKE_HOST_SYSTEM_NAME}")
set(CMAKE_SYSTEM_VERSION "${CMAKE_HOST_SYSTEM_VERSION}") set(CMAKE_SYSTEM_VERSION "${CMAKE_HOST_SYSTEM_VERSION}")
set(CMAKE_SYSTEM_PROCESSOR "${CMAKE_HOST_SYSTEM_PROCESSOR}") set(CMAKE_SYSTEM_PROCESSOR "${CMAKE_HOST_SYSTEM_PROCESSOR}")
set(CMAKE_CROSSCOMPILING FALSE) set(CMAKE_CROSSCOMPILING FALSE)
set(PRESET_CMAKE_SYSTEM_NAME FALSE) set(PRESET_CMAKE_SYSTEM_NAME FALSE)
endif(CMAKE_SYSTEM_NAME) endif()
macro(ADJUST_CMAKE_SYSTEM_VARIABLES _PREFIX) macro(ADJUST_CMAKE_SYSTEM_VARIABLES _PREFIX)
if(NOT ${_PREFIX}_NAME) if(NOT ${_PREFIX}_NAME)
set(${_PREFIX}_NAME "UnknownOS") set(${_PREFIX}_NAME "UnknownOS")
endif(NOT ${_PREFIX}_NAME) endif()
# fix for BSD/OS , remove the / # fix for BSD/OS , remove the /
if(${_PREFIX}_NAME MATCHES BSD.OS) if(${_PREFIX}_NAME MATCHES BSD.OS)
set(${_PREFIX}_NAME BSDOS) set(${_PREFIX}_NAME BSDOS)
endif(${_PREFIX}_NAME MATCHES BSD.OS) endif()
# fix for GNU/kFreeBSD, remove the GNU/ # fix for GNU/kFreeBSD, remove the GNU/
if(${_PREFIX}_NAME MATCHES kFreeBSD) if(${_PREFIX}_NAME MATCHES kFreeBSD)
set(${_PREFIX}_NAME kFreeBSD) set(${_PREFIX}_NAME kFreeBSD)
endif(${_PREFIX}_NAME MATCHES kFreeBSD) endif()
# fix for CYGWIN which has windows version in it # fix for CYGWIN which has windows version in it
if(${_PREFIX}_NAME MATCHES CYGWIN) if(${_PREFIX}_NAME MATCHES CYGWIN)
set(${_PREFIX}_NAME CYGWIN) set(${_PREFIX}_NAME CYGWIN)
endif(${_PREFIX}_NAME MATCHES CYGWIN) endif()
# set CMAKE_SYSTEM to the CMAKE_SYSTEM_NAME # set CMAKE_SYSTEM to the CMAKE_SYSTEM_NAME
set(${_PREFIX} ${${_PREFIX}_NAME}) set(${_PREFIX} ${${_PREFIX}_NAME})
# if there is a CMAKE_SYSTEM_VERSION then add a -${CMAKE_SYSTEM_VERSION} # if there is a CMAKE_SYSTEM_VERSION then add a -${CMAKE_SYSTEM_VERSION}
if(${_PREFIX}_VERSION) if(${_PREFIX}_VERSION)
set(${_PREFIX} ${${_PREFIX}}-${${_PREFIX}_VERSION}) set(${_PREFIX} ${${_PREFIX}}-${${_PREFIX}_VERSION})
endif(${_PREFIX}_VERSION) endif()
endmacro(ADJUST_CMAKE_SYSTEM_VARIABLES _PREFIX) endmacro()
ADJUST_CMAKE_SYSTEM_VARIABLES(CMAKE_SYSTEM) ADJUST_CMAKE_SYSTEM_VARIABLES(CMAKE_SYSTEM)
ADJUST_CMAKE_SYSTEM_VARIABLES(CMAKE_HOST_SYSTEM) ADJUST_CMAKE_SYSTEM_VARIABLES(CMAKE_HOST_SYSTEM)
@ -156,21 +156,21 @@ if(CMAKE_BINARY_DIR)
"The target system is: ${CMAKE_SYSTEM_NAME} - ${CMAKE_SYSTEM_VERSION} - ${CMAKE_SYSTEM_PROCESSOR}\n") "The target system is: ${CMAKE_SYSTEM_NAME} - ${CMAKE_SYSTEM_VERSION} - ${CMAKE_SYSTEM_PROCESSOR}\n")
file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
"The host system is: ${CMAKE_HOST_SYSTEM_NAME} - ${CMAKE_HOST_SYSTEM_VERSION} - ${CMAKE_HOST_SYSTEM_PROCESSOR}\n") "The host system is: ${CMAKE_HOST_SYSTEM_NAME} - ${CMAKE_HOST_SYSTEM_VERSION} - ${CMAKE_HOST_SYSTEM_PROCESSOR}\n")
else(PRESET_CMAKE_SYSTEM_NAME) else()
file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
"The system is: ${CMAKE_SYSTEM_NAME} - ${CMAKE_SYSTEM_VERSION} - ${CMAKE_SYSTEM_PROCESSOR}\n") "The system is: ${CMAKE_SYSTEM_NAME} - ${CMAKE_SYSTEM_VERSION} - ${CMAKE_SYSTEM_PROCESSOR}\n")
endif(PRESET_CMAKE_SYSTEM_NAME) endif()
# if a toolchain file is used, it needs to be included in the configured file, # if a toolchain file is used, it needs to be included in the configured file,
# so settings done there are also available if they don't go in the cache and in try_compile() # so settings done there are also available if they don't go in the cache and in try_compile()
set(INCLUDE_CMAKE_TOOLCHAIN_FILE_IF_REQUIRED) set(INCLUDE_CMAKE_TOOLCHAIN_FILE_IF_REQUIRED)
if(DEFINED CMAKE_TOOLCHAIN_FILE) if(DEFINED CMAKE_TOOLCHAIN_FILE)
set(INCLUDE_CMAKE_TOOLCHAIN_FILE_IF_REQUIRED "include(\"${CMAKE_TOOLCHAIN_FILE}\")") set(INCLUDE_CMAKE_TOOLCHAIN_FILE_IF_REQUIRED "include(\"${CMAKE_TOOLCHAIN_FILE}\")")
endif(DEFINED CMAKE_TOOLCHAIN_FILE) endif()
# configure variables set in this file for fast reload, the template file is defined at the top of this file # configure variables set in this file for fast reload, the template file is defined at the top of this file
configure_file(${CMAKE_ROOT}/Modules/CMakeSystem.cmake.in configure_file(${CMAKE_ROOT}/Modules/CMakeSystem.cmake.in
${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeSystem.cmake ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeSystem.cmake
IMMEDIATE @ONLY) IMMEDIATE @ONLY)
endif(CMAKE_BINARY_DIR) endif()

View File

@ -76,16 +76,16 @@ function(CMAKE_EXPAND_IMPORTED_TARGETS _RESULT )
# guard against infinite loop: abort after 100 iterations ( 100 is arbitrary chosen) # guard against infinite loop: abort after 100 iterations ( 100 is arbitrary chosen)
if ("${_CCSR_LOOP_COUNTER}" LESS 100) if ("${_CCSR_LOOP_COUNTER}" LESS 100)
set(_CHECK_FOR_IMPORTED_TARGETS TRUE) set(_CHECK_FOR_IMPORTED_TARGETS TRUE)
# else ("${_CCSR_LOOP_COUNTER}" LESS 1) # else ()
# message(STATUS "********* aborting loop, counter : ${_CCSR_LOOP_COUNTER}") # message(STATUS "********* aborting loop, counter : ${_CCSR_LOOP_COUNTER}")
endif ("${_CCSR_LOOP_COUNTER}" LESS 100) endif ()
# if one of the imported configurations equals ${CMAKE_TRY_COMPILE_CONFIGURATION}, # if one of the imported configurations equals ${CMAKE_TRY_COMPILE_CONFIGURATION},
# use it, otherwise simply use the first one: # use it, otherwise simply use the first one:
list(FIND _importedConfigs "${CEIT_CONFIGURATION}" _configIndexToUse) list(FIND _importedConfigs "${CEIT_CONFIGURATION}" _configIndexToUse)
if("${_configIndexToUse}" EQUAL -1) if("${_configIndexToUse}" EQUAL -1)
set(_configIndexToUse 0) set(_configIndexToUse 0)
endif("${_configIndexToUse}" EQUAL -1) endif()
list(GET _importedConfigs ${_configIndexToUse} _importedConfigToUse) list(GET _importedConfigs ${_configIndexToUse} _importedConfigToUse)
get_target_property(_importedLocation "${_CURRENT_LIB}" IMPORTED_LOCATION_${_importedConfigToUse}) get_target_property(_importedLocation "${_CURRENT_LIB}" IMPORTED_LOCATION_${_importedConfigToUse})
@ -98,18 +98,18 @@ function(CMAKE_EXPAND_IMPORTED_TARGETS _RESULT )
# message(STATUS "Appending link interface lib ${_currentLinkInterfaceLib}") # message(STATUS "Appending link interface lib ${_currentLinkInterfaceLib}")
if(_currentLinkInterfaceLib) if(_currentLinkInterfaceLib)
list(APPEND _CCSR_NEW_REQ_LIBS "${_currentLinkInterfaceLib}" ) list(APPEND _CCSR_NEW_REQ_LIBS "${_currentLinkInterfaceLib}" )
endif(_currentLinkInterfaceLib) endif()
endforeach(_currentLinkInterfaceLib "${_linkInterfaceLibs}") endforeach()
endif(_linkInterfaceLibs) endif()
else(_importedConfigs) else()
# "Normal" libraries are just used as they are. # "Normal" libraries are just used as they are.
list(APPEND _CCSR_NEW_REQ_LIBS "${_CURRENT_LIB}" ) list(APPEND _CCSR_NEW_REQ_LIBS "${_CURRENT_LIB}" )
# message(STATUS "Appending lib directly: ${_CURRENT_LIB}") # message(STATUS "Appending lib directly: ${_CURRENT_LIB}")
endif(_importedConfigs) endif()
endforeach(_CURRENT_LIB ${_CCSR_REQ_LIBS}) endforeach()
set(_CCSR_REQ_LIBS ${_CCSR_NEW_REQ_LIBS} ) set(_CCSR_REQ_LIBS ${_CCSR_NEW_REQ_LIBS} )
endwhile(_CHECK_FOR_IMPORTED_TARGETS) endwhile()
# Finally we iterate once more over all libraries. This loop only removes # Finally we iterate once more over all libraries. This loop only removes
# all remaining imported target names (there shouldn't be any left anyway). # all remaining imported target names (there shouldn't be any left anyway).
@ -119,10 +119,10 @@ function(CMAKE_EXPAND_IMPORTED_TARGETS _RESULT )
if (NOT _importedConfigs) if (NOT _importedConfigs)
list(APPEND _CCSR_NEW_REQ_LIBS "${_CURRENT_LIB}" ) list(APPEND _CCSR_NEW_REQ_LIBS "${_CURRENT_LIB}" )
# message(STATUS "final: appending ${_CURRENT_LIB}") # message(STATUS "final: appending ${_CURRENT_LIB}")
else (NOT _importedConfigs) else ()
# message(STATUS "final: skipping ${_CURRENT_LIB}") # message(STATUS "final: skipping ${_CURRENT_LIB}")
endif (NOT _importedConfigs) endif ()
endforeach(_CURRENT_LIB ${_CCSR_REQ_LIBS}) endforeach()
# message(STATUS "setting -${_RESULT}- to -${_CCSR_NEW_REQ_LIBS}-") # message(STATUS "setting -${_RESULT}- to -${_CCSR_NEW_REQ_LIBS}-")
set(${_RESULT} "${_CCSR_NEW_REQ_LIBS}" PARENT_SCOPE) set(${_RESULT} "${_CCSR_NEW_REQ_LIBS}" PARENT_SCOPE)

View File

@ -30,7 +30,7 @@ macro(CMAKE_EXPORT_BUILD_SETTINGS SETTINGS_FILE)
if(${SETTINGS_FILE} MATCHES ".+") if(${SETTINGS_FILE} MATCHES ".+")
configure_file(${CMAKE_ROOT}/Modules/CMakeBuildSettings.cmake.in configure_file(${CMAKE_ROOT}/Modules/CMakeBuildSettings.cmake.in
${SETTINGS_FILE} @ONLY IMMEDIATE) ${SETTINGS_FILE} @ONLY IMMEDIATE)
else(${SETTINGS_FILE} MATCHES ".+") else()
message(SEND_ERROR "CMAKE_EXPORT_BUILD_SETTINGS called with no argument.") message(SEND_ERROR "CMAKE_EXPORT_BUILD_SETTINGS called with no argument.")
endif(${SETTINGS_FILE} MATCHES ".+") endif()
endmacro(CMAKE_EXPORT_BUILD_SETTINGS) endmacro()

View File

@ -44,7 +44,7 @@ macro(_DETERMINE_GCC_SYSTEM_INCLUDE_DIRS _lang _resultIncludeDirs _resultDefines
foreach(nextLine ${_includeLines}) foreach(nextLine ${_includeLines})
string(STRIP "${nextLine}" _includePath) string(STRIP "${nextLine}" _includePath)
list(APPEND ${_resultIncludeDirs} "${_includePath}") list(APPEND ${_resultIncludeDirs} "${_includePath}")
endforeach(nextLine) endforeach()
endif() endif()
@ -71,9 +71,9 @@ macro(_DETERMINE_GCC_SYSTEM_INCLUDE_DIRS _lang _resultIncludeDirs _resultDefines
else() else()
list(APPEND ${_resultDefines} " ") list(APPEND ${_resultDefines} " ")
endif() endif()
endforeach(nextLine) endforeach()
endmacro(_DETERMINE_GCC_SYSTEM_INCLUDE_DIRS _lang) endmacro()
# Save the current LC_ALL, LC_MESSAGES, and LANG environment variables and set them # Save the current LC_ALL, LC_MESSAGES, and LANG environment variables and set them
# to "C" that way GCC's "search starts here" text is in English and we can grok it. # to "C" that way GCC's "search starts here" text is in English and we can grok it.

View File

@ -48,7 +48,7 @@ else("${CMAKE_CXX_COMPILER_ID}" MATCHES "MSVC"
find_program(CMAKE_RANLIB NAMES ${_CMAKE_TOOLCHAIN_PREFIX}ranlib HINTS ${_CMAKE_TOOLCHAIN_LOCATION}) find_program(CMAKE_RANLIB NAMES ${_CMAKE_TOOLCHAIN_PREFIX}ranlib HINTS ${_CMAKE_TOOLCHAIN_LOCATION})
if(NOT CMAKE_RANLIB) if(NOT CMAKE_RANLIB)
set(CMAKE_RANLIB : CACHE INTERNAL "noop for ranlib") set(CMAKE_RANLIB : CACHE INTERNAL "noop for ranlib")
endif(NOT CMAKE_RANLIB) endif()
find_program(CMAKE_STRIP NAMES ${_CMAKE_TOOLCHAIN_PREFIX}strip HINTS ${_CMAKE_TOOLCHAIN_LOCATION}) find_program(CMAKE_STRIP NAMES ${_CMAKE_TOOLCHAIN_PREFIX}strip HINTS ${_CMAKE_TOOLCHAIN_LOCATION})
find_program(CMAKE_LINKER NAMES ${_CMAKE_TOOLCHAIN_PREFIX}ld HINTS ${_CMAKE_TOOLCHAIN_LOCATION}) find_program(CMAKE_LINKER NAMES ${_CMAKE_TOOLCHAIN_PREFIX}ld HINTS ${_CMAKE_TOOLCHAIN_LOCATION})
@ -69,7 +69,7 @@ if(APPLE)
if(NOT CMAKE_INSTALL_NAME_TOOL) if(NOT CMAKE_INSTALL_NAME_TOOL)
message(FATAL_ERROR "Could not find install_name_tool, please check your installation.") message(FATAL_ERROR "Could not find install_name_tool, please check your installation.")
endif(NOT CMAKE_INSTALL_NAME_TOOL) endif()
mark_as_advanced(CMAKE_INSTALL_NAME_TOOL) mark_as_advanced(CMAKE_INSTALL_NAME_TOOL)
endif(APPLE) endif()

View File

@ -19,7 +19,7 @@ find_program(CMAKE_CODEBLOCKS_EXECUTABLE NAMES codeblocks DOC "The CodeBlocks ex
if(CMAKE_CODEBLOCKS_EXECUTABLE) if(CMAKE_CODEBLOCKS_EXECUTABLE)
set(CMAKE_OPEN_PROJECT_COMMAND "${CMAKE_CODEBLOCKS_EXECUTABLE} <PROJECT_FILE>" ) set(CMAKE_OPEN_PROJECT_COMMAND "${CMAKE_CODEBLOCKS_EXECUTABLE} <PROJECT_FILE>" )
endif(CMAKE_CODEBLOCKS_EXECUTABLE) endif()
# Determine builtin macros and include dirs: # Determine builtin macros and include dirs:
include(${CMAKE_CURRENT_LIST_DIR}/CMakeExtraGeneratorDetermineCompilerMacrosAndIncludeDirs.cmake) include(${CMAKE_CURRENT_LIST_DIR}/CMakeExtraGeneratorDetermineCompilerMacrosAndIncludeDirs.cmake)

View File

@ -25,8 +25,8 @@ if(NOT CMAKE_FIND_FRAMEWORKS_INCLUDED)
/Network/Library/Frameworks/${fwk}.framework) /Network/Library/Frameworks/${fwk}.framework)
if(EXISTS ${dir}) if(EXISTS ${dir})
set(${fwk}_FRAMEWORKS ${${fwk}_FRAMEWORKS} ${dir}) set(${fwk}_FRAMEWORKS ${${fwk}_FRAMEWORKS} ${dir})
endif(EXISTS ${dir}) endif()
endforeach(dir) endforeach()
endif(APPLE) endif()
endmacro(CMAKE_FIND_FRAMEWORKS) endmacro()
endif(NOT CMAKE_FIND_FRAMEWORKS_INCLUDED) endif()

View File

@ -19,5 +19,5 @@ find_program(CMAKE_KDEVELOP3_EXECUTABLE NAMES kdevelop DOC "The KDevelop3 execut
if(CMAKE_KDEVELOP3_EXECUTABLE) if(CMAKE_KDEVELOP3_EXECUTABLE)
set(CMAKE_OPEN_PROJECT_COMMAND "${CMAKE_KDEVELOP3_EXECUTABLE} <PROJECT_FILE>" ) set(CMAKE_OPEN_PROJECT_COMMAND "${CMAKE_KDEVELOP3_EXECUTABLE} <PROJECT_FILE>" )
endif(CMAKE_KDEVELOP3_EXECUTABLE) endif()

View File

@ -179,7 +179,7 @@ if(${NAME}_FOUND OR ${UPPERCASE_NAME}_FOUND)
set_compile_flags_var(${NAME}) set_compile_flags_var(${NAME})
elseif("${MODE}" STREQUAL "LINK") elseif("${MODE}" STREQUAL "LINK")
set_link_flags_var(${NAME}) set_link_flags_var(${NAME})
else("${MODE}" STREQUAL "LINK") else()
message(FATAL_ERROR "Invalid mode argument ${MODE} given.") message(FATAL_ERROR "Invalid mode argument ${MODE} given.")
endif() endif()

View File

@ -52,8 +52,8 @@ macro(CMAKE_FORCE_C_COMPILER compiler id)
# Set old compiler id variables. # Set old compiler id variables.
if("${CMAKE_C_COMPILER_ID}" MATCHES "GNU") if("${CMAKE_C_COMPILER_ID}" MATCHES "GNU")
set(CMAKE_COMPILER_IS_GNUCC 1) set(CMAKE_COMPILER_IS_GNUCC 1)
endif("${CMAKE_C_COMPILER_ID}" MATCHES "GNU") endif()
endmacro(CMAKE_FORCE_C_COMPILER) endmacro()
macro(CMAKE_FORCE_CXX_COMPILER compiler id) macro(CMAKE_FORCE_CXX_COMPILER compiler id)
set(CMAKE_CXX_COMPILER "${compiler}") set(CMAKE_CXX_COMPILER "${compiler}")
@ -65,8 +65,8 @@ macro(CMAKE_FORCE_CXX_COMPILER compiler id)
# Set old compiler id variables. # Set old compiler id variables.
if("${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU") if("${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU")
set(CMAKE_COMPILER_IS_GNUCXX 1) set(CMAKE_COMPILER_IS_GNUCXX 1)
endif("${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU") endif()
endmacro(CMAKE_FORCE_CXX_COMPILER) endmacro()
macro(CMAKE_FORCE_Fortran_COMPILER compiler id) macro(CMAKE_FORCE_Fortran_COMPILER compiler id)
set(CMAKE_Fortran_COMPILER "${compiler}") set(CMAKE_Fortran_COMPILER "${compiler}")
@ -78,5 +78,5 @@ macro(CMAKE_FORCE_Fortran_COMPILER compiler id)
# Set old compiler id variables. # Set old compiler id variables.
if("${CMAKE_Fortran_COMPILER_ID}" MATCHES "GNU") if("${CMAKE_Fortran_COMPILER_ID}" MATCHES "GNU")
set(CMAKE_COMPILER_IS_GNUG77 1) set(CMAKE_COMPILER_IS_GNUG77 1)
endif("${CMAKE_Fortran_COMPILER_ID}" MATCHES "GNU") endif()
endmacro(CMAKE_FORCE_Fortran_COMPILER) endmacro()

View File

@ -12,7 +12,7 @@ set(CMAKE_COMPILER_IS_CYGWIN @CMAKE_COMPILER_IS_CYGWIN@)
if(CMAKE_COMPILER_IS_CYGWIN) if(CMAKE_COMPILER_IS_CYGWIN)
set(CYGWIN 1) set(CYGWIN 1)
set(UNIX 1) set(UNIX 1)
endif(CMAKE_COMPILER_IS_CYGWIN) endif()
set(CMAKE_Fortran_COMPILER_ENV_VAR "FC") set(CMAKE_Fortran_COMPILER_ENV_VAR "FC")
@ -20,16 +20,16 @@ set(CMAKE_Fortran_COMPILER_SUPPORTS_F90 @CMAKE_Fortran_COMPILER_SUPPORTS_F90@)
if(CMAKE_COMPILER_IS_MINGW) if(CMAKE_COMPILER_IS_MINGW)
set(MINGW 1) set(MINGW 1)
endif(CMAKE_COMPILER_IS_MINGW) endif()
set(CMAKE_Fortran_COMPILER_ID_RUN 1) set(CMAKE_Fortran_COMPILER_ID_RUN 1)
set(CMAKE_Fortran_SOURCE_FILE_EXTENSIONS f;F;f77;F77;f90;F90;for;For;FOR;f95;F95) set(CMAKE_Fortran_SOURCE_FILE_EXTENSIONS f;F;f77;F77;f90;F90;for;For;FOR;f95;F95)
set(CMAKE_Fortran_IGNORE_EXTENSIONS h;H;o;O;obj;OBJ;def;DEF;rc;RC) set(CMAKE_Fortran_IGNORE_EXTENSIONS h;H;o;O;obj;OBJ;def;DEF;rc;RC)
set(CMAKE_Fortran_LINKER_PREFERENCE 20) set(CMAKE_Fortran_LINKER_PREFERENCE 20)
if(UNIX) if(UNIX)
set(CMAKE_Fortran_OUTPUT_EXTENSION .o) set(CMAKE_Fortran_OUTPUT_EXTENSION .o)
else(UNIX) else()
set(CMAKE_Fortran_OUTPUT_EXTENSION .obj) set(CMAKE_Fortran_OUTPUT_EXTENSION .obj)
endif(UNIX) endif()
# Save compiler ABI information. # Save compiler ABI information.
set(CMAKE_Fortran_SIZEOF_DATA_PTR "@CMAKE_Fortran_SIZEOF_DATA_PTR@") set(CMAKE_Fortran_SIZEOF_DATA_PTR "@CMAKE_Fortran_SIZEOF_DATA_PTR@")
@ -42,7 +42,7 @@ endif()
if(CMAKE_Fortran_COMPILER_ABI) if(CMAKE_Fortran_COMPILER_ABI)
set(CMAKE_INTERNAL_PLATFORM_ABI "${CMAKE_Fortran_COMPILER_ABI}") set(CMAKE_INTERNAL_PLATFORM_ABI "${CMAKE_Fortran_COMPILER_ABI}")
endif(CMAKE_Fortran_COMPILER_ABI) endif()
if(CMAKE_Fortran_LIBRARY_ARCHITECTURE) if(CMAKE_Fortran_LIBRARY_ARCHITECTURE)
set(CMAKE_LIBRARY_ARCHITECTURE "@CMAKE_Fortran_LIBRARY_ARCHITECTURE@") set(CMAKE_LIBRARY_ARCHITECTURE "@CMAKE_Fortran_LIBRARY_ARCHITECTURE@")

View File

@ -21,28 +21,28 @@ set(_INCLUDED_FILE 0)
# Load compiler-specific information. # Load compiler-specific information.
if(CMAKE_Fortran_COMPILER_ID) if(CMAKE_Fortran_COMPILER_ID)
include(Compiler/${CMAKE_Fortran_COMPILER_ID}-Fortran OPTIONAL) include(Compiler/${CMAKE_Fortran_COMPILER_ID}-Fortran OPTIONAL)
endif(CMAKE_Fortran_COMPILER_ID) endif()
set(CMAKE_BASE_NAME) set(CMAKE_BASE_NAME)
get_filename_component(CMAKE_BASE_NAME ${CMAKE_Fortran_COMPILER} NAME_WE) get_filename_component(CMAKE_BASE_NAME ${CMAKE_Fortran_COMPILER} NAME_WE)
# since the gnu compiler has several names force g++ # since the gnu compiler has several names force g++
if(CMAKE_COMPILER_IS_GNUG77) if(CMAKE_COMPILER_IS_GNUG77)
set(CMAKE_BASE_NAME g77) set(CMAKE_BASE_NAME g77)
endif(CMAKE_COMPILER_IS_GNUG77) endif()
if(CMAKE_Fortran_COMPILER_ID) if(CMAKE_Fortran_COMPILER_ID)
include(Platform/${CMAKE_SYSTEM_NAME}-${CMAKE_Fortran_COMPILER_ID}-Fortran OPTIONAL RESULT_VARIABLE _INCLUDED_FILE) include(Platform/${CMAKE_SYSTEM_NAME}-${CMAKE_Fortran_COMPILER_ID}-Fortran OPTIONAL RESULT_VARIABLE _INCLUDED_FILE)
endif(CMAKE_Fortran_COMPILER_ID) endif()
if (NOT _INCLUDED_FILE) if (NOT _INCLUDED_FILE)
include(Platform/${CMAKE_SYSTEM_NAME}-${CMAKE_BASE_NAME} OPTIONAL include(Platform/${CMAKE_SYSTEM_NAME}-${CMAKE_BASE_NAME} OPTIONAL
RESULT_VARIABLE _INCLUDED_FILE) RESULT_VARIABLE _INCLUDED_FILE)
endif (NOT _INCLUDED_FILE) endif ()
# We specify the compiler information in the system file for some # We specify the compiler information in the system file for some
# platforms, but this language may not have been enabled when the file # platforms, but this language may not have been enabled when the file
# was first included. Include it again to get the language info. # was first included. Include it again to get the language info.
# Remove this when all compiler info is removed from system files. # Remove this when all compiler info is removed from system files.
if (NOT _INCLUDED_FILE) if (NOT _INCLUDED_FILE)
include(Platform/${CMAKE_SYSTEM_NAME} OPTIONAL) include(Platform/${CMAKE_SYSTEM_NAME} OPTIONAL)
endif (NOT _INCLUDED_FILE) endif ()
if(CMAKE_Fortran_SIZEOF_DATA_PTR) if(CMAKE_Fortran_SIZEOF_DATA_PTR)
foreach(f ${CMAKE_Fortran_ABI_FILES}) foreach(f ${CMAKE_Fortran_ABI_FILES})
@ -76,15 +76,15 @@ set(CMAKE_NEEDS_REQUIRES_STEP_Fortran_FLAG 1)
if(NOT CMAKE_Fortran_COMPILE_OPTIONS_PIC) if(NOT CMAKE_Fortran_COMPILE_OPTIONS_PIC)
set(CMAKE_Fortran_COMPILE_OPTIONS_PIC ${CMAKE_C_COMPILE_OPTIONS_PIC}) set(CMAKE_Fortran_COMPILE_OPTIONS_PIC ${CMAKE_C_COMPILE_OPTIONS_PIC})
endif(NOT CMAKE_Fortran_COMPILE_OPTIONS_PIC) endif()
if(NOT CMAKE_Fortran_COMPILE_OPTIONS_PIE) if(NOT CMAKE_Fortran_COMPILE_OPTIONS_PIE)
set(CMAKE_Fortran_COMPILE_OPTIONS_PIE ${CMAKE_C_COMPILE_OPTIONS_PIE}) set(CMAKE_Fortran_COMPILE_OPTIONS_PIE ${CMAKE_C_COMPILE_OPTIONS_PIE})
endif(NOT CMAKE_Fortran_COMPILE_OPTIONS_PIE) endif()
if(NOT CMAKE_Fortran_COMPILE_OPTIONS_DLL) if(NOT CMAKE_Fortran_COMPILE_OPTIONS_DLL)
set(CMAKE_Fortran_COMPILE_OPTIONS_DLL ${CMAKE_C_COMPILE_OPTIONS_DLL}) set(CMAKE_Fortran_COMPILE_OPTIONS_DLL ${CMAKE_C_COMPILE_OPTIONS_DLL})
endif(NOT CMAKE_Fortran_COMPILE_OPTIONS_DLL) endif()
# Create a set of shared library variable specific to Fortran # Create a set of shared library variable specific to Fortran
# For 90% of the systems, these are the same flags as the C versions # For 90% of the systems, these are the same flags as the C versions
@ -127,7 +127,7 @@ endif()
if(NOT CMAKE_MODULE_EXISTS) if(NOT CMAKE_MODULE_EXISTS)
set(CMAKE_SHARED_MODULE_Fortran_FLAGS ${CMAKE_SHARED_LIBRARY_Fortran_FLAGS}) set(CMAKE_SHARED_MODULE_Fortran_FLAGS ${CMAKE_SHARED_LIBRARY_Fortran_FLAGS})
set(CMAKE_SHARED_MODULE_CREATE_Fortran_FLAGS ${CMAKE_SHARED_LIBRARY_CREATE_Fortran_FLAGS}) set(CMAKE_SHARED_MODULE_CREATE_Fortran_FLAGS ${CMAKE_SHARED_LIBRARY_CREATE_Fortran_FLAGS})
endif(NOT CMAKE_MODULE_EXISTS) endif()
# repeat for modules # repeat for modules
if(NOT DEFINED CMAKE_SHARED_MODULE_CREATE_Fortran_FLAGS) if(NOT DEFINED CMAKE_SHARED_MODULE_CREATE_Fortran_FLAGS)
@ -152,15 +152,15 @@ endif()
if(NOT DEFINED CMAKE_SHARED_LIBRARY_LINK_Fortran_WITH_RUNTIME_PATH) if(NOT DEFINED CMAKE_SHARED_LIBRARY_LINK_Fortran_WITH_RUNTIME_PATH)
set(CMAKE_SHARED_LIBRARY_LINK_Fortran_WITH_RUNTIME_PATH ${CMAKE_SHARED_LIBRARY_LINK_C_WITH_RUNTIME_PATH}) set(CMAKE_SHARED_LIBRARY_LINK_Fortran_WITH_RUNTIME_PATH ${CMAKE_SHARED_LIBRARY_LINK_C_WITH_RUNTIME_PATH})
endif(NOT DEFINED CMAKE_SHARED_LIBRARY_LINK_Fortran_WITH_RUNTIME_PATH) endif()
if(NOT CMAKE_INCLUDE_FLAG_Fortran) if(NOT CMAKE_INCLUDE_FLAG_Fortran)
set(CMAKE_INCLUDE_FLAG_Fortran ${CMAKE_INCLUDE_FLAG_C}) set(CMAKE_INCLUDE_FLAG_Fortran ${CMAKE_INCLUDE_FLAG_C})
endif(NOT CMAKE_INCLUDE_FLAG_Fortran) endif()
if(NOT CMAKE_INCLUDE_FLAG_SEP_Fortran) if(NOT CMAKE_INCLUDE_FLAG_SEP_Fortran)
set(CMAKE_INCLUDE_FLAG_SEP_Fortran ${CMAKE_INCLUDE_FLAG_SEP_C}) set(CMAKE_INCLUDE_FLAG_SEP_Fortran ${CMAKE_INCLUDE_FLAG_SEP_C})
endif(NOT CMAKE_INCLUDE_FLAG_SEP_Fortran) endif()
set(CMAKE_VERBOSE_MAKEFILE FALSE CACHE BOOL "If this value is on, makefiles will be generated without the .SILENT directive, and all commands will be echoed to the console during the make. This is useful for debugging only. With Visual Studio IDE projects all commands are done without /nologo.") set(CMAKE_VERBOSE_MAKEFILE FALSE CACHE BOOL "If this value is on, makefiles will be generated without the .SILENT directive, and all commands will be echoed to the console during the make. This is useful for debugging only. With Visual Studio IDE projects all commands are done without /nologo.")
@ -168,7 +168,7 @@ set(CMAKE_Fortran_FLAGS_INIT "$ENV{FFLAGS} ${CMAKE_Fortran_FLAGS_INIT}")
# avoid just having a space as the initial value for the cache # avoid just having a space as the initial value for the cache
if(CMAKE_Fortran_FLAGS_INIT STREQUAL " ") if(CMAKE_Fortran_FLAGS_INIT STREQUAL " ")
set(CMAKE_Fortran_FLAGS_INIT) set(CMAKE_Fortran_FLAGS_INIT)
endif(CMAKE_Fortran_FLAGS_INIT STREQUAL " ") endif()
set (CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS_INIT}" CACHE STRING set (CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS_INIT}" CACHE STRING
"Flags for Fortran compiler.") "Flags for Fortran compiler.")
@ -184,12 +184,12 @@ include(CMakeCommonLanguageInclude)
if(NOT CMAKE_Fortran_CREATE_SHARED_LIBRARY) if(NOT CMAKE_Fortran_CREATE_SHARED_LIBRARY)
set(CMAKE_Fortran_CREATE_SHARED_LIBRARY set(CMAKE_Fortran_CREATE_SHARED_LIBRARY
"<CMAKE_Fortran_COMPILER> <CMAKE_SHARED_LIBRARY_Fortran_FLAGS> <LANGUAGE_COMPILE_FLAGS> <LINK_FLAGS> <CMAKE_SHARED_LIBRARY_CREATE_Fortran_FLAGS> <SONAME_FLAG><TARGET_SONAME> -o <TARGET> <OBJECTS> <LINK_LIBRARIES>") "<CMAKE_Fortran_COMPILER> <CMAKE_SHARED_LIBRARY_Fortran_FLAGS> <LANGUAGE_COMPILE_FLAGS> <LINK_FLAGS> <CMAKE_SHARED_LIBRARY_CREATE_Fortran_FLAGS> <SONAME_FLAG><TARGET_SONAME> -o <TARGET> <OBJECTS> <LINK_LIBRARIES>")
endif(NOT CMAKE_Fortran_CREATE_SHARED_LIBRARY) endif()
# create a Fortran shared module just copy the shared library rule # create a Fortran shared module just copy the shared library rule
if(NOT CMAKE_Fortran_CREATE_SHARED_MODULE) if(NOT CMAKE_Fortran_CREATE_SHARED_MODULE)
set(CMAKE_Fortran_CREATE_SHARED_MODULE ${CMAKE_Fortran_CREATE_SHARED_LIBRARY}) set(CMAKE_Fortran_CREATE_SHARED_MODULE ${CMAKE_Fortran_CREATE_SHARED_LIBRARY})
endif(NOT CMAKE_Fortran_CREATE_SHARED_MODULE) endif()
# Create a static archive incrementally for large object file counts. # Create a static archive incrementally for large object file counts.
# If CMAKE_Fortran_CREATE_STATIC_LIBRARY is set it will override these. # If CMAKE_Fortran_CREATE_STATIC_LIBRARY is set it will override these.
@ -208,19 +208,19 @@ endif()
if(NOT CMAKE_Fortran_COMPILE_OBJECT) if(NOT CMAKE_Fortran_COMPILE_OBJECT)
set(CMAKE_Fortran_COMPILE_OBJECT set(CMAKE_Fortran_COMPILE_OBJECT
"<CMAKE_Fortran_COMPILER> <DEFINES> <FLAGS> -c <SOURCE> -o <OBJECT>") "<CMAKE_Fortran_COMPILER> <DEFINES> <FLAGS> -c <SOURCE> -o <OBJECT>")
endif(NOT CMAKE_Fortran_COMPILE_OBJECT) endif()
# link a fortran program # link a fortran program
if(NOT CMAKE_Fortran_LINK_EXECUTABLE) if(NOT CMAKE_Fortran_LINK_EXECUTABLE)
set(CMAKE_Fortran_LINK_EXECUTABLE set(CMAKE_Fortran_LINK_EXECUTABLE
"<CMAKE_Fortran_COMPILER> <CMAKE_Fortran_LINK_FLAGS> <LINK_FLAGS> <FLAGS> <OBJECTS> -o <TARGET> <LINK_LIBRARIES>") "<CMAKE_Fortran_COMPILER> <CMAKE_Fortran_LINK_FLAGS> <LINK_FLAGS> <FLAGS> <OBJECTS> -o <TARGET> <LINK_LIBRARIES>")
endif(NOT CMAKE_Fortran_LINK_EXECUTABLE) endif()
if(CMAKE_Fortran_STANDARD_LIBRARIES_INIT) if(CMAKE_Fortran_STANDARD_LIBRARIES_INIT)
set(CMAKE_Fortran_STANDARD_LIBRARIES "${CMAKE_Fortran_STANDARD_LIBRARIES_INIT}" set(CMAKE_Fortran_STANDARD_LIBRARIES "${CMAKE_Fortran_STANDARD_LIBRARIES_INIT}"
CACHE STRING "Libraries linked by defalut with all Fortran applications.") CACHE STRING "Libraries linked by defalut with all Fortran applications.")
mark_as_advanced(CMAKE_Fortran_STANDARD_LIBRARIES) mark_as_advanced(CMAKE_Fortran_STANDARD_LIBRARIES)
endif(CMAKE_Fortran_STANDARD_LIBRARIES_INIT) endif()
if(NOT CMAKE_NOT_USING_CONFIG_FLAGS) if(NOT CMAKE_NOT_USING_CONFIG_FLAGS)
set (CMAKE_Fortran_FLAGS_DEBUG "${CMAKE_Fortran_FLAGS_DEBUG_INIT}" CACHE STRING set (CMAKE_Fortran_FLAGS_DEBUG "${CMAKE_Fortran_FLAGS_DEBUG_INIT}" CACHE STRING
@ -232,7 +232,7 @@ if(NOT CMAKE_NOT_USING_CONFIG_FLAGS)
set (CMAKE_Fortran_FLAGS_RELWITHDEBINFO "${CMAKE_Fortran_FLAGS_RELWITHDEBINFO_INIT}" CACHE STRING set (CMAKE_Fortran_FLAGS_RELWITHDEBINFO "${CMAKE_Fortran_FLAGS_RELWITHDEBINFO_INIT}" CACHE STRING
"Flags used by the compiler during Release with Debug Info builds.") "Flags used by the compiler during Release with Debug Info builds.")
endif(NOT CMAKE_NOT_USING_CONFIG_FLAGS) endif()
mark_as_advanced( mark_as_advanced(
CMAKE_Fortran_FLAGS CMAKE_Fortran_FLAGS

View File

@ -51,21 +51,21 @@ if(CMAKE_GENERATOR MATCHES "Makefiles")
mark_as_advanced(CMAKE_COLOR_MAKEFILE) mark_as_advanced(CMAKE_COLOR_MAKEFILE)
if(DEFINED CMAKE_RULE_MESSAGES) if(DEFINED CMAKE_RULE_MESSAGES)
set_property(GLOBAL PROPERTY RULE_MESSAGES ${CMAKE_RULE_MESSAGES}) set_property(GLOBAL PROPERTY RULE_MESSAGES ${CMAKE_RULE_MESSAGES})
endif(DEFINED CMAKE_RULE_MESSAGES) endif()
if(CMAKE_GENERATOR MATCHES "Unix Makefiles") if(CMAKE_GENERATOR MATCHES "Unix Makefiles")
set(CMAKE_EXPORT_COMPILE_COMMANDS OFF CACHE BOOL set(CMAKE_EXPORT_COMPILE_COMMANDS OFF CACHE BOOL
"Enable/Disable output of compile commands during generation." "Enable/Disable output of compile commands during generation."
) )
mark_as_advanced(CMAKE_EXPORT_COMPILE_COMMANDS) mark_as_advanced(CMAKE_EXPORT_COMPILE_COMMANDS)
endif(CMAKE_GENERATOR MATCHES "Unix Makefiles") endif()
endif(CMAKE_GENERATOR MATCHES "Makefiles") endif()
if(CMAKE_GENERATOR MATCHES "Ninja") if(CMAKE_GENERATOR MATCHES "Ninja")
set(CMAKE_EXPORT_COMPILE_COMMANDS OFF CACHE BOOL set(CMAKE_EXPORT_COMPILE_COMMANDS OFF CACHE BOOL
"Enable/Disable output of compile commands during generation." "Enable/Disable output of compile commands during generation."
) )
mark_as_advanced(CMAKE_EXPORT_COMPILE_COMMANDS) mark_as_advanced(CMAKE_EXPORT_COMPILE_COMMANDS)
endif(CMAKE_GENERATOR MATCHES "Ninja") endif()
# GetDefaultWindowsPrefixBase # GetDefaultWindowsPrefixBase
# #
@ -162,19 +162,19 @@ endfunction()
# command line to override it. # command line to override it.
if(NOT DEFINED CMAKE_INSTALL_PREFIX) if(NOT DEFINED CMAKE_INSTALL_PREFIX)
set(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT 1) set(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT 1)
endif(NOT DEFINED CMAKE_INSTALL_PREFIX) endif()
# Choose a default install prefix for this platform. # Choose a default install prefix for this platform.
if(CMAKE_HOST_UNIX) if(CMAKE_HOST_UNIX)
set(CMAKE_INSTALL_PREFIX "/usr/local" set(CMAKE_INSTALL_PREFIX "/usr/local"
CACHE PATH "Install path prefix, prepended onto install directories.") CACHE PATH "Install path prefix, prepended onto install directories.")
else(CMAKE_HOST_UNIX) else()
GetDefaultWindowsPrefixBase(CMAKE_GENERIC_PROGRAM_FILES) GetDefaultWindowsPrefixBase(CMAKE_GENERIC_PROGRAM_FILES)
set(CMAKE_INSTALL_PREFIX set(CMAKE_INSTALL_PREFIX
"${CMAKE_GENERIC_PROGRAM_FILES}/${PROJECT_NAME}" "${CMAKE_GENERIC_PROGRAM_FILES}/${PROJECT_NAME}"
CACHE PATH "Install path prefix, prepended onto install directories.") CACHE PATH "Install path prefix, prepended onto install directories.")
set(CMAKE_GENERIC_PROGRAM_FILES) set(CMAKE_GENERIC_PROGRAM_FILES)
endif(CMAKE_HOST_UNIX) endif()
# Set a variable which will be used as component name in install() commands # Set a variable which will be used as component name in install() commands
# where no COMPONENT has been given: # where no COMPONENT has been given:

View File

@ -18,7 +18,7 @@
# stored settings using the CMAKE_EXPORT_BUILD_SETTINGS macro. # stored settings using the CMAKE_EXPORT_BUILD_SETTINGS macro.
macro(CMAKE_IMPORT_BUILD_SETTINGS SETTINGS_FILE) macro(CMAKE_IMPORT_BUILD_SETTINGS SETTINGS_FILE)
if(${SETTINGS_FILE} MATCHES ".+") if(${SETTINGS_FILE} MATCHES ".+")
else(${SETTINGS_FILE} MATCHES ".+") else()
message(SEND_ERROR "CMAKE_IMPORT_BUILD_SETTINGS called with no argument.") message(SEND_ERROR "CMAKE_IMPORT_BUILD_SETTINGS called with no argument.")
endif(${SETTINGS_FILE} MATCHES ".+") endif()
endmacro(CMAKE_IMPORT_BUILD_SETTINGS) endmacro()

View File

@ -34,26 +34,26 @@ endif()
if(NOT CMAKE_Java_CREATE_STATIC_LIBRARY) if(NOT CMAKE_Java_CREATE_STATIC_LIBRARY)
# if(WIN32) # if(WIN32)
# set(class_files_mask "*.class") # set(class_files_mask "*.class")
# else(WIN32) # else()
set(class_files_mask ".") set(class_files_mask ".")
# endif(WIN32) # endif()
set(CMAKE_Java_CREATE_STATIC_LIBRARY set(CMAKE_Java_CREATE_STATIC_LIBRARY
"<CMAKE_Java_ARCHIVE> -cf <TARGET> -C <OBJECT_DIR> ${class_files_mask}") "<CMAKE_Java_ARCHIVE> -cf <TARGET> -C <OBJECT_DIR> ${class_files_mask}")
# "${class_files_mask}" should really be "<OBJECTS>" but compling a *.java # "${class_files_mask}" should really be "<OBJECTS>" but compling a *.java
# file can create more than one *.class file... # file can create more than one *.class file...
endif(NOT CMAKE_Java_CREATE_STATIC_LIBRARY) endif()
# compile a Java file into an object file # compile a Java file into an object file
if(NOT CMAKE_Java_COMPILE_OBJECT) if(NOT CMAKE_Java_COMPILE_OBJECT)
set(CMAKE_Java_COMPILE_OBJECT set(CMAKE_Java_COMPILE_OBJECT
"<CMAKE_Java_COMPILER> <FLAGS> <SOURCE> -d <OBJECT_DIR>") "<CMAKE_Java_COMPILER> <FLAGS> <SOURCE> -d <OBJECT_DIR>")
endif(NOT CMAKE_Java_COMPILE_OBJECT) endif()
# set java include flag option and the separator for multiple include paths # set java include flag option and the separator for multiple include paths
set(CMAKE_INCLUDE_FLAG_Java "-classpath ") set(CMAKE_INCLUDE_FLAG_Java "-classpath ")
if(WIN32 AND NOT CYGWIN) if(WIN32 AND NOT CYGWIN)
set(CMAKE_INCLUDE_FLAG_SEP_Java ";") set(CMAKE_INCLUDE_FLAG_SEP_Java ";")
else(WIN32 AND NOT CYGWIN) else()
set(CMAKE_INCLUDE_FLAG_SEP_Java ":") set(CMAKE_INCLUDE_FLAG_SEP_Java ":")
endif(WIN32 AND NOT CYGWIN) endif()

View File

@ -19,6 +19,6 @@ find_program(CMAKE_SH sh.exe )
if(CMAKE_SH) if(CMAKE_SH)
message(FATAL_ERROR "sh.exe was found in your PATH, here:\n${CMAKE_SH}\nFor MinGW make to work correctly sh.exe must NOT be in your path.\nRun cmake from a shell that does not have sh.exe in your PATH.\nIf you want to use a UNIX shell, then use MSYS Makefiles.\n") message(FATAL_ERROR "sh.exe was found in your PATH, here:\n${CMAKE_SH}\nFor MinGW make to work correctly sh.exe must NOT be in your path.\nRun cmake from a shell that does not have sh.exe in your PATH.\nIf you want to use a UNIX shell, then use MSYS Makefiles.\n")
set(CMAKE_MAKE_PROGRAM NOTFOUND) set(CMAKE_MAKE_PROGRAM NOTFOUND)
endif(CMAKE_SH) endif()
mark_as_advanced(CMAKE_MAKE_PROGRAM CMAKE_SH) mark_as_advanced(CMAKE_MAKE_PROGRAM CMAKE_SH)

View File

@ -214,7 +214,7 @@ macro(check_required_components _NAME)
set(\${_NAME}_FOUND FALSE) set(\${_NAME}_FOUND FALSE)
endif() endif()
endif() endif()
endforeach(comp) endforeach()
endmacro() endmacro()
") ")
endif() endif()

View File

@ -84,11 +84,11 @@ function(CMAKE_PARSE_ARGUMENTS prefix _optionNames _singleArgNames _multiArgName
# first set all result variables to empty/FALSE # first set all result variables to empty/FALSE
foreach(arg_name ${_singleArgNames} ${_multiArgNames}) foreach(arg_name ${_singleArgNames} ${_multiArgNames})
set(${prefix}_${arg_name}) set(${prefix}_${arg_name})
endforeach(arg_name) endforeach()
foreach(option ${_optionNames}) foreach(option ${_optionNames})
set(${prefix}_${option} FALSE) set(${prefix}_${option} FALSE)
endforeach(option) endforeach()
set(${prefix}_UNPARSED_ARGUMENTS) set(${prefix}_UNPARSED_ARGUMENTS)
@ -109,9 +109,9 @@ function(CMAKE_PARSE_ARGUMENTS prefix _optionNames _singleArgNames _multiArgName
elseif("${insideValues}" STREQUAL "MULTI") elseif("${insideValues}" STREQUAL "MULTI")
list(APPEND ${prefix}_${currentArgName} ${currentArg}) list(APPEND ${prefix}_${currentArgName} ${currentArg})
endif() endif()
else(insideValues) else()
list(APPEND ${prefix}_UNPARSED_ARGUMENTS ${currentArg}) list(APPEND ${prefix}_UNPARSED_ARGUMENTS ${currentArg})
endif(insideValues) endif()
else() else()
if(NOT ${optionIndex} EQUAL -1) if(NOT ${optionIndex} EQUAL -1)
set(${prefix}_${currentArg} TRUE) set(${prefix}_${currentArg} TRUE)
@ -127,12 +127,12 @@ function(CMAKE_PARSE_ARGUMENTS prefix _optionNames _singleArgNames _multiArgName
endif() endif()
endif() endif()
endforeach(currentArg) endforeach()
# propagate the result variables to the caller: # propagate the result variables to the caller:
foreach(arg_name ${_singleArgNames} ${_multiArgNames} ${_optionNames}) foreach(arg_name ${_singleArgNames} ${_multiArgNames} ${_optionNames})
set(${prefix}_${arg_name} ${${prefix}_${arg_name}} PARENT_SCOPE) set(${prefix}_${arg_name} ${${prefix}_${arg_name}} PARENT_SCOPE)
endforeach(arg_name) endforeach()
set(${prefix}_UNPARSED_ARGUMENTS ${${prefix}_UNPARSED_ARGUMENTS} PARENT_SCOPE) set(${prefix}_UNPARSED_ARGUMENTS ${${prefix}_UNPARSED_ARGUMENTS} PARENT_SCOPE)
endfunction(CMAKE_PARSE_ARGUMENTS _options _singleArgs _multiArgs) endfunction()

View File

@ -43,7 +43,7 @@ macro(CMAKE_PUSH_CHECK_STATE)
set(_CMAKE_REQUIRED_DEFINITIONS_SAVE_${_CMAKE_PUSH_CHECK_STATE_COUNTER} ${CMAKE_REQUIRED_DEFINITIONS}) set(_CMAKE_REQUIRED_DEFINITIONS_SAVE_${_CMAKE_PUSH_CHECK_STATE_COUNTER} ${CMAKE_REQUIRED_DEFINITIONS})
set(_CMAKE_REQUIRED_LIBRARIES_SAVE_${_CMAKE_PUSH_CHECK_STATE_COUNTER} ${CMAKE_REQUIRED_LIBRARIES}) set(_CMAKE_REQUIRED_LIBRARIES_SAVE_${_CMAKE_PUSH_CHECK_STATE_COUNTER} ${CMAKE_REQUIRED_LIBRARIES})
set(_CMAKE_REQUIRED_FLAGS_SAVE_${_CMAKE_PUSH_CHECK_STATE_COUNTER} ${CMAKE_REQUIRED_FLAGS}) set(_CMAKE_REQUIRED_FLAGS_SAVE_${_CMAKE_PUSH_CHECK_STATE_COUNTER} ${CMAKE_REQUIRED_FLAGS})
endmacro(CMAKE_PUSH_CHECK_STATE) endmacro()
macro(CMAKE_POP_CHECK_STATE) macro(CMAKE_POP_CHECK_STATE)
@ -58,4 +58,4 @@ macro(CMAKE_POP_CHECK_STATE)
math(EXPR _CMAKE_PUSH_CHECK_STATE_COUNTER "${_CMAKE_PUSH_CHECK_STATE_COUNTER}-1") math(EXPR _CMAKE_PUSH_CHECK_STATE_COUNTER "${_CMAKE_PUSH_CHECK_STATE_COUNTER}-1")
endif() endif()
endmacro(CMAKE_POP_CHECK_STATE) endmacro()

View File

@ -44,7 +44,7 @@ set(CMAKE_INCLUDE_FLAG_RC "-I")
if(NOT CMAKE_RC_COMPILE_OBJECT) if(NOT CMAKE_RC_COMPILE_OBJECT)
set(CMAKE_RC_COMPILE_OBJECT set(CMAKE_RC_COMPILE_OBJECT
"<CMAKE_RC_COMPILER> <FLAGS> <DEFINES> /fo<OBJECT> <SOURCE>") "<CMAKE_RC_COMPILER> <FLAGS> <DEFINES> /fo<OBJECT> <SOURCE>")
endif(NOT CMAKE_RC_COMPILE_OBJECT) endif()
mark_as_advanced( mark_as_advanced(
CMAKE_RC_FLAGS CMAKE_RC_FLAGS

View File

@ -44,8 +44,8 @@ if(NOT _INCLUDED_SYSTEM_INFO_FILE)
${CMAKE_BINARY_DIR}/CopyOfCMakeCache.txt COPYONLY) ${CMAKE_BINARY_DIR}/CopyOfCMakeCache.txt COPYONLY)
message("Your CMakeCache.txt file was copied to CopyOfCMakeCache.txt. " message("Your CMakeCache.txt file was copied to CopyOfCMakeCache.txt. "
"Please send that file to cmake@www.cmake.org.") "Please send that file to cmake@www.cmake.org.")
endif(EXISTS ${CMAKE_BINARY_DIR}/CMakeCache.txt) endif()
endif(NOT _INCLUDED_SYSTEM_INFO_FILE) endif()
# optionally include a file which can do extra-generator specific things, e.g. # optionally include a file which can do extra-generator specific things, e.g.
@ -53,7 +53,7 @@ endif(NOT _INCLUDED_SYSTEM_INFO_FILE)
if(CMAKE_EXTRA_GENERATOR) if(CMAKE_EXTRA_GENERATOR)
string(REPLACE " " "" _CMAKE_EXTRA_GENERATOR_NO_SPACES ${CMAKE_EXTRA_GENERATOR} ) string(REPLACE " " "" _CMAKE_EXTRA_GENERATOR_NO_SPACES ${CMAKE_EXTRA_GENERATOR} )
include("CMakeFind${_CMAKE_EXTRA_GENERATOR_NO_SPACES}" OPTIONAL) include("CMakeFind${_CMAKE_EXTRA_GENERATOR_NO_SPACES}" OPTIONAL)
endif(CMAKE_EXTRA_GENERATOR) endif()
# for most systems a module is the same as a shared library # for most systems a module is the same as a shared library
@ -63,7 +63,7 @@ endif(CMAKE_EXTRA_GENERATOR)
if(NOT CMAKE_MODULE_EXISTS) if(NOT CMAKE_MODULE_EXISTS)
set(CMAKE_SHARED_MODULE_PREFIX "${CMAKE_SHARED_LIBRARY_PREFIX}") set(CMAKE_SHARED_MODULE_PREFIX "${CMAKE_SHARED_LIBRARY_PREFIX}")
set(CMAKE_SHARED_MODULE_SUFFIX "${CMAKE_SHARED_LIBRARY_SUFFIX}") set(CMAKE_SHARED_MODULE_SUFFIX "${CMAKE_SHARED_LIBRARY_SUFFIX}")
endif(NOT CMAKE_MODULE_EXISTS) endif()
set(CMAKE_SYSTEM_SPECIFIC_INFORMATION_LOADED 1) set(CMAKE_SYSTEM_SPECIFIC_INFORMATION_LOADED 1)

View File

@ -37,7 +37,7 @@ if(NOT CMAKE_C_COMPILER_WORKS)
${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/testCCompiler.c ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/testCCompiler.c
OUTPUT_VARIABLE __CMAKE_C_COMPILER_OUTPUT) OUTPUT_VARIABLE __CMAKE_C_COMPILER_OUTPUT)
set(C_TEST_WAS_RUN 1) set(C_TEST_WAS_RUN 1)
endif(NOT CMAKE_C_COMPILER_WORKS) endif()
if(NOT CMAKE_C_COMPILER_WORKS) if(NOT CMAKE_C_COMPILER_WORKS)
PrintTestCompilerStatus("C" " -- broken") PrintTestCompilerStatus("C" " -- broken")
@ -53,19 +53,19 @@ if(NOT CMAKE_C_COMPILER_WORKS)
"is not able to compile a simple test program.\nIt fails " "is not able to compile a simple test program.\nIt fails "
"with the following output:\n ${__CMAKE_C_COMPILER_OUTPUT}\n\n" "with the following output:\n ${__CMAKE_C_COMPILER_OUTPUT}\n\n"
"CMake will not be able to correctly generate this project.") "CMake will not be able to correctly generate this project.")
else(NOT CMAKE_C_COMPILER_WORKS) else()
if(C_TEST_WAS_RUN) if(C_TEST_WAS_RUN)
PrintTestCompilerStatus("C" " -- works") PrintTestCompilerStatus("C" " -- works")
file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
"Determining if the C compiler works passed with " "Determining if the C compiler works passed with "
"the following output:\n${__CMAKE_C_COMPILER_OUTPUT}\n\n") "the following output:\n${__CMAKE_C_COMPILER_OUTPUT}\n\n")
endif(C_TEST_WAS_RUN) endif()
set(CMAKE_C_COMPILER_WORKS 1 CACHE INTERNAL "") set(CMAKE_C_COMPILER_WORKS 1 CACHE INTERNAL "")
if(CMAKE_C_COMPILER_FORCED) if(CMAKE_C_COMPILER_FORCED)
# The compiler configuration was forced by the user. # The compiler configuration was forced by the user.
# Assume the user has configured all compiler information. # Assume the user has configured all compiler information.
else(CMAKE_C_COMPILER_FORCED) else()
# Try to identify the ABI and configure it into CMakeCCompiler.cmake # Try to identify the ABI and configure it into CMakeCCompiler.cmake
include(${CMAKE_ROOT}/Modules/CMakeDetermineCompilerABI.cmake) include(${CMAKE_ROOT}/Modules/CMakeDetermineCompilerABI.cmake)
CMAKE_DETERMINE_COMPILER_ABI(C ${CMAKE_ROOT}/Modules/CMakeCCompilerABI.c) CMAKE_DETERMINE_COMPILER_ABI(C ${CMAKE_ROOT}/Modules/CMakeCCompilerABI.c)
@ -75,13 +75,13 @@ else(NOT CMAKE_C_COMPILER_WORKS)
@ONLY IMMEDIATE # IMMEDIATE must be here for compatibility mode <= 2.0 @ONLY IMMEDIATE # IMMEDIATE must be here for compatibility mode <= 2.0
) )
include(${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeCCompiler.cmake) include(${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeCCompiler.cmake)
endif(CMAKE_C_COMPILER_FORCED) endif()
if(CMAKE_C_SIZEOF_DATA_PTR) if(CMAKE_C_SIZEOF_DATA_PTR)
foreach(f ${CMAKE_C_ABI_FILES}) foreach(f ${CMAKE_C_ABI_FILES})
include(${f}) include(${f})
endforeach() endforeach()
unset(CMAKE_C_ABI_FILES) unset(CMAKE_C_ABI_FILES)
endif() endif()
endif(NOT CMAKE_C_COMPILER_WORKS) endif()
unset(__CMAKE_C_COMPILER_OUTPUT) unset(__CMAKE_C_COMPILER_OUTPUT)

View File

@ -30,7 +30,7 @@ if(NOT CMAKE_CXX_COMPILER_WORKS)
${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/testCXXCompiler.cxx ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/testCXXCompiler.cxx
OUTPUT_VARIABLE __CMAKE_CXX_COMPILER_OUTPUT) OUTPUT_VARIABLE __CMAKE_CXX_COMPILER_OUTPUT)
set(CXX_TEST_WAS_RUN 1) set(CXX_TEST_WAS_RUN 1)
endif(NOT CMAKE_CXX_COMPILER_WORKS) endif()
if(NOT CMAKE_CXX_COMPILER_WORKS) if(NOT CMAKE_CXX_COMPILER_WORKS)
PrintTestCompilerStatus("CXX" " -- broken") PrintTestCompilerStatus("CXX" " -- broken")
@ -46,19 +46,19 @@ if(NOT CMAKE_CXX_COMPILER_WORKS)
"is not able to compile a simple test program.\nIt fails " "is not able to compile a simple test program.\nIt fails "
"with the following output:\n ${__CMAKE_CXX_COMPILER_OUTPUT}\n\n" "with the following output:\n ${__CMAKE_CXX_COMPILER_OUTPUT}\n\n"
"CMake will not be able to correctly generate this project.") "CMake will not be able to correctly generate this project.")
else(NOT CMAKE_CXX_COMPILER_WORKS) else()
if(CXX_TEST_WAS_RUN) if(CXX_TEST_WAS_RUN)
PrintTestCompilerStatus("CXX" " -- works") PrintTestCompilerStatus("CXX" " -- works")
file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
"Determining if the CXX compiler works passed with " "Determining if the CXX compiler works passed with "
"the following output:\n${__CMAKE_CXX_COMPILER_OUTPUT}\n\n") "the following output:\n${__CMAKE_CXX_COMPILER_OUTPUT}\n\n")
endif(CXX_TEST_WAS_RUN) endif()
set(CMAKE_CXX_COMPILER_WORKS 1 CACHE INTERNAL "") set(CMAKE_CXX_COMPILER_WORKS 1 CACHE INTERNAL "")
if(CMAKE_CXX_COMPILER_FORCED) if(CMAKE_CXX_COMPILER_FORCED)
# The compiler configuration was forced by the user. # The compiler configuration was forced by the user.
# Assume the user has configured all compiler information. # Assume the user has configured all compiler information.
else(CMAKE_CXX_COMPILER_FORCED) else()
# Try to identify the ABI and configure it into CMakeCXXCompiler.cmake # Try to identify the ABI and configure it into CMakeCXXCompiler.cmake
include(${CMAKE_ROOT}/Modules/CMakeDetermineCompilerABI.cmake) include(${CMAKE_ROOT}/Modules/CMakeDetermineCompilerABI.cmake)
CMAKE_DETERMINE_COMPILER_ABI(CXX ${CMAKE_ROOT}/Modules/CMakeCXXCompilerABI.cpp) CMAKE_DETERMINE_COMPILER_ABI(CXX ${CMAKE_ROOT}/Modules/CMakeCXXCompilerABI.cpp)
@ -68,13 +68,13 @@ else(NOT CMAKE_CXX_COMPILER_WORKS)
@ONLY IMMEDIATE # IMMEDIATE must be here for compatibility mode <= 2.0 @ONLY IMMEDIATE # IMMEDIATE must be here for compatibility mode <= 2.0
) )
include(${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeCXXCompiler.cmake) include(${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeCXXCompiler.cmake)
endif(CMAKE_CXX_COMPILER_FORCED) endif()
if(CMAKE_CXX_SIZEOF_DATA_PTR) if(CMAKE_CXX_SIZEOF_DATA_PTR)
foreach(f ${CMAKE_CXX_ABI_FILES}) foreach(f ${CMAKE_CXX_ABI_FILES})
include(${f}) include(${f})
endforeach() endforeach()
unset(CMAKE_CXX_ABI_FILES) unset(CMAKE_CXX_ABI_FILES)
endif() endif()
endif(NOT CMAKE_CXX_COMPILER_WORKS) endif()
unset(__CMAKE_CXX_COMPILER_OUTPUT) unset(__CMAKE_CXX_COMPILER_OUTPUT)

View File

@ -30,7 +30,7 @@ if(NOT CMAKE_Fortran_COMPILER_WORKS)
${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/testFortranCompiler.f ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/testFortranCompiler.f
OUTPUT_VARIABLE OUTPUT) OUTPUT_VARIABLE OUTPUT)
set(FORTRAN_TEST_WAS_RUN 1) set(FORTRAN_TEST_WAS_RUN 1)
endif(NOT CMAKE_Fortran_COMPILER_WORKS) endif()
if(NOT CMAKE_Fortran_COMPILER_WORKS) if(NOT CMAKE_Fortran_COMPILER_WORKS)
PrintTestCompilerStatus("Fortran" " -- broken") PrintTestCompilerStatus("Fortran" " -- broken")
@ -41,19 +41,19 @@ if(NOT CMAKE_Fortran_COMPILER_WORKS)
"is not able to compile a simple test program.\nIt fails " "is not able to compile a simple test program.\nIt fails "
"with the following output:\n ${OUTPUT}\n\n" "with the following output:\n ${OUTPUT}\n\n"
"CMake will not be able to correctly generate this project.") "CMake will not be able to correctly generate this project.")
else(NOT CMAKE_Fortran_COMPILER_WORKS) else()
if(FORTRAN_TEST_WAS_RUN) if(FORTRAN_TEST_WAS_RUN)
PrintTestCompilerStatus("Fortran" " -- works") PrintTestCompilerStatus("Fortran" " -- works")
file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
"Determining if the Fortran compiler works passed with " "Determining if the Fortran compiler works passed with "
"the following output:\n${OUTPUT}\n\n") "the following output:\n${OUTPUT}\n\n")
endif(FORTRAN_TEST_WAS_RUN) endif()
set(CMAKE_Fortran_COMPILER_WORKS 1 CACHE INTERNAL "") set(CMAKE_Fortran_COMPILER_WORKS 1 CACHE INTERNAL "")
if(CMAKE_Fortran_COMPILER_FORCED) if(CMAKE_Fortran_COMPILER_FORCED)
# The compiler configuration was forced by the user. # The compiler configuration was forced by the user.
# Assume the user has configured all compiler information. # Assume the user has configured all compiler information.
else(CMAKE_Fortran_COMPILER_FORCED) else()
# Try to identify the ABI and configure it into CMakeFortranCompiler.cmake # Try to identify the ABI and configure it into CMakeFortranCompiler.cmake
include(${CMAKE_ROOT}/Modules/CMakeDetermineCompilerABI.cmake) include(${CMAKE_ROOT}/Modules/CMakeDetermineCompilerABI.cmake)
CMAKE_DETERMINE_COMPILER_ABI(Fortran ${CMAKE_ROOT}/Modules/CMakeFortranCompilerABI.F) CMAKE_DETERMINE_COMPILER_ABI(Fortran ${CMAKE_ROOT}/Modules/CMakeFortranCompilerABI.F)
@ -75,15 +75,15 @@ else(NOT CMAKE_Fortran_COMPILER_WORKS)
"Determining if the Fortran compiler supports Fortran 90 passed with " "Determining if the Fortran compiler supports Fortran 90 passed with "
"the following output:\n${OUTPUT}\n\n") "the following output:\n${OUTPUT}\n\n")
set(CMAKE_Fortran_COMPILER_SUPPORTS_F90 1) set(CMAKE_Fortran_COMPILER_SUPPORTS_F90 1)
else(CMAKE_Fortran_COMPILER_SUPPORTS_F90) else()
message(STATUS "Checking whether ${CMAKE_Fortran_COMPILER} supports Fortran 90 -- no") message(STATUS "Checking whether ${CMAKE_Fortran_COMPILER} supports Fortran 90 -- no")
file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
"Determining if the Fortran compiler supports Fortran 90 failed with " "Determining if the Fortran compiler supports Fortran 90 failed with "
"the following output:\n${OUTPUT}\n\n") "the following output:\n${OUTPUT}\n\n")
set(CMAKE_Fortran_COMPILER_SUPPORTS_F90 0) set(CMAKE_Fortran_COMPILER_SUPPORTS_F90 0)
endif(CMAKE_Fortran_COMPILER_SUPPORTS_F90) endif()
unset(CMAKE_Fortran_COMPILER_SUPPORTS_F90 CACHE) unset(CMAKE_Fortran_COMPILER_SUPPORTS_F90 CACHE)
endif(NOT DEFINED CMAKE_Fortran_COMPILER_SUPPORTS_F90) endif()
configure_file( configure_file(
${CMAKE_ROOT}/Modules/CMakeFortranCompiler.cmake.in ${CMAKE_ROOT}/Modules/CMakeFortranCompiler.cmake.in
@ -91,11 +91,11 @@ else(NOT CMAKE_Fortran_COMPILER_WORKS)
@ONLY IMMEDIATE # IMMEDIATE must be here for compatibility mode <= 2.0 @ONLY IMMEDIATE # IMMEDIATE must be here for compatibility mode <= 2.0
) )
include(${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeFortranCompiler.cmake) include(${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeFortranCompiler.cmake)
endif(CMAKE_Fortran_COMPILER_FORCED) endif()
if(CMAKE_Fortran_SIZEOF_DATA_PTR) if(CMAKE_Fortran_SIZEOF_DATA_PTR)
foreach(f ${CMAKE_Fortran_ABI_FILES}) foreach(f ${CMAKE_Fortran_ABI_FILES})
include(${f}) include(${f})
endforeach() endforeach()
unset(CMAKE_Fortran_ABI_FILES) unset(CMAKE_Fortran_ABI_FILES)
endif() endif()
endif(NOT CMAKE_Fortran_COMPILER_WORKS) endif()

View File

@ -16,7 +16,7 @@
set( _CMAKE_MAKE_PROGRAM_NAMES devenv) set( _CMAKE_MAKE_PROGRAM_NAMES devenv)
if(NOT CMAKE_CROSSCOMPILING) if(NOT CMAKE_CROSSCOMPILING)
set( _CMAKE_MAKE_PROGRAM_NAMES ${_CMAKE_MAKE_PROGRAM_NAMES} VCExpress) set( _CMAKE_MAKE_PROGRAM_NAMES ${_CMAKE_MAKE_PROGRAM_NAMES} VCExpress)
endif(NOT CMAKE_CROSSCOMPILING) endif()
find_program(CMAKE_MAKE_PROGRAM find_program(CMAKE_MAKE_PROGRAM
NAMES ${_CMAKE_MAKE_PROGRAM_NAMES} NAMES ${_CMAKE_MAKE_PROGRAM_NAMES}

View File

@ -16,7 +16,7 @@
set( _CMAKE_MAKE_PROGRAM_NAMES devenv) set( _CMAKE_MAKE_PROGRAM_NAMES devenv)
if(NOT CMAKE_CROSSCOMPILING) if(NOT CMAKE_CROSSCOMPILING)
set( _CMAKE_MAKE_PROGRAM_NAMES ${_CMAKE_MAKE_PROGRAM_NAMES} VCExpress) set( _CMAKE_MAKE_PROGRAM_NAMES ${_CMAKE_MAKE_PROGRAM_NAMES} VCExpress)
endif(NOT CMAKE_CROSSCOMPILING) endif()
find_program(CMAKE_MAKE_PROGRAM find_program(CMAKE_MAKE_PROGRAM
NAMES ${_CMAKE_MAKE_PROGRAM_NAMES} NAMES ${_CMAKE_MAKE_PROGRAM_NAMES}

View File

@ -47,7 +47,7 @@ function(crt_version file list_var)
else() else()
message(FATAL_ERROR "Parse error could not find version in [${s}]") message(FATAL_ERROR "Parse error could not find version in [${s}]")
endif() endif()
endforeach(s) endforeach()
if(NOT DEFINED has_match) if(NOT DEFINED has_match)
message("Information: no embeded manifest in: ${file}") message("Information: no embeded manifest in: ${file}")
return() return()
@ -57,7 +57,7 @@ function(crt_version file list_var)
if(version_list) if(version_list)
set(${list_var} ${version_list} PARENT_SCOPE) set(${list_var} ${version_list} PARENT_SCOPE)
endif() endif()
endfunction(crt_version) endfunction()
set(fatal_error FALSE) set(fatal_error FALSE)
# check_version: # check_version:
@ -75,7 +75,7 @@ function(check_version file manifest_versions)
message("ERROR: ${file} uses ${ver} not found in shipped manifests:[${manifest_versions}].") message("ERROR: ${file} uses ${ver} not found in shipped manifests:[${manifest_versions}].")
set(fatal_error TRUE PARENT_SCOPE) set(fatal_error TRUE PARENT_SCOPE)
endif() endif()
endforeach(ver) endforeach()
list(LENGTH file_versions len) list(LENGTH file_versions len)
if(${len} GREATER 1) if(${len} GREATER 1)
message("WARNING: found more than one version of MICROSOFT.VC80.CRT referenced in ${file}: [${file_versions}]") message("WARNING: found more than one version of MICROSOFT.VC80.CRT referenced in ${file}: [${file_versions}]")
@ -88,7 +88,7 @@ set(manifest_version_list )
file(GLOB_RECURSE manifest_files "*.manifest") file(GLOB_RECURSE manifest_files "*.manifest")
foreach(f ${manifest_files}) foreach(f ${manifest_files})
crt_version("${f}" manifest_version_list) crt_version("${f}" manifest_version_list)
endforeach(f) endforeach()
list(LENGTH manifest_version_list LEN) list(LENGTH manifest_version_list LEN)
if(LEN EQUAL 0) if(LEN EQUAL 0)
message(FATAL_ERROR "No .manifest files found, no version check can be done.") message(FATAL_ERROR "No .manifest files found, no version check can be done.")

View File

@ -287,19 +287,19 @@
# Define this var in order to avoid (or warn) concerning multiple inclusion # Define this var in order to avoid (or warn) concerning multiple inclusion
if(CPack_CMake_INCLUDED) if(CPack_CMake_INCLUDED)
message(WARNING "CPack.cmake has already been included!!") message(WARNING "CPack.cmake has already been included!!")
else(CPack_CMake_INCLUDED) else()
set(CPack_CMake_INCLUDED 1) set(CPack_CMake_INCLUDED 1)
endif(CPack_CMake_INCLUDED) endif()
# Pick a configuration file # Pick a configuration file
set(cpack_input_file "${CMAKE_ROOT}/Templates/CPackConfig.cmake.in") set(cpack_input_file "${CMAKE_ROOT}/Templates/CPackConfig.cmake.in")
if(EXISTS "${CMAKE_SOURCE_DIR}/CPackConfig.cmake.in") if(EXISTS "${CMAKE_SOURCE_DIR}/CPackConfig.cmake.in")
set(cpack_input_file "${CMAKE_SOURCE_DIR}/CPackConfig.cmake.in") set(cpack_input_file "${CMAKE_SOURCE_DIR}/CPackConfig.cmake.in")
endif(EXISTS "${CMAKE_SOURCE_DIR}/CPackConfig.cmake.in") endif()
set(cpack_source_input_file "${CMAKE_ROOT}/Templates/CPackConfig.cmake.in") set(cpack_source_input_file "${CMAKE_ROOT}/Templates/CPackConfig.cmake.in")
if(EXISTS "${CMAKE_SOURCE_DIR}/CPackSourceConfig.cmake.in") if(EXISTS "${CMAKE_SOURCE_DIR}/CPackSourceConfig.cmake.in")
set(cpack_source_input_file "${CMAKE_SOURCE_DIR}/CPackSourceConfig.cmake.in") set(cpack_source_input_file "${CMAKE_SOURCE_DIR}/CPackSourceConfig.cmake.in")
endif(EXISTS "${CMAKE_SOURCE_DIR}/CPackSourceConfig.cmake.in") endif()
# Backward compatibility # Backward compatibility
# Include CPackComponent macros if it has not already been included before. # Include CPackComponent macros if it has not already been included before.
@ -309,8 +309,8 @@ include(CPackComponent)
macro(cpack_set_if_not_set name value) macro(cpack_set_if_not_set name value)
if(NOT DEFINED "${name}") if(NOT DEFINED "${name}")
set(${name} "${value}") set(${name} "${value}")
endif(NOT DEFINED "${name}") endif()
endmacro(cpack_set_if_not_set) endmacro()
# cpack_encode_variables - Macro to encode variables for the configuration file # cpack_encode_variables - Macro to encode variables for the configuration file
# find any variable that starts with CPACK and create a variable # find any variable that starts with CPACK and create a variable
@ -324,9 +324,9 @@ macro(cpack_encode_variables)
if("xxx${var}" MATCHES "xxxCPACK") if("xxx${var}" MATCHES "xxxCPACK")
set(_CPACK_OTHER_VARIABLES_ set(_CPACK_OTHER_VARIABLES_
"${_CPACK_OTHER_VARIABLES_}\nSET(${var} \"${${var}}\")") "${_CPACK_OTHER_VARIABLES_}\nSET(${var} \"${${var}}\")")
endif("xxx${var}" MATCHES "xxxCPACK") endif()
endforeach(var ${res}) endforeach()
endmacro(cpack_encode_variables) endmacro()
# Set the package name # Set the package name
cpack_set_if_not_set(CPACK_PACKAGE_NAME "${CMAKE_PROJECT_NAME}") cpack_set_if_not_set(CPACK_PACKAGE_NAME "${CMAKE_PROJECT_NAME}")
@ -352,20 +352,20 @@ cpack_set_if_not_set(CPACK_MODULE_PATH "${CMAKE_MODULE_PATH}")
if(CPACK_NSIS_ENABLE_UNINSTALL_BEFORE_INSTALL) if(CPACK_NSIS_ENABLE_UNINSTALL_BEFORE_INSTALL)
set(CPACK_NSIS_ENABLE_UNINSTALL_BEFORE_INSTALL ON) set(CPACK_NSIS_ENABLE_UNINSTALL_BEFORE_INSTALL ON)
endif(CPACK_NSIS_ENABLE_UNINSTALL_BEFORE_INSTALL) endif()
if(CPACK_NSIS_MODIFY_PATH) if(CPACK_NSIS_MODIFY_PATH)
set(CPACK_NSIS_MODIFY_PATH ON) set(CPACK_NSIS_MODIFY_PATH ON)
endif(CPACK_NSIS_MODIFY_PATH) endif()
set(__cpack_system_name ${CMAKE_SYSTEM_NAME}) set(__cpack_system_name ${CMAKE_SYSTEM_NAME})
if(${__cpack_system_name} MATCHES Windows) if(${__cpack_system_name} MATCHES Windows)
if(CMAKE_CL_64) if(CMAKE_CL_64)
set(__cpack_system_name win64) set(__cpack_system_name win64)
else(CMAKE_CL_64) else()
set(__cpack_system_name win32) set(__cpack_system_name win32)
endif(CMAKE_CL_64) endif()
endif(${__cpack_system_name} MATCHES Windows) endif()
cpack_set_if_not_set(CPACK_SYSTEM_NAME "${__cpack_system_name}") cpack_set_if_not_set(CPACK_SYSTEM_NAME "${__cpack_system_name}")
# Root dir: default value should be the string literal "$PROGRAMFILES" # Root dir: default value should be the string literal "$PROGRAMFILES"
@ -386,15 +386,15 @@ cpack_set_if_not_set(CPACK_PACKAGE_RELOCATABLE "true")
# always force to exactly "true" or "false" for CPack.Info.plist.in: # always force to exactly "true" or "false" for CPack.Info.plist.in:
if(CPACK_PACKAGE_RELOCATABLE) if(CPACK_PACKAGE_RELOCATABLE)
set(CPACK_PACKAGE_RELOCATABLE "true") set(CPACK_PACKAGE_RELOCATABLE "true")
else(CPACK_PACKAGE_RELOCATABLE) else()
set(CPACK_PACKAGE_RELOCATABLE "false") set(CPACK_PACKAGE_RELOCATABLE "false")
endif(CPACK_PACKAGE_RELOCATABLE) endif()
macro(cpack_check_file_exists file description) macro(cpack_check_file_exists file description)
if(NOT EXISTS "${file}") if(NOT EXISTS "${file}")
message(SEND_ERROR "CPack ${description} file: \"${file}\" could not be found.") message(SEND_ERROR "CPack ${description} file: \"${file}\" could not be found.")
endif(NOT EXISTS "${file}") endif()
endmacro(cpack_check_file_exists) endmacro()
cpack_check_file_exists("${CPACK_PACKAGE_DESCRIPTION_FILE}" "package description") cpack_check_file_exists("${CPACK_PACKAGE_DESCRIPTION_FILE}" "package description")
cpack_check_file_exists("${CPACK_RESOURCE_FILE_LICENSE}" "license resource") cpack_check_file_exists("${CPACK_RESOURCE_FILE_LICENSE}" "license resource")
@ -404,8 +404,8 @@ cpack_check_file_exists("${CPACK_RESOURCE_FILE_WELCOME}" "welcome resource")
macro(cpack_optional_append _list _cond _item) macro(cpack_optional_append _list _cond _item)
if(${_cond}) if(${_cond})
set(${_list} ${${_list}} ${_item}) set(${_list} ${${_list}} ${_item})
endif(${_cond}) endif()
endmacro(cpack_optional_append _list _cond _item) endmacro()
##variable ##variable
# CPACK_BINARY_<GENNAME> - CPack generated options for binary generators. The # CPACK_BINARY_<GENNAME> - CPack generated options for binary generators. The
@ -420,26 +420,26 @@ if(NOT CPACK_GENERATOR)
if(UNIX) if(UNIX)
if(CYGWIN) if(CYGWIN)
option(CPACK_BINARY_CYGWIN "Enable to build Cygwin binary packages" ON) option(CPACK_BINARY_CYGWIN "Enable to build Cygwin binary packages" ON)
else(CYGWIN) else()
if(APPLE) if(APPLE)
option(CPACK_BINARY_BUNDLE "Enable to build OSX bundles" OFF) option(CPACK_BINARY_BUNDLE "Enable to build OSX bundles" OFF)
option(CPACK_BINARY_DRAGNDROP "Enable to build OSX Drag And Drop package" OFF) option(CPACK_BINARY_DRAGNDROP "Enable to build OSX Drag And Drop package" OFF)
option(CPACK_BINARY_PACKAGEMAKER "Enable to build PackageMaker packages" ON) option(CPACK_BINARY_PACKAGEMAKER "Enable to build PackageMaker packages" ON)
option(CPACK_BINARY_OSXX11 "Enable to build OSX X11 packages" OFF) option(CPACK_BINARY_OSXX11 "Enable to build OSX X11 packages" OFF)
else(APPLE) else()
option(CPACK_BINARY_TZ "Enable to build TZ packages" ON) option(CPACK_BINARY_TZ "Enable to build TZ packages" ON)
endif(APPLE) endif()
option(CPACK_BINARY_STGZ "Enable to build STGZ packages" ON) option(CPACK_BINARY_STGZ "Enable to build STGZ packages" ON)
option(CPACK_BINARY_TGZ "Enable to build TGZ packages" ON) option(CPACK_BINARY_TGZ "Enable to build TGZ packages" ON)
option(CPACK_BINARY_TBZ2 "Enable to build TBZ2 packages" OFF) option(CPACK_BINARY_TBZ2 "Enable to build TBZ2 packages" OFF)
option(CPACK_BINARY_DEB "Enable to build Debian packages" OFF) option(CPACK_BINARY_DEB "Enable to build Debian packages" OFF)
option(CPACK_BINARY_RPM "Enable to build RPM packages" OFF) option(CPACK_BINARY_RPM "Enable to build RPM packages" OFF)
option(CPACK_BINARY_NSIS "Enable to build NSIS packages" OFF) option(CPACK_BINARY_NSIS "Enable to build NSIS packages" OFF)
endif(CYGWIN) endif()
else(UNIX) else()
option(CPACK_BINARY_NSIS "Enable to build NSIS packages" ON) option(CPACK_BINARY_NSIS "Enable to build NSIS packages" ON)
option(CPACK_BINARY_ZIP "Enable to build ZIP packages" OFF) option(CPACK_BINARY_ZIP "Enable to build ZIP packages" OFF)
endif(UNIX) endif()
cpack_optional_append(CPACK_GENERATOR CPACK_BINARY_BUNDLE Bundle) cpack_optional_append(CPACK_GENERATOR CPACK_BINARY_BUNDLE Bundle)
cpack_optional_append(CPACK_GENERATOR CPACK_BINARY_DRAGNDROP DragNDrop) cpack_optional_append(CPACK_GENERATOR CPACK_BINARY_DRAGNDROP DragNDrop)
@ -455,29 +455,29 @@ if(NOT CPACK_GENERATOR)
cpack_optional_append(CPACK_GENERATOR CPACK_BINARY_TZ TZ) cpack_optional_append(CPACK_GENERATOR CPACK_BINARY_TZ TZ)
cpack_optional_append(CPACK_GENERATOR CPACK_BINARY_ZIP ZIP) cpack_optional_append(CPACK_GENERATOR CPACK_BINARY_ZIP ZIP)
endif(NOT CPACK_GENERATOR) endif()
# Provide options to choose source generators # Provide options to choose source generators
if(NOT CPACK_SOURCE_GENERATOR) if(NOT CPACK_SOURCE_GENERATOR)
if(UNIX) if(UNIX)
if(CYGWIN) if(CYGWIN)
option(CPACK_SOURCE_CYGWIN "Enable to build Cygwin source packages" ON) option(CPACK_SOURCE_CYGWIN "Enable to build Cygwin source packages" ON)
else(CYGWIN) else()
option(CPACK_SOURCE_TBZ2 "Enable to build TBZ2 source packages" ON) option(CPACK_SOURCE_TBZ2 "Enable to build TBZ2 source packages" ON)
option(CPACK_SOURCE_TGZ "Enable to build TGZ source packages" ON) option(CPACK_SOURCE_TGZ "Enable to build TGZ source packages" ON)
option(CPACK_SOURCE_TZ "Enable to build TZ source packages" ON) option(CPACK_SOURCE_TZ "Enable to build TZ source packages" ON)
option(CPACK_SOURCE_ZIP "Enable to build ZIP source packages" OFF) option(CPACK_SOURCE_ZIP "Enable to build ZIP source packages" OFF)
endif(CYGWIN) endif()
else(UNIX) else()
option(CPACK_SOURCE_ZIP "Enable to build ZIP source packages" ON) option(CPACK_SOURCE_ZIP "Enable to build ZIP source packages" ON)
endif(UNIX) endif()
cpack_optional_append(CPACK_SOURCE_GENERATOR CPACK_SOURCE_CYGWIN CygwinSource) cpack_optional_append(CPACK_SOURCE_GENERATOR CPACK_SOURCE_CYGWIN CygwinSource)
cpack_optional_append(CPACK_SOURCE_GENERATOR CPACK_SOURCE_TGZ TGZ) cpack_optional_append(CPACK_SOURCE_GENERATOR CPACK_SOURCE_TGZ TGZ)
cpack_optional_append(CPACK_SOURCE_GENERATOR CPACK_SOURCE_TBZ2 TBZ2) cpack_optional_append(CPACK_SOURCE_GENERATOR CPACK_SOURCE_TBZ2 TBZ2)
cpack_optional_append(CPACK_SOURCE_GENERATOR CPACK_SOURCE_TZ TZ) cpack_optional_append(CPACK_SOURCE_GENERATOR CPACK_SOURCE_TZ TZ)
cpack_optional_append(CPACK_SOURCE_GENERATOR CPACK_SOURCE_ZIP ZIP) cpack_optional_append(CPACK_SOURCE_GENERATOR CPACK_SOURCE_ZIP ZIP)
endif(NOT CPACK_SOURCE_GENERATOR) endif()
# mark the above options as advanced # mark the above options as advanced
mark_as_advanced(CPACK_BINARY_CYGWIN CPACK_BINARY_PACKAGEMAKER CPACK_BINARY_OSXX11 mark_as_advanced(CPACK_BINARY_CYGWIN CPACK_BINARY_PACKAGEMAKER CPACK_BINARY_OSXX11
@ -526,12 +526,12 @@ if(DEFINED CPACK_COMPONENTS_ALL)
if(CPACK_MONOLITHIC_INSTALL) if(CPACK_MONOLITHIC_INSTALL)
message("CPack warning: both CPACK_COMPONENTS_ALL and CPACK_MONOLITHIC_INSTALL have been set.\nDefaulting to a monolithic installation.") message("CPack warning: both CPACK_COMPONENTS_ALL and CPACK_MONOLITHIC_INSTALL have been set.\nDefaulting to a monolithic installation.")
set(CPACK_COMPONENTS_ALL) set(CPACK_COMPONENTS_ALL)
else(CPACK_MONOLITHIC_INSTALL) else()
# The user has provided the set of components to be installed as # The user has provided the set of components to be installed as
# part of a component-based installation; trust her. # part of a component-based installation; trust her.
set(CPACK_COMPONENTS_ALL_SET_BY_USER TRUE) set(CPACK_COMPONENTS_ALL_SET_BY_USER TRUE)
endif(CPACK_MONOLITHIC_INSTALL) endif()
else(DEFINED CPACK_COMPONENTS_ALL) else()
# If the user has not specifically requested a monolithic installer # If the user has not specifically requested a monolithic installer
# but has specified components in various "install" commands, tell # but has specified components in various "install" commands, tell
# CPack about those components. # CPack about those components.
@ -543,10 +543,10 @@ else(DEFINED CPACK_COMPONENTS_ALL)
# (at least, it isn't a component-based installation, but may # (at least, it isn't a component-based installation, but may
# become one later if the user uses the cpack_add_* commands). # become one later if the user uses the cpack_add_* commands).
set(CPACK_COMPONENTS_ALL) set(CPACK_COMPONENTS_ALL)
endif(CPACK_COMPONENTS_LEN EQUAL 1) endif()
set(CPACK_COMPONENTS_LEN) set(CPACK_COMPONENTS_LEN)
endif(NOT CPACK_MONOLITHIC_INSTALL) endif()
endif(DEFINED CPACK_COMPONENTS_ALL) endif()
# CMake always generates a component named "Unspecified", which is # CMake always generates a component named "Unspecified", which is
# used to install everything that doesn't have an explicitly-provided # used to install everything that doesn't have an explicitly-provided

View File

@ -283,10 +283,10 @@ macro(cpack_parse_arguments prefix arg_names option_names)
set(${prefix}_DEFAULT_ARGS) set(${prefix}_DEFAULT_ARGS)
foreach(arg_name ${arg_names}) foreach(arg_name ${arg_names})
set(${prefix}_${arg_name}) set(${prefix}_${arg_name})
endforeach(arg_name) endforeach()
foreach(option ${option_names}) foreach(option ${option_names})
set(${prefix}_${option} FALSE) set(${prefix}_${option} FALSE)
endforeach(option) endforeach()
set(current_arg_name DEFAULT_ARGS) set(current_arg_name DEFAULT_ARGS)
set(current_arg_list) set(current_arg_list)
@ -297,18 +297,18 @@ macro(cpack_parse_arguments prefix arg_names option_names)
set(${prefix}_${current_arg_name} ${current_arg_list}) set(${prefix}_${current_arg_name} ${current_arg_list})
set(current_arg_name ${arg}) set(current_arg_name ${arg})
set(current_arg_list) set(current_arg_list)
else (is_arg_name GREATER -1) else ()
set(loption_names ${option_names}) set(loption_names ${option_names})
list(FIND loption_names "${arg}" is_option) list(FIND loption_names "${arg}" is_option)
if (is_option GREATER -1) if (is_option GREATER -1)
set(${prefix}_${arg} TRUE) set(${prefix}_${arg} TRUE)
else (is_option GREATER -1) else ()
set(current_arg_list ${current_arg_list} ${arg}) set(current_arg_list ${current_arg_list} ${arg})
endif (is_option GREATER -1) endif ()
endif (is_arg_name GREATER -1) endif ()
endforeach(arg) endforeach()
set(${prefix}_${current_arg_name} ${current_arg_list}) set(${prefix}_${current_arg_name} ${current_arg_list})
endmacro(cpack_parse_arguments) endmacro()
# Macro that appends a SET command for the given variable name (var) # Macro that appends a SET command for the given variable name (var)
# to the macro named strvar, but only if the variable named "var" # to the macro named strvar, but only if the variable named "var"
@ -319,10 +319,10 @@ macro(cpack_append_variable_set_command var strvar)
set(${strvar} "${${strvar}}set(${var}") set(${strvar} "${${strvar}}set(${var}")
foreach(APPENDVAL ${${var}}) foreach(APPENDVAL ${${var}})
set(${strvar} "${${strvar}} ${APPENDVAL}") set(${strvar} "${${strvar}} ${APPENDVAL}")
endforeach(APPENDVAL) endforeach()
set(${strvar} "${${strvar}})\n") set(${strvar} "${${strvar}})\n")
endif (DEFINED ${var}) endif ()
endmacro(cpack_append_variable_set_command) endmacro()
# Macro that appends a SET command for the given variable name (var) # Macro that appends a SET command for the given variable name (var)
# to the macro named strvar, but only if the variable named "var" # to the macro named strvar, but only if the variable named "var"
@ -333,9 +333,9 @@ macro(cpack_append_string_variable_set_command var strvar)
list(LENGTH ${var} CPACK_APP_VALUE_LEN) list(LENGTH ${var} CPACK_APP_VALUE_LEN)
if(${CPACK_APP_VALUE_LEN} EQUAL 1) if(${CPACK_APP_VALUE_LEN} EQUAL 1)
set(${strvar} "${${strvar}}set(${var} \"${${var}}\")\n") set(${strvar} "${${strvar}}set(${var} \"${${var}}\")\n")
endif(${CPACK_APP_VALUE_LEN} EQUAL 1) endif()
endif (DEFINED ${var}) endif ()
endmacro(cpack_append_string_variable_set_command) endmacro()
# Macro that appends a SET command for the given variable name (var) # Macro that appends a SET command for the given variable name (var)
# to the macro named strvar, but only if the variable named "var" # to the macro named strvar, but only if the variable named "var"
@ -346,9 +346,9 @@ macro(cpack_append_option_set_command var strvar)
list(LENGTH ${var} CPACK_APP_VALUE_LEN) list(LENGTH ${var} CPACK_APP_VALUE_LEN)
if(${CPACK_APP_VALUE_LEN} EQUAL 1) if(${CPACK_APP_VALUE_LEN} EQUAL 1)
set(${strvar} "${${strvar}}set(${var} TRUE)\n") set(${strvar} "${${strvar}}set(${var} TRUE)\n")
endif(${CPACK_APP_VALUE_LEN} EQUAL 1) endif()
endif (${var}) endif ()
endmacro(cpack_append_option_set_command) endmacro()
# Macro that adds a component to the CPack installer # Macro that adds a component to the CPack installer
macro(cpack_add_component compname) macro(cpack_add_component compname)
@ -375,10 +375,10 @@ macro(cpack_add_component compname)
set(CPACK_ADDCOMP_STR "${CPACK_ADDCOMP_STR}\nSET(CPACK_COMPONENTS_ALL") set(CPACK_ADDCOMP_STR "${CPACK_ADDCOMP_STR}\nSET(CPACK_COMPONENTS_ALL")
foreach(COMP ${CPACK_ADDCOMP_COMPONENTS}) foreach(COMP ${CPACK_ADDCOMP_COMPONENTS})
set(CPACK_ADDCOMP_STR "${CPACK_ADDCOMP_STR} ${COMP}") set(CPACK_ADDCOMP_STR "${CPACK_ADDCOMP_STR} ${COMP}")
endforeach(COMP) endforeach()
set(CPACK_ADDCOMP_STR "${CPACK_ADDCOMP_STR})\n") set(CPACK_ADDCOMP_STR "${CPACK_ADDCOMP_STR})\n")
endif(NOT CPACK_COMPONENTS_ALL_SET_BY_USER) endif()
endif(NOT CPACK_MONOLITHIC_INSTALL) endif()
cpack_append_string_variable_set_command( cpack_append_string_variable_set_command(
CPACK_COMPONENT_${CPACK_ADDCOMP_UNAME}_DISPLAY_NAME CPACK_COMPONENT_${CPACK_ADDCOMP_UNAME}_DISPLAY_NAME
@ -416,8 +416,8 @@ macro(cpack_add_component compname)
# will be encoded by cpack_encode_variables. # will be encoded by cpack_encode_variables.
if(CPack_CMake_INCLUDED) if(CPack_CMake_INCLUDED)
file(APPEND "${CPACK_OUTPUT_CONFIG_FILE}" "${CPACK_ADDCOMP_STR}") file(APPEND "${CPACK_OUTPUT_CONFIG_FILE}" "${CPACK_ADDCOMP_STR}")
endif(CPack_CMake_INCLUDED) endif()
endmacro(cpack_add_component) endmacro()
# Macro that adds a component group to the CPack installer # Macro that adds a component group to the CPack installer
macro(cpack_add_component_group grpname) macro(cpack_add_component_group grpname)
@ -447,8 +447,8 @@ macro(cpack_add_component_group grpname)
# will be encoded by cpack_encode_variables. # will be encoded by cpack_encode_variables.
if(CPack_CMake_INCLUDED) if(CPack_CMake_INCLUDED)
file(APPEND "${CPACK_OUTPUT_CONFIG_FILE}" "${CPACK_ADDGRP_STR}") file(APPEND "${CPACK_OUTPUT_CONFIG_FILE}" "${CPACK_ADDGRP_STR}")
endif(CPack_CMake_INCLUDED) endif()
endmacro(cpack_add_component_group) endmacro()
# Macro that adds an installation type to the CPack installer # Macro that adds an installation type to the CPack installer
macro(cpack_add_install_type insttype) macro(cpack_add_install_type insttype)
@ -472,8 +472,8 @@ macro(cpack_add_install_type insttype)
# will be encoded by cpack_encode_variables. # will be encoded by cpack_encode_variables.
if(CPack_CMake_INCLUDED) if(CPack_CMake_INCLUDED)
file(APPEND "${CPACK_OUTPUT_CONFIG_FILE}" "${CPACK_INSTTYPE_STR}") file(APPEND "${CPACK_OUTPUT_CONFIG_FILE}" "${CPACK_INSTTYPE_STR}")
endif(CPack_CMake_INCLUDED) endif()
endmacro(cpack_add_install_type) endmacro()
macro(cpack_configure_downloads site) macro(cpack_configure_downloads site)
cpack_parse_arguments(CPACK_DOWNLOAD cpack_parse_arguments(CPACK_DOWNLOAD
@ -497,7 +497,7 @@ macro(cpack_configure_downloads site)
CPACK_CONFIG_DL_STR) CPACK_CONFIG_DL_STR)
if (${CPACK_DOWNLOAD_ALL} AND NOT ${CPACK_DOWNLOAD_NO_ADD_REMOVE}) if (${CPACK_DOWNLOAD_ALL} AND NOT ${CPACK_DOWNLOAD_NO_ADD_REMOVE})
set(CPACK_DOWNLOAD_ADD_REMOVE ON) set(CPACK_DOWNLOAD_ADD_REMOVE ON)
endif (${CPACK_DOWNLOAD_ALL} AND NOT ${CPACK_DOWNLOAD_NO_ADD_REMOVE}) endif ()
set(CPACK_ADD_REMOVE ${CPACK_DOWNLOAD_ADD_REMOVE}) set(CPACK_ADD_REMOVE ${CPACK_DOWNLOAD_ADD_REMOVE})
cpack_append_option_set_command( cpack_append_option_set_command(
CPACK_ADD_REMOVE CPACK_ADD_REMOVE
@ -508,6 +508,6 @@ macro(cpack_configure_downloads site)
# will be encoded by cpack_encode_variables. # will be encoded by cpack_encode_variables.
if(CPack_CMake_INCLUDED) if(CPack_CMake_INCLUDED)
file(APPEND "${CPACK_OUTPUT_CONFIG_FILE}" "${CPACK_CONFIG_DL_STR}") file(APPEND "${CPACK_OUTPUT_CONFIG_FILE}" "${CPACK_CONFIG_DL_STR}")
endif(CPack_CMake_INCLUDED) endif()
endmacro(cpack_configure_downloads) endmacro()
endif(NOT CPackComponent_CMake_INCLUDED) endif()

View File

@ -187,22 +187,22 @@
if(CMAKE_BINARY_DIR) if(CMAKE_BINARY_DIR)
message(FATAL_ERROR "CPackDeb.cmake may only be used by CPack internally.") message(FATAL_ERROR "CPackDeb.cmake may only be used by CPack internally.")
endif(CMAKE_BINARY_DIR) endif()
if(NOT UNIX) if(NOT UNIX)
message(FATAL_ERROR "CPackDeb.cmake may only be used under UNIX.") message(FATAL_ERROR "CPackDeb.cmake may only be used under UNIX.")
endif(NOT UNIX) endif()
# CPACK_DEBIAN_PACKAGE_SHLIBDEPS # CPACK_DEBIAN_PACKAGE_SHLIBDEPS
# If specify OFF, only user depends are used # If specify OFF, only user depends are used
if(NOT DEFINED CPACK_DEBIAN_PACKAGE_SHLIBDEPS) if(NOT DEFINED CPACK_DEBIAN_PACKAGE_SHLIBDEPS)
set(CPACK_DEBIAN_PACKAGE_SHLIBDEPS OFF) set(CPACK_DEBIAN_PACKAGE_SHLIBDEPS OFF)
endif(NOT DEFINED CPACK_DEBIAN_PACKAGE_SHLIBDEPS) endif()
find_program(FAKEROOT_EXECUTABLE fakeroot) find_program(FAKEROOT_EXECUTABLE fakeroot)
if(FAKEROOT_EXECUTABLE) if(FAKEROOT_EXECUTABLE)
set(CPACK_DEBIAN_FAKEROOT_EXECUTABLE ${FAKEROOT_EXECUTABLE}) set(CPACK_DEBIAN_FAKEROOT_EXECUTABLE ${FAKEROOT_EXECUTABLE})
endif(FAKEROOT_EXECUTABLE) endif()
if(CPACK_DEBIAN_PACKAGE_SHLIBDEPS) if(CPACK_DEBIAN_PACKAGE_SHLIBDEPS)
# dpkg-shlibdeps is a Debian utility for generating dependency list # dpkg-shlibdeps is a Debian utility for generating dependency list
@ -220,7 +220,7 @@ if(CPACK_DEBIAN_PACKAGE_SHLIBDEPS)
set(SHLIBDEPS_EXECUTABLE_VERSION "${CMAKE_MATCH_1}") set(SHLIBDEPS_EXECUTABLE_VERSION "${CMAKE_MATCH_1}")
if(CPACK_DEBIAN_PACKAGE_DEBUG) if(CPACK_DEBIAN_PACKAGE_DEBUG)
message( "CPackDeb Debug: dpkg-shlibdeps version is <${SHLIBDEPS_EXECUTABLE_VERSION}>") message( "CPackDeb Debug: dpkg-shlibdeps version is <${SHLIBDEPS_EXECUTABLE_VERSION}>")
endif(CPACK_DEBIAN_PACKAGE_DEBUG) endif()
# Generating binary list - Get type of all install files # Generating binary list - Get type of all install files
execute_process(COMMAND find -type f execute_process(COMMAND find -type f
@ -260,17 +260,17 @@ if(CPACK_DEBIAN_PACKAGE_SHLIBDEPS)
if(CPACK_DEBIAN_PACKAGE_DEBUG) if(CPACK_DEBIAN_PACKAGE_DEBUG)
# dpkg-shlibdeps will throw some warnings if some input files are not binary # dpkg-shlibdeps will throw some warnings if some input files are not binary
message( "CPackDeb Debug: dpkg-shlibdeps warnings \n${SHLIBDEPS_ERROR}") message( "CPackDeb Debug: dpkg-shlibdeps warnings \n${SHLIBDEPS_ERROR}")
endif(CPACK_DEBIAN_PACKAGE_DEBUG) endif()
if (NOT SHLIBDEPS_RESULT EQUAL 0) if (NOT SHLIBDEPS_RESULT EQUAL 0)
message (FATAL_ERROR "CPackDeb: dpkg-shlibdeps: ${SHLIBDEPS_ERROR}") message (FATAL_ERROR "CPackDeb: dpkg-shlibdeps: ${SHLIBDEPS_ERROR}")
endif (NOT SHLIBDEPS_RESULT EQUAL 0) endif ()
#Get rid of prefix generated by dpkg-shlibdeps #Get rid of prefix generated by dpkg-shlibdeps
string (REGEX REPLACE "^.*Depends=" "" CPACK_DEBIAN_PACKAGE_AUTO_DEPENDS ${SHLIBDEPS_OUTPUT}) string (REGEX REPLACE "^.*Depends=" "" CPACK_DEBIAN_PACKAGE_AUTO_DEPENDS ${SHLIBDEPS_OUTPUT})
if(CPACK_DEBIAN_PACKAGE_DEBUG) if(CPACK_DEBIAN_PACKAGE_DEBUG)
message( "CPackDeb Debug: Found dependency: ${CPACK_DEBIAN_PACKAGE_AUTO_DEPENDS}") message( "CPackDeb Debug: Found dependency: ${CPACK_DEBIAN_PACKAGE_AUTO_DEPENDS}")
endif(CPACK_DEBIAN_PACKAGE_DEBUG) endif()
# Remove blank control file # Remove blank control file
# Might not be safe if package actual contain file or directory named debian # Might not be safe if package actual contain file or directory named debian
@ -279,21 +279,21 @@ if(CPACK_DEBIAN_PACKAGE_SHLIBDEPS)
# Append user depend if set # Append user depend if set
if (CPACK_DEBIAN_PACKAGE_DEPENDS) if (CPACK_DEBIAN_PACKAGE_DEPENDS)
set (CPACK_DEBIAN_PACKAGE_DEPENDS "${CPACK_DEBIAN_PACKAGE_AUTO_DEPENDS}, ${CPACK_DEBIAN_PACKAGE_DEPENDS}") set (CPACK_DEBIAN_PACKAGE_DEPENDS "${CPACK_DEBIAN_PACKAGE_AUTO_DEPENDS}, ${CPACK_DEBIAN_PACKAGE_DEPENDS}")
else (CPACK_DEBIAN_PACKAGE_DEPENDS) else ()
set (CPACK_DEBIAN_PACKAGE_DEPENDS "${CPACK_DEBIAN_PACKAGE_AUTO_DEPENDS}") set (CPACK_DEBIAN_PACKAGE_DEPENDS "${CPACK_DEBIAN_PACKAGE_AUTO_DEPENDS}")
endif (CPACK_DEBIAN_PACKAGE_DEPENDS) endif ()
else (SHLIBDEPS_EXECUTABLE) else ()
if(CPACK_DEBIAN_PACKAGE_DEBUG) if(CPACK_DEBIAN_PACKAGE_DEBUG)
message( "CPackDeb Debug: Using only user-provided depends because dpkg-shlibdeps is not found.") message( "CPackDeb Debug: Using only user-provided depends because dpkg-shlibdeps is not found.")
endif(CPACK_DEBIAN_PACKAGE_DEBUG) endif()
endif(SHLIBDEPS_EXECUTABLE) endif()
else (CPACK_DEBIAN_PACKAGE_SHLIBDEPS) else ()
if(CPACK_DEBIAN_PACKAGE_DEBUG) if(CPACK_DEBIAN_PACKAGE_DEBUG)
message( "CPackDeb Debug: Using only user-provided depends") message( "CPackDeb Debug: Using only user-provided depends")
endif(CPACK_DEBIAN_PACKAGE_DEBUG) endif()
endif(CPACK_DEBIAN_PACKAGE_SHLIBDEPS) endif()
# Let's define the control file found in debian package: # Let's define the control file found in debian package:
@ -305,15 +305,15 @@ endif(CPACK_DEBIAN_PACKAGE_SHLIBDEPS)
# Package: (mandatory) # Package: (mandatory)
if(NOT CPACK_DEBIAN_PACKAGE_NAME) if(NOT CPACK_DEBIAN_PACKAGE_NAME)
string(TOLOWER "${CPACK_PACKAGE_NAME}" CPACK_DEBIAN_PACKAGE_NAME) string(TOLOWER "${CPACK_PACKAGE_NAME}" CPACK_DEBIAN_PACKAGE_NAME)
endif(NOT CPACK_DEBIAN_PACKAGE_NAME) endif()
# Version: (mandatory) # Version: (mandatory)
if(NOT CPACK_DEBIAN_PACKAGE_VERSION) if(NOT CPACK_DEBIAN_PACKAGE_VERSION)
if(NOT CPACK_PACKAGE_VERSION) if(NOT CPACK_PACKAGE_VERSION)
message(FATAL_ERROR "CPackDeb: Debian package requires a package version") message(FATAL_ERROR "CPackDeb: Debian package requires a package version")
endif(NOT CPACK_PACKAGE_VERSION) endif()
set(CPACK_DEBIAN_PACKAGE_VERSION ${CPACK_PACKAGE_VERSION}) set(CPACK_DEBIAN_PACKAGE_VERSION ${CPACK_PACKAGE_VERSION})
endif(NOT CPACK_DEBIAN_PACKAGE_VERSION) endif()
# Architecture: (mandatory) # Architecture: (mandatory)
if(NOT CPACK_DEBIAN_PACKAGE_ARCHITECTURE) if(NOT CPACK_DEBIAN_PACKAGE_ARCHITECTURE)
@ -323,12 +323,12 @@ if(NOT CPACK_DEBIAN_PACKAGE_ARCHITECTURE)
if(NOT DPKG_CMD) if(NOT DPKG_CMD)
message(STATUS "CPackDeb: Can not find dpkg in your path, default to i386.") message(STATUS "CPackDeb: Can not find dpkg in your path, default to i386.")
set(CPACK_DEBIAN_PACKAGE_ARCHITECTURE i386) set(CPACK_DEBIAN_PACKAGE_ARCHITECTURE i386)
endif(NOT DPKG_CMD) endif()
execute_process(COMMAND "${DPKG_CMD}" --print-architecture execute_process(COMMAND "${DPKG_CMD}" --print-architecture
OUTPUT_VARIABLE CPACK_DEBIAN_PACKAGE_ARCHITECTURE OUTPUT_VARIABLE CPACK_DEBIAN_PACKAGE_ARCHITECTURE
OUTPUT_STRIP_TRAILING_WHITESPACE OUTPUT_STRIP_TRAILING_WHITESPACE
) )
endif(NOT CPACK_DEBIAN_PACKAGE_ARCHITECTURE) endif()
# have a look at get_property(result GLOBAL PROPERTY ENABLED_FEATURES), # have a look at get_property(result GLOBAL PROPERTY ENABLED_FEATURES),
# this returns the successful find_package() calls, maybe this can help # this returns the successful find_package() calls, maybe this can help
@ -337,33 +337,33 @@ endif(NOT CPACK_DEBIAN_PACKAGE_ARCHITECTURE)
# TODO: automate 'objdump -p | grep NEEDED' # TODO: automate 'objdump -p | grep NEEDED'
if(NOT CPACK_DEBIAN_PACKAGE_DEPENDS) if(NOT CPACK_DEBIAN_PACKAGE_DEPENDS)
message(STATUS "CPACK_DEBIAN_PACKAGE_DEPENDS not set, the package will have no dependencies.") message(STATUS "CPACK_DEBIAN_PACKAGE_DEPENDS not set, the package will have no dependencies.")
endif(NOT CPACK_DEBIAN_PACKAGE_DEPENDS) endif()
# Maintainer: (mandatory) # Maintainer: (mandatory)
if(NOT CPACK_DEBIAN_PACKAGE_MAINTAINER) if(NOT CPACK_DEBIAN_PACKAGE_MAINTAINER)
if(NOT CPACK_PACKAGE_CONTACT) if(NOT CPACK_PACKAGE_CONTACT)
message(FATAL_ERROR "CPackDeb: Debian package requires a maintainer for a package, set CPACK_PACKAGE_CONTACT or CPACK_DEBIAN_PACKAGE_MAINTAINER") message(FATAL_ERROR "CPackDeb: Debian package requires a maintainer for a package, set CPACK_PACKAGE_CONTACT or CPACK_DEBIAN_PACKAGE_MAINTAINER")
endif(NOT CPACK_PACKAGE_CONTACT) endif()
set(CPACK_DEBIAN_PACKAGE_MAINTAINER ${CPACK_PACKAGE_CONTACT}) set(CPACK_DEBIAN_PACKAGE_MAINTAINER ${CPACK_PACKAGE_CONTACT})
endif(NOT CPACK_DEBIAN_PACKAGE_MAINTAINER) endif()
# Description: (mandatory) # Description: (mandatory)
if(NOT CPACK_DEBIAN_PACKAGE_DESCRIPTION) if(NOT CPACK_DEBIAN_PACKAGE_DESCRIPTION)
if(NOT CPACK_PACKAGE_DESCRIPTION_SUMMARY) if(NOT CPACK_PACKAGE_DESCRIPTION_SUMMARY)
message(FATAL_ERROR "CPackDeb: Debian package requires a summary for a package, set CPACK_PACKAGE_DESCRIPTION_SUMMARY or CPACK_DEBIAN_PACKAGE_DESCRIPTION") message(FATAL_ERROR "CPackDeb: Debian package requires a summary for a package, set CPACK_PACKAGE_DESCRIPTION_SUMMARY or CPACK_DEBIAN_PACKAGE_DESCRIPTION")
endif(NOT CPACK_PACKAGE_DESCRIPTION_SUMMARY) endif()
set(CPACK_DEBIAN_PACKAGE_DESCRIPTION ${CPACK_PACKAGE_DESCRIPTION_SUMMARY}) set(CPACK_DEBIAN_PACKAGE_DESCRIPTION ${CPACK_PACKAGE_DESCRIPTION_SUMMARY})
endif(NOT CPACK_DEBIAN_PACKAGE_DESCRIPTION) endif()
# Section: (recommended) # Section: (recommended)
if(NOT CPACK_DEBIAN_PACKAGE_SECTION) if(NOT CPACK_DEBIAN_PACKAGE_SECTION)
set(CPACK_DEBIAN_PACKAGE_SECTION "devel") set(CPACK_DEBIAN_PACKAGE_SECTION "devel")
endif(NOT CPACK_DEBIAN_PACKAGE_SECTION) endif()
# Priority: (recommended) # Priority: (recommended)
if(NOT CPACK_DEBIAN_PACKAGE_PRIORITY) if(NOT CPACK_DEBIAN_PACKAGE_PRIORITY)
set(CPACK_DEBIAN_PACKAGE_PRIORITY "optional") set(CPACK_DEBIAN_PACKAGE_PRIORITY "optional")
endif(NOT CPACK_DEBIAN_PACKAGE_PRIORITY ) endif()
# Recommends: # Recommends:
# You should set: CPACK_DEBIAN_PACKAGE_RECOMMENDS # You should set: CPACK_DEBIAN_PACKAGE_RECOMMENDS
@ -388,11 +388,11 @@ if(CPACK_DEB_PACKAGE_COMPONENT)
set(CPACK_DEB_PACKAGE_COMPONENT_PART_PATH "/${CPACK_DEB_PACKAGE_COMPONENT}") set(CPACK_DEB_PACKAGE_COMPONENT_PART_PATH "/${CPACK_DEB_PACKAGE_COMPONENT}")
set(WDIR "${CPACK_TOPLEVEL_DIRECTORY}/${CPACK_PACKAGE_FILE_NAME}/${CPACK_DEB_PACKAGE_COMPONENT}") set(WDIR "${CPACK_TOPLEVEL_DIRECTORY}/${CPACK_PACKAGE_FILE_NAME}/${CPACK_DEB_PACKAGE_COMPONENT}")
string(TOLOWER "${CPACK_PACKAGE_NAME}${CPACK_DEB_PACKAGE_COMPONENT_PART_NAME}" CPACK_DEBIAN_PACKAGE_NAME) string(TOLOWER "${CPACK_PACKAGE_NAME}${CPACK_DEB_PACKAGE_COMPONENT_PART_NAME}" CPACK_DEBIAN_PACKAGE_NAME)
else(CPACK_DEB_PACKAGE_COMPONENT) else()
set(CPACK_DEB_PACKAGE_COMPONENT_PART_NAME "") set(CPACK_DEB_PACKAGE_COMPONENT_PART_NAME "")
set(CPACK_DEB_PACKAGE_COMPONENT_PART_PATH "") set(CPACK_DEB_PACKAGE_COMPONENT_PART_PATH "")
set(WDIR "${CPACK_TOPLEVEL_DIRECTORY}/${CPACK_PACKAGE_FILE_NAME}") set(WDIR "${CPACK_TOPLEVEL_DIRECTORY}/${CPACK_PACKAGE_FILE_NAME}")
endif(CPACK_DEB_PACKAGE_COMPONENT) endif()
# Print out some debug information if we were asked for that # Print out some debug information if we were asked for that
if(CPACK_DEBIAN_PACKAGE_DEBUG) if(CPACK_DEBIAN_PACKAGE_DEBUG)
@ -404,7 +404,7 @@ if(CPACK_DEBIAN_PACKAGE_DEBUG)
message("CPackDeb:Debug: CPACK_PACKAGE_FILE_NAME = ${CPACK_PACKAGE_FILE_NAME}") message("CPackDeb:Debug: CPACK_PACKAGE_FILE_NAME = ${CPACK_PACKAGE_FILE_NAME}")
message("CPackDeb:Debug: CPACK_PACKAGE_INSTALL_DIRECTORY = ${CPACK_PACKAGE_INSTALL_DIRECTORY}") message("CPackDeb:Debug: CPACK_PACKAGE_INSTALL_DIRECTORY = ${CPACK_PACKAGE_INSTALL_DIRECTORY}")
message("CPackDeb:Debug: CPACK_TEMPORARY_PACKAGE_FILE_NAME = ${CPACK_TEMPORARY_PACKAGE_FILE_NAME}") message("CPackDeb:Debug: CPACK_TEMPORARY_PACKAGE_FILE_NAME = ${CPACK_TEMPORARY_PACKAGE_FILE_NAME}")
endif(CPACK_DEBIAN_PACKAGE_DEBUG) endif()
# For debian source packages: # For debian source packages:
# debian/control # debian/control
@ -418,4 +418,4 @@ endif(CPACK_DEBIAN_PACKAGE_DEBUG)
# set(CPACK_DEBIAN_PACKAGE_BUILDS_DEPENDS # set(CPACK_DEBIAN_PACKAGE_BUILDS_DEPENDS
# "debhelper (>> 5.0.0), libncurses5-dev, tcl8.4" # "debhelper (>> 5.0.0), libncurses5-dev, tcl8.4"
# ) # )
#endif(NOT CPACK_DEBIAN_PACKAGE_BUILDS_DEPENDS) #endif()

View File

@ -241,11 +241,11 @@
if(CMAKE_BINARY_DIR) if(CMAKE_BINARY_DIR)
message(FATAL_ERROR "CPackRPM.cmake may only be used by CPack internally.") message(FATAL_ERROR "CPackRPM.cmake may only be used by CPack internally.")
endif(CMAKE_BINARY_DIR) endif()
if(NOT UNIX) if(NOT UNIX)
message(FATAL_ERROR "CPackRPM.cmake may only be used under UNIX.") message(FATAL_ERROR "CPackRPM.cmake may only be used under UNIX.")
endif(NOT UNIX) endif()
# rpmbuild is the basic command for building RPM package # rpmbuild is the basic command for building RPM package
# it may be a simple (symbolic) link to rpm command. # it may be a simple (symbolic) link to rpm command.
@ -264,12 +264,12 @@ if(RPMBUILD_EXECUTABLE)
${_TMP_VERSION}) ${_TMP_VERSION})
if(CPACK_RPM_PACKAGE_DEBUG) if(CPACK_RPM_PACKAGE_DEBUG)
message("CPackRPM:Debug: rpmbuild version is <${RPMBUILD_EXECUTABLE_VERSION}>") message("CPackRPM:Debug: rpmbuild version is <${RPMBUILD_EXECUTABLE_VERSION}>")
endif(CPACK_RPM_PACKAGE_DEBUG) endif()
endif(RPMBUILD_EXECUTABLE) endif()
if(NOT RPMBUILD_EXECUTABLE) if(NOT RPMBUILD_EXECUTABLE)
message(FATAL_ERROR "RPM package requires rpmbuild executable") message(FATAL_ERROR "RPM package requires rpmbuild executable")
endif(NOT RPMBUILD_EXECUTABLE) endif()
# Display lsb_release output if DEBUG mode enable # Display lsb_release output if DEBUG mode enable
# This will help to diagnose problem with CPackRPM # This will help to diagnose problem with CPackRPM
@ -284,11 +284,11 @@ if(CPACK_RPM_PACKAGE_DEBUG)
string(REGEX REPLACE "\n" ", " string(REGEX REPLACE "\n" ", "
LSB_RELEASE_OUTPUT LSB_RELEASE_OUTPUT
${_TMP_LSB_RELEASE_OUTPUT}) ${_TMP_LSB_RELEASE_OUTPUT})
else (LSB_RELEASE_EXECUTABLE) else ()
set(LSB_RELEASE_OUTPUT "lsb_release not installed/found!") set(LSB_RELEASE_OUTPUT "lsb_release not installed/found!")
endif(LSB_RELEASE_EXECUTABLE) endif()
message("CPackRPM:Debug: LSB_RELEASE = ${LSB_RELEASE_OUTPUT}") message("CPackRPM:Debug: LSB_RELEASE = ${LSB_RELEASE_OUTPUT}")
endif(CPACK_RPM_PACKAGE_DEBUG) endif()
# We may use RPM version in the future in order # We may use RPM version in the future in order
# to shut down warning about space in buildtree # to shut down warning about space in buildtree
@ -296,7 +296,7 @@ endif(CPACK_RPM_PACKAGE_DEBUG)
# not checked [yet]. # not checked [yet].
if(CPACK_TOPLEVEL_DIRECTORY MATCHES ".* .*") if(CPACK_TOPLEVEL_DIRECTORY MATCHES ".* .*")
message(FATAL_ERROR "${RPMBUILD_EXECUTABLE} can't handle paths with spaces, use a build directory without spaces for building RPMs.") message(FATAL_ERROR "${RPMBUILD_EXECUTABLE} can't handle paths with spaces, use a build directory without spaces for building RPMs.")
endif(CPACK_TOPLEVEL_DIRECTORY MATCHES ".* .*") endif()
# If rpmbuild is found # If rpmbuild is found
# we try to discover alien since we may be on non RPM distro like Debian. # we try to discover alien since we may be on non RPM distro like Debian.
@ -306,18 +306,18 @@ endif(CPACK_TOPLEVEL_DIRECTORY MATCHES ".* .*")
find_program(ALIEN_EXECUTABLE alien) find_program(ALIEN_EXECUTABLE alien)
if(ALIEN_EXECUTABLE) if(ALIEN_EXECUTABLE)
message(STATUS "alien found, we may be on a Debian based distro.") message(STATUS "alien found, we may be on a Debian based distro.")
endif(ALIEN_EXECUTABLE) endif()
# Are we packaging components ? # Are we packaging components ?
if(CPACK_RPM_PACKAGE_COMPONENT) if(CPACK_RPM_PACKAGE_COMPONENT)
set(CPACK_RPM_PACKAGE_COMPONENT_PART_NAME "-${CPACK_RPM_PACKAGE_COMPONENT}") set(CPACK_RPM_PACKAGE_COMPONENT_PART_NAME "-${CPACK_RPM_PACKAGE_COMPONENT}")
set(CPACK_RPM_PACKAGE_COMPONENT_PART_PATH "/${CPACK_RPM_PACKAGE_COMPONENT}") set(CPACK_RPM_PACKAGE_COMPONENT_PART_PATH "/${CPACK_RPM_PACKAGE_COMPONENT}")
set(WDIR "${CPACK_TOPLEVEL_DIRECTORY}/${CPACK_PACKAGE_FILE_NAME}/${CPACK_RPM_PACKAGE_COMPONENT}") set(WDIR "${CPACK_TOPLEVEL_DIRECTORY}/${CPACK_PACKAGE_FILE_NAME}/${CPACK_RPM_PACKAGE_COMPONENT}")
else(CPACK_RPM_PACKAGE_COMPONENT) else()
set(CPACK_RPM_PACKAGE_COMPONENT_PART_NAME "") set(CPACK_RPM_PACKAGE_COMPONENT_PART_NAME "")
set(CPACK_RPM_PACKAGE_COMPONENT_PART_PATH "") set(CPACK_RPM_PACKAGE_COMPONENT_PART_PATH "")
set(WDIR "${CPACK_TOPLEVEL_DIRECTORY}/${CPACK_PACKAGE_FILE_NAME}") set(WDIR "${CPACK_TOPLEVEL_DIRECTORY}/${CPACK_PACKAGE_FILE_NAME}")
endif(CPACK_RPM_PACKAGE_COMPONENT) endif()
# #
# Use user-defined RPM specific variables value # Use user-defined RPM specific variables value
@ -333,23 +333,23 @@ if(NOT CPACK_RPM_PACKAGE_SUMMARY)
# if neither var is defined lets use the name as summary # if neither var is defined lets use the name as summary
if(NOT CPACK_PACKAGE_DESCRIPTION_SUMMARY) if(NOT CPACK_PACKAGE_DESCRIPTION_SUMMARY)
string(TOLOWER "${CPACK_PACKAGE_NAME}" CPACK_RPM_PACKAGE_SUMMARY) string(TOLOWER "${CPACK_PACKAGE_NAME}" CPACK_RPM_PACKAGE_SUMMARY)
else(NOT CPACK_PACKAGE_DESCRIPTION_SUMMARY) else()
set(CPACK_RPM_PACKAGE_SUMMARY ${CPACK_PACKAGE_DESCRIPTION_SUMMARY}) set(CPACK_RPM_PACKAGE_SUMMARY ${CPACK_PACKAGE_DESCRIPTION_SUMMARY})
endif(NOT CPACK_PACKAGE_DESCRIPTION_SUMMARY) endif()
endif(NOT CPACK_RPM_PACKAGE_SUMMARY) endif()
# CPACK_RPM_PACKAGE_NAME (mandatory) # CPACK_RPM_PACKAGE_NAME (mandatory)
if(NOT CPACK_RPM_PACKAGE_NAME) if(NOT CPACK_RPM_PACKAGE_NAME)
string(TOLOWER "${CPACK_PACKAGE_NAME}" CPACK_RPM_PACKAGE_NAME) string(TOLOWER "${CPACK_PACKAGE_NAME}" CPACK_RPM_PACKAGE_NAME)
endif(NOT CPACK_RPM_PACKAGE_NAME) endif()
# CPACK_RPM_PACKAGE_VERSION (mandatory) # CPACK_RPM_PACKAGE_VERSION (mandatory)
if(NOT CPACK_RPM_PACKAGE_VERSION) if(NOT CPACK_RPM_PACKAGE_VERSION)
if(NOT CPACK_PACKAGE_VERSION) if(NOT CPACK_PACKAGE_VERSION)
message(FATAL_ERROR "RPM package requires a package version") message(FATAL_ERROR "RPM package requires a package version")
endif(NOT CPACK_PACKAGE_VERSION) endif()
set(CPACK_RPM_PACKAGE_VERSION ${CPACK_PACKAGE_VERSION}) set(CPACK_RPM_PACKAGE_VERSION ${CPACK_PACKAGE_VERSION})
endif(NOT CPACK_RPM_PACKAGE_VERSION) endif()
# Replace '-' in version with '_' # Replace '-' in version with '_'
# '-' character is an Illegal RPM version character # '-' character is an Illegal RPM version character
# it is illegal because it is used to separate # it is illegal because it is used to separate
@ -361,10 +361,10 @@ if(CPACK_RPM_PACKAGE_ARCHITECTURE)
set(TMP_RPM_BUILDARCH "Buildarch: ${CPACK_RPM_PACKAGE_ARCHITECTURE}") set(TMP_RPM_BUILDARCH "Buildarch: ${CPACK_RPM_PACKAGE_ARCHITECTURE}")
if(CPACK_RPM_PACKAGE_DEBUG) if(CPACK_RPM_PACKAGE_DEBUG)
message("CPackRPM:Debug: using user-specified build arch = ${CPACK_RPM_PACKAGE_ARCHITECTURE}") message("CPackRPM:Debug: using user-specified build arch = ${CPACK_RPM_PACKAGE_ARCHITECTURE}")
endif(CPACK_RPM_PACKAGE_DEBUG) endif()
else(CPACK_RPM_PACKAGE_ARCHITECTURE) else()
set(TMP_RPM_BUILDARCH "") set(TMP_RPM_BUILDARCH "")
endif(CPACK_RPM_PACKAGE_ARCHITECTURE) endif()
# CPACK_RPM_PACKAGE_RELEASE # CPACK_RPM_PACKAGE_RELEASE
# The RPM release is the numbering of the RPM package ITSELF # The RPM release is the numbering of the RPM package ITSELF
@ -376,26 +376,26 @@ endif(CPACK_RPM_PACKAGE_ARCHITECTURE)
# If not set, 1 is a good candidate # If not set, 1 is a good candidate
if(NOT CPACK_RPM_PACKAGE_RELEASE) if(NOT CPACK_RPM_PACKAGE_RELEASE)
set(CPACK_RPM_PACKAGE_RELEASE 1) set(CPACK_RPM_PACKAGE_RELEASE 1)
endif(NOT CPACK_RPM_PACKAGE_RELEASE) endif()
# CPACK_RPM_PACKAGE_LICENSE # CPACK_RPM_PACKAGE_LICENSE
if(NOT CPACK_RPM_PACKAGE_LICENSE) if(NOT CPACK_RPM_PACKAGE_LICENSE)
set(CPACK_RPM_PACKAGE_LICENSE "unknown") set(CPACK_RPM_PACKAGE_LICENSE "unknown")
endif(NOT CPACK_RPM_PACKAGE_LICENSE) endif()
# CPACK_RPM_PACKAGE_GROUP # CPACK_RPM_PACKAGE_GROUP
if(NOT CPACK_RPM_PACKAGE_GROUP) if(NOT CPACK_RPM_PACKAGE_GROUP)
set(CPACK_RPM_PACKAGE_GROUP "unknown") set(CPACK_RPM_PACKAGE_GROUP "unknown")
endif(NOT CPACK_RPM_PACKAGE_GROUP) endif()
# CPACK_RPM_PACKAGE_VENDOR # CPACK_RPM_PACKAGE_VENDOR
if(NOT CPACK_RPM_PACKAGE_VENDOR) if(NOT CPACK_RPM_PACKAGE_VENDOR)
if(CPACK_PACKAGE_VENDOR) if(CPACK_PACKAGE_VENDOR)
set(CPACK_RPM_PACKAGE_VENDOR "${CPACK_PACKAGE_VENDOR}") set(CPACK_RPM_PACKAGE_VENDOR "${CPACK_PACKAGE_VENDOR}")
else(CPACK_PACKAGE_VENDOR) else()
set(CPACK_RPM_PACKAGE_VENDOR "unknown") set(CPACK_RPM_PACKAGE_VENDOR "unknown")
endif(CPACK_PACKAGE_VENDOR) endif()
endif(NOT CPACK_RPM_PACKAGE_VENDOR) endif()
# CPACK_RPM_PACKAGE_SOURCE # CPACK_RPM_PACKAGE_SOURCE
# The name of the source tarball in case we generate a source RPM # The name of the source tarball in case we generate a source RPM
@ -410,70 +410,70 @@ endif(NOT CPACK_RPM_PACKAGE_VENDOR)
if (NOT CPACK_RPM_PACKAGE_DESCRIPTION) if (NOT CPACK_RPM_PACKAGE_DESCRIPTION)
if (CPACK_PACKAGE_DESCRIPTION_FILE) if (CPACK_PACKAGE_DESCRIPTION_FILE)
file(READ ${CPACK_PACKAGE_DESCRIPTION_FILE} CPACK_RPM_PACKAGE_DESCRIPTION) file(READ ${CPACK_PACKAGE_DESCRIPTION_FILE} CPACK_RPM_PACKAGE_DESCRIPTION)
else (CPACK_PACKAGE_DESCRIPTION_FILE) else ()
set(CPACK_RPM_PACKAGE_DESCRIPTION "no package description available") set(CPACK_RPM_PACKAGE_DESCRIPTION "no package description available")
endif (CPACK_PACKAGE_DESCRIPTION_FILE) endif ()
endif (NOT CPACK_RPM_PACKAGE_DESCRIPTION) endif ()
# CPACK_RPM_COMPRESSION_TYPE # CPACK_RPM_COMPRESSION_TYPE
# #
if (CPACK_RPM_COMPRESSION_TYPE) if (CPACK_RPM_COMPRESSION_TYPE)
if(CPACK_RPM_PACKAGE_DEBUG) if(CPACK_RPM_PACKAGE_DEBUG)
message("CPackRPM:Debug: User Specified RPM compression type: ${CPACK_RPM_COMPRESSION_TYPE}") message("CPackRPM:Debug: User Specified RPM compression type: ${CPACK_RPM_COMPRESSION_TYPE}")
endif(CPACK_RPM_PACKAGE_DEBUG) endif()
if(CPACK_RPM_COMPRESSION_TYPE STREQUAL "lzma") if(CPACK_RPM_COMPRESSION_TYPE STREQUAL "lzma")
set(CPACK_RPM_COMPRESSION_TYPE_TMP "%define _binary_payload w9.lzdio") set(CPACK_RPM_COMPRESSION_TYPE_TMP "%define _binary_payload w9.lzdio")
endif(CPACK_RPM_COMPRESSION_TYPE STREQUAL "lzma") endif()
if(CPACK_RPM_COMPRESSION_TYPE STREQUAL "xz") if(CPACK_RPM_COMPRESSION_TYPE STREQUAL "xz")
set(CPACK_RPM_COMPRESSION_TYPE_TMP "%define _binary_payload w7.xzdio") set(CPACK_RPM_COMPRESSION_TYPE_TMP "%define _binary_payload w7.xzdio")
endif(CPACK_RPM_COMPRESSION_TYPE STREQUAL "xz") endif()
if(CPACK_RPM_COMPRESSION_TYPE STREQUAL "bzip2") if(CPACK_RPM_COMPRESSION_TYPE STREQUAL "bzip2")
set(CPACK_RPM_COMPRESSION_TYPE_TMP "%define _binary_payload w9.bzdio") set(CPACK_RPM_COMPRESSION_TYPE_TMP "%define _binary_payload w9.bzdio")
endif(CPACK_RPM_COMPRESSION_TYPE STREQUAL "bzip2") endif()
if(CPACK_RPM_COMPRESSION_TYPE STREQUAL "gzip") if(CPACK_RPM_COMPRESSION_TYPE STREQUAL "gzip")
set(CPACK_RPM_COMPRESSION_TYPE_TMP "%define _binary_payload w9.gzdio") set(CPACK_RPM_COMPRESSION_TYPE_TMP "%define _binary_payload w9.gzdio")
endif(CPACK_RPM_COMPRESSION_TYPE STREQUAL "gzip") endif()
else(CPACK_RPM_COMPRESSION_TYPE) else()
set(CPACK_RPM_COMPRESSION_TYPE_TMP "") set(CPACK_RPM_COMPRESSION_TYPE_TMP "")
endif(CPACK_RPM_COMPRESSION_TYPE) endif()
if(CPACK_PACKAGE_RELOCATABLE) if(CPACK_PACKAGE_RELOCATABLE)
set(CPACK_RPM_PACKAGE_RELOCATABLE TRUE) set(CPACK_RPM_PACKAGE_RELOCATABLE TRUE)
endif(CPACK_PACKAGE_RELOCATABLE) endif()
if(CPACK_RPM_PACKAGE_RELOCATABLE) if(CPACK_RPM_PACKAGE_RELOCATABLE)
if(CPACK_RPM_PACKAGE_DEBUG) if(CPACK_RPM_PACKAGE_DEBUG)
message("CPackRPM:Debug: Trying to build a relocatable package") message("CPackRPM:Debug: Trying to build a relocatable package")
endif(CPACK_RPM_PACKAGE_DEBUG) endif()
if(CPACK_SET_DESTDIR AND (NOT CPACK_SET_DESTDIR STREQUAL "I_ON")) if(CPACK_SET_DESTDIR AND (NOT CPACK_SET_DESTDIR STREQUAL "I_ON"))
message("CPackRPM:Warning: CPACK_SET_DESTDIR is set (=${CPACK_SET_DESTDIR}) while requesting a relocatable package (CPACK_RPM_PACKAGE_RELOCATABLE is set): this is not supported, the package won't be relocatable.") message("CPackRPM:Warning: CPACK_SET_DESTDIR is set (=${CPACK_SET_DESTDIR}) while requesting a relocatable package (CPACK_RPM_PACKAGE_RELOCATABLE is set): this is not supported, the package won't be relocatable.")
else(CPACK_SET_DESTDIR AND (NOT CPACK_SET_DESTDIR STREQUAL "I_ON")) else()
set(CPACK_RPM_PACKAGE_PREFIX ${CPACK_PACKAGING_INSTALL_PREFIX}) set(CPACK_RPM_PACKAGE_PREFIX ${CPACK_PACKAGING_INSTALL_PREFIX})
endif(CPACK_SET_DESTDIR AND (NOT CPACK_SET_DESTDIR STREQUAL "I_ON")) endif()
endif(CPACK_RPM_PACKAGE_RELOCATABLE) endif()
# Check if additional fields for RPM spec header are given # Check if additional fields for RPM spec header are given
# There may be some COMPONENT specific variables as well # There may be some COMPONENT specific variables as well
foreach(_RPM_SPEC_HEADER URL REQUIRES SUGGESTS PROVIDES OBSOLETES PREFIX CONFLICTS AUTOPROV AUTOREQ AUTOREQPROV) foreach(_RPM_SPEC_HEADER URL REQUIRES SUGGESTS PROVIDES OBSOLETES PREFIX CONFLICTS AUTOPROV AUTOREQ AUTOREQPROV)
if(CPACK_RPM_PACKAGE_DEBUG) if(CPACK_RPM_PACKAGE_DEBUG)
message("CPackRPM:Debug: processing ${_RPM_SPEC_HEADER}") message("CPackRPM:Debug: processing ${_RPM_SPEC_HEADER}")
endif(CPACK_RPM_PACKAGE_DEBUG) endif()
if(CPACK_RPM_PACKAGE_COMPONENT) if(CPACK_RPM_PACKAGE_COMPONENT)
if(CPACK_RPM_${CPACK_RPM_PACKAGE_COMPONENT}_PACKAGE_${_RPM_SPEC_HEADER}) if(CPACK_RPM_${CPACK_RPM_PACKAGE_COMPONENT}_PACKAGE_${_RPM_SPEC_HEADER})
if(CPACK_RPM_PACKAGE_DEBUG) if(CPACK_RPM_PACKAGE_DEBUG)
message("CPackRPM:Debug: using CPACK_RPM_${CPACK_RPM_PACKAGE_COMPONENT}_PACKAGE_${_RPM_SPEC_HEADER}") message("CPackRPM:Debug: using CPACK_RPM_${CPACK_RPM_PACKAGE_COMPONENT}_PACKAGE_${_RPM_SPEC_HEADER}")
endif(CPACK_RPM_PACKAGE_DEBUG) endif()
set(CPACK_RPM_PACKAGE_${_RPM_SPEC_HEADER}_TMP ${CPACK_RPM_${CPACK_RPM_PACKAGE_COMPONENT}_PACKAGE_${_RPM_SPEC_HEADER}}) set(CPACK_RPM_PACKAGE_${_RPM_SPEC_HEADER}_TMP ${CPACK_RPM_${CPACK_RPM_PACKAGE_COMPONENT}_PACKAGE_${_RPM_SPEC_HEADER}})
else() else()
if(CPACK_RPM_PACKAGE_DEBUG) if(CPACK_RPM_PACKAGE_DEBUG)
message("CPackRPM:Debug: CPACK_RPM_${CPACK_RPM_PACKAGE_COMPONENT}_PACKAGE_${_RPM_SPEC_HEADER} not defined") message("CPackRPM:Debug: CPACK_RPM_${CPACK_RPM_PACKAGE_COMPONENT}_PACKAGE_${_RPM_SPEC_HEADER} not defined")
message("CPackRPM:Debug: using CPACK_RPM_PACKAGE_${_RPM_SPEC_HEADER}") message("CPackRPM:Debug: using CPACK_RPM_PACKAGE_${_RPM_SPEC_HEADER}")
endif(CPACK_RPM_PACKAGE_DEBUG) endif()
set(CPACK_RPM_PACKAGE_${_RPM_SPEC_HEADER}_TMP ${CPACK_RPM_PACKAGE_${_RPM_SPEC_HEADER}}) set(CPACK_RPM_PACKAGE_${_RPM_SPEC_HEADER}_TMP ${CPACK_RPM_PACKAGE_${_RPM_SPEC_HEADER}})
endif() endif()
else() else()
if(CPACK_RPM_PACKAGE_DEBUG) if(CPACK_RPM_PACKAGE_DEBUG)
message("CPackRPM:Debug: using CPACK_RPM_PACKAGE_${_RPM_SPEC_HEADER}") message("CPackRPM:Debug: using CPACK_RPM_PACKAGE_${_RPM_SPEC_HEADER}")
endif(CPACK_RPM_PACKAGE_DEBUG) endif()
set(CPACK_RPM_PACKAGE_${_RPM_SPEC_HEADER}_TMP ${CPACK_RPM_PACKAGE_${_RPM_SPEC_HEADER}}) set(CPACK_RPM_PACKAGE_${_RPM_SPEC_HEADER}_TMP ${CPACK_RPM_PACKAGE_${_RPM_SPEC_HEADER}})
endif() endif()
@ -486,13 +486,13 @@ foreach(_RPM_SPEC_HEADER URL REQUIRES SUGGESTS PROVIDES OBSOLETES PREFIX CONFLIC
set(_PACKAGE_HEADER_NAME "${_PACKAGE_HEADER_NAME}${_PACKAGE_HEADER_TAIL}") set(_PACKAGE_HEADER_NAME "${_PACKAGE_HEADER_NAME}${_PACKAGE_HEADER_TAIL}")
if(CPACK_RPM_PACKAGE_DEBUG) if(CPACK_RPM_PACKAGE_DEBUG)
message("CPackRPM:Debug: User defined ${_PACKAGE_HEADER_NAME}:\n ${CPACK_RPM_PACKAGE_${_RPM_SPEC_HEADER}_TMP}") message("CPackRPM:Debug: User defined ${_PACKAGE_HEADER_NAME}:\n ${CPACK_RPM_PACKAGE_${_RPM_SPEC_HEADER}_TMP}")
endif(CPACK_RPM_PACKAGE_DEBUG) endif()
set(TMP_RPM_${_RPM_SPEC_HEADER} "${_PACKAGE_HEADER_NAME}: ${CPACK_RPM_PACKAGE_${_RPM_SPEC_HEADER}_TMP}") set(TMP_RPM_${_RPM_SPEC_HEADER} "${_PACKAGE_HEADER_NAME}: ${CPACK_RPM_PACKAGE_${_RPM_SPEC_HEADER}_TMP}")
else(CPACK_RPM_PACKAGE_${_RPM_SPEC_HEADER}_TMP) else()
# Do not forget to unset previously set header (from previous component) # Do not forget to unset previously set header (from previous component)
unset(TMP_RPM_${_RPM_SPEC_HEADER}) unset(TMP_RPM_${_RPM_SPEC_HEADER})
endif(CPACK_RPM_PACKAGE_${_RPM_SPEC_HEADER}_TMP) endif()
endforeach(_RPM_SPEC_HEADER) endforeach()
# CPACK_RPM_SPEC_INSTALL_POST # CPACK_RPM_SPEC_INSTALL_POST
# May be used to define a RPM post intallation script # May be used to define a RPM post intallation script
@ -501,9 +501,9 @@ endforeach(_RPM_SPEC_HEADER)
if(CPACK_RPM_SPEC_INSTALL_POST) if(CPACK_RPM_SPEC_INSTALL_POST)
if(CPACK_RPM_PACKAGE_DEBUG) if(CPACK_RPM_PACKAGE_DEBUG)
message("CPackRPM:Debug: User defined CPACK_RPM_SPEC_INSTALL_POST = ${CPACK_RPM_SPEC_INSTALL_POST}") message("CPackRPM:Debug: User defined CPACK_RPM_SPEC_INSTALL_POST = ${CPACK_RPM_SPEC_INSTALL_POST}")
endif(CPACK_RPM_PACKAGE_DEBUG) endif()
set(TMP_RPM_SPEC_INSTALL_POST "%define __spec_install_post ${CPACK_RPM_SPEC_INSTALL_POST}") set(TMP_RPM_SPEC_INSTALL_POST "%define __spec_install_post ${CPACK_RPM_SPEC_INSTALL_POST}")
endif(CPACK_RPM_SPEC_INSTALL_POST) endif()
# CPACK_RPM_POST_INSTALL_SCRIPT_FILE (or CPACK_RPM_<COMPONENT>_POST_INSTALL_SCRIPT_FILE) # CPACK_RPM_POST_INSTALL_SCRIPT_FILE (or CPACK_RPM_<COMPONENT>_POST_INSTALL_SCRIPT_FILE)
# CPACK_RPM_POST_UNINSTALL_SCRIPT_FILE (or CPACK_RPM_<COMPONENT>_POST_UNINSTALL_SCRIPT_FILE) # CPACK_RPM_POST_UNINSTALL_SCRIPT_FILE (or CPACK_RPM_<COMPONENT>_POST_UNINSTALL_SCRIPT_FILE)
@ -518,39 +518,39 @@ if(CPACK_RPM_PACKAGE_COMPONENT)
endif() endif()
if(CPACK_RPM_${CPACK_RPM_PACKAGE_COMPONENT}_POST_UNINSTALL_SCRIPT_FILE) if(CPACK_RPM_${CPACK_RPM_PACKAGE_COMPONENT}_POST_UNINSTALL_SCRIPT_FILE)
set(CPACK_RPM_POST_UNINSTALL_READ_FILE ${CPACK_RPM_${CPACK_RPM_PACKAGE_COMPONENT}_POST_UNINSTALL_SCRIPT_FILE}) set(CPACK_RPM_POST_UNINSTALL_READ_FILE ${CPACK_RPM_${CPACK_RPM_PACKAGE_COMPONENT}_POST_UNINSTALL_SCRIPT_FILE})
else(CPACK_RPM_${CPACK_RPM_PACKAGE_COMPONENT}_POST_UNINSTALL_SCRIPT_FILE) else()
set(CPACK_RPM_POST_UNINSTALL_READ_FILE ${CPACK_RPM_POST_UNINSTALL_SCRIPT_FILE}) set(CPACK_RPM_POST_UNINSTALL_READ_FILE ${CPACK_RPM_POST_UNINSTALL_SCRIPT_FILE})
endif(CPACK_RPM_${CPACK_RPM_PACKAGE_COMPONENT}_POST_UNINSTALL_SCRIPT_FILE) endif()
else(CPACK_RPM_PACKAGE_COMPONENT) else()
set(CPACK_RPM_POST_INSTALL_READ_FILE ${CPACK_RPM_POST_INSTALL_SCRIPT_FILE}) set(CPACK_RPM_POST_INSTALL_READ_FILE ${CPACK_RPM_POST_INSTALL_SCRIPT_FILE})
set(CPACK_RPM_POST_UNINSTALL_READ_FILE ${CPACK_RPM_POST_UNINSTALL_SCRIPT_FILE}) set(CPACK_RPM_POST_UNINSTALL_READ_FILE ${CPACK_RPM_POST_UNINSTALL_SCRIPT_FILE})
endif(CPACK_RPM_PACKAGE_COMPONENT) endif()
# Handle post-install file if it has been specified # Handle post-install file if it has been specified
if(CPACK_RPM_POST_INSTALL_READ_FILE) if(CPACK_RPM_POST_INSTALL_READ_FILE)
if(EXISTS ${CPACK_RPM_POST_INSTALL_READ_FILE}) if(EXISTS ${CPACK_RPM_POST_INSTALL_READ_FILE})
file(READ ${CPACK_RPM_POST_INSTALL_READ_FILE} CPACK_RPM_SPEC_POSTINSTALL) file(READ ${CPACK_RPM_POST_INSTALL_READ_FILE} CPACK_RPM_SPEC_POSTINSTALL)
else(EXISTS ${CPACK_RPM_POST_INSTALL_READ_FILE}) else()
message("CPackRPM:Warning: CPACK_RPM_POST_INSTALL_SCRIPT_FILE <${CPACK_RPM_POST_INSTALL_READ_FILE}> does not exists - ignoring") message("CPackRPM:Warning: CPACK_RPM_POST_INSTALL_SCRIPT_FILE <${CPACK_RPM_POST_INSTALL_READ_FILE}> does not exists - ignoring")
endif(EXISTS ${CPACK_RPM_POST_INSTALL_READ_FILE}) endif()
else(CPACK_RPM_POST_INSTALL_READ_FILE) else()
# reset SPEC var value if no post install file has been specified # reset SPEC var value if no post install file has been specified
# (either globally or component-wise) # (either globally or component-wise)
set(CPACK_RPM_SPEC_POSTINSTALL "") set(CPACK_RPM_SPEC_POSTINSTALL "")
endif(CPACK_RPM_POST_INSTALL_READ_FILE) endif()
# Handle post-uninstall file if it has been specified # Handle post-uninstall file if it has been specified
if(CPACK_RPM_POST_UNINSTALL_READ_FILE) if(CPACK_RPM_POST_UNINSTALL_READ_FILE)
if(EXISTS ${CPACK_RPM_POST_UNINSTALL_READ_FILE}) if(EXISTS ${CPACK_RPM_POST_UNINSTALL_READ_FILE})
file(READ ${CPACK_RPM_POST_UNINSTALL_READ_FILE} CPACK_RPM_SPEC_POSTUNINSTALL) file(READ ${CPACK_RPM_POST_UNINSTALL_READ_FILE} CPACK_RPM_SPEC_POSTUNINSTALL)
else(EXISTS ${CPACK_RPM_POST_UNINSTALL_READ_FILE}) else()
message("CPackRPM:Warning: CPACK_RPM_POST_UNINSTALL_SCRIPT_FILE <${CPACK_RPM_POST_UNINSTALL_READ_FILE}> does not exists - ignoring") message("CPackRPM:Warning: CPACK_RPM_POST_UNINSTALL_SCRIPT_FILE <${CPACK_RPM_POST_UNINSTALL_READ_FILE}> does not exists - ignoring")
endif(EXISTS ${CPACK_RPM_POST_UNINSTALL_READ_FILE}) endif()
else(CPACK_RPM_POST_UNINSTALL_READ_FILE) else()
# reset SPEC var value if no post uninstall file has been specified # reset SPEC var value if no post uninstall file has been specified
# (either globally or component-wise) # (either globally or component-wise)
set(CPACK_RPM_SPEC_POSTUNINSTALL "") set(CPACK_RPM_SPEC_POSTUNINSTALL "")
endif(CPACK_RPM_POST_UNINSTALL_READ_FILE) endif()
# CPACK_RPM_PRE_INSTALL_SCRIPT_FILE (or CPACK_RPM_<COMPONENT>_PRE_INSTALL_SCRIPT_FILE) # CPACK_RPM_PRE_INSTALL_SCRIPT_FILE (or CPACK_RPM_<COMPONENT>_PRE_INSTALL_SCRIPT_FILE)
# CPACK_RPM_PRE_UNINSTALL_SCRIPT_FILE (or CPACK_RPM_<COMPONENT>_PRE_UNINSTALL_SCRIPT_FILE) # CPACK_RPM_PRE_UNINSTALL_SCRIPT_FILE (or CPACK_RPM_<COMPONENT>_PRE_UNINSTALL_SCRIPT_FILE)
@ -560,44 +560,44 @@ endif(CPACK_RPM_POST_UNINSTALL_READ_FILE)
if(CPACK_RPM_PACKAGE_COMPONENT) if(CPACK_RPM_PACKAGE_COMPONENT)
if(CPACK_RPM_${CPACK_RPM_PACKAGE_COMPONENT}_PRE_INSTALL_SCRIPT_FILE) if(CPACK_RPM_${CPACK_RPM_PACKAGE_COMPONENT}_PRE_INSTALL_SCRIPT_FILE)
set(CPACK_RPM_PRE_INSTALL_READ_FILE ${CPACK_RPM_${CPACK_RPM_PACKAGE_COMPONENT}_PRE_INSTALL_SCRIPT_FILE}) set(CPACK_RPM_PRE_INSTALL_READ_FILE ${CPACK_RPM_${CPACK_RPM_PACKAGE_COMPONENT}_PRE_INSTALL_SCRIPT_FILE})
else(CPACK_RPM_${CPACK_RPM_PACKAGE_COMPONENT}_PRE_INSTALL_SCRIPT_FILE) else()
set(CPACK_RPM_PRE_INSTALL_READ_FILE ${CPACK_RPM_PRE_INSTALL_SCRIPT_FILE}) set(CPACK_RPM_PRE_INSTALL_READ_FILE ${CPACK_RPM_PRE_INSTALL_SCRIPT_FILE})
endif(CPACK_RPM_${CPACK_RPM_PACKAGE_COMPONENT}_PRE_INSTALL_SCRIPT_FILE) endif()
if(CPACK_RPM_${CPACK_RPM_PACKAGE_COMPONENT}_PRE_UNINSTALL_SCRIPT_FILE) if(CPACK_RPM_${CPACK_RPM_PACKAGE_COMPONENT}_PRE_UNINSTALL_SCRIPT_FILE)
set(CPACK_RPM_PRE_UNINSTALL_READ_FILE ${CPACK_RPM_${CPACK_RPM_PACKAGE_COMPONENT}_PRE_UNINSTALL_SCRIPT_FILE}) set(CPACK_RPM_PRE_UNINSTALL_READ_FILE ${CPACK_RPM_${CPACK_RPM_PACKAGE_COMPONENT}_PRE_UNINSTALL_SCRIPT_FILE})
else(CPACK_RPM_${CPACK_RPM_PACKAGE_COMPONENT}_PRE_UNINSTALL_SCRIPT_FILE) else()
set(CPACK_RPM_PRE_UNINSTALL_READ_FILE ${CPACK_RPM_PRE_UNINSTALL_SCRIPT_FILE}) set(CPACK_RPM_PRE_UNINSTALL_READ_FILE ${CPACK_RPM_PRE_UNINSTALL_SCRIPT_FILE})
endif(CPACK_RPM_${CPACK_RPM_PACKAGE_COMPONENT}_PRE_UNINSTALL_SCRIPT_FILE) endif()
else(CPACK_RPM_PACKAGE_COMPONENT) else()
set(CPACK_RPM_PRE_INSTALL_READ_FILE ${CPACK_RPM_PRE_INSTALL_SCRIPT_FILE}) set(CPACK_RPM_PRE_INSTALL_READ_FILE ${CPACK_RPM_PRE_INSTALL_SCRIPT_FILE})
set(CPACK_RPM_PRE_UNINSTALL_READ_FILE ${CPACK_RPM_PRE_UNINSTALL_SCRIPT_FILE}) set(CPACK_RPM_PRE_UNINSTALL_READ_FILE ${CPACK_RPM_PRE_UNINSTALL_SCRIPT_FILE})
endif(CPACK_RPM_PACKAGE_COMPONENT) endif()
# Handle pre-install file if it has been specified # Handle pre-install file if it has been specified
if(CPACK_RPM_PRE_INSTALL_READ_FILE) if(CPACK_RPM_PRE_INSTALL_READ_FILE)
if(EXISTS ${CPACK_RPM_PRE_INSTALL_READ_FILE}) if(EXISTS ${CPACK_RPM_PRE_INSTALL_READ_FILE})
file(READ ${CPACK_RPM_PRE_INSTALL_READ_FILE} CPACK_RPM_SPEC_PREINSTALL) file(READ ${CPACK_RPM_PRE_INSTALL_READ_FILE} CPACK_RPM_SPEC_PREINSTALL)
else(EXISTS ${CPACK_RPM_PRE_INSTALL_READ_FILE}) else()
message("CPackRPM:Warning: CPACK_RPM_PRE_INSTALL_SCRIPT_FILE <${CPACK_RPM_PRE_INSTALL_READ_FILE}> does not exists - ignoring") message("CPackRPM:Warning: CPACK_RPM_PRE_INSTALL_SCRIPT_FILE <${CPACK_RPM_PRE_INSTALL_READ_FILE}> does not exists - ignoring")
endif(EXISTS ${CPACK_RPM_PRE_INSTALL_READ_FILE}) endif()
else(CPACK_RPM_PRE_INSTALL_READ_FILE) else()
# reset SPEC var value if no pre-install file has been specified # reset SPEC var value if no pre-install file has been specified
# (either globally or component-wise) # (either globally or component-wise)
set(CPACK_RPM_SPEC_PREINSTALL "") set(CPACK_RPM_SPEC_PREINSTALL "")
endif(CPACK_RPM_PRE_INSTALL_READ_FILE) endif()
# Handle pre-uninstall file if it has been specified # Handle pre-uninstall file if it has been specified
if(CPACK_RPM_PRE_UNINSTALL_READ_FILE) if(CPACK_RPM_PRE_UNINSTALL_READ_FILE)
if(EXISTS ${CPACK_RPM_PRE_UNINSTALL_READ_FILE}) if(EXISTS ${CPACK_RPM_PRE_UNINSTALL_READ_FILE})
file(READ ${CPACK_RPM_PRE_UNINSTALL_READ_FILE} CPACK_RPM_SPEC_PREUNINSTALL) file(READ ${CPACK_RPM_PRE_UNINSTALL_READ_FILE} CPACK_RPM_SPEC_PREUNINSTALL)
else(EXISTS ${CPACK_RPM_PRE_UNINSTALL_READ_FILE}) else()
message("CPackRPM:Warning: CPACK_RPM_PRE_UNINSTALL_SCRIPT_FILE <${CPACK_RPM_PRE_UNINSTALL_READ_FILE}> does not exists - ignoring") message("CPackRPM:Warning: CPACK_RPM_PRE_UNINSTALL_SCRIPT_FILE <${CPACK_RPM_PRE_UNINSTALL_READ_FILE}> does not exists - ignoring")
endif(EXISTS ${CPACK_RPM_PRE_UNINSTALL_READ_FILE}) endif()
else(CPACK_RPM_PRE_UNINSTALL_READ_FILE) else()
# reset SPEC var value if no pre-uninstall file has been specified # reset SPEC var value if no pre-uninstall file has been specified
# (either globally or component-wise) # (either globally or component-wise)
set(CPACK_RPM_SPEC_PREUNINSTALL "") set(CPACK_RPM_SPEC_PREUNINSTALL "")
endif(CPACK_RPM_PRE_UNINSTALL_READ_FILE) endif()
# CPACK_RPM_CHANGELOG_FILE # CPACK_RPM_CHANGELOG_FILE
# May be used to embed a changelog in the spec file. # May be used to embed a changelog in the spec file.
@ -605,20 +605,20 @@ endif(CPACK_RPM_PRE_UNINSTALL_READ_FILE)
if(CPACK_RPM_CHANGELOG_FILE) if(CPACK_RPM_CHANGELOG_FILE)
if(EXISTS ${CPACK_RPM_CHANGELOG_FILE}) if(EXISTS ${CPACK_RPM_CHANGELOG_FILE})
file(READ ${CPACK_RPM_CHANGELOG_FILE} CPACK_RPM_SPEC_CHANGELOG) file(READ ${CPACK_RPM_CHANGELOG_FILE} CPACK_RPM_SPEC_CHANGELOG)
else(EXISTS ${CPACK_RPM_CHANGELOG_FILE}) else()
message(SEND_ERROR "CPackRPM:Warning: CPACK_RPM_CHANGELOG_FILE <${CPACK_RPM_CHANGELOG_FILE}> does not exists - ignoring") message(SEND_ERROR "CPackRPM:Warning: CPACK_RPM_CHANGELOG_FILE <${CPACK_RPM_CHANGELOG_FILE}> does not exists - ignoring")
endif(EXISTS ${CPACK_RPM_CHANGELOG_FILE}) endif()
else(CPACK_RPM_CHANGELOG_FILE) else()
set(CPACK_RPM_SPEC_CHANGELOG "* Sun Jul 4 2010 Erk <eric.noulard@gmail.com>\n Generated by CPack RPM (no Changelog file were provided)") set(CPACK_RPM_SPEC_CHANGELOG "* Sun Jul 4 2010 Erk <eric.noulard@gmail.com>\n Generated by CPack RPM (no Changelog file were provided)")
endif(CPACK_RPM_CHANGELOG_FILE) endif()
# CPACK_RPM_SPEC_MORE_DEFINE # CPACK_RPM_SPEC_MORE_DEFINE
# This is a generated spec rpm file spaceholder # This is a generated spec rpm file spaceholder
if(CPACK_RPM_SPEC_MORE_DEFINE) if(CPACK_RPM_SPEC_MORE_DEFINE)
if(CPACK_RPM_PACKAGE_DEBUG) if(CPACK_RPM_PACKAGE_DEBUG)
message("CPackRPM:Debug: User defined more define spec line specified:\n ${CPACK_RPM_SPEC_MORE_DEFINE}") message("CPackRPM:Debug: User defined more define spec line specified:\n ${CPACK_RPM_SPEC_MORE_DEFINE}")
endif(CPACK_RPM_PACKAGE_DEBUG) endif()
endif(CPACK_RPM_SPEC_MORE_DEFINE) endif()
# Now we may create the RPM build tree structure # Now we may create the RPM build tree structure
set(CPACK_RPM_ROOTDIR "${CPACK_TOPLEVEL_DIRECTORY}") set(CPACK_RPM_ROOTDIR "${CPACK_TOPLEVEL_DIRECTORY}")
@ -683,7 +683,7 @@ if(CPACK_RPM_PACKAGE_COMPONENT)
if(CPACK_RPM_PACKAGE_DEBUG) if(CPACK_RPM_PACKAGE_DEBUG)
message("CPackRPM:Debug: Handling Absolute Destination Files: <${CPACK_ABSOLUTE_DESTINATION_FILES_INTERNAL}>") message("CPackRPM:Debug: Handling Absolute Destination Files: <${CPACK_ABSOLUTE_DESTINATION_FILES_INTERNAL}>")
message("CPackRPM:Debug: in component = ${CPACK_RPM_PACKAGE_COMPONENT}") message("CPackRPM:Debug: in component = ${CPACK_RPM_PACKAGE_COMPONENT}")
endif(CPACK_RPM_PACKAGE_DEBUG) endif()
endif() endif()
else() else()
if(CPACK_ABSOLUTE_DESTINATION_FILES) if(CPACK_ABSOLUTE_DESTINATION_FILES)
@ -698,7 +698,7 @@ if(CPACK_RPM_PACKAGE_COMPONENT)
if(CPACK_RPM_PACKAGE_DEBUG) if(CPACK_RPM_PACKAGE_DEBUG)
message("CPackRPM:Debug: Handling User Filelist: <${CPACK_RPM_USER_FILELIST_INTERNAL}>") message("CPackRPM:Debug: Handling User Filelist: <${CPACK_RPM_USER_FILELIST_INTERNAL}>")
message("CPackRPM:Debug: in component = ${CPACK_RPM_PACKAGE_COMPONENT}") message("CPackRPM:Debug: in component = ${CPACK_RPM_PACKAGE_COMPONENT}")
endif(CPACK_RPM_PACKAGE_DEBUG) endif()
else() else()
set(CPACK_RPM_USER_FILELIST_INTERNAL "") set(CPACK_RPM_USER_FILELIST_INTERNAL "")
endif() endif()
@ -717,7 +717,7 @@ endif()
if(CPACK_RPM_USER_FILELIST_INTERNAL) if(CPACK_RPM_USER_FILELIST_INTERNAL)
if(CPACK_RPM_PACKAGE_DEBUG) if(CPACK_RPM_PACKAGE_DEBUG)
message("CPackRPM:Debug: Handling User Filelist: <${CPACK_RPM_USER_FILELIST_INTERNAL}>") message("CPackRPM:Debug: Handling User Filelist: <${CPACK_RPM_USER_FILELIST_INTERNAL}>")
endif(CPACK_RPM_PACKAGE_DEBUG) endif()
# Create CMake list from CPACK_RPM_INSTALL_FILES # Create CMake list from CPACK_RPM_INSTALL_FILES
string(STRIP "${CPACK_RPM_INSTALL_FILES}" CPACK_RPM_INSTALL_FILES_LIST) string(STRIP "${CPACK_RPM_INSTALL_FILES}" CPACK_RPM_INSTALL_FILES_LIST)
@ -747,7 +747,7 @@ if(CPACK_RPM_USER_FILELIST_INTERNAL)
set(CPACK_RPM_INSTALL_FILES "") set(CPACK_RPM_INSTALL_FILES "")
foreach(F IN LISTS CPACK_RPM_INSTALL_FILES_LIST) foreach(F IN LISTS CPACK_RPM_INSTALL_FILES_LIST)
set(CPACK_RPM_INSTALL_FILES "${CPACK_RPM_INSTALL_FILES}\"${F}\"\n") set(CPACK_RPM_INSTALL_FILES "${CPACK_RPM_INSTALL_FILES}\"${F}\"\n")
endforeach(F) endforeach()
else() else()
set(CPACK_RPM_USER_INSTALL_FILES "") set(CPACK_RPM_USER_INSTALL_FILES "")
endif() endif()
@ -755,7 +755,7 @@ endif()
if (CPACK_ABSOLUTE_DESTINATION_FILES_INTERNAL) if (CPACK_ABSOLUTE_DESTINATION_FILES_INTERNAL)
if(CPACK_RPM_PACKAGE_DEBUG) if(CPACK_RPM_PACKAGE_DEBUG)
message("CPackRPM:Debug: Handling Absolute Destination Files: ${CPACK_ABSOLUTE_DESTINATION_FILES_INTERNAL}") message("CPackRPM:Debug: Handling Absolute Destination Files: ${CPACK_ABSOLUTE_DESTINATION_FILES_INTERNAL}")
endif(CPACK_RPM_PACKAGE_DEBUG) endif()
# Remove trailing space # Remove trailing space
string(STRIP "${CPACK_RPM_INSTALL_FILES}" CPACK_RPM_INSTALL_FILES_LIST) string(STRIP "${CPACK_RPM_INSTALL_FILES}" CPACK_RPM_INSTALL_FILES_LIST)
# Transform endline separated - string into CMake List # Transform endline separated - string into CMake List
@ -768,20 +768,20 @@ if (CPACK_ABSOLUTE_DESTINATION_FILES_INTERNAL)
set(CPACK_RPM_INSTALL_FILES "") set(CPACK_RPM_INSTALL_FILES "")
foreach(F IN LISTS CPACK_RPM_INSTALL_FILES_LIST) foreach(F IN LISTS CPACK_RPM_INSTALL_FILES_LIST)
set(CPACK_RPM_INSTALL_FILES "${CPACK_RPM_INSTALL_FILES}\"${F}\"\n") set(CPACK_RPM_INSTALL_FILES "${CPACK_RPM_INSTALL_FILES}\"${F}\"\n")
endforeach(F) endforeach()
# Build ABSOLUTE_INSTALL_FILES # Build ABSOLUTE_INSTALL_FILES
set(CPACK_RPM_ABSOLUTE_INSTALL_FILES "") set(CPACK_RPM_ABSOLUTE_INSTALL_FILES "")
foreach(F IN LISTS CPACK_ABSOLUTE_DESTINATION_FILES_INTERNAL) foreach(F IN LISTS CPACK_ABSOLUTE_DESTINATION_FILES_INTERNAL)
set(CPACK_RPM_ABSOLUTE_INSTALL_FILES "${CPACK_RPM_ABSOLUTE_INSTALL_FILES}%config \"${F}\"\n") set(CPACK_RPM_ABSOLUTE_INSTALL_FILES "${CPACK_RPM_ABSOLUTE_INSTALL_FILES}%config \"${F}\"\n")
endforeach(F) endforeach()
if(CPACK_RPM_PACKAGE_DEBUG) if(CPACK_RPM_PACKAGE_DEBUG)
message("CPackRPM:Debug: CPACK_RPM_ABSOLUTE_INSTALL_FILES=${CPACK_RPM_ABSOLUTE_INSTALL_FILES}") message("CPackRPM:Debug: CPACK_RPM_ABSOLUTE_INSTALL_FILES=${CPACK_RPM_ABSOLUTE_INSTALL_FILES}")
message("CPackRPM:Debug: CPACK_RPM_INSTALL_FILES=${CPACK_RPM_INSTALL_FILES}") message("CPackRPM:Debug: CPACK_RPM_INSTALL_FILES=${CPACK_RPM_INSTALL_FILES}")
endif(CPACK_RPM_PACKAGE_DEBUG) endif()
else() else()
# reset vars in order to avoid leakage of value(s) from one component to another # reset vars in order to avoid leakage of value(s) from one component to another
set(CPACK_RPM_ABSOLUTE_INSTALL_FILES "") set(CPACK_RPM_ABSOLUTE_INSTALL_FILES "")
endif(CPACK_ABSOLUTE_DESTINATION_FILES_INTERNAL) endif()
# Prepend directories in ${CPACK_RPM_INSTALL_FILES} with %dir # Prepend directories in ${CPACK_RPM_INSTALL_FILES} with %dir
# This is necessary to avoid duplicate files since rpmbuild do # This is necessary to avoid duplicate files since rpmbuild do
@ -799,7 +799,7 @@ foreach(F IN LISTS CPACK_RPM_INSTALL_FILES_LIST)
else() else()
set(CPACK_RPM_INSTALL_FILES "${CPACK_RPM_INSTALL_FILES}\"${F}\"\n") set(CPACK_RPM_INSTALL_FILES "${CPACK_RPM_INSTALL_FILES}\"${F}\"\n")
endif() endif()
endforeach(F) endforeach()
set(CPACK_RPM_INSTALL_FILES_LIST "") set(CPACK_RPM_INSTALL_FILES_LIST "")
# The name of the final spec file to be used by rpmbuild # The name of the final spec file to be used by rpmbuild
@ -816,7 +816,7 @@ if(CPACK_RPM_PACKAGE_DEBUG)
message("CPackRPM:Debug: CPACK_RPM_BINARY_SPECFILE = ${CPACK_RPM_BINARY_SPECFILE}") message("CPackRPM:Debug: CPACK_RPM_BINARY_SPECFILE = ${CPACK_RPM_BINARY_SPECFILE}")
message("CPackRPM:Debug: CPACK_PACKAGE_INSTALL_DIRECTORY = ${CPACK_PACKAGE_INSTALL_DIRECTORY}") message("CPackRPM:Debug: CPACK_PACKAGE_INSTALL_DIRECTORY = ${CPACK_PACKAGE_INSTALL_DIRECTORY}")
message("CPackRPM:Debug: CPACK_TEMPORARY_PACKAGE_FILE_NAME = ${CPACK_TEMPORARY_PACKAGE_FILE_NAME}") message("CPackRPM:Debug: CPACK_TEMPORARY_PACKAGE_FILE_NAME = ${CPACK_TEMPORARY_PACKAGE_FILE_NAME}")
endif(CPACK_RPM_PACKAGE_DEBUG) endif()
# USER generated spec file handling. # USER generated spec file handling.
# We should generate a spec file template: # We should generate a spec file template:
@ -900,8 +900,8 @@ ${CPACK_RPM_USER_INSTALL_FILES}
# to customize their own spec file. # to customize their own spec file.
if(CPACK_RPM_GENERATE_USER_BINARY_SPECFILE_TEMPLATE) if(CPACK_RPM_GENERATE_USER_BINARY_SPECFILE_TEMPLATE)
message(FATAL_ERROR "CPackRPM: STOP here Generated USER binary spec file templare is: ${CPACK_RPM_BINARY_SPECFILE}.in") message(FATAL_ERROR "CPackRPM: STOP here Generated USER binary spec file templare is: ${CPACK_RPM_BINARY_SPECFILE}.in")
endif(CPACK_RPM_GENERATE_USER_BINARY_SPECFILE_TEMPLATE) endif()
endif(CPACK_RPM_GENERATE_USER_BINARY_SPECFILE_TEMPLATE OR NOT CPACK_RPM_USER_BINARY_SPECFILE) endif()
# After that we may either use a user provided spec file # After that we may either use a user provided spec file
# or generate one using appropriate variables value. # or generate one using appropriate variables value.
@ -910,12 +910,12 @@ if(CPACK_RPM_USER_BINARY_SPECFILE)
message("CPackRPM: Will use USER specified spec file: ${CPACK_RPM_USER_BINARY_SPECFILE}") message("CPackRPM: Will use USER specified spec file: ${CPACK_RPM_USER_BINARY_SPECFILE}")
# The user provided file is processed for @var replacement # The user provided file is processed for @var replacement
configure_file(${CPACK_RPM_USER_BINARY_SPECFILE} ${CPACK_RPM_BINARY_SPECFILE} @ONLY) configure_file(${CPACK_RPM_USER_BINARY_SPECFILE} ${CPACK_RPM_BINARY_SPECFILE} @ONLY)
else(CPACK_RPM_USER_BINARY_SPECFILE) else()
# No User specified spec file, will use the generated spec file # No User specified spec file, will use the generated spec file
message("CPackRPM: Will use GENERATED spec file: ${CPACK_RPM_BINARY_SPECFILE}") message("CPackRPM: Will use GENERATED spec file: ${CPACK_RPM_BINARY_SPECFILE}")
# Note the just created file is processed for @var replacement # Note the just created file is processed for @var replacement
configure_file(${CPACK_RPM_BINARY_SPECFILE}.in ${CPACK_RPM_BINARY_SPECFILE} @ONLY) configure_file(${CPACK_RPM_BINARY_SPECFILE}.in ${CPACK_RPM_BINARY_SPECFILE} @ONLY)
endif(CPACK_RPM_USER_BINARY_SPECFILE) endif()
if(RPMBUILD_EXECUTABLE) if(RPMBUILD_EXECUTABLE)
# Now call rpmbuild using the SPECFILE # Now call rpmbuild using the SPECFILE
@ -936,9 +936,9 @@ if(RPMBUILD_EXECUTABLE)
message("CPackRPM:Debug: *** ${RPMBUILDERR} ***") message("CPackRPM:Debug: *** ${RPMBUILDERR} ***")
message("CPackRPM:Debug: - ${CPACK_TOPLEVEL_DIRECTORY}/rpmbuild${CPACK_RPM_PACKAGE_COMPONENT_PART_NAME}.out") message("CPackRPM:Debug: - ${CPACK_TOPLEVEL_DIRECTORY}/rpmbuild${CPACK_RPM_PACKAGE_COMPONENT_PART_NAME}.out")
message("CPackRPM:Debug: *** ${RPMBUILDERR} ***") message("CPackRPM:Debug: *** ${RPMBUILDERR} ***")
endif(CPACK_RPM_PACKAGE_DEBUG OR CPACK_RPMBUILD_EXEC_RESULT) endif()
else(RPMBUILD_EXECUTABLE) else()
if(ALIEN_EXECUTABLE) if(ALIEN_EXECUTABLE)
message(FATAL_ERROR "RPM packaging through alien not done (yet)") message(FATAL_ERROR "RPM packaging through alien not done (yet)")
endif(ALIEN_EXECUTABLE) endif()
endif(RPMBUILD_EXECUTABLE) endif()

View File

@ -14,21 +14,21 @@
if(CMAKE_BINARY_DIR) if(CMAKE_BINARY_DIR)
message(FATAL_ERROR "CPackZIP.cmake may only be used by CPack internally.") message(FATAL_ERROR "CPackZIP.cmake may only be used by CPack internally.")
endif(CMAKE_BINARY_DIR) endif()
find_program(ZIP_EXECUTABLE wzzip PATHS "$ENV{ProgramFiles}/WinZip") find_program(ZIP_EXECUTABLE wzzip PATHS "$ENV{ProgramFiles}/WinZip")
if(ZIP_EXECUTABLE) if(ZIP_EXECUTABLE)
set(CPACK_ZIP_COMMAND "\"${ZIP_EXECUTABLE}\" -P \"<ARCHIVE>\" @<FILELIST>") set(CPACK_ZIP_COMMAND "\"${ZIP_EXECUTABLE}\" -P \"<ARCHIVE>\" @<FILELIST>")
set(CPACK_ZIP_NEED_QUOTES TRUE) set(CPACK_ZIP_NEED_QUOTES TRUE)
endif(ZIP_EXECUTABLE) endif()
if(NOT ZIP_EXECUTABLE) if(NOT ZIP_EXECUTABLE)
find_program(ZIP_EXECUTABLE 7z PATHS "$ENV{ProgramFiles}/7-Zip") find_program(ZIP_EXECUTABLE 7z PATHS "$ENV{ProgramFiles}/7-Zip")
if(ZIP_EXECUTABLE) if(ZIP_EXECUTABLE)
set(CPACK_ZIP_COMMAND "\"${ZIP_EXECUTABLE}\" a -tzip \"<ARCHIVE>\" @<FILELIST>") set(CPACK_ZIP_COMMAND "\"${ZIP_EXECUTABLE}\" a -tzip \"<ARCHIVE>\" @<FILELIST>")
set(CPACK_ZIP_NEED_QUOTES TRUE) set(CPACK_ZIP_NEED_QUOTES TRUE)
endif(ZIP_EXECUTABLE) endif()
endif(NOT ZIP_EXECUTABLE) endif()
if(NOT ZIP_EXECUTABLE) if(NOT ZIP_EXECUTABLE)
find_package(Cygwin) find_package(Cygwin)
@ -36,6 +36,6 @@ if(NOT ZIP_EXECUTABLE)
if(ZIP_EXECUTABLE) if(ZIP_EXECUTABLE)
set(CPACK_ZIP_COMMAND "\"${ZIP_EXECUTABLE}\" -r \"<ARCHIVE>\" . -i@<FILELIST>") set(CPACK_ZIP_COMMAND "\"${ZIP_EXECUTABLE}\" -r \"<ARCHIVE>\" . -i@<FILELIST>")
set(CPACK_ZIP_NEED_QUOTES FALSE) set(CPACK_ZIP_NEED_QUOTES FALSE)
endif(ZIP_EXECUTABLE) endif()
endif(NOT ZIP_EXECUTABLE) endif()

View File

@ -67,31 +67,31 @@ function(GET_VS_VERSION_STRING generator var)
NUMBER "${generator}") NUMBER "${generator}")
if("${generator}" MATCHES "Visual Studio 7 .NET 2003") if("${generator}" MATCHES "Visual Studio 7 .NET 2003")
set(ver_string "vs71") set(ver_string "vs71")
else("${generator}" MATCHES "Visual Studio 7 .NET 2003") else()
set(ver_string "vs${NUMBER}") set(ver_string "vs${NUMBER}")
endif("${generator}" MATCHES "Visual Studio 7 .NET 2003") endif()
set(${var} ${ver_string} PARENT_SCOPE) set(${var} ${ver_string} PARENT_SCOPE)
endfunction(GET_VS_VERSION_STRING) endfunction()
if(BUILD_TESTING) if(BUILD_TESTING)
# Setup some auxilary macros # Setup some auxilary macros
macro(SET_IF_NOT_SET var val) macro(SET_IF_NOT_SET var val)
if(NOT DEFINED "${var}") if(NOT DEFINED "${var}")
set("${var}" "${val}") set("${var}" "${val}")
endif(NOT DEFINED "${var}") endif()
endmacro(SET_IF_NOT_SET) endmacro()
macro(SET_IF_SET var val) macro(SET_IF_SET var val)
if(NOT "${val}" MATCHES "^$") if(NOT "${val}" MATCHES "^$")
set("${var}" "${val}") set("${var}" "${val}")
endif(NOT "${val}" MATCHES "^$") endif()
endmacro(SET_IF_SET) endmacro()
macro(SET_IF_SET_AND_NOT_SET var val) macro(SET_IF_SET_AND_NOT_SET var val)
if(NOT "${val}" MATCHES "^$") if(NOT "${val}" MATCHES "^$")
SET_IF_NOT_SET("${var}" "${val}") SET_IF_NOT_SET("${var}" "${val}")
endif(NOT "${val}" MATCHES "^$") endif()
endmacro(SET_IF_SET_AND_NOT_SET) endmacro()
# Make sure testing is enabled # Make sure testing is enabled
enable_testing() enable_testing()
@ -107,18 +107,18 @@ if(BUILD_TESTING)
SET_IF_SET_AND_NOT_SET(DROP_LOCATION "${CTEST_DROP_LOCATION}") SET_IF_SET_AND_NOT_SET(DROP_LOCATION "${CTEST_DROP_LOCATION}")
SET_IF_SET_AND_NOT_SET(TRIGGER_SITE "${CTEST_TRIGGER_SITE}") SET_IF_SET_AND_NOT_SET(TRIGGER_SITE "${CTEST_TRIGGER_SITE}")
SET_IF_SET_AND_NOT_SET(UPDATE_TYPE "${CTEST_UPDATE_TYPE}") SET_IF_SET_AND_NOT_SET(UPDATE_TYPE "${CTEST_UPDATE_TYPE}")
endif(EXISTS "${PROJECT_SOURCE_DIR}/CTestConfig.cmake") endif()
# the project can have a DartConfig.cmake file # the project can have a DartConfig.cmake file
if(EXISTS "${PROJECT_SOURCE_DIR}/DartConfig.cmake") if(EXISTS "${PROJECT_SOURCE_DIR}/DartConfig.cmake")
include("${PROJECT_SOURCE_DIR}/DartConfig.cmake") include("${PROJECT_SOURCE_DIR}/DartConfig.cmake")
else(EXISTS "${PROJECT_SOURCE_DIR}/DartConfig.cmake") else()
# Dashboard is opened for submissions for a 24 hour period starting at # Dashboard is opened for submissions for a 24 hour period starting at
# the specified NIGHTLY_START_TIME. Time is specified in 24 hour format. # the specified NIGHTLY_START_TIME. Time is specified in 24 hour format.
SET_IF_NOT_SET (NIGHTLY_START_TIME "00:00:00 EDT") SET_IF_NOT_SET (NIGHTLY_START_TIME "00:00:00 EDT")
SET_IF_NOT_SET(DROP_METHOD "http") SET_IF_NOT_SET(DROP_METHOD "http")
SET_IF_NOT_SET (COMPRESS_SUBMISSION ON) SET_IF_NOT_SET (COMPRESS_SUBMISSION ON)
endif(EXISTS "${PROJECT_SOURCE_DIR}/DartConfig.cmake") endif()
SET_IF_NOT_SET (NIGHTLY_START_TIME "00:00:00 EDT") SET_IF_NOT_SET (NIGHTLY_START_TIME "00:00:00 EDT")
find_program(CVSCOMMAND cvs ) find_program(CVSCOMMAND cvs )
@ -141,7 +141,7 @@ if(BUILD_TESTING)
elseif(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/.git") elseif(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/.git")
set(UPDATE_TYPE git) set(UPDATE_TYPE git)
endif() endif()
endif(NOT UPDATE_TYPE) endif()
string(TOLOWER "${UPDATE_TYPE}" _update_type) string(TOLOWER "${UPDATE_TYPE}" _update_type)
if("${_update_type}" STREQUAL "cvs") if("${_update_type}" STREQUAL "cvs")
@ -199,36 +199,36 @@ if(BUILD_TESTING)
set(DART_COMPILER "${CMAKE_CXX_COMPILER}") set(DART_COMPILER "${CMAKE_CXX_COMPILER}")
if(NOT DART_COMPILER) if(NOT DART_COMPILER)
set(DART_COMPILER "${CMAKE_C_COMPILER}") set(DART_COMPILER "${CMAKE_C_COMPILER}")
endif(NOT DART_COMPILER) endif()
if(NOT DART_COMPILER) if(NOT DART_COMPILER)
set(DART_COMPILER "unknown") set(DART_COMPILER "unknown")
endif(NOT DART_COMPILER) endif()
if(WIN32) if(WIN32)
set(DART_NAME_COMPONENT "NAME_WE") set(DART_NAME_COMPONENT "NAME_WE")
else(WIN32) else()
set(DART_NAME_COMPONENT "NAME") set(DART_NAME_COMPONENT "NAME")
endif(WIN32) endif()
if(NOT BUILD_NAME_SYSTEM_NAME) if(NOT BUILD_NAME_SYSTEM_NAME)
set(BUILD_NAME_SYSTEM_NAME "${CMAKE_SYSTEM_NAME}") set(BUILD_NAME_SYSTEM_NAME "${CMAKE_SYSTEM_NAME}")
endif(NOT BUILD_NAME_SYSTEM_NAME) endif()
if(WIN32) if(WIN32)
set(BUILD_NAME_SYSTEM_NAME "Win32") set(BUILD_NAME_SYSTEM_NAME "Win32")
endif(WIN32) endif()
if(UNIX OR BORLAND) if(UNIX OR BORLAND)
get_filename_component(DART_CXX_NAME get_filename_component(DART_CXX_NAME
"${CMAKE_CXX_COMPILER}" ${DART_NAME_COMPONENT}) "${CMAKE_CXX_COMPILER}" ${DART_NAME_COMPONENT})
else(UNIX OR BORLAND) else()
get_filename_component(DART_CXX_NAME get_filename_component(DART_CXX_NAME
"${CMAKE_BUILD_TOOL}" ${DART_NAME_COMPONENT}) "${CMAKE_BUILD_TOOL}" ${DART_NAME_COMPONENT})
endif(UNIX OR BORLAND) endif()
if(DART_CXX_NAME MATCHES "msdev") if(DART_CXX_NAME MATCHES "msdev")
set(DART_CXX_NAME "vs60") set(DART_CXX_NAME "vs60")
endif(DART_CXX_NAME MATCHES "msdev") endif()
if(DART_CXX_NAME MATCHES "devenv") if(DART_CXX_NAME MATCHES "devenv")
GET_VS_VERSION_STRING("${CMAKE_GENERATOR}" DART_CXX_NAME) GET_VS_VERSION_STRING("${CMAKE_GENERATOR}" DART_CXX_NAME)
endif(DART_CXX_NAME MATCHES "devenv") endif()
set(BUILDNAME "${BUILD_NAME_SYSTEM_NAME}-${DART_CXX_NAME}") set(BUILDNAME "${BUILD_NAME_SYSTEM_NAME}-${DART_CXX_NAME}")
endif(NOT BUILDNAME) endif()
# the build command # the build command
build_command(MAKECOMMAND_DEFAULT_VALUE build_command(MAKECOMMAND_DEFAULT_VALUE
@ -241,11 +241,11 @@ if(BUILD_TESTING)
set(DEFAULT_CTEST_CONFIGURATION_TYPE "$ENV{CMAKE_CONFIG_TYPE}") set(DEFAULT_CTEST_CONFIGURATION_TYPE "$ENV{CMAKE_CONFIG_TYPE}")
if(DEFAULT_CTEST_CONFIGURATION_TYPE STREQUAL "") if(DEFAULT_CTEST_CONFIGURATION_TYPE STREQUAL "")
set(DEFAULT_CTEST_CONFIGURATION_TYPE "Release") set(DEFAULT_CTEST_CONFIGURATION_TYPE "Release")
endif(DEFAULT_CTEST_CONFIGURATION_TYPE STREQUAL "") endif()
if(NOT "${CMAKE_GENERATOR}" MATCHES "Make") if(NOT "${CMAKE_GENERATOR}" MATCHES "Make")
set(CTEST_USE_LAUNCHERS 0) set(CTEST_USE_LAUNCHERS 0)
endif(NOT "${CMAKE_GENERATOR}" MATCHES "Make") endif()
if(CTEST_USE_LAUNCHERS) if(CTEST_USE_LAUNCHERS)
set(CTEST_LAUNCH_COMPILE "\"${CMAKE_CTEST_COMMAND}\" --launch --target-name <TARGET_NAME> --build-dir <CMAKE_CURRENT_BINARY_DIR> --output <OBJECT> --source <SOURCE> --language <LANGUAGE> --") set(CTEST_LAUNCH_COMPILE "\"${CMAKE_CTEST_COMMAND}\" --launch --target-name <TARGET_NAME> --build-dir <CMAKE_CURRENT_BINARY_DIR> --output <OBJECT> --source <SOURCE> --language <LANGUAGE> --")
set(CTEST_LAUNCH_LINK "\"${CMAKE_CTEST_COMMAND}\" --launch --target-name <TARGET_NAME> --build-dir <CMAKE_CURRENT_BINARY_DIR> --output <TARGET> --target-type <TARGET_TYPE> --language <LANGUAGE> --") set(CTEST_LAUNCH_LINK "\"${CMAKE_CTEST_COMMAND}\" --launch --target-name <TARGET_NAME> --build-dir <CMAKE_CURRENT_BINARY_DIR> --output <TARGET> --target-type <TARGET_TYPE> --language <LANGUAGE> --")
@ -253,7 +253,7 @@ if(BUILD_TESTING)
set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE "${CTEST_LAUNCH_COMPILE}") set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE "${CTEST_LAUNCH_COMPILE}")
set_property(GLOBAL PROPERTY RULE_LAUNCH_LINK "${CTEST_LAUNCH_LINK}") set_property(GLOBAL PROPERTY RULE_LAUNCH_LINK "${CTEST_LAUNCH_LINK}")
set_property(GLOBAL PROPERTY RULE_LAUNCH_CUSTOM "${CTEST_LAUNCH_CUSTOM}") set_property(GLOBAL PROPERTY RULE_LAUNCH_CUSTOM "${CTEST_LAUNCH_CUSTOM}")
endif(CTEST_USE_LAUNCHERS) endif()
mark_as_advanced( mark_as_advanced(
BZRCOMMAND BZRCOMMAND
@ -282,5 +282,5 @@ if(BUILD_TESTING)
set(RUN_FROM_CTEST_OR_DART 1) set(RUN_FROM_CTEST_OR_DART 1)
include(CTestTargets) include(CTestTargets)
set(RUN_FROM_CTEST_OR_DART) set(RUN_FROM_CTEST_OR_DART)
endif(NOT RUN_FROM_DART) endif()
endif(BUILD_TESTING) endif()

View File

@ -14,7 +14,7 @@
if(NOT RUN_FROM_CTEST_OR_DART) if(NOT RUN_FROM_CTEST_OR_DART)
message(FATAL_ERROR "Do not incldue CTestTargets.cmake directly") message(FATAL_ERROR "Do not incldue CTestTargets.cmake directly")
endif(NOT RUN_FROM_CTEST_OR_DART) endif()
# make directories in the binary tree # make directories in the binary tree
file(MAKE_DIRECTORY ${PROJECT_BINARY_DIR}/Testing/Temporary) file(MAKE_DIRECTORY ${PROJECT_BINARY_DIR}/Testing/Temporary)
@ -30,11 +30,11 @@ if(CTEST_NEW_FORMAT)
configure_file( configure_file(
${CMAKE_ROOT}/Modules/DartConfiguration.tcl.in ${CMAKE_ROOT}/Modules/DartConfiguration.tcl.in
${PROJECT_BINARY_DIR}/CTestConfiguration.ini ) ${PROJECT_BINARY_DIR}/CTestConfiguration.ini )
else(CTEST_NEW_FORMAT) else()
configure_file( configure_file(
${CMAKE_ROOT}/Modules/DartConfiguration.tcl.in ${CMAKE_ROOT}/Modules/DartConfiguration.tcl.in
${PROJECT_BINARY_DIR}/DartConfiguration.tcl ) ${PROJECT_BINARY_DIR}/DartConfiguration.tcl )
endif(CTEST_NEW_FORMAT) endif()
# #
# Section 3: # Section 3:
@ -47,7 +47,7 @@ set(__conf_types "")
if(CMAKE_CONFIGURATION_TYPES) if(CMAKE_CONFIGURATION_TYPES)
# We need to pass the configuration type on the test command line. # We need to pass the configuration type on the test command line.
set(__conf_types -C "${CMAKE_CFG_INTDIR}") set(__conf_types -C "${CMAKE_CFG_INTDIR}")
endif(CMAKE_CONFIGURATION_TYPES) endif()
# Add convenience targets. Do this at most once in case of nested # Add convenience targets. Do this at most once in case of nested
# projects. # projects.
@ -66,7 +66,7 @@ if(NOT _CTEST_TARGETS_ADDED)
) )
set_property(TARGET ${mode} PROPERTY RULE_LAUNCH_CUSTOM "") set_property(TARGET ${mode} PROPERTY RULE_LAUNCH_CUSTOM "")
set_property(TARGET ${mode} PROPERTY FOLDER "CTestDashboardTargets") set_property(TARGET ${mode} PROPERTY FOLDER "CTestDashboardTargets")
endforeach(mode) endforeach()
# For Makefile generators add more granular targets. # For Makefile generators add more granular targets.
if("${CMAKE_GENERATOR}" MATCHES "(Ninja|Make)") if("${CMAKE_GENERATOR}" MATCHES "(Ninja|Make)")
@ -81,9 +81,9 @@ if(NOT _CTEST_TARGETS_ADDED)
) )
set_property(TARGET ${mode}${testtype} PROPERTY RULE_LAUNCH_CUSTOM "") set_property(TARGET ${mode}${testtype} PROPERTY RULE_LAUNCH_CUSTOM "")
set_property(TARGET ${mode}${testtype} PROPERTY FOLDER "CTestDashboardTargets") set_property(TARGET ${mode}${testtype} PROPERTY FOLDER "CTestDashboardTargets")
endforeach(testtype) endforeach()
endforeach(mode) endforeach()
endif("${CMAKE_GENERATOR}" MATCHES "(Ninja|Make)") endif()
# If requested, add an alias that is the equivalent of the built-in "test" # If requested, add an alias that is the equivalent of the built-in "test"
# or "RUN_TESTS" target: # or "RUN_TESTS" target:
@ -92,4 +92,4 @@ if(NOT _CTEST_TARGETS_ADDED)
${CMAKE_CTEST_COMMAND} ${__conf_types} ${CMAKE_CTEST_COMMAND} ${__conf_types}
) )
endif() endif()
endif(NOT _CTEST_TARGETS_ADDED) endif()

View File

@ -42,4 +42,4 @@ macro (CHECK_C_COMPILER_FLAG _FLAG _RESULT)
FAIL_REGEX "WARNING: unknown flag:" # Open64 FAIL_REGEX "WARNING: unknown flag:" # Open64
) )
set (CMAKE_REQUIRED_DEFINITIONS "${SAFE_CMAKE_REQUIRED_DEFINITIONS}") set (CMAKE_REQUIRED_DEFINITIONS "${SAFE_CMAKE_REQUIRED_DEFINITIONS}")
endmacro (CHECK_C_COMPILER_FLAG) endmacro ()

View File

@ -47,15 +47,15 @@ macro(CHECK_C_SOURCE_COMPILES SOURCE VAR)
CMAKE_EXPAND_IMPORTED_TARGETS(_ADJUSTED_CMAKE_REQUIRED_LIBRARIES LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} CONFIGURATION "${CMAKE_TRY_COMPILE_CONFIGURATION}") CMAKE_EXPAND_IMPORTED_TARGETS(_ADJUSTED_CMAKE_REQUIRED_LIBRARIES LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} CONFIGURATION "${CMAKE_TRY_COMPILE_CONFIGURATION}")
set(CHECK_C_SOURCE_COMPILES_ADD_LIBRARIES set(CHECK_C_SOURCE_COMPILES_ADD_LIBRARIES
"-DLINK_LIBRARIES:STRING=${_ADJUSTED_CMAKE_REQUIRED_LIBRARIES}") "-DLINK_LIBRARIES:STRING=${_ADJUSTED_CMAKE_REQUIRED_LIBRARIES}")
else(CMAKE_REQUIRED_LIBRARIES) else()
set(CHECK_C_SOURCE_COMPILES_ADD_LIBRARIES) set(CHECK_C_SOURCE_COMPILES_ADD_LIBRARIES)
endif(CMAKE_REQUIRED_LIBRARIES) endif()
if(CMAKE_REQUIRED_INCLUDES) if(CMAKE_REQUIRED_INCLUDES)
set(CHECK_C_SOURCE_COMPILES_ADD_INCLUDES set(CHECK_C_SOURCE_COMPILES_ADD_INCLUDES
"-DINCLUDE_DIRECTORIES:STRING=${CMAKE_REQUIRED_INCLUDES}") "-DINCLUDE_DIRECTORIES:STRING=${CMAKE_REQUIRED_INCLUDES}")
else(CMAKE_REQUIRED_INCLUDES) else()
set(CHECK_C_SOURCE_COMPILES_ADD_INCLUDES) set(CHECK_C_SOURCE_COMPILES_ADD_INCLUDES)
endif(CMAKE_REQUIRED_INCLUDES) endif()
file(WRITE "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/src.c" file(WRITE "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/src.c"
"${SOURCE}\n") "${SOURCE}\n")
@ -82,14 +82,14 @@ macro(CHECK_C_SOURCE_COMPILES SOURCE VAR)
"Performing C SOURCE FILE Test ${VAR} succeded with the following output:\n" "Performing C SOURCE FILE Test ${VAR} succeded with the following output:\n"
"${OUTPUT}\n" "${OUTPUT}\n"
"Source file was:\n${SOURCE}\n") "Source file was:\n${SOURCE}\n")
else(${VAR}) else()
message(STATUS "Performing Test ${VAR} - Failed") message(STATUS "Performing Test ${VAR} - Failed")
set(${VAR} "" CACHE INTERNAL "Test ${VAR}") set(${VAR} "" CACHE INTERNAL "Test ${VAR}")
file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
"Performing C SOURCE FILE Test ${VAR} failed with the following output:\n" "Performing C SOURCE FILE Test ${VAR} failed with the following output:\n"
"${OUTPUT}\n" "${OUTPUT}\n"
"Source file was:\n${SOURCE}\n") "Source file was:\n${SOURCE}\n")
endif(${VAR}) endif()
endif("${VAR}" MATCHES "^${VAR}$") endif()
endmacro(CHECK_C_SOURCE_COMPILES) endmacro()

View File

@ -36,15 +36,15 @@ macro(CHECK_C_SOURCE_RUNS SOURCE VAR)
CMAKE_EXPAND_IMPORTED_TARGETS(_ADJUSTED_CMAKE_REQUIRED_LIBRARIES LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} CONFIGURATION "${CMAKE_TRY_COMPILE_CONFIGURATION}") CMAKE_EXPAND_IMPORTED_TARGETS(_ADJUSTED_CMAKE_REQUIRED_LIBRARIES LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} CONFIGURATION "${CMAKE_TRY_COMPILE_CONFIGURATION}")
set(CHECK_C_SOURCE_COMPILES_ADD_LIBRARIES set(CHECK_C_SOURCE_COMPILES_ADD_LIBRARIES
"-DLINK_LIBRARIES:STRING=${_ADJUSTED_CMAKE_REQUIRED_LIBRARIES}") "-DLINK_LIBRARIES:STRING=${_ADJUSTED_CMAKE_REQUIRED_LIBRARIES}")
else(CMAKE_REQUIRED_LIBRARIES) else()
set(CHECK_C_SOURCE_COMPILES_ADD_LIBRARIES) set(CHECK_C_SOURCE_COMPILES_ADD_LIBRARIES)
endif(CMAKE_REQUIRED_LIBRARIES) endif()
if(CMAKE_REQUIRED_INCLUDES) if(CMAKE_REQUIRED_INCLUDES)
set(CHECK_C_SOURCE_COMPILES_ADD_INCLUDES set(CHECK_C_SOURCE_COMPILES_ADD_INCLUDES
"-DINCLUDE_DIRECTORIES:STRING=${CMAKE_REQUIRED_INCLUDES}") "-DINCLUDE_DIRECTORIES:STRING=${CMAKE_REQUIRED_INCLUDES}")
else(CMAKE_REQUIRED_INCLUDES) else()
set(CHECK_C_SOURCE_COMPILES_ADD_INCLUDES) set(CHECK_C_SOURCE_COMPILES_ADD_INCLUDES)
endif(CMAKE_REQUIRED_INCLUDES) endif()
file(WRITE "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/src.c" file(WRITE "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/src.c"
"${SOURCE}\n") "${SOURCE}\n")
@ -61,7 +61,7 @@ macro(CHECK_C_SOURCE_RUNS SOURCE VAR)
# if it did not compile make the return value fail code of 1 # if it did not compile make the return value fail code of 1
if(NOT ${VAR}_COMPILED) if(NOT ${VAR}_COMPILED)
set(${VAR}_EXITCODE 1) set(${VAR}_EXITCODE 1)
endif(NOT ${VAR}_COMPILED) endif()
# if the return value was 0 then it worked # if the return value was 0 then it worked
if("${${VAR}_EXITCODE}" EQUAL 0) if("${${VAR}_EXITCODE}" EQUAL 0)
set(${VAR} 1 CACHE INTERNAL "Test ${VAR}") set(${VAR} 1 CACHE INTERNAL "Test ${VAR}")
@ -71,12 +71,12 @@ macro(CHECK_C_SOURCE_RUNS SOURCE VAR)
"${OUTPUT}\n" "${OUTPUT}\n"
"Return value: ${${VAR}}\n" "Return value: ${${VAR}}\n"
"Source file was:\n${SOURCE}\n") "Source file was:\n${SOURCE}\n")
else("${${VAR}_EXITCODE}" EQUAL 0) else()
if(CMAKE_CROSSCOMPILING AND "${${VAR}_EXITCODE}" MATCHES "FAILED_TO_RUN") if(CMAKE_CROSSCOMPILING AND "${${VAR}_EXITCODE}" MATCHES "FAILED_TO_RUN")
set(${VAR} "${${VAR}_EXITCODE}") set(${VAR} "${${VAR}_EXITCODE}")
else(CMAKE_CROSSCOMPILING AND "${${VAR}_EXITCODE}" MATCHES "FAILED_TO_RUN") else()
set(${VAR} "" CACHE INTERNAL "Test ${VAR}") set(${VAR} "" CACHE INTERNAL "Test ${VAR}")
endif(CMAKE_CROSSCOMPILING AND "${${VAR}_EXITCODE}" MATCHES "FAILED_TO_RUN") endif()
message(STATUS "Performing Test ${VAR} - Failed") message(STATUS "Performing Test ${VAR} - Failed")
file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
@ -85,7 +85,7 @@ macro(CHECK_C_SOURCE_RUNS SOURCE VAR)
"Return value: ${${VAR}_EXITCODE}\n" "Return value: ${${VAR}_EXITCODE}\n"
"Source file was:\n${SOURCE}\n") "Source file was:\n${SOURCE}\n")
endif("${${VAR}_EXITCODE}" EQUAL 0) endif()
endif("${VAR}" MATCHES "^${VAR}$") endif()
endmacro(CHECK_C_SOURCE_RUNS) endmacro()

View File

@ -44,5 +44,5 @@ macro (CHECK_CXX_COMPILER_FLAG _FLAG _RESULT)
FAIL_REGEX "WARNING: unknown flag:" # Open64 FAIL_REGEX "WARNING: unknown flag:" # Open64
) )
set (CMAKE_REQUIRED_DEFINITIONS "${SAFE_CMAKE_REQUIRED_DEFINITIONS}") set (CMAKE_REQUIRED_DEFINITIONS "${SAFE_CMAKE_REQUIRED_DEFINITIONS}")
endmacro (CHECK_CXX_COMPILER_FLAG) endmacro ()

View File

@ -48,15 +48,15 @@ macro(CHECK_CXX_SOURCE_COMPILES SOURCE VAR)
CMAKE_EXPAND_IMPORTED_TARGETS(_ADJUSTED_CMAKE_REQUIRED_LIBRARIES LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} CONFIGURATION "${CMAKE_TRY_COMPILE_CONFIGURATION}") CMAKE_EXPAND_IMPORTED_TARGETS(_ADJUSTED_CMAKE_REQUIRED_LIBRARIES LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} CONFIGURATION "${CMAKE_TRY_COMPILE_CONFIGURATION}")
set(CHECK_CXX_SOURCE_COMPILES_ADD_LIBRARIES set(CHECK_CXX_SOURCE_COMPILES_ADD_LIBRARIES
"-DLINK_LIBRARIES:STRING=${_ADJUSTED_CMAKE_REQUIRED_LIBRARIES}") "-DLINK_LIBRARIES:STRING=${_ADJUSTED_CMAKE_REQUIRED_LIBRARIES}")
else(CMAKE_REQUIRED_LIBRARIES) else()
set(CHECK_CXX_SOURCE_COMPILES_ADD_LIBRARIES) set(CHECK_CXX_SOURCE_COMPILES_ADD_LIBRARIES)
endif(CMAKE_REQUIRED_LIBRARIES) endif()
if(CMAKE_REQUIRED_INCLUDES) if(CMAKE_REQUIRED_INCLUDES)
set(CHECK_CXX_SOURCE_COMPILES_ADD_INCLUDES set(CHECK_CXX_SOURCE_COMPILES_ADD_INCLUDES
"-DINCLUDE_DIRECTORIES:STRING=${CMAKE_REQUIRED_INCLUDES}") "-DINCLUDE_DIRECTORIES:STRING=${CMAKE_REQUIRED_INCLUDES}")
else(CMAKE_REQUIRED_INCLUDES) else()
set(CHECK_CXX_SOURCE_COMPILES_ADD_INCLUDES) set(CHECK_CXX_SOURCE_COMPILES_ADD_INCLUDES)
endif(CMAKE_REQUIRED_INCLUDES) endif()
file(WRITE "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/src.cxx" file(WRITE "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/src.cxx"
"${SOURCE}\n") "${SOURCE}\n")
@ -83,14 +83,14 @@ macro(CHECK_CXX_SOURCE_COMPILES SOURCE VAR)
"Performing C++ SOURCE FILE Test ${VAR} succeded with the following output:\n" "Performing C++ SOURCE FILE Test ${VAR} succeded with the following output:\n"
"${OUTPUT}\n" "${OUTPUT}\n"
"Source file was:\n${SOURCE}\n") "Source file was:\n${SOURCE}\n")
else(${VAR}) else()
message(STATUS "Performing Test ${VAR} - Failed") message(STATUS "Performing Test ${VAR} - Failed")
set(${VAR} "" CACHE INTERNAL "Test ${VAR}") set(${VAR} "" CACHE INTERNAL "Test ${VAR}")
file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
"Performing C++ SOURCE FILE Test ${VAR} failed with the following output:\n" "Performing C++ SOURCE FILE Test ${VAR} failed with the following output:\n"
"${OUTPUT}\n" "${OUTPUT}\n"
"Source file was:\n${SOURCE}\n") "Source file was:\n${SOURCE}\n")
endif(${VAR}) endif()
endif("${VAR}" MATCHES "^${VAR}$") endif()
endmacro(CHECK_CXX_SOURCE_COMPILES) endmacro()

View File

@ -36,15 +36,15 @@ macro(CHECK_CXX_SOURCE_RUNS SOURCE VAR)
CMAKE_EXPAND_IMPORTED_TARGETS(_ADJUSTED_CMAKE_REQUIRED_LIBRARIES LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} CONFIGURATION "${CMAKE_TRY_COMPILE_CONFIGURATION}") CMAKE_EXPAND_IMPORTED_TARGETS(_ADJUSTED_CMAKE_REQUIRED_LIBRARIES LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} CONFIGURATION "${CMAKE_TRY_COMPILE_CONFIGURATION}")
set(CHECK_CXX_SOURCE_COMPILES_ADD_LIBRARIES set(CHECK_CXX_SOURCE_COMPILES_ADD_LIBRARIES
"-DLINK_LIBRARIES:STRING=${_ADJUSTED_CMAKE_REQUIRED_LIBRARIES}") "-DLINK_LIBRARIES:STRING=${_ADJUSTED_CMAKE_REQUIRED_LIBRARIES}")
else(CMAKE_REQUIRED_LIBRARIES) else()
set(CHECK_CXX_SOURCE_COMPILES_ADD_LIBRARIES) set(CHECK_CXX_SOURCE_COMPILES_ADD_LIBRARIES)
endif(CMAKE_REQUIRED_LIBRARIES) endif()
if(CMAKE_REQUIRED_INCLUDES) if(CMAKE_REQUIRED_INCLUDES)
set(CHECK_CXX_SOURCE_COMPILES_ADD_INCLUDES set(CHECK_CXX_SOURCE_COMPILES_ADD_INCLUDES
"-DINCLUDE_DIRECTORIES:STRING=${CMAKE_REQUIRED_INCLUDES}") "-DINCLUDE_DIRECTORIES:STRING=${CMAKE_REQUIRED_INCLUDES}")
else(CMAKE_REQUIRED_INCLUDES) else()
set(CHECK_CXX_SOURCE_COMPILES_ADD_INCLUDES) set(CHECK_CXX_SOURCE_COMPILES_ADD_INCLUDES)
endif(CMAKE_REQUIRED_INCLUDES) endif()
file(WRITE "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/src.cxx" file(WRITE "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/src.cxx"
"${SOURCE}\n") "${SOURCE}\n")
@ -62,7 +62,7 @@ macro(CHECK_CXX_SOURCE_RUNS SOURCE VAR)
# if it did not compile make the return value fail code of 1 # if it did not compile make the return value fail code of 1
if(NOT ${VAR}_COMPILED) if(NOT ${VAR}_COMPILED)
set(${VAR}_EXITCODE 1) set(${VAR}_EXITCODE 1)
endif(NOT ${VAR}_COMPILED) endif()
# if the return value was 0 then it worked # if the return value was 0 then it worked
if("${${VAR}_EXITCODE}" EQUAL 0) if("${${VAR}_EXITCODE}" EQUAL 0)
set(${VAR} 1 CACHE INTERNAL "Test ${VAR}") set(${VAR} 1 CACHE INTERNAL "Test ${VAR}")
@ -72,12 +72,12 @@ macro(CHECK_CXX_SOURCE_RUNS SOURCE VAR)
"${OUTPUT}\n" "${OUTPUT}\n"
"Return value: ${${VAR}}\n" "Return value: ${${VAR}}\n"
"Source file was:\n${SOURCE}\n") "Source file was:\n${SOURCE}\n")
else("${${VAR}_EXITCODE}" EQUAL 0) else()
if(CMAKE_CROSSCOMPILING AND "${${VAR}_EXITCODE}" MATCHES "FAILED_TO_RUN") if(CMAKE_CROSSCOMPILING AND "${${VAR}_EXITCODE}" MATCHES "FAILED_TO_RUN")
set(${VAR} "${${VAR}_EXITCODE}") set(${VAR} "${${VAR}_EXITCODE}")
else(CMAKE_CROSSCOMPILING AND "${${VAR}_EXITCODE}" MATCHES "FAILED_TO_RUN") else()
set(${VAR} "" CACHE INTERNAL "Test ${VAR}") set(${VAR} "" CACHE INTERNAL "Test ${VAR}")
endif(CMAKE_CROSSCOMPILING AND "${${VAR}_EXITCODE}" MATCHES "FAILED_TO_RUN") endif()
message(STATUS "Performing Test ${VAR} - Failed") message(STATUS "Performing Test ${VAR} - Failed")
file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
@ -85,7 +85,7 @@ macro(CHECK_CXX_SOURCE_RUNS SOURCE VAR)
"${OUTPUT}\n" "${OUTPUT}\n"
"Return value: ${${VAR}_EXITCODE}\n" "Return value: ${${VAR}_EXITCODE}\n"
"Source file was:\n${SOURCE}\n") "Source file was:\n${SOURCE}\n")
endif("${${VAR}_EXITCODE}" EQUAL 0) endif()
endif("${VAR}" MATCHES "^${VAR}$") endif()
endmacro(CHECK_CXX_SOURCE_RUNS) endmacro()

View File

@ -39,4 +39,4 @@ include(CheckSymbolExists)
macro(CHECK_CXX_SYMBOL_EXISTS SYMBOL FILES VARIABLE) macro(CHECK_CXX_SYMBOL_EXISTS SYMBOL FILES VARIABLE)
_CHECK_SYMBOL_EXISTS("${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/CheckSymbolExists.cxx" "${SYMBOL}" "${FILES}" "${VARIABLE}" ) _CHECK_SYMBOL_EXISTS("${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/CheckSymbolExists.cxx" "${SYMBOL}" "${FILES}" "${VARIABLE}" )
endmacro(CHECK_CXX_SYMBOL_EXISTS) endmacro()

View File

@ -33,9 +33,9 @@ macro(CHECK_FORTRAN_FUNCTION_EXISTS FUNCTION VARIABLE)
cmake_expand_imported_targets(_ADJUSTED_CMAKE_REQUIRED_LIBRARIES LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} CONFIGURATION "${CMAKE_TRY_COMPILE_CONFIGURATION}") cmake_expand_imported_targets(_ADJUSTED_CMAKE_REQUIRED_LIBRARIES LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} CONFIGURATION "${CMAKE_TRY_COMPILE_CONFIGURATION}")
set(CHECK_FUNCTION_EXISTS_ADD_LIBRARIES set(CHECK_FUNCTION_EXISTS_ADD_LIBRARIES
"-DLINK_LIBRARIES:STRING=${_ADJUSTED_CMAKE_REQUIRED_LIBRARIES}") "-DLINK_LIBRARIES:STRING=${_ADJUSTED_CMAKE_REQUIRED_LIBRARIES}")
else(CMAKE_REQUIRED_LIBRARIES) else()
set(CHECK_FUNCTION_EXISTS_ADD_LIBRARIES) set(CHECK_FUNCTION_EXISTS_ADD_LIBRARIES)
endif(CMAKE_REQUIRED_LIBRARIES) endif()
file(WRITE file(WRITE
${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/testFortranCompiler.f ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/testFortranCompiler.f
" "
@ -58,12 +58,12 @@ macro(CHECK_FORTRAN_FUNCTION_EXISTS FUNCTION VARIABLE)
file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
"Determining if the Fortran ${FUNCTION} exists passed with the following output:\n" "Determining if the Fortran ${FUNCTION} exists passed with the following output:\n"
"${OUTPUT}\n\n") "${OUTPUT}\n\n")
else(${VARIABLE}) else()
message(STATUS "Looking for Fortran ${FUNCTION} - not found") message(STATUS "Looking for Fortran ${FUNCTION} - not found")
set(${VARIABLE} "" CACHE INTERNAL "Have Fortran function ${FUNCTION}") set(${VARIABLE} "" CACHE INTERNAL "Have Fortran function ${FUNCTION}")
file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
"Determining if the Fortran ${FUNCTION} exists failed with the following output:\n" "Determining if the Fortran ${FUNCTION} exists failed with the following output:\n"
"${OUTPUT}\n\n") "${OUTPUT}\n\n")
endif(${VARIABLE}) endif()
endif(NOT DEFINED ${VARIABLE}) endif()
endmacro(CHECK_FORTRAN_FUNCTION_EXISTS) endmacro()

View File

@ -40,15 +40,15 @@ macro(CHECK_FUNCTION_EXISTS FUNCTION VARIABLE)
CMAKE_EXPAND_IMPORTED_TARGETS(_ADJUSTED_CMAKE_REQUIRED_LIBRARIES LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} CONFIGURATION "${CMAKE_TRY_COMPILE_CONFIGURATION}") CMAKE_EXPAND_IMPORTED_TARGETS(_ADJUSTED_CMAKE_REQUIRED_LIBRARIES LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} CONFIGURATION "${CMAKE_TRY_COMPILE_CONFIGURATION}")
set(CHECK_FUNCTION_EXISTS_ADD_LIBRARIES set(CHECK_FUNCTION_EXISTS_ADD_LIBRARIES
"-DLINK_LIBRARIES:STRING=${_ADJUSTED_CMAKE_REQUIRED_LIBRARIES}") "-DLINK_LIBRARIES:STRING=${_ADJUSTED_CMAKE_REQUIRED_LIBRARIES}")
else(CMAKE_REQUIRED_LIBRARIES) else()
set(CHECK_FUNCTION_EXISTS_ADD_LIBRARIES) set(CHECK_FUNCTION_EXISTS_ADD_LIBRARIES)
endif(CMAKE_REQUIRED_LIBRARIES) endif()
if(CMAKE_REQUIRED_INCLUDES) if(CMAKE_REQUIRED_INCLUDES)
set(CHECK_FUNCTION_EXISTS_ADD_INCLUDES set(CHECK_FUNCTION_EXISTS_ADD_INCLUDES
"-DINCLUDE_DIRECTORIES:STRING=${CMAKE_REQUIRED_INCLUDES}") "-DINCLUDE_DIRECTORIES:STRING=${CMAKE_REQUIRED_INCLUDES}")
else(CMAKE_REQUIRED_INCLUDES) else()
set(CHECK_FUNCTION_EXISTS_ADD_INCLUDES) set(CHECK_FUNCTION_EXISTS_ADD_INCLUDES)
endif(CMAKE_REQUIRED_INCLUDES) endif()
try_compile(${VARIABLE} try_compile(${VARIABLE}
${CMAKE_BINARY_DIR} ${CMAKE_BINARY_DIR}
${CMAKE_ROOT}/Modules/CheckFunctionExists.c ${CMAKE_ROOT}/Modules/CheckFunctionExists.c
@ -63,12 +63,12 @@ macro(CHECK_FUNCTION_EXISTS FUNCTION VARIABLE)
file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
"Determining if the function ${FUNCTION} exists passed with the following output:\n" "Determining if the function ${FUNCTION} exists passed with the following output:\n"
"${OUTPUT}\n\n") "${OUTPUT}\n\n")
else(${VARIABLE}) else()
message(STATUS "Looking for ${FUNCTION} - not found") message(STATUS "Looking for ${FUNCTION} - not found")
set(${VARIABLE} "" CACHE INTERNAL "Have function ${FUNCTION}") set(${VARIABLE} "" CACHE INTERNAL "Have function ${FUNCTION}")
file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
"Determining if the function ${FUNCTION} exists failed with the following output:\n" "Determining if the function ${FUNCTION} exists failed with the following output:\n"
"${OUTPUT}\n\n") "${OUTPUT}\n\n")
endif(${VARIABLE}) endif()
endif("${VARIABLE}" MATCHES "^${VARIABLE}$") endif()
endmacro(CHECK_FUNCTION_EXISTS) endmacro()

View File

@ -32,9 +32,9 @@ macro(CHECK_INCLUDE_FILE INCLUDE VARIABLE)
if("${VARIABLE}" MATCHES "^${VARIABLE}$") if("${VARIABLE}" MATCHES "^${VARIABLE}$")
if(CMAKE_REQUIRED_INCLUDES) if(CMAKE_REQUIRED_INCLUDES)
set(CHECK_INCLUDE_FILE_C_INCLUDE_DIRS "-DINCLUDE_DIRECTORIES=${CMAKE_REQUIRED_INCLUDES}") set(CHECK_INCLUDE_FILE_C_INCLUDE_DIRS "-DINCLUDE_DIRECTORIES=${CMAKE_REQUIRED_INCLUDES}")
else(CMAKE_REQUIRED_INCLUDES) else()
set(CHECK_INCLUDE_FILE_C_INCLUDE_DIRS) set(CHECK_INCLUDE_FILE_C_INCLUDE_DIRS)
endif(CMAKE_REQUIRED_INCLUDES) endif()
set(MACRO_CHECK_INCLUDE_FILE_FLAGS ${CMAKE_REQUIRED_FLAGS}) set(MACRO_CHECK_INCLUDE_FILE_FLAGS ${CMAKE_REQUIRED_FLAGS})
set(CHECK_INCLUDE_FILE_VAR ${INCLUDE}) set(CHECK_INCLUDE_FILE_VAR ${INCLUDE})
configure_file(${CMAKE_ROOT}/Modules/CheckIncludeFile.c.in configure_file(${CMAKE_ROOT}/Modules/CheckIncludeFile.c.in
@ -43,7 +43,7 @@ macro(CHECK_INCLUDE_FILE INCLUDE VARIABLE)
if(${ARGC} EQUAL 3) if(${ARGC} EQUAL 3)
set(CMAKE_C_FLAGS_SAVE ${CMAKE_C_FLAGS}) set(CMAKE_C_FLAGS_SAVE ${CMAKE_C_FLAGS})
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${ARGV2}") set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${ARGV2}")
endif(${ARGC} EQUAL 3) endif()
try_compile(${VARIABLE} try_compile(${VARIABLE}
${CMAKE_BINARY_DIR} ${CMAKE_BINARY_DIR}
@ -56,7 +56,7 @@ macro(CHECK_INCLUDE_FILE INCLUDE VARIABLE)
if(${ARGC} EQUAL 3) if(${ARGC} EQUAL 3)
set(CMAKE_C_FLAGS ${CMAKE_C_FLAGS_SAVE}) set(CMAKE_C_FLAGS ${CMAKE_C_FLAGS_SAVE})
endif(${ARGC} EQUAL 3) endif()
if(${VARIABLE}) if(${VARIABLE})
message(STATUS "Looking for ${INCLUDE} - found") message(STATUS "Looking for ${INCLUDE} - found")
@ -65,13 +65,13 @@ macro(CHECK_INCLUDE_FILE INCLUDE VARIABLE)
"Determining if the include file ${INCLUDE} " "Determining if the include file ${INCLUDE} "
"exists passed with the following output:\n" "exists passed with the following output:\n"
"${OUTPUT}\n\n") "${OUTPUT}\n\n")
else(${VARIABLE}) else()
message(STATUS "Looking for ${INCLUDE} - not found") message(STATUS "Looking for ${INCLUDE} - not found")
set(${VARIABLE} "" CACHE INTERNAL "Have include ${INCLUDE}") set(${VARIABLE} "" CACHE INTERNAL "Have include ${INCLUDE}")
file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
"Determining if the include file ${INCLUDE} " "Determining if the include file ${INCLUDE} "
"exists failed with the following output:\n" "exists failed with the following output:\n"
"${OUTPUT}\n\n") "${OUTPUT}\n\n")
endif(${VARIABLE}) endif()
endif("${VARIABLE}" MATCHES "^${VARIABLE}$") endif()
endmacro(CHECK_INCLUDE_FILE) endmacro()

View File

@ -32,9 +32,9 @@ macro(CHECK_INCLUDE_FILE_CXX INCLUDE VARIABLE)
if("${VARIABLE}" MATCHES "^${VARIABLE}$") if("${VARIABLE}" MATCHES "^${VARIABLE}$")
if(CMAKE_REQUIRED_INCLUDES) if(CMAKE_REQUIRED_INCLUDES)
set(CHECK_INCLUDE_FILE_CXX_INCLUDE_DIRS "-DINCLUDE_DIRECTORIES=${CMAKE_REQUIRED_INCLUDES}") set(CHECK_INCLUDE_FILE_CXX_INCLUDE_DIRS "-DINCLUDE_DIRECTORIES=${CMAKE_REQUIRED_INCLUDES}")
else(CMAKE_REQUIRED_INCLUDES) else()
set(CHECK_INCLUDE_FILE_CXX_INCLUDE_DIRS) set(CHECK_INCLUDE_FILE_CXX_INCLUDE_DIRS)
endif(CMAKE_REQUIRED_INCLUDES) endif()
set(MACRO_CHECK_INCLUDE_FILE_FLAGS ${CMAKE_REQUIRED_FLAGS}) set(MACRO_CHECK_INCLUDE_FILE_FLAGS ${CMAKE_REQUIRED_FLAGS})
set(CHECK_INCLUDE_FILE_VAR ${INCLUDE}) set(CHECK_INCLUDE_FILE_VAR ${INCLUDE})
configure_file(${CMAKE_ROOT}/Modules/CheckIncludeFile.cxx.in configure_file(${CMAKE_ROOT}/Modules/CheckIncludeFile.cxx.in
@ -43,7 +43,7 @@ macro(CHECK_INCLUDE_FILE_CXX INCLUDE VARIABLE)
if(${ARGC} EQUAL 3) if(${ARGC} EQUAL 3)
set(CMAKE_CXX_FLAGS_SAVE ${CMAKE_CXX_FLAGS}) set(CMAKE_CXX_FLAGS_SAVE ${CMAKE_CXX_FLAGS})
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${ARGV2}") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${ARGV2}")
endif(${ARGC} EQUAL 3) endif()
try_compile(${VARIABLE} try_compile(${VARIABLE}
${CMAKE_BINARY_DIR} ${CMAKE_BINARY_DIR}
@ -56,7 +56,7 @@ macro(CHECK_INCLUDE_FILE_CXX INCLUDE VARIABLE)
if(${ARGC} EQUAL 3) if(${ARGC} EQUAL 3)
set(CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS_SAVE}) set(CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS_SAVE})
endif(${ARGC} EQUAL 3) endif()
if(${VARIABLE}) if(${VARIABLE})
message(STATUS "Looking for C++ include ${INCLUDE} - found") message(STATUS "Looking for C++ include ${INCLUDE} - found")
@ -65,13 +65,13 @@ macro(CHECK_INCLUDE_FILE_CXX INCLUDE VARIABLE)
"Determining if the include file ${INCLUDE} " "Determining if the include file ${INCLUDE} "
"exists passed with the following output:\n" "exists passed with the following output:\n"
"${OUTPUT}\n\n") "${OUTPUT}\n\n")
else(${VARIABLE}) else()
message(STATUS "Looking for C++ include ${INCLUDE} - not found") message(STATUS "Looking for C++ include ${INCLUDE} - not found")
set(${VARIABLE} "" CACHE INTERNAL "Have include ${INCLUDE}") set(${VARIABLE} "" CACHE INTERNAL "Have include ${INCLUDE}")
file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
"Determining if the include file ${INCLUDE} " "Determining if the include file ${INCLUDE} "
"exists failed with the following output:\n" "exists failed with the following output:\n"
"${OUTPUT}\n\n") "${OUTPUT}\n\n")
endif(${VARIABLE}) endif()
endif("${VARIABLE}" MATCHES "^${VARIABLE}$") endif()
endmacro(CHECK_INCLUDE_FILE_CXX) endmacro()

View File

@ -30,15 +30,15 @@ macro(CHECK_INCLUDE_FILES INCLUDE VARIABLE)
set(CMAKE_CONFIGURABLE_FILE_CONTENT "/* */\n") set(CMAKE_CONFIGURABLE_FILE_CONTENT "/* */\n")
if(CMAKE_REQUIRED_INCLUDES) if(CMAKE_REQUIRED_INCLUDES)
set(CHECK_INCLUDE_FILES_INCLUDE_DIRS "-DINCLUDE_DIRECTORIES=${CMAKE_REQUIRED_INCLUDES}") set(CHECK_INCLUDE_FILES_INCLUDE_DIRS "-DINCLUDE_DIRECTORIES=${CMAKE_REQUIRED_INCLUDES}")
else(CMAKE_REQUIRED_INCLUDES) else()
set(CHECK_INCLUDE_FILES_INCLUDE_DIRS) set(CHECK_INCLUDE_FILES_INCLUDE_DIRS)
endif(CMAKE_REQUIRED_INCLUDES) endif()
set(CHECK_INCLUDE_FILES_CONTENT "/* */\n") set(CHECK_INCLUDE_FILES_CONTENT "/* */\n")
set(MACRO_CHECK_INCLUDE_FILES_FLAGS ${CMAKE_REQUIRED_FLAGS}) set(MACRO_CHECK_INCLUDE_FILES_FLAGS ${CMAKE_REQUIRED_FLAGS})
foreach(FILE ${INCLUDE}) foreach(FILE ${INCLUDE})
set(CMAKE_CONFIGURABLE_FILE_CONTENT set(CMAKE_CONFIGURABLE_FILE_CONTENT
"${CMAKE_CONFIGURABLE_FILE_CONTENT}#include <${FILE}>\n") "${CMAKE_CONFIGURABLE_FILE_CONTENT}#include <${FILE}>\n")
endforeach(FILE) endforeach()
set(CMAKE_CONFIGURABLE_FILE_CONTENT set(CMAKE_CONFIGURABLE_FILE_CONTENT
"${CMAKE_CONFIGURABLE_FILE_CONTENT}\n\nint main(){return 0;}\n") "${CMAKE_CONFIGURABLE_FILE_CONTENT}\n\nint main(){return 0;}\n")
configure_file("${CMAKE_ROOT}/Modules/CMakeConfigurableFile.in" configure_file("${CMAKE_ROOT}/Modules/CMakeConfigurableFile.in"
@ -70,13 +70,13 @@ macro(CHECK_INCLUDE_FILES INCLUDE VARIABLE)
"Determining if files ${INCLUDE} " "Determining if files ${INCLUDE} "
"exist passed with the following output:\n" "exist passed with the following output:\n"
"${OUTPUT}\n\n") "${OUTPUT}\n\n")
else(${VARIABLE}) else()
message(STATUS "Looking for ${_description} - not found.") message(STATUS "Looking for ${_description} - not found.")
set(${VARIABLE} "" CACHE INTERNAL "Have includes ${INCLUDE}") set(${VARIABLE} "" CACHE INTERNAL "Have includes ${INCLUDE}")
file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
"Determining if files ${INCLUDE} " "Determining if files ${INCLUDE} "
"exist failed with the following output:\n" "exist failed with the following output:\n"
"${OUTPUT}\nSource:\n${CMAKE_CONFIGURABLE_FILE_CONTENT}\n") "${OUTPUT}\nSource:\n${CMAKE_CONFIGURABLE_FILE_CONTENT}\n")
endif(${VARIABLE}) endif()
endif("${VARIABLE}" MATCHES "^${VARIABLE}$") endif()
endmacro(CHECK_INCLUDE_FILES) endmacro()

View File

@ -40,7 +40,7 @@ macro(CHECK_LIBRARY_EXISTS LIBRARY FUNCTION LOCATION VARIABLE)
CMAKE_EXPAND_IMPORTED_TARGETS(_ADJUSTED_CMAKE_REQUIRED_LIBRARIES LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} CONFIGURATION "${CMAKE_TRY_COMPILE_CONFIGURATION}") CMAKE_EXPAND_IMPORTED_TARGETS(_ADJUSTED_CMAKE_REQUIRED_LIBRARIES LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} CONFIGURATION "${CMAKE_TRY_COMPILE_CONFIGURATION}")
set(CHECK_LIBRARY_EXISTS_LIBRARIES set(CHECK_LIBRARY_EXISTS_LIBRARIES
${CHECK_LIBRARY_EXISTS_LIBRARIES} ${_ADJUSTED_CMAKE_REQUIRED_LIBRARIES}) ${CHECK_LIBRARY_EXISTS_LIBRARIES} ${_ADJUSTED_CMAKE_REQUIRED_LIBRARIES})
endif(CMAKE_REQUIRED_LIBRARIES) endif()
try_compile(${VARIABLE} try_compile(${VARIABLE}
${CMAKE_BINARY_DIR} ${CMAKE_BINARY_DIR}
${CMAKE_ROOT}/Modules/CheckFunctionExists.c ${CMAKE_ROOT}/Modules/CheckFunctionExists.c
@ -58,13 +58,13 @@ macro(CHECK_LIBRARY_EXISTS LIBRARY FUNCTION LOCATION VARIABLE)
"Determining if the function ${FUNCTION} exists in the ${LIBRARY} " "Determining if the function ${FUNCTION} exists in the ${LIBRARY} "
"passed with the following output:\n" "passed with the following output:\n"
"${OUTPUT}\n\n") "${OUTPUT}\n\n")
else(${VARIABLE}) else()
message(STATUS "Looking for ${FUNCTION} in ${LIBRARY} - not found") message(STATUS "Looking for ${FUNCTION} in ${LIBRARY} - not found")
set(${VARIABLE} "" CACHE INTERNAL "Have library ${LIBRARY}") set(${VARIABLE} "" CACHE INTERNAL "Have library ${LIBRARY}")
file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
"Determining if the function ${FUNCTION} exists in the ${LIBRARY} " "Determining if the function ${FUNCTION} exists in the ${LIBRARY} "
"failed with the following output:\n" "failed with the following output:\n"
"${OUTPUT}\n\n") "${OUTPUT}\n\n")
endif(${VARIABLE}) endif()
endif("${VARIABLE}" MATCHES "^${VARIABLE}$") endif()
endmacro(CHECK_LIBRARY_EXISTS) endmacro()

View File

@ -50,20 +50,20 @@ function(CHECK_PROTOTYPE_DEFINITION _FUNCTION _PROTOTYPE _RETURN _HEADER _VARIAB
cmake_expand_imported_targets(_ADJUSTED_CMAKE_REQUIRED_LIBRARIES LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} CONFIGURATION "${CMAKE_TRY_COMPILE_CONFIGURATION}") cmake_expand_imported_targets(_ADJUSTED_CMAKE_REQUIRED_LIBRARIES LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} CONFIGURATION "${CMAKE_TRY_COMPILE_CONFIGURATION}")
set(CHECK_PROTOTYPE_DEFINITION_LIBS set(CHECK_PROTOTYPE_DEFINITION_LIBS
"-DLINK_LIBRARIES:STRING=${_ADJUSTED_CMAKE_REQUIRED_LIBRARIES}") "-DLINK_LIBRARIES:STRING=${_ADJUSTED_CMAKE_REQUIRED_LIBRARIES}")
else(CMAKE_REQUIRED_LIBRARIES) else()
set(CHECK_PROTOTYPE_DEFINITION_LIBS) set(CHECK_PROTOTYPE_DEFINITION_LIBS)
endif(CMAKE_REQUIRED_LIBRARIES) endif()
if (CMAKE_REQUIRED_INCLUDES) if (CMAKE_REQUIRED_INCLUDES)
set(CMAKE_SYMBOL_EXISTS_INCLUDES set(CMAKE_SYMBOL_EXISTS_INCLUDES
"-DINCLUDE_DIRECTORIES:STRING=${CMAKE_REQUIRED_INCLUDES}") "-DINCLUDE_DIRECTORIES:STRING=${CMAKE_REQUIRED_INCLUDES}")
else(CMAKE_REQUIRED_INCLUDES) else()
set(CMAKE_SYMBOL_EXISTS_INCLUDES) set(CMAKE_SYMBOL_EXISTS_INCLUDES)
endif(CMAKE_REQUIRED_INCLUDES) endif()
foreach(_FILE ${_HEADER}) foreach(_FILE ${_HEADER})
set(CHECK_PROTOTYPE_DEFINITION_HEADER set(CHECK_PROTOTYPE_DEFINITION_HEADER
"${CHECK_PROTOTYPE_DEFINITION_HEADER}#include <${_FILE}>\n") "${CHECK_PROTOTYPE_DEFINITION_HEADER}#include <${_FILE}>\n")
endforeach(_FILE) endforeach()
set(CHECK_PROTOTYPE_DEFINITION_SYMBOL ${_FUNCTION}) set(CHECK_PROTOTYPE_DEFINITION_SYMBOL ${_FUNCTION})
set(CHECK_PROTOTYPE_DEFINITION_PROTO ${_PROTOTYPE}) set(CHECK_PROTOTYPE_DEFINITION_PROTO ${_PROTOTYPE})
@ -89,13 +89,13 @@ function(CHECK_PROTOTYPE_DEFINITION _FUNCTION _PROTOTYPE _RETURN _HEADER _VARIAB
file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
"Determining if the prototype ${_FUNCTION} exists for ${_VARIABLE} passed with the following output:\n" "Determining if the prototype ${_FUNCTION} exists for ${_VARIABLE} passed with the following output:\n"
"${OUTPUT}\n\n") "${OUTPUT}\n\n")
else (${_VARIABLE}) else ()
message(STATUS "Checking prototype ${_FUNCTION} for ${_VARIABLE} - False") message(STATUS "Checking prototype ${_FUNCTION} for ${_VARIABLE} - False")
set(${_VARIABLE} 0 CACHE INTERNAL "Have correct prototype for ${_FUNCTION}") set(${_VARIABLE} 0 CACHE INTERNAL "Have correct prototype for ${_FUNCTION}")
file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
"Determining if the prototype ${_FUNCTION} exists for ${_VARIABLE} failed with the following output:\n" "Determining if the prototype ${_FUNCTION} exists for ${_VARIABLE} failed with the following output:\n"
"${OUTPUT}\n\n${_SOURCE}\n\n") "${OUTPUT}\n\n${_SOURCE}\n\n")
endif (${_VARIABLE}) endif ()
endif("${_VARIABLE}" MATCHES "^${_VARIABLE}$") endif()
endfunction(CHECK_PROTOTYPE_DEFINITION) endfunction()

View File

@ -34,7 +34,7 @@ macro (CHECK_STRUCT_HAS_MEMBER _STRUCT _MEMBER _HEADER _RESULT)
set(_INCLUDE_FILES) set(_INCLUDE_FILES)
foreach (it ${_HEADER}) foreach (it ${_HEADER})
set(_INCLUDE_FILES "${_INCLUDE_FILES}#include <${it}>\n") set(_INCLUDE_FILES "${_INCLUDE_FILES}#include <${it}>\n")
endforeach (it) endforeach ()
set(_CHECK_STRUCT_MEMBER_SOURCE_CODE " set(_CHECK_STRUCT_MEMBER_SOURCE_CODE "
${_INCLUDE_FILES} ${_INCLUDE_FILES}
@ -47,5 +47,5 @@ int main()
") ")
CHECK_C_SOURCE_COMPILES("${_CHECK_STRUCT_MEMBER_SOURCE_CODE}" ${_RESULT}) CHECK_C_SOURCE_COMPILES("${_CHECK_STRUCT_MEMBER_SOURCE_CODE}" ${_RESULT})
endmacro (CHECK_STRUCT_HAS_MEMBER) endmacro ()

View File

@ -40,7 +40,7 @@ include("${CMAKE_CURRENT_LIST_DIR}/CMakeExpandImportedTargets.cmake")
macro(CHECK_SYMBOL_EXISTS SYMBOL FILES VARIABLE) macro(CHECK_SYMBOL_EXISTS SYMBOL FILES VARIABLE)
_CHECK_SYMBOL_EXISTS("${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/CheckSymbolExists.c" "${SYMBOL}" "${FILES}" "${VARIABLE}" ) _CHECK_SYMBOL_EXISTS("${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/CheckSymbolExists.c" "${SYMBOL}" "${FILES}" "${VARIABLE}" )
endmacro(CHECK_SYMBOL_EXISTS) endmacro()
macro(_CHECK_SYMBOL_EXISTS SOURCEFILE SYMBOL FILES VARIABLE) macro(_CHECK_SYMBOL_EXISTS SOURCEFILE SYMBOL FILES VARIABLE)
if("${VARIABLE}" MATCHES "^${VARIABLE}$") if("${VARIABLE}" MATCHES "^${VARIABLE}$")
@ -51,19 +51,19 @@ macro(_CHECK_SYMBOL_EXISTS SOURCEFILE SYMBOL FILES VARIABLE)
CMAKE_EXPAND_IMPORTED_TARGETS(_ADJUSTED_CMAKE_REQUIRED_LIBRARIES LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} CONFIGURATION "${CMAKE_TRY_COMPILE_CONFIGURATION}") CMAKE_EXPAND_IMPORTED_TARGETS(_ADJUSTED_CMAKE_REQUIRED_LIBRARIES LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} CONFIGURATION "${CMAKE_TRY_COMPILE_CONFIGURATION}")
set(CHECK_SYMBOL_EXISTS_LIBS set(CHECK_SYMBOL_EXISTS_LIBS
"-DLINK_LIBRARIES:STRING=${_ADJUSTED_CMAKE_REQUIRED_LIBRARIES}") "-DLINK_LIBRARIES:STRING=${_ADJUSTED_CMAKE_REQUIRED_LIBRARIES}")
else(CMAKE_REQUIRED_LIBRARIES) else()
set(CHECK_SYMBOL_EXISTS_LIBS) set(CHECK_SYMBOL_EXISTS_LIBS)
endif(CMAKE_REQUIRED_LIBRARIES) endif()
if(CMAKE_REQUIRED_INCLUDES) if(CMAKE_REQUIRED_INCLUDES)
set(CMAKE_SYMBOL_EXISTS_INCLUDES set(CMAKE_SYMBOL_EXISTS_INCLUDES
"-DINCLUDE_DIRECTORIES:STRING=${CMAKE_REQUIRED_INCLUDES}") "-DINCLUDE_DIRECTORIES:STRING=${CMAKE_REQUIRED_INCLUDES}")
else(CMAKE_REQUIRED_INCLUDES) else()
set(CMAKE_SYMBOL_EXISTS_INCLUDES) set(CMAKE_SYMBOL_EXISTS_INCLUDES)
endif(CMAKE_REQUIRED_INCLUDES) endif()
foreach(FILE ${FILES}) foreach(FILE ${FILES})
set(CMAKE_CONFIGURABLE_FILE_CONTENT set(CMAKE_CONFIGURABLE_FILE_CONTENT
"${CMAKE_CONFIGURABLE_FILE_CONTENT}#include <${FILE}>\n") "${CMAKE_CONFIGURABLE_FILE_CONTENT}#include <${FILE}>\n")
endforeach(FILE) endforeach()
set(CMAKE_CONFIGURABLE_FILE_CONTENT set(CMAKE_CONFIGURABLE_FILE_CONTENT
"${CMAKE_CONFIGURABLE_FILE_CONTENT}\nint main(int argc, char** argv)\n{\n (void)argv;\n#ifndef ${SYMBOL}\n return ((int*)(&${SYMBOL}))[argc];\n#else\n (void)argc;\n return 0;\n#endif\n}\n") "${CMAKE_CONFIGURABLE_FILE_CONTENT}\nint main(int argc, char** argv)\n{\n (void)argv;\n#ifndef ${SYMBOL}\n return ((int*)(&${SYMBOL}))[argc];\n#else\n (void)argc;\n return 0;\n#endif\n}\n")
@ -88,7 +88,7 @@ macro(_CHECK_SYMBOL_EXISTS SOURCEFILE SYMBOL FILES VARIABLE)
"exist passed with the following output:\n" "exist passed with the following output:\n"
"${OUTPUT}\nFile ${SOURCEFILE}:\n" "${OUTPUT}\nFile ${SOURCEFILE}:\n"
"${CMAKE_CONFIGURABLE_FILE_CONTENT}\n") "${CMAKE_CONFIGURABLE_FILE_CONTENT}\n")
else(${VARIABLE}) else()
message(STATUS "Looking for ${SYMBOL} - not found.") message(STATUS "Looking for ${SYMBOL} - not found.")
set(${VARIABLE} "" CACHE INTERNAL "Have symbol ${SYMBOL}") set(${VARIABLE} "" CACHE INTERNAL "Have symbol ${SYMBOL}")
file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
@ -96,6 +96,6 @@ macro(_CHECK_SYMBOL_EXISTS SOURCEFILE SYMBOL FILES VARIABLE)
"exist failed with the following output:\n" "exist failed with the following output:\n"
"${OUTPUT}\nFile ${SOURCEFILE}:\n" "${OUTPUT}\nFile ${SOURCEFILE}:\n"
"${CMAKE_CONFIGURABLE_FILE_CONTENT}\n") "${CMAKE_CONFIGURABLE_FILE_CONTENT}\n")
endif(${VARIABLE}) endif()
endif("${VARIABLE}" MATCHES "^${VARIABLE}$") endif()
endmacro(_CHECK_SYMBOL_EXISTS) endmacro()

View File

@ -142,7 +142,7 @@ function(__check_type_size_impl type var map builtin)
file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
"Determining size of ${type} passed with the following output:\n${output}\n\n") "Determining size of ${type} passed with the following output:\n${output}\n\n")
set(${var} "${${var}}" CACHE INTERNAL "CHECK_TYPE_SIZE: sizeof(${type})") set(${var} "${${var}}" CACHE INTERNAL "CHECK_TYPE_SIZE: sizeof(${type})")
else(HAVE_${var}) else()
# The check failed to compile. # The check failed to compile.
message(STATUS "Check size of ${type} - failed") message(STATUS "Check size of ${type} - failed")
file(READ ${src} content) file(READ ${src} content)
@ -150,7 +150,7 @@ function(__check_type_size_impl type var map builtin)
"Determining size of ${type} failed with the following output:\n${output}\n${src}:\n${content}\n\n") "Determining size of ${type} failed with the following output:\n${output}\n${src}:\n${content}\n\n")
set(${var} "" CACHE INTERNAL "CHECK_TYPE_SIZE: ${type} unknown") set(${var} "" CACHE INTERNAL "CHECK_TYPE_SIZE: ${type} unknown")
file(REMOVE ${map}) file(REMOVE ${map})
endif(HAVE_${var}) endif()
endfunction() endfunction()
#----------------------------------------------------------------------------- #-----------------------------------------------------------------------------

View File

@ -39,9 +39,9 @@ macro(CHECK_VARIABLE_EXISTS VAR VARIABLE)
CMAKE_EXPAND_IMPORTED_TARGETS(_ADJUSTED_CMAKE_REQUIRED_LIBRARIES LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} CONFIGURATION "${CMAKE_TRY_COMPILE_CONFIGURATION}") CMAKE_EXPAND_IMPORTED_TARGETS(_ADJUSTED_CMAKE_REQUIRED_LIBRARIES LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} CONFIGURATION "${CMAKE_TRY_COMPILE_CONFIGURATION}")
set(CHECK_VARIABLE_EXISTS_ADD_LIBRARIES set(CHECK_VARIABLE_EXISTS_ADD_LIBRARIES
"-DLINK_LIBRARIES:STRING=${_ADJUSTED_CMAKE_REQUIRED_LIBRARIES}") "-DLINK_LIBRARIES:STRING=${_ADJUSTED_CMAKE_REQUIRED_LIBRARIES}")
else(CMAKE_REQUIRED_LIBRARIES) else()
set(CHECK_VARIABLE_EXISTS_ADD_LIBRARIES) set(CHECK_VARIABLE_EXISTS_ADD_LIBRARIES)
endif(CMAKE_REQUIRED_LIBRARIES) endif()
try_compile(${VARIABLE} try_compile(${VARIABLE}
${CMAKE_BINARY_DIR} ${CMAKE_BINARY_DIR}
${CMAKE_ROOT}/Modules/CheckVariableExists.c ${CMAKE_ROOT}/Modules/CheckVariableExists.c
@ -55,12 +55,12 @@ macro(CHECK_VARIABLE_EXISTS VAR VARIABLE)
file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
"Determining if the variable ${VAR} exists passed with the following output:\n" "Determining if the variable ${VAR} exists passed with the following output:\n"
"${OUTPUT}\n\n") "${OUTPUT}\n\n")
else(${VARIABLE}) else()
set(${VARIABLE} "" CACHE INTERNAL "Have variable ${VAR}") set(${VARIABLE} "" CACHE INTERNAL "Have variable ${VAR}")
message(STATUS "Looking for ${VAR} - not found") message(STATUS "Looking for ${VAR} - not found")
file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
"Determining if the variable ${VAR} exists failed with the following output:\n" "Determining if the variable ${VAR} exists failed with the following output:\n"
"${OUTPUT}\n\n") "${OUTPUT}\n\n")
endif(${VARIABLE}) endif()
endif("${VARIABLE}" MATCHES "^${VARIABLE}$") endif()
endmacro(CHECK_VARIABLE_EXISTS) endmacro()

View File

@ -50,5 +50,5 @@ macro(__compiler_gnu lang)
set(CMAKE_${lang}_CREATE_ASSEMBLY_SOURCE "<CMAKE_${lang}_COMPILER> <DEFINES> <FLAGS> -S <SOURCE> -o <ASSEMBLY_SOURCE>") set(CMAKE_${lang}_CREATE_ASSEMBLY_SOURCE "<CMAKE_${lang}_COMPILER> <DEFINES> <FLAGS> -S <SOURCE> -o <ASSEMBLY_SOURCE>")
if(NOT APPLE) if(NOT APPLE)
set(CMAKE_INCLUDE_SYSTEM_FLAG_${lang} "-isystem ") set(CMAKE_INCLUDE_SYSTEM_FLAG_${lang} "-isystem ")
endif(NOT APPLE) endif()
endmacro() endmacro()

View File

@ -8,6 +8,6 @@ set(CMAKE_ASM_FLAGS_RELWITHDEBINFO_INIT "-O2 -g")
if(UNIX) if(UNIX)
set(CMAKE_ASM_SOURCE_FILE_EXTENSIONS s;S) set(CMAKE_ASM_SOURCE_FILE_EXTENSIONS s;S)
else(UNIX) else()
set(CMAKE_ASM_SOURCE_FILE_EXTENSIONS asm) set(CMAKE_ASM_SOURCE_FILE_EXTENSIONS asm)
endif(UNIX) endif()

View File

@ -21,4 +21,4 @@ set(CMAKE_ASM_FLAGS_RELWITHDEBINFO_INIT "-g -xO2")
foreach(type SHARED_LIBRARY SHARED_MODULE EXE) foreach(type SHARED_LIBRARY SHARED_MODULE EXE)
set(CMAKE_${type}_LINK_STATIC_ASM_FLAGS "-Bstatic") set(CMAKE_${type}_LINK_STATIC_ASM_FLAGS "-Bstatic")
set(CMAKE_${type}_LINK_DYNAMIC_ASM_FLAGS "-Bdynamic") set(CMAKE_${type}_LINK_DYNAMIC_ASM_FLAGS "-Bdynamic")
endforeach(type) endforeach()

View File

@ -21,7 +21,7 @@ set(CMAKE_C_FLAGS_RELWITHDEBINFO_INIT "-g -xO2")
foreach(type SHARED_LIBRARY SHARED_MODULE EXE) foreach(type SHARED_LIBRARY SHARED_MODULE EXE)
set(CMAKE_${type}_LINK_STATIC_C_FLAGS "-Bstatic") set(CMAKE_${type}_LINK_STATIC_C_FLAGS "-Bstatic")
set(CMAKE_${type}_LINK_DYNAMIC_C_FLAGS "-Bdynamic") set(CMAKE_${type}_LINK_DYNAMIC_C_FLAGS "-Bdynamic")
endforeach(type) endforeach()
set(CMAKE_C_CREATE_PREPROCESSED_SOURCE "<CMAKE_C_COMPILER> <DEFINES> <FLAGS> -E <SOURCE> > <PREPROCESSED_SOURCE>") 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>") set(CMAKE_C_CREATE_ASSEMBLY_SOURCE "<CMAKE_C_COMPILER> <DEFINES> <FLAGS> -S <SOURCE> -o <ASSEMBLY_SOURCE>")

View File

@ -21,7 +21,7 @@ set(CMAKE_CXX_FLAGS_RELWITHDEBINFO_INIT "-g -xO2")
foreach(type SHARED_LIBRARY SHARED_MODULE EXE) foreach(type SHARED_LIBRARY SHARED_MODULE EXE)
set(CMAKE_${type}_LINK_STATIC_CXX_FLAGS "-Bstatic") set(CMAKE_${type}_LINK_STATIC_CXX_FLAGS "-Bstatic")
set(CMAKE_${type}_LINK_DYNAMIC_CXX_FLAGS "-Bdynamic") set(CMAKE_${type}_LINK_DYNAMIC_CXX_FLAGS "-Bdynamic")
endforeach(type) endforeach()
set(CMAKE_CXX_CREATE_PREPROCESSED_SOURCE "<CMAKE_CXX_COMPILER> <DEFINES> <FLAGS> -E <SOURCE> > <PREPROCESSED_SOURCE>") set(CMAKE_CXX_CREATE_PREPROCESSED_SOURCE "<CMAKE_CXX_COMPILER> <DEFINES> <FLAGS> -E <SOURCE> > <PREPROCESSED_SOURCE>")
set(CMAKE_CXX_CREATE_ASSEMBLY_SOURCE "<CMAKE_CXX_COMPILER> <FLAGS> -S <SOURCE> -o <ASSEMBLY_SOURCE>") set(CMAKE_CXX_CREATE_ASSEMBLY_SOURCE "<CMAKE_CXX_COMPILER> <FLAGS> -S <SOURCE> -o <ASSEMBLY_SOURCE>")

View File

@ -6,7 +6,7 @@
# include(Dart) # include(Dart)
# if(BUILD_TESTING) # if(BUILD_TESTING)
# # ... testing related CMake code ... # # ... testing related CMake code ...
# endif(BUILD_TESTING) # endif()
# The BUILD_TESTING option is created by the Dart module to determine # The BUILD_TESTING option is created by the Dart module to determine
# whether testing support should be enabled. The default is ON. # whether testing support should be enabled. The default is ON.
@ -76,7 +76,7 @@ if(BUILD_TESTING)
set(HAVE_DART) set(HAVE_DART)
if(EXISTS "${DART_ROOT}/Source/Client/Dart.conf.in") if(EXISTS "${DART_ROOT}/Source/Client/Dart.conf.in")
set(HAVE_DART 1) set(HAVE_DART 1)
endif(EXISTS "${DART_ROOT}/Source/Client/Dart.conf.in") endif()
# #
# Section #2: # Section #2:
@ -86,7 +86,7 @@ if(BUILD_TESTING)
# find a tcl shell command # find a tcl shell command
if(HAVE_DART) if(HAVE_DART)
find_package(Tclsh) find_package(Tclsh)
endif(HAVE_DART) endif()
if (HAVE_DART) if (HAVE_DART)
@ -110,13 +110,13 @@ if(BUILD_TESTING)
set(DART_EXPERIMENTAL_NAME Experimental) set(DART_EXPERIMENTAL_NAME Experimental)
if(DART_EXPERIMENTAL_USE_PROJECT_NAME) if(DART_EXPERIMENTAL_USE_PROJECT_NAME)
set(DART_EXPERIMENTAL_NAME "${DART_EXPERIMENTAL_NAME}${PROJECT_NAME}") set(DART_EXPERIMENTAL_NAME "${DART_EXPERIMENTAL_NAME}${PROJECT_NAME}")
endif(DART_EXPERIMENTAL_USE_PROJECT_NAME) endif()
endif (HAVE_DART) endif ()
set(RUN_FROM_CTEST_OR_DART 1) set(RUN_FROM_CTEST_OR_DART 1)
include(CTestTargets) include(CTestTargets)
set(RUN_FROM_CTEST_OR_DART) set(RUN_FROM_CTEST_OR_DART)
endif(BUILD_TESTING) endif()
# #
# End of Dart.cmake # End of Dart.cmake

View File

@ -49,4 +49,4 @@ if (BUILD_DOCUMENTATION)
# We will probably need bash to create the custom target # We will probably need bash to create the custom target
# #
endif (BUILD_DOCUMENTATION) endif ()

View File

@ -226,7 +226,7 @@ function(_ep_parse_arguments f name ns args)
set(key "${arg}") set(key "${arg}")
endif() endif()
endforeach() endforeach()
endfunction(_ep_parse_arguments) endfunction()
define_property(DIRECTORY PROPERTY "EP_BASE" INHERITED define_property(DIRECTORY PROPERTY "EP_BASE" INHERITED
@ -329,7 +329,7 @@ endif()
" "
) )
endfunction(_ep_write_gitclone_script) endfunction()
function(_ep_write_downloadfile_script script_filename remote local timeout md5) function(_ep_write_downloadfile_script script_filename remote local timeout md5)
@ -377,7 +377,7 @@ message(STATUS \"downloading... done\")
" "
) )
endfunction(_ep_write_downloadfile_script) endfunction()
function(_ep_write_verifyfile_script script_filename local md5) function(_ep_write_verifyfile_script script_filename local md5)
@ -422,7 +422,7 @@ endif()
" "
) )
endfunction(_ep_write_verifyfile_script) endfunction()
function(_ep_write_extractfile_script script_filename name filename directory) function(_ep_write_extractfile_script script_filename name filename directory)
@ -502,7 +502,7 @@ message(STATUS \"extracting... done\")
" "
) )
endfunction(_ep_write_extractfile_script) endfunction()
function(_ep_set_directories name) function(_ep_set_directories name)
@ -523,7 +523,7 @@ function(_ep_set_directories name)
set(binary_default "${prefix}/src/${name}-build") set(binary_default "${prefix}/src/${name}-build")
set(stamp_default "${prefix}/src/${name}-stamp") set(stamp_default "${prefix}/src/${name}-stamp")
set(install_default "${prefix}") set(install_default "${prefix}")
else() # assert(base) else()
set(tmp_default "${base}/tmp/${name}") set(tmp_default "${base}/tmp/${name}")
set(download_default "${base}/Download/${name}") set(download_default "${base}/Download/${name}")
set(source_default "${base}/Source/${name}") set(source_default "${base}/Source/${name}")
@ -573,7 +573,7 @@ function(_ep_set_directories name)
message(FATAL_ERROR "dir '${dir}' does not exist after file(MAKE_DIRECTORY)") message(FATAL_ERROR "dir '${dir}' does not exist after file(MAKE_DIRECTORY)")
endif() endif()
endforeach() endforeach()
endfunction(_ep_set_directories) endfunction()
# IMPORTANT: this MUST be a macro and not a function because of the # IMPORTANT: this MUST be a macro and not a function because of the
@ -633,7 +633,7 @@ function(_ep_write_initial_cache target_name script_filename args)
file(WRITE "${script_filename}.in" "\@script_initial_cache\@\n") file(WRITE "${script_filename}.in" "\@script_initial_cache\@\n")
endif() endif()
configure_file("${script_filename}.in" "${script_filename}") configure_file("${script_filename}.in" "${script_filename}")
endfunction(_ep_write_initial_cache) endfunction()
function(ExternalProject_Get_Property name) function(ExternalProject_Get_Property name)
@ -645,7 +645,7 @@ function(ExternalProject_Get_Property name)
endif() endif()
set(${var} "${${var}}" PARENT_SCOPE) set(${var} "${${var}}" PARENT_SCOPE)
endforeach() endforeach()
endfunction(ExternalProject_Get_Property) endfunction()
function(_ep_get_configure_command_id name cfg_cmd_id_var) function(_ep_get_configure_command_id name cfg_cmd_id_var)
@ -671,7 +671,7 @@ function(_ep_get_configure_command_id name cfg_cmd_id_var)
endif() endif()
endif() endif()
endif() endif()
endfunction(_ep_get_configure_command_id) endfunction()
function(_ep_get_build_command name step cmd_var) function(_ep_get_build_command name step cmd_var)
@ -710,7 +710,7 @@ function(_ep_get_build_command name step cmd_var)
set(args "") set(args "")
endif() endif()
endif() endif()
else() # if(cfg_cmd_id STREQUAL "configure") else()
# Non-CMake project. Guess "make" and "make install" and "make test". # Non-CMake project. Guess "make" and "make install" and "make test".
if("${CMAKE_GENERATOR}" MATCHES "Makefiles") if("${CMAKE_GENERATOR}" MATCHES "Makefiles")
# Try to get the parallel arguments # Try to get the parallel arguments
@ -736,7 +736,7 @@ function(_ep_get_build_command name step cmd_var)
endif() endif()
set(${cmd_var} "${cmd}" PARENT_SCOPE) set(${cmd_var} "${cmd}" PARENT_SCOPE)
endfunction(_ep_get_build_command) endfunction()
function(_ep_write_log_script name step cmd_var) function(_ep_write_log_script name step cmd_var)
ExternalProject_Get_Property(${name} stamp_dir) ExternalProject_Get_Property(${name} stamp_dir)
@ -784,7 +784,7 @@ if(result)
set(msg \"Command failed (\${result}):\\n\") set(msg \"Command failed (\${result}):\\n\")
foreach(arg IN LISTS command) foreach(arg IN LISTS command)
set(msg \"\${msg} '\${arg}'\") set(msg \"\${msg} '\${arg}'\")
endforeach(arg) endforeach()
message(FATAL_ERROR \"\${msg}\") message(FATAL_ERROR \"\${msg}\")
endif() endif()
") ")
@ -823,7 +823,7 @@ if(result)
set(msg \"Command failed: \${result}\\n\") set(msg \"Command failed: \${result}\\n\")
foreach(arg IN LISTS command) foreach(arg IN LISTS command)
set(msg \"\${msg} '\${arg}'\") set(msg \"\${msg} '\${arg}'\")
endforeach(arg) endforeach()
set(msg \"\${msg}\\nSee also\\n ${logbase}-*.log\\n\") set(msg \"\${msg}\\nSee also\\n ${logbase}-*.log\\n\")
message(FATAL_ERROR \"\${msg}\") message(FATAL_ERROR \"\${msg}\")
else() else()
@ -833,7 +833,7 @@ endif()
") ")
set(command ${CMAKE_COMMAND} ${make} ${config} -P ${script}) set(command ${CMAKE_COMMAND} ${make} ${config} -P ${script})
set(${cmd_var} "${command}" PARENT_SCOPE) set(${cmd_var} "${command}" PARENT_SCOPE)
endfunction(_ep_write_log_script) endfunction()
# This module used to use "/${CMAKE_CFG_INTDIR}" directly and produced # This module used to use "/${CMAKE_CFG_INTDIR}" directly and produced
# makefiles with "/./" in paths for custom command dependencies. Which # makefiles with "/./" in paths for custom command dependencies. Which
@ -849,7 +849,7 @@ function(_ep_get_configuration_subdir_suffix suffix_var)
set(suffix "/${CMAKE_CFG_INTDIR}") set(suffix "/${CMAKE_CFG_INTDIR}")
endif() endif()
set(${suffix_var} "${suffix}" PARENT_SCOPE) set(${suffix_var} "${suffix}" PARENT_SCOPE)
endfunction(_ep_get_configuration_subdir_suffix) endfunction()
function(_ep_get_step_stampfile name step stampfile_var) function(_ep_get_step_stampfile name step stampfile_var)
@ -876,7 +876,7 @@ function(ExternalProject_Add_StepTargets name)
add_dependencies(${name}-${step} ${arg}) add_dependencies(${name}-${step} ${arg})
endforeach() endforeach()
endforeach() endforeach()
endfunction(ExternalProject_Add_StepTargets) endfunction()
function(ExternalProject_Add_Step name step) function(ExternalProject_Add_Step name step)
@ -974,7 +974,7 @@ function(ExternalProject_Add_Step name step)
break() break()
endif() endif()
endforeach() endforeach()
endfunction(ExternalProject_Add_Step) endfunction()
function(_ep_add_mkdir_command name) function(_ep_add_mkdir_command name)
@ -992,7 +992,7 @@ function(_ep_add_mkdir_command name)
COMMAND ${CMAKE_COMMAND} -E make_directory ${stamp_dir}${cfgdir} COMMAND ${CMAKE_COMMAND} -E make_directory ${stamp_dir}${cfgdir}
COMMAND ${CMAKE_COMMAND} -E make_directory ${download_dir} COMMAND ${CMAKE_COMMAND} -E make_directory ${download_dir}
) )
endfunction(_ep_add_mkdir_command) endfunction()
function(_ep_get_git_version git_EXECUTABLE git_version_var) function(_ep_get_git_version git_EXECUTABLE git_version_var)
@ -1215,7 +1215,7 @@ function(_ep_add_download_command name)
DEPENDEES mkdir DEPENDEES mkdir
${log} ${log}
) )
endfunction(_ep_add_download_command) endfunction()
function(_ep_add_update_command name) function(_ep_add_update_command name)
@ -1297,7 +1297,7 @@ function(_ep_add_update_command name)
DEPENDEES download DEPENDEES download
${log} ${log}
) )
endfunction(_ep_add_update_command) endfunction()
function(_ep_add_patch_command name) function(_ep_add_patch_command name)
@ -1317,7 +1317,7 @@ function(_ep_add_patch_command name)
WORKING_DIRECTORY ${work_dir} WORKING_DIRECTORY ${work_dir}
DEPENDEES download DEPENDEES download
) )
endfunction(_ep_add_patch_command) endfunction()
# TODO: Make sure external projects use the proper compiler # TODO: Make sure external projects use the proper compiler
@ -1392,7 +1392,7 @@ function(_ep_add_configure_command name)
DEPENDS ${file_deps} DEPENDS ${file_deps}
${log} ${log}
) )
endfunction(_ep_add_configure_command) endfunction()
function(_ep_add_build_command name) function(_ep_add_build_command name)
@ -1418,7 +1418,7 @@ function(_ep_add_build_command name)
DEPENDEES configure DEPENDEES configure
${log} ${log}
) )
endfunction(_ep_add_build_command) endfunction()
function(_ep_add_install_command name) function(_ep_add_install_command name)
@ -1444,7 +1444,7 @@ function(_ep_add_install_command name)
DEPENDEES build DEPENDEES build
${log} ${log}
) )
endfunction(_ep_add_install_command) endfunction()
function(_ep_add_test_command name) function(_ep_add_test_command name)
@ -1484,7 +1484,7 @@ function(_ep_add_test_command name)
${log} ${log}
) )
endif() endif()
endfunction(_ep_add_test_command) endfunction()
function(ExternalProject_Add name) function(ExternalProject_Add name)
@ -1550,4 +1550,4 @@ function(ExternalProject_Add name)
# on install. # on install.
# #
_ep_add_test_command(${name}) _ep_add_test_command(${name})
endfunction(ExternalProject_Add) endfunction()

View File

@ -188,7 +188,7 @@ function(ADD_FEATURE_INFO _name _enabled _desc)
endif () endif ()
set_property(GLOBAL PROPERTY _CMAKE_${_name}_DESCRIPTION "${_desc}" ) set_property(GLOBAL PROPERTY _CMAKE_${_name}_DESCRIPTION "${_desc}" )
endfunction(ADD_FEATURE_INFO) endfunction()
@ -253,7 +253,7 @@ function(SET_PACKAGE_PROPERTIES _name _props)
set_property(GLOBAL PROPERTY _CMAKE_${_name}_TYPE "${_SPP_TYPE}" ) set_property(GLOBAL PROPERTY _CMAKE_${_name}_TYPE "${_SPP_TYPE}" )
endif() endif()
endfunction(SET_PACKAGE_PROPERTIES) endfunction()
@ -306,28 +306,28 @@ function(_FS_GET_FEATURE_SUMMARY _property _var _includeQuiet)
get_property(_info GLOBAL PROPERTY _CMAKE_${_currentFeature}_REQUIRED_VERSION) get_property(_info GLOBAL PROPERTY _CMAKE_${_currentFeature}_REQUIRED_VERSION)
if(_info) if(_info)
set(_currentFeatureText "${_currentFeatureText} (required version ${_info})") set(_currentFeatureText "${_currentFeatureText} (required version ${_info})")
endif(_info) endif()
get_property(_info GLOBAL PROPERTY _CMAKE_${_currentFeature}_DESCRIPTION) get_property(_info GLOBAL PROPERTY _CMAKE_${_currentFeature}_DESCRIPTION)
if(_info) if(_info)
set(_currentFeatureText "${_currentFeatureText} , ${_info}") set(_currentFeatureText "${_currentFeatureText} , ${_info}")
endif(_info) endif()
get_property(_info GLOBAL PROPERTY _CMAKE_${_currentFeature}_URL) get_property(_info GLOBAL PROPERTY _CMAKE_${_currentFeature}_URL)
if(_info) if(_info)
set(_currentFeatureText "${_currentFeatureText} , <${_info}>") set(_currentFeatureText "${_currentFeatureText} , <${_info}>")
endif(_info) endif()
get_property(_info GLOBAL PROPERTY _CMAKE_${_currentFeature}_PURPOSE) get_property(_info GLOBAL PROPERTY _CMAKE_${_currentFeature}_PURPOSE)
foreach(_purpose ${_info}) foreach(_purpose ${_info})
set(_currentFeatureText "${_currentFeatureText}\n ${_purpose}") set(_currentFeatureText "${_currentFeatureText}\n ${_purpose}")
endforeach() endforeach()
endif(includeThisOne) endif()
endif("${_type}" STREQUAL ANY OR "${_type}" STREQUAL "${_currentType}") endif()
endforeach(_currentFeature) endforeach()
set(${_var} "${_currentFeatureText}" PARENT_SCOPE) set(${_var} "${_currentFeatureText}" PARENT_SCOPE)
endfunction(_FS_GET_FEATURE_SUMMARY) endfunction()
@ -412,11 +412,11 @@ function(FEATURE_SUMMARY)
if(_FS_FILENAME) if(_FS_FILENAME)
if(_FS_APPEND) if(_FS_APPEND)
file(APPEND "${_FS_FILENAME}" "${_fullText}") file(APPEND "${_FS_FILENAME}" "${_fullText}")
else(_FS_APPEND) else()
file(WRITE "${_FS_FILENAME}" "${_fullText}") file(WRITE "${_FS_FILENAME}" "${_fullText}")
endif() endif()
else(_FS_FILENAME) else()
if(NOT _FS_VAR) if(NOT _FS_VAR)
message(STATUS "${_fullText}") message(STATUS "${_fullText}")
endif() endif()
@ -430,7 +430,7 @@ function(FEATURE_SUMMARY)
message(FATAL_ERROR "feature_summary() Error: REQUIRED package(s) are missing, aborting CMake run.") message(FATAL_ERROR "feature_summary() Error: REQUIRED package(s) are missing, aborting CMake run.")
endif() endif()
endfunction(FEATURE_SUMMARY) endfunction()
# The stuff below is only kept for compatibility # The stuff below is only kept for compatibility
@ -445,22 +445,22 @@ function(SET_PACKAGE_INFO _name _desc)
if(_purpose MATCHES ".+") if(_purpose MATCHES ".+")
set_property(GLOBAL APPEND PROPERTY _CMAKE_${_name}_PURPOSE "${_purpose}" ) set_property(GLOBAL APPEND PROPERTY _CMAKE_${_name}_PURPOSE "${_purpose}" )
endif() endif()
endfunction(SET_PACKAGE_INFO) endfunction()
function(SET_FEATURE_INFO) function(SET_FEATURE_INFO)
SET_PACKAGE_INFO(${ARGN}) SET_PACKAGE_INFO(${ARGN})
endfunction(SET_FEATURE_INFO) endfunction()
function(PRINT_ENABLED_FEATURES) function(PRINT_ENABLED_FEATURES)
FEATURE_SUMMARY(WHAT ENABLED_FEATURES DESCRIPTION "Enabled features:") FEATURE_SUMMARY(WHAT ENABLED_FEATURES DESCRIPTION "Enabled features:")
endfunction(PRINT_ENABLED_FEATURES) endfunction()
function(PRINT_DISABLED_FEATURES) function(PRINT_DISABLED_FEATURES)
FEATURE_SUMMARY(WHAT DISABLED_FEATURES DESCRIPTION "Disabled features:") FEATURE_SUMMARY(WHAT DISABLED_FEATURES DESCRIPTION "Disabled features:")
endfunction(PRINT_DISABLED_FEATURES) endfunction()

View File

@ -33,7 +33,7 @@ if (UNIX)
/usr/local/avifile/lib /usr/local/avifile/lib
) )
endif (UNIX) endif ()
# handle the QUIETLY and REQUIRED arguments and set AVIFILE_FOUND to TRUE if # handle the QUIETLY and REQUIRED arguments and set AVIFILE_FOUND to TRUE if
# all listed variables are TRUE # all listed variables are TRUE

View File

@ -66,10 +66,10 @@ if(ARMADILLO_INCLUDE_DIR)
# WARNING: The number of spaces before the version name is not one. # 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}")
endif(EXISTS "${ARMADILLO_INCLUDE_DIR}/armadillo_bits/arma_version.hpp") endif()
set(ARMADILLO_VERSION_STRING "${ARMADILLO_VERSION_MAJOR}.${ARMADILLO_VERSION_MINOR}.${ARMADILLO_VERSION_PATCH}") set(ARMADILLO_VERSION_STRING "${ARMADILLO_VERSION_MAJOR}.${ARMADILLO_VERSION_MINOR}.${ARMADILLO_VERSION_PATCH}")
endif (ARMADILLO_INCLUDE_DIR) endif ()
#====================== #======================
@ -84,7 +84,7 @@ find_package_handle_standard_args(Armadillo
if (ARMADILLO_FOUND) if (ARMADILLO_FOUND)
set(ARMADILLO_INCLUDE_DIRS ${ARMADILLO_INCLUDE_DIR}) set(ARMADILLO_INCLUDE_DIRS ${ARMADILLO_INCLUDE_DIR})
set(ARMADILLO_LIBRARIES ${ARMADILLO_LIBRARY}) set(ARMADILLO_LIBRARIES ${ARMADILLO_LIBRARY})
endif (ARMADILLO_FOUND) endif ()
# Hide internal variables # Hide internal variables

View File

@ -98,14 +98,14 @@ if(BISON_EXECUTABLE)
set(BISON_${Name}_VERBOSE_FILE ${filename}) set(BISON_${Name}_VERBOSE_FILE ${filename})
list(APPEND BISON_TARGET_extraoutputs list(APPEND BISON_TARGET_extraoutputs
"${BISON_TARGET_output_path}/${BISON_TARGET_output_name}.output") "${BISON_TARGET_output_path}/${BISON_TARGET_output_name}.output")
endmacro(BISON_TARGET_option_verbose) endmacro()
# internal macro # internal macro
macro(BISON_TARGET_option_extraopts Options) macro(BISON_TARGET_option_extraopts Options)
set(BISON_TARGET_extraopts "${Options}") set(BISON_TARGET_extraopts "${Options}")
separate_arguments(BISON_TARGET_extraopts) separate_arguments(BISON_TARGET_extraopts)
list(APPEND BISON_TARGET_cmdopt ${BISON_TARGET_extraopts}) list(APPEND BISON_TARGET_cmdopt ${BISON_TARGET_extraopts})
endmacro(BISON_TARGET_option_extraopts) endmacro()
#============================================================ #============================================================
# BISON_TARGET (public macro) # BISON_TARGET (public macro)
@ -161,12 +161,12 @@ if(BISON_EXECUTABLE)
set(BISON_${Name}_COMPILE_FLAGS ${BISON_TARGET_cmdopt}) set(BISON_${Name}_COMPILE_FLAGS ${BISON_TARGET_cmdopt})
set(BISON_${Name}_OUTPUT_SOURCE "${BisonOutput}") set(BISON_${Name}_OUTPUT_SOURCE "${BisonOutput}")
endif(NOT ${ARGC} EQUAL 3 AND NOT ${ARGC} EQUAL 5 AND NOT ${ARGC} EQUAL 7) endif()
endmacro(BISON_TARGET) endmacro()
# #
#============================================================ #============================================================
endif(BISON_EXECUTABLE) endif()
include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake) include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(BISON REQUIRED_VARS BISON_EXECUTABLE FIND_PACKAGE_HANDLE_STANDARD_ARGS(BISON REQUIRED_VARS BISON_EXECUTABLE

View File

@ -54,10 +54,10 @@ elseif( (_LANGUAGES_ MATCHES C) OR (_LANGUAGES_ MATCHES CXX) )
else() else()
if(BLAS_FIND_REQUIRED) if(BLAS_FIND_REQUIRED)
message(FATAL_ERROR "FindBLAS requires Fortran, C, or C++ to be enabled.") message(FATAL_ERROR "FindBLAS requires Fortran, C, or C++ to be enabled.")
else(BLAS_FIND_REQUIRED) else()
message(STATUS "Looking for BLAS... - NOT found (Unsupported languages)") message(STATUS "Looking for BLAS... - NOT found (Unsupported languages)")
return() return()
endif(BLAS_FIND_REQUIRED) endif()
endif() endif()
macro(Check_Fortran_Libraries LIBRARIES _prefix _name _flags _list _thread) macro(Check_Fortran_Libraries LIBRARIES _prefix _name _flags _list _thread)
@ -94,18 +94,18 @@ foreach(_library ${_list})
if (BLA_STATIC) if (BLA_STATIC)
if (WIN32) if (WIN32)
set(CMAKE_FIND_LIBRARY_SUFFIXES .lib ${CMAKE_FIND_LIBRARY_SUFFIXES}) set(CMAKE_FIND_LIBRARY_SUFFIXES .lib ${CMAKE_FIND_LIBRARY_SUFFIXES})
endif ( WIN32 ) endif ()
if (APPLE) if (APPLE)
set(CMAKE_FIND_LIBRARY_SUFFIXES .lib ${CMAKE_FIND_LIBRARY_SUFFIXES}) set(CMAKE_FIND_LIBRARY_SUFFIXES .lib ${CMAKE_FIND_LIBRARY_SUFFIXES})
else (APPLE) else ()
set(CMAKE_FIND_LIBRARY_SUFFIXES .a ${CMAKE_FIND_LIBRARY_SUFFIXES}) set(CMAKE_FIND_LIBRARY_SUFFIXES .a ${CMAKE_FIND_LIBRARY_SUFFIXES})
endif (APPLE) endif ()
else (BLA_STATIC) else ()
if (CMAKE_SYSTEM_NAME STREQUAL "Linux") if (CMAKE_SYSTEM_NAME STREQUAL "Linux")
# for ubuntu's libblas3gf and liblapack3gf packages # for ubuntu's libblas3gf and liblapack3gf packages
set(CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES} .so.3gf) set(CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES} .so.3gf)
endif () endif ()
endif (BLA_STATIC) endif ()
find_library(${_prefix}_${_library}_LIBRARY find_library(${_prefix}_${_library}_LIBRARY
NAMES ${_library} NAMES ${_library}
PATHS ${_libdir} PATHS ${_libdir}
@ -113,8 +113,8 @@ foreach(_library ${_list})
mark_as_advanced(${_prefix}_${_library}_LIBRARY) mark_as_advanced(${_prefix}_${_library}_LIBRARY)
set(${LIBRARIES} ${${LIBRARIES}} ${${_prefix}_${_library}_LIBRARY}) set(${LIBRARIES} ${${LIBRARIES}} ${${_prefix}_${_library}_LIBRARY})
set(_libraries_work ${${_prefix}_${_library}_LIBRARY}) set(_libraries_work ${${_prefix}_${_library}_LIBRARY})
endif(_libraries_work) endif()
endforeach(_library ${_list}) endforeach()
if(_libraries_work) if(_libraries_work)
# Test this combination of libraries. # Test this combination of libraries.
set(CMAKE_REQUIRED_LIBRARIES ${_flags} ${${LIBRARIES}} ${_thread}) set(CMAKE_REQUIRED_LIBRARIES ${_flags} ${${LIBRARIES}} ${_thread})
@ -127,23 +127,23 @@ if(_libraries_work)
set(CMAKE_REQUIRED_LIBRARIES) set(CMAKE_REQUIRED_LIBRARIES)
mark_as_advanced(${_prefix}${_combined_name}_WORKS) mark_as_advanced(${_prefix}${_combined_name}_WORKS)
set(_libraries_work ${${_prefix}${_combined_name}_WORKS}) set(_libraries_work ${${_prefix}${_combined_name}_WORKS})
endif(_libraries_work) endif()
if(NOT _libraries_work) if(NOT _libraries_work)
set(${LIBRARIES} FALSE) set(${LIBRARIES} FALSE)
endif(NOT _libraries_work) endif()
#message("DEBUG: ${LIBRARIES} = ${${LIBRARIES}}") #message("DEBUG: ${LIBRARIES} = ${${LIBRARIES}}")
endmacro(Check_Fortran_Libraries) endmacro()
set(BLAS_LINKER_FLAGS) set(BLAS_LINKER_FLAGS)
set(BLAS_LIBRARIES) set(BLAS_LIBRARIES)
set(BLAS95_LIBRARIES) set(BLAS95_LIBRARIES)
if ($ENV{BLA_VENDOR} MATCHES ".+") if ($ENV{BLA_VENDOR} MATCHES ".+")
set(BLA_VENDOR $ENV{BLA_VENDOR}) set(BLA_VENDOR $ENV{BLA_VENDOR})
else ($ENV{BLA_VENDOR} MATCHES ".+") else ()
if(NOT BLA_VENDOR) if(NOT BLA_VENDOR)
set(BLA_VENDOR "All") set(BLA_VENDOR "All")
endif(NOT BLA_VENDOR) endif()
endif ($ENV{BLA_VENDOR} MATCHES ".+") endif ()
if (BLA_VENDOR STREQUAL "Goto" OR BLA_VENDOR STREQUAL "All") if (BLA_VENDOR STREQUAL "Goto" OR BLA_VENDOR STREQUAL "All")
if(NOT BLAS_LIBRARIES) if(NOT BLAS_LIBRARIES)
@ -156,8 +156,8 @@ if (BLA_VENDOR STREQUAL "Goto" OR BLA_VENDOR STREQUAL "All")
"goto2" "goto2"
"" ""
) )
endif(NOT BLAS_LIBRARIES) endif()
endif (BLA_VENDOR STREQUAL "Goto" OR BLA_VENDOR STREQUAL "All") endif ()
if (BLA_VENDOR STREQUAL "ATLAS" OR BLA_VENDOR STREQUAL "All") if (BLA_VENDOR STREQUAL "ATLAS" OR BLA_VENDOR STREQUAL "All")
if(NOT BLAS_LIBRARIES) if(NOT BLAS_LIBRARIES)
@ -170,8 +170,8 @@ if (BLA_VENDOR STREQUAL "ATLAS" OR BLA_VENDOR STREQUAL "All")
"f77blas;atlas" "f77blas;atlas"
"" ""
) )
endif(NOT BLAS_LIBRARIES) endif()
endif (BLA_VENDOR STREQUAL "ATLAS" OR BLA_VENDOR STREQUAL "All") endif ()
# BLAS in PhiPACK libraries? (requires generic BLAS lib, too) # BLAS in PhiPACK libraries? (requires generic BLAS lib, too)
if (BLA_VENDOR STREQUAL "PhiPACK" OR BLA_VENDOR STREQUAL "All") if (BLA_VENDOR STREQUAL "PhiPACK" OR BLA_VENDOR STREQUAL "All")
@ -184,8 +184,8 @@ if (BLA_VENDOR STREQUAL "PhiPACK" OR BLA_VENDOR STREQUAL "All")
"sgemm;dgemm;blas" "sgemm;dgemm;blas"
"" ""
) )
endif(NOT BLAS_LIBRARIES) endif()
endif (BLA_VENDOR STREQUAL "PhiPACK" OR BLA_VENDOR STREQUAL "All") endif ()
# BLAS in Alpha CXML library? # BLAS in Alpha CXML library?
if (BLA_VENDOR STREQUAL "CXML" OR BLA_VENDOR STREQUAL "All") if (BLA_VENDOR STREQUAL "CXML" OR BLA_VENDOR STREQUAL "All")
@ -198,8 +198,8 @@ if (BLA_VENDOR STREQUAL "CXML" OR BLA_VENDOR STREQUAL "All")
"cxml" "cxml"
"" ""
) )
endif(NOT BLAS_LIBRARIES) endif()
endif (BLA_VENDOR STREQUAL "CXML" OR BLA_VENDOR STREQUAL "All") endif ()
# BLAS in Alpha DXML library? (now called CXML, see above) # BLAS in Alpha DXML library? (now called CXML, see above)
if (BLA_VENDOR STREQUAL "DXML" OR BLA_VENDOR STREQUAL "All") if (BLA_VENDOR STREQUAL "DXML" OR BLA_VENDOR STREQUAL "All")
@ -212,8 +212,8 @@ if (BLA_VENDOR STREQUAL "DXML" OR BLA_VENDOR STREQUAL "All")
"dxml" "dxml"
"" ""
) )
endif(NOT BLAS_LIBRARIES) endif()
endif (BLA_VENDOR STREQUAL "DXML" OR BLA_VENDOR STREQUAL "All") endif ()
# BLAS in Sun Performance library? # BLAS in Sun Performance library?
if (BLA_VENDOR STREQUAL "SunPerf" OR BLA_VENDOR STREQUAL "All") if (BLA_VENDOR STREQUAL "SunPerf" OR BLA_VENDOR STREQUAL "All")
@ -228,9 +228,9 @@ if (BLA_VENDOR STREQUAL "SunPerf" OR BLA_VENDOR STREQUAL "All")
) )
if(BLAS_LIBRARIES) if(BLAS_LIBRARIES)
set(BLAS_LINKER_FLAGS "-xlic_lib=sunperf") set(BLAS_LINKER_FLAGS "-xlic_lib=sunperf")
endif(BLAS_LIBRARIES) endif()
endif(NOT BLAS_LIBRARIES) endif()
endif (BLA_VENDOR STREQUAL "SunPerf" OR BLA_VENDOR STREQUAL "All") endif ()
# BLAS in SCSL library? (SGI/Cray Scientific Library) # BLAS in SCSL library? (SGI/Cray Scientific Library)
if (BLA_VENDOR STREQUAL "SCSL" OR BLA_VENDOR STREQUAL "All") if (BLA_VENDOR STREQUAL "SCSL" OR BLA_VENDOR STREQUAL "All")
@ -243,8 +243,8 @@ if (BLA_VENDOR STREQUAL "SCSL" OR BLA_VENDOR STREQUAL "All")
"scsl" "scsl"
"" ""
) )
endif(NOT BLAS_LIBRARIES) endif()
endif (BLA_VENDOR STREQUAL "SCSL" OR BLA_VENDOR STREQUAL "All") endif ()
# BLAS in SGIMATH library? # BLAS in SGIMATH library?
if (BLA_VENDOR STREQUAL "SGIMATH" OR BLA_VENDOR STREQUAL "All") if (BLA_VENDOR STREQUAL "SGIMATH" OR BLA_VENDOR STREQUAL "All")
@ -257,8 +257,8 @@ if (BLA_VENDOR STREQUAL "SGIMATH" OR BLA_VENDOR STREQUAL "All")
"complib.sgimath" "complib.sgimath"
"" ""
) )
endif(NOT BLAS_LIBRARIES) endif()
endif (BLA_VENDOR STREQUAL "SGIMATH" OR BLA_VENDOR STREQUAL "All") endif ()
# BLAS in IBM ESSL library? (requires generic BLAS lib, too) # BLAS in IBM ESSL library? (requires generic BLAS lib, too)
if (BLA_VENDOR STREQUAL "IBMESSL" OR BLA_VENDOR STREQUAL "All") if (BLA_VENDOR STREQUAL "IBMESSL" OR BLA_VENDOR STREQUAL "All")
@ -271,8 +271,8 @@ if (BLA_VENDOR STREQUAL "IBMESSL" OR BLA_VENDOR STREQUAL "All")
"essl;blas" "essl;blas"
"" ""
) )
endif(NOT BLAS_LIBRARIES) endif()
endif (BLA_VENDOR STREQUAL "IBMESSL" OR BLA_VENDOR STREQUAL "All") endif ()
#BLAS in acml library? #BLAS in acml library?
if (BLA_VENDOR MATCHES "ACML.*" OR BLA_VENDOR STREQUAL "All") if (BLA_VENDOR MATCHES "ACML.*" OR BLA_VENDOR STREQUAL "All")
@ -321,7 +321,7 @@ if (BLA_VENDOR MATCHES "ACML.*" OR BLA_VENDOR STREQUAL "All")
elseif( CMAKE_Fortran_COMPILER_ID STREQUAL "NAG" ) elseif( CMAKE_Fortran_COMPILER_ID STREQUAL "NAG" )
set( _ACML_COMPILER32 "nag32" ) set( _ACML_COMPILER32 "nag32" )
set( _ACML_COMPILER64 "nag64" ) set( _ACML_COMPILER64 "nag64" )
else() #if( CMAKE_Fortran_COMPILER_ID STREQUAL "GNU" ) else()
set( _ACML_COMPILER32 "gfortran32" ) set( _ACML_COMPILER32 "gfortran32" )
set( _ACML_COMPILER64 "gfortran64" ) set( _ACML_COMPILER64 "gfortran64" )
endif() endif()
@ -330,7 +330,7 @@ if (BLA_VENDOR MATCHES "ACML.*" OR BLA_VENDOR STREQUAL "All")
set(_ACML_MP_LIB_DIRS set(_ACML_MP_LIB_DIRS
"${_ACML_ROOT}/${_ACML_COMPILER32}_mp${_ACML_PATH_SUFFIX}/lib" "${_ACML_ROOT}/${_ACML_COMPILER32}_mp${_ACML_PATH_SUFFIX}/lib"
"${_ACML_ROOT}/${_ACML_COMPILER64}_mp${_ACML_PATH_SUFFIX}/lib" ) "${_ACML_ROOT}/${_ACML_COMPILER64}_mp${_ACML_PATH_SUFFIX}/lib" )
else() #if( _BLAS_VENDOR STREQUAL "ACML" ) else()
set(_ACML_LIB_DIRS set(_ACML_LIB_DIRS
"${_ACML_ROOT}/${_ACML_COMPILER32}${_ACML_PATH_SUFFIX}/lib" "${_ACML_ROOT}/${_ACML_COMPILER32}${_ACML_PATH_SUFFIX}/lib"
"${_ACML_ROOT}/${_ACML_COMPILER64}${_ACML_PATH_SUFFIX}/lib" ) "${_ACML_ROOT}/${_ACML_COMPILER64}${_ACML_PATH_SUFFIX}/lib" )
@ -364,7 +364,7 @@ if (BLA_VENDOR MATCHES "ACML.*" OR BLA_VENDOR STREQUAL "All")
break() break()
endif() endif()
endforeach() endforeach()
else() #if( _BLAS_VENDOR STREQUAL "ACML" ) else()
foreach( BLAS_ACML_LIB_DIRS ${_ACML_LIB_DIRS} ) foreach( BLAS_ACML_LIB_DIRS ${_ACML_LIB_DIRS} )
check_fortran_libraries ( check_fortran_libraries (
BLAS_LIBRARIES BLAS_LIBRARIES
@ -388,7 +388,7 @@ if (BLA_VENDOR MATCHES "ACML.*" OR BLA_VENDOR STREQUAL "All")
"acml;acml_mv" "acml;acml_mv"
"" ""
) )
endif(NOT BLAS_LIBRARIES) endif()
if(NOT BLAS_LIBRARIES) if(NOT BLAS_LIBRARIES)
check_fortran_libraries( check_fortran_libraries(
BLAS_LIBRARIES BLAS_LIBRARIES
@ -398,7 +398,7 @@ if (BLA_VENDOR MATCHES "ACML.*" OR BLA_VENDOR STREQUAL "All")
"acml_mp;acml_mv" "acml_mp;acml_mv"
"" ""
) )
endif(NOT BLAS_LIBRARIES) endif()
if(NOT BLAS_LIBRARIES) if(NOT BLAS_LIBRARIES)
check_fortran_libraries( check_fortran_libraries(
BLAS_LIBRARIES BLAS_LIBRARIES
@ -408,7 +408,7 @@ if (BLA_VENDOR MATCHES "ACML.*" OR BLA_VENDOR STREQUAL "All")
"acml;acml_mv;CALBLAS" "acml;acml_mv;CALBLAS"
"" ""
) )
endif(NOT BLAS_LIBRARIES) endif()
endif () # ACML endif () # ACML
# Apple BLAS library? # Apple BLAS library?
@ -422,8 +422,8 @@ if(NOT BLAS_LIBRARIES)
"Accelerate" "Accelerate"
"" ""
) )
endif(NOT BLAS_LIBRARIES) endif()
endif (BLA_VENDOR STREQUAL "Apple" OR BLA_VENDOR STREQUAL "All") endif ()
if (BLA_VENDOR STREQUAL "NAS" OR BLA_VENDOR STREQUAL "All") if (BLA_VENDOR STREQUAL "NAS" OR BLA_VENDOR STREQUAL "All")
if ( NOT BLAS_LIBRARIES ) if ( NOT BLAS_LIBRARIES )
@ -435,8 +435,8 @@ if (BLA_VENDOR STREQUAL "NAS" OR BLA_VENDOR STREQUAL "All")
"vecLib" "vecLib"
"" ""
) )
endif ( NOT BLAS_LIBRARIES ) endif ()
endif (BLA_VENDOR STREQUAL "NAS" OR BLA_VENDOR STREQUAL "All") endif ()
# Generic BLAS library? # Generic BLAS library?
if (BLA_VENDOR STREQUAL "Generic" OR BLA_VENDOR STREQUAL "All") if (BLA_VENDOR STREQUAL "Generic" OR BLA_VENDOR STREQUAL "All")
if(NOT BLAS_LIBRARIES) if(NOT BLAS_LIBRARIES)
@ -448,8 +448,8 @@ if (BLA_VENDOR STREQUAL "Generic" OR BLA_VENDOR STREQUAL "All")
"blas" "blas"
"" ""
) )
endif(NOT BLAS_LIBRARIES) endif()
endif (BLA_VENDOR STREQUAL "Generic" OR BLA_VENDOR STREQUAL "All") endif ()
#BLAS in intel mkl 10 library? (em64t 64bit) #BLAS in intel mkl 10 library? (em64t 64bit)
if (BLA_VENDOR MATCHES "Intel*" OR BLA_VENDOR STREQUAL "All") if (BLA_VENDOR MATCHES "Intel*" OR BLA_VENDOR STREQUAL "All")
@ -459,9 +459,9 @@ if (BLA_VENDOR MATCHES "Intel*" OR BLA_VENDOR STREQUAL "All")
if (_LANGUAGES_ MATCHES C OR _LANGUAGES_ MATCHES CXX) if (_LANGUAGES_ MATCHES C OR _LANGUAGES_ MATCHES CXX)
if(BLAS_FIND_QUIETLY OR NOT BLAS_FIND_REQUIRED) if(BLAS_FIND_QUIETLY OR NOT BLAS_FIND_REQUIRED)
find_package(Threads) find_package(Threads)
else(BLAS_FIND_QUIETLY OR NOT BLAS_FIND_REQUIRED) else()
find_package(Threads REQUIRED) find_package(Threads REQUIRED)
endif(BLAS_FIND_QUIETLY OR NOT BLAS_FIND_REQUIRED) endif()
set(BLAS_SEARCH_LIBS "") set(BLAS_SEARCH_LIBS "")
@ -471,7 +471,7 @@ if (BLA_VENDOR MATCHES "Intel*" OR BLA_VENDOR STREQUAL "All")
if (WIN32) if (WIN32)
list(APPEND BLAS_SEARCH_LIBS list(APPEND BLAS_SEARCH_LIBS
"mkl_blas95 mkl_intel_c mkl_intel_thread mkl_core libguide40") "mkl_blas95 mkl_intel_c mkl_intel_thread mkl_core libguide40")
else (WIN32) else ()
if (BLA_VENDOR STREQUAL "Intel10_32" OR BLA_VENDOR STREQUAL "All") if (BLA_VENDOR STREQUAL "Intel10_32" OR BLA_VENDOR STREQUAL "All")
list(APPEND BLAS_SEARCH_LIBS list(APPEND BLAS_SEARCH_LIBS
"mkl_blas95 mkl_intel mkl_intel_thread mkl_core guide") "mkl_blas95 mkl_intel mkl_intel_thread mkl_core guide")
@ -490,18 +490,18 @@ if (BLA_VENDOR MATCHES "Intel*" OR BLA_VENDOR STREQUAL "All")
"mkl_blas95_lp64 mkl_intel_lp64 mkl_intel_thread mkl_core iomp5") "mkl_blas95_lp64 mkl_intel_lp64 mkl_intel_thread mkl_core iomp5")
endif () endif ()
endif () endif ()
endif (WIN32) endif ()
if (BLA_VENDOR STREQUAL "Intel10_64lp_seq" OR BLA_VENDOR STREQUAL "All") if (BLA_VENDOR STREQUAL "Intel10_64lp_seq" OR BLA_VENDOR STREQUAL "All")
list(APPEND BLAS_SEARCH_LIBS list(APPEND BLAS_SEARCH_LIBS
"mkl_blas95_lp64 mkl_intel_lp64 mkl_sequential mkl_core") "mkl_blas95_lp64 mkl_intel_lp64 mkl_sequential mkl_core")
endif () endif ()
else (BLA_F95) else ()
set(BLAS_mkl_SEARCH_SYMBOL sgemm) set(BLAS_mkl_SEARCH_SYMBOL sgemm)
set(_LIBRARIES BLAS_LIBRARIES) set(_LIBRARIES BLAS_LIBRARIES)
if (WIN32) if (WIN32)
list(APPEND BLAS_SEARCH_LIBS list(APPEND BLAS_SEARCH_LIBS
"mkl_c_dll mkl_intel_thread_dll mkl_core_dll libguide40") "mkl_c_dll mkl_intel_thread_dll mkl_core_dll libguide40")
else (WIN32) else ()
if (BLA_VENDOR STREQUAL "Intel10_32" OR BLA_VENDOR STREQUAL "All") if (BLA_VENDOR STREQUAL "Intel10_32" OR BLA_VENDOR STREQUAL "All")
list(APPEND BLAS_SEARCH_LIBS list(APPEND BLAS_SEARCH_LIBS
"mkl_intel mkl_intel_thread mkl_core guide") "mkl_intel mkl_intel_thread mkl_core guide")
@ -531,12 +531,12 @@ if (BLA_VENDOR MATCHES "Intel*" OR BLA_VENDOR STREQUAL "All")
list(APPEND BLAS_SEARCH_LIBS list(APPEND BLAS_SEARCH_LIBS
"mkl_em64t") "mkl_em64t")
endif () endif ()
endif (WIN32) endif ()
if (BLA_VENDOR STREQUAL "Intel10_64lp_seq" OR BLA_VENDOR STREQUAL "All") if (BLA_VENDOR STREQUAL "Intel10_64lp_seq" OR BLA_VENDOR STREQUAL "All")
list(APPEND BLAS_SEARCH_LIBS list(APPEND BLAS_SEARCH_LIBS
"mkl_intel_lp64 mkl_sequential mkl_core") "mkl_intel_lp64 mkl_sequential mkl_core")
endif () endif ()
endif (BLA_F95) endif ()
foreach (IT ${BLAS_SEARCH_LIBS}) foreach (IT ${BLAS_SEARCH_LIBS})
string(REPLACE " " ";" SEARCH_LIBS ${IT}) string(REPLACE " " ";" SEARCH_LIBS ${IT})
@ -553,54 +553,54 @@ if (BLA_VENDOR MATCHES "Intel*" OR BLA_VENDOR STREQUAL "All")
endif () endif ()
endforeach () endforeach ()
endif (_LANGUAGES_ MATCHES C OR _LANGUAGES_ MATCHES CXX) endif ()
endif (BLA_VENDOR MATCHES "Intel*" OR BLA_VENDOR STREQUAL "All") endif ()
if(BLA_F95) if(BLA_F95)
if(BLAS95_LIBRARIES) if(BLAS95_LIBRARIES)
set(BLAS95_FOUND TRUE) set(BLAS95_FOUND TRUE)
else(BLAS95_LIBRARIES) else()
set(BLAS95_FOUND FALSE) set(BLAS95_FOUND FALSE)
endif(BLAS95_LIBRARIES) endif()
if(NOT BLAS_FIND_QUIETLY) if(NOT BLAS_FIND_QUIETLY)
if(BLAS95_FOUND) if(BLAS95_FOUND)
message(STATUS "A library with BLAS95 API found.") message(STATUS "A library with BLAS95 API found.")
else(BLAS95_FOUND) else()
if(BLAS_FIND_REQUIRED) if(BLAS_FIND_REQUIRED)
message(FATAL_ERROR message(FATAL_ERROR
"A required library with BLAS95 API not found. Please specify library location.") "A required library with BLAS95 API not found. Please specify library location.")
else(BLAS_FIND_REQUIRED) else()
message(STATUS message(STATUS
"A library with BLAS95 API not found. Please specify library location.") "A library with BLAS95 API not found. Please specify library location.")
endif(BLAS_FIND_REQUIRED) endif()
endif(BLAS95_FOUND) endif()
endif(NOT BLAS_FIND_QUIETLY) endif()
set(BLAS_FOUND TRUE) set(BLAS_FOUND TRUE)
set(BLAS_LIBRARIES "${BLAS95_LIBRARIES}") set(BLAS_LIBRARIES "${BLAS95_LIBRARIES}")
else(BLA_F95) else()
if(BLAS_LIBRARIES) if(BLAS_LIBRARIES)
set(BLAS_FOUND TRUE) set(BLAS_FOUND TRUE)
else(BLAS_LIBRARIES) else()
set(BLAS_FOUND FALSE) set(BLAS_FOUND FALSE)
endif(BLAS_LIBRARIES) endif()
if(NOT BLAS_FIND_QUIETLY) if(NOT BLAS_FIND_QUIETLY)
if(BLAS_FOUND) if(BLAS_FOUND)
message(STATUS "A library with BLAS API found.") message(STATUS "A library with BLAS API found.")
else(BLAS_FOUND) else()
if(BLAS_FIND_REQUIRED) if(BLAS_FIND_REQUIRED)
message(FATAL_ERROR message(FATAL_ERROR
"A required library with BLAS API not found. Please specify library location." "A required library with BLAS API not found. Please specify library location."
) )
else(BLAS_FIND_REQUIRED) else()
message(STATUS message(STATUS
"A library with BLAS API not found. Please specify library location." "A library with BLAS API not found. Please specify library location."
) )
endif(BLAS_FIND_REQUIRED) endif()
endif(BLAS_FOUND) endif()
endif(NOT BLAS_FIND_QUIETLY) endif()
endif(BLA_F95) endif()
set(CMAKE_FIND_LIBRARY_SUFFIXES ${_blas_ORIG_CMAKE_FIND_LIBRARY_SUFFIXES}) set(CMAKE_FIND_LIBRARY_SUFFIXES ${_blas_ORIG_CMAKE_FIND_LIBRARY_SUFFIXES})

View File

@ -34,12 +34,12 @@ if (NOT BZIP2_LIBRARIES)
include(${CMAKE_CURRENT_LIST_DIR}/SelectLibraryConfigurations.cmake) include(${CMAKE_CURRENT_LIST_DIR}/SelectLibraryConfigurations.cmake)
SELECT_LIBRARY_CONFIGURATIONS(BZIP2) SELECT_LIBRARY_CONFIGURATIONS(BZIP2)
endif (NOT BZIP2_LIBRARIES) endif ()
if (BZIP2_INCLUDE_DIR AND EXISTS "${BZIP2_INCLUDE_DIR}/bzlib.h") if (BZIP2_INCLUDE_DIR AND EXISTS "${BZIP2_INCLUDE_DIR}/bzlib.h")
file(STRINGS "${BZIP2_INCLUDE_DIR}/bzlib.h" BZLIB_H REGEX "bzip2/libbzip2 version [0-9]+\\.[^ ]+ of [0-9]+ ") file(STRINGS "${BZIP2_INCLUDE_DIR}/bzlib.h" BZLIB_H REGEX "bzip2/libbzip2 version [0-9]+\\.[^ ]+ of [0-9]+ ")
string(REGEX REPLACE ".* bzip2/libbzip2 version ([0-9]+\\.[^ ]+) of [0-9]+ .*" "\\1" BZIP2_VERSION_STRING "${BZLIB_H}") string(REGEX REPLACE ".* bzip2/libbzip2 version ([0-9]+\\.[^ ]+) of [0-9]+ .*" "\\1" BZIP2_VERSION_STRING "${BZLIB_H}")
endif (BZIP2_INCLUDE_DIR AND EXISTS "${BZIP2_INCLUDE_DIR}/bzlib.h") endif ()
# handle the QUIETLY and REQUIRED arguments and set BZip2_FOUND to TRUE if # handle the QUIETLY and REQUIRED arguments and set BZip2_FOUND to TRUE if
# all listed variables are TRUE # all listed variables are TRUE
@ -51,6 +51,6 @@ FIND_PACKAGE_HANDLE_STANDARD_ARGS(BZip2
if (BZIP2_FOUND) if (BZIP2_FOUND)
include(CheckLibraryExists) include(CheckLibraryExists)
CHECK_LIBRARY_EXISTS("${BZIP2_LIBRARIES}" BZ2_bzCompressInit "" BZIP2_NEED_PREFIX) CHECK_LIBRARY_EXISTS("${BZIP2_LIBRARIES}" BZ2_bzCompressInit "" BZIP2_NEED_PREFIX)
endif (BZIP2_FOUND) endif ()
mark_as_advanced(BZIP2_INCLUDE_DIR) mark_as_advanced(BZIP2_INCLUDE_DIR)

View File

@ -361,16 +361,16 @@ macro(_Boost_ADJUST_LIB_VARS basename)
set(Boost_LIBRARY_DIRS ${Boost_LIBRARY_DIRS} CACHE FILEPATH "Boost library directory") set(Boost_LIBRARY_DIRS ${Boost_LIBRARY_DIRS} CACHE FILEPATH "Boost library directory")
set(Boost_${basename}_FOUND ON CACHE INTERNAL "Whether the Boost ${basename} library found") set(Boost_${basename}_FOUND ON CACHE INTERNAL "Whether the Boost ${basename} library found")
endif(Boost_${basename}_LIBRARY) endif()
endif(Boost_INCLUDE_DIR ) endif()
# Make variables changeble to the advanced user # Make variables changeble to the advanced user
mark_as_advanced( mark_as_advanced(
Boost_${basename}_LIBRARY Boost_${basename}_LIBRARY
Boost_${basename}_LIBRARY_RELEASE Boost_${basename}_LIBRARY_RELEASE
Boost_${basename}_LIBRARY_DEBUG Boost_${basename}_LIBRARY_DEBUG
) )
endmacro(_Boost_ADJUST_LIB_VARS) endmacro()
#------------------------------------------------------------------------------- #-------------------------------------------------------------------------------
@ -479,21 +479,21 @@ function(_Boost_GUESS_COMPILER_PREFIX _ret)
# In Boost 1.36.0 and newer, the mangled compiler name used # In Boost 1.36.0 and newer, the mangled compiler name used
# on Mac OS X/Darwin is "xgcc". # on Mac OS X/Darwin is "xgcc".
set(_boost_COMPILER "-xgcc${_boost_COMPILER_VERSION}") set(_boost_COMPILER "-xgcc${_boost_COMPILER_VERSION}")
else(${Boost_MINOR_VERSION} GREATER 35) else()
# In Boost <= 1.35.0, there is no mangled compiler name for # In Boost <= 1.35.0, there is no mangled compiler name for
# the Mac OS X/Darwin version of GCC. # the Mac OS X/Darwin version of GCC.
set(_boost_COMPILER "") set(_boost_COMPILER "")
endif(${Boost_MINOR_VERSION} GREATER 35) endif()
else(Boost_MINOR_VERSION) else()
# We don't know the Boost version, so assume it's # We don't know the Boost version, so assume it's
# pre-1.36.0. # pre-1.36.0.
set(_boost_COMPILER "") set(_boost_COMPILER "")
endif(Boost_MINOR_VERSION) endif()
else() else()
set(_boost_COMPILER "-gcc${_boost_COMPILER_VERSION}") set(_boost_COMPILER "-gcc${_boost_COMPILER_VERSION}")
endif() endif()
endif() endif()
endif (CMAKE_COMPILER_IS_GNUCXX) endif ()
else() else()
# TODO at least Boost_DEBUG here? # TODO at least Boost_DEBUG here?
set(_boost_COMPILER "") set(_boost_COMPILER "")
@ -525,7 +525,7 @@ if(Boost_FIND_VERSION_EXACT)
set(_boost_TEST_VERSIONS set(_boost_TEST_VERSIONS
"${Boost_FIND_VERSION_MAJOR}.${Boost_FIND_VERSION_MINOR}.${Boost_FIND_VERSION_PATCH}" "${Boost_FIND_VERSION_MAJOR}.${Boost_FIND_VERSION_MINOR}.${Boost_FIND_VERSION_PATCH}"
"${Boost_FIND_VERSION_MAJOR}.${Boost_FIND_VERSION_MINOR}") "${Boost_FIND_VERSION_MAJOR}.${Boost_FIND_VERSION_MINOR}")
else(Boost_FIND_VERSION_EXACT) else()
# The user has not requested an exact version. Among known # The user has not requested an exact version. Among known
# versions, find those that are acceptable to the user request. # versions, find those that are acceptable to the user request.
set(_Boost_KNOWN_VERSIONS ${Boost_ADDITIONAL_VERSIONS} set(_Boost_KNOWN_VERSIONS ${Boost_ADDITIONAL_VERSIONS}
@ -549,12 +549,12 @@ else(Boost_FIND_VERSION_EXACT)
# the patch level dropped. # the patch level dropped.
list(APPEND _boost_TEST_VERSIONS "${version}") list(APPEND _boost_TEST_VERSIONS "${version}")
endif() endif()
endforeach(version) endforeach()
else(Boost_FIND_VERSION) else()
# Any version is acceptable. # Any version is acceptable.
set(_boost_TEST_VERSIONS "${_Boost_KNOWN_VERSIONS}") set(_boost_TEST_VERSIONS "${_Boost_KNOWN_VERSIONS}")
endif(Boost_FIND_VERSION) endif()
endif(Boost_FIND_VERSION_EXACT) endif()
# The reason that we failed to find Boost. This will be set to a # The reason that we failed to find Boost. This will be set to a
# user-friendly message when we fail to find some necessary piece of # user-friendly message when we fail to find some necessary piece of
@ -597,7 +597,7 @@ set(Boost_ERROR_REASON)
# for linking. # for linking.
set(Boost_LIB_DIAGNOSTIC_DEFINITIONS set(Boost_LIB_DIAGNOSTIC_DEFINITIONS
"-DBOOST_LIB_DIAGNOSTIC" CACHE STRING "Boost diagnostic define") "-DBOOST_LIB_DIAGNOSTIC" CACHE STRING "Boost diagnostic define")
endif(WIN32) endif()
set(_boost_INCLUDE_SEARCH_DIRS_SYSTEM set(_boost_INCLUDE_SEARCH_DIRS_SYSTEM
C:/boost/include C:/boost/include
@ -671,7 +671,7 @@ set(Boost_ERROR_REASON)
file(TO_CMAKE_PATH ${BOOST_INCLUDEDIR} BOOST_INCLUDEDIR) file(TO_CMAKE_PATH ${BOOST_INCLUDEDIR} BOOST_INCLUDEDIR)
set(_boost_INCLUDE_SEARCH_DIRS set(_boost_INCLUDE_SEARCH_DIRS
${BOOST_INCLUDEDIR} ${_boost_INCLUDE_SEARCH_DIRS}) ${BOOST_INCLUDEDIR} ${_boost_INCLUDE_SEARCH_DIRS})
endif( BOOST_INCLUDEDIR ) endif()
# ------------------------------------------------------------------------ # ------------------------------------------------------------------------
# Search for Boost include DIR # Search for Boost include DIR
@ -699,7 +699,7 @@ set(Boost_ERROR_REASON)
list(APPEND _boost_PATH_SUFFIXES "boost-${_boost_BOOSTIFIED_VERSION}") list(APPEND _boost_PATH_SUFFIXES "boost-${_boost_BOOSTIFIED_VERSION}")
list(APPEND _boost_PATH_SUFFIXES "boost_${_boost_BOOSTIFIED_VERSION}") list(APPEND _boost_PATH_SUFFIXES "boost_${_boost_BOOSTIFIED_VERSION}")
endforeach(_boost_VER) endforeach()
if(Boost_DEBUG) if(Boost_DEBUG)
message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] " message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] "
@ -717,7 +717,7 @@ set(Boost_ERROR_REASON)
PATH_SUFFIXES ${_boost_PATH_SUFFIXES} PATH_SUFFIXES ${_boost_PATH_SUFFIXES}
${_boost_FIND_OPTIONS} ${_boost_FIND_OPTIONS}
) )
endif( NOT Boost_INCLUDE_DIR ) endif()
# ------------------------------------------------------------------------ # ------------------------------------------------------------------------
# Extract version information from version.hpp # Extract version information from version.hpp
@ -748,16 +748,16 @@ set(Boost_ERROR_REASON)
set(Boost_ERROR_REASON set(Boost_ERROR_REASON
"${Boost_ERROR_REASON}Boost version: ${Boost_MAJOR_VERSION}.${Boost_MINOR_VERSION}.${Boost_SUBMINOR_VERSION}\nBoost include path: ${Boost_INCLUDE_DIR}") "${Boost_ERROR_REASON}Boost version: ${Boost_MAJOR_VERSION}.${Boost_MINOR_VERSION}.${Boost_SUBMINOR_VERSION}\nBoost include path: ${Boost_INCLUDE_DIR}")
endif(NOT "${Boost_VERSION}" STREQUAL "0") endif()
if(Boost_DEBUG) if(Boost_DEBUG)
message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] " message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] "
"version.hpp reveals boost " "version.hpp reveals boost "
"${Boost_MAJOR_VERSION}.${Boost_MINOR_VERSION}.${Boost_SUBMINOR_VERSION}") "${Boost_MAJOR_VERSION}.${Boost_MINOR_VERSION}.${Boost_SUBMINOR_VERSION}")
endif() endif()
else(Boost_INCLUDE_DIR) else()
set(Boost_ERROR_REASON set(Boost_ERROR_REASON
"${Boost_ERROR_REASON}Unable to find the Boost header files. Please set BOOST_ROOT to the root directory containing Boost or BOOST_INCLUDEDIR to the directory containing Boost's headers.") "${Boost_ERROR_REASON}Unable to find the Boost header files. Please set BOOST_ROOT to the root directory containing Boost or BOOST_INCLUDEDIR to the directory containing Boost's headers.")
endif(Boost_INCLUDE_DIR) endif()
# ------------------------------------------------------------------------ # ------------------------------------------------------------------------
# Suffix initialization and compiler suffix detection. # Suffix initialization and compiler suffix detection.
@ -1007,7 +1007,7 @@ set(Boost_ERROR_REASON)
_Boost_ADJUST_LIB_VARS(${UPPERCOMPONENT}) _Boost_ADJUST_LIB_VARS(${UPPERCOMPONENT})
endforeach(COMPONENT) endforeach()
# Restore the original find library ordering # Restore the original find library ordering
if( Boost_USE_STATIC_LIBS ) if( Boost_USE_STATIC_LIBS )
@ -1044,9 +1044,9 @@ set(Boost_ERROR_REASON)
if( Boost_FIND_VERSION_PATCH AND Boost_SUBMINOR_VERSION LESS "${Boost_FIND_VERSION_PATCH}" ) if( Boost_FIND_VERSION_PATCH AND Boost_SUBMINOR_VERSION LESS "${Boost_FIND_VERSION_PATCH}" )
set( Boost_FOUND FALSE ) set( Boost_FOUND FALSE )
set(_Boost_VERSION_AGE "old") set(_Boost_VERSION_AGE "old")
endif( Boost_FIND_VERSION_PATCH AND Boost_SUBMINOR_VERSION LESS "${Boost_FIND_VERSION_PATCH}" ) endif()
endif( Boost_MINOR_VERSION LESS "${Boost_FIND_VERSION_MINOR}" ) endif()
endif( Boost_MAJOR_VERSION LESS "${Boost_FIND_VERSION_MAJOR}" ) endif()
if (NOT Boost_FOUND) if (NOT Boost_FOUND)
_Boost_MARK_COMPONENTS_FOUND(OFF) _Boost_MARK_COMPONENTS_FOUND(OFF)
@ -1061,7 +1061,7 @@ set(Boost_ERROR_REASON)
# If the user didn't specify a patchlevel, it's 0. # If the user didn't specify a patchlevel, it's 0.
if (NOT Boost_FIND_VERSION_PATCH) if (NOT Boost_FIND_VERSION_PATCH)
set(Boost_FIND_VERSION_PATCH 0) set(Boost_FIND_VERSION_PATCH 0)
endif (NOT Boost_FIND_VERSION_PATCH) endif ()
# We'll set Boost_FOUND true again if we have an exact version match. # We'll set Boost_FOUND true again if we have an exact version match.
set(Boost_FOUND FALSE) set(Boost_FOUND FALSE)
@ -1071,10 +1071,10 @@ set(Boost_ERROR_REASON)
if(Boost_SUBMINOR_VERSION EQUAL "${Boost_FIND_VERSION_PATCH}" ) if(Boost_SUBMINOR_VERSION EQUAL "${Boost_FIND_VERSION_PATCH}" )
set( Boost_FOUND TRUE ) set( Boost_FOUND TRUE )
_Boost_MARK_COMPONENTS_FOUND(ON) _Boost_MARK_COMPONENTS_FOUND(ON)
endif(Boost_SUBMINOR_VERSION EQUAL "${Boost_FIND_VERSION_PATCH}" ) endif()
endif( Boost_MINOR_VERSION EQUAL "${Boost_FIND_VERSION_MINOR}" ) endif()
endif( Boost_MAJOR_VERSION EQUAL "${Boost_FIND_VERSION_MAJOR}" ) endif()
endif (Boost_FOUND AND Boost_FIND_VERSION_EXACT) endif ()
if(NOT Boost_FOUND) if(NOT Boost_FOUND)
# State that we found a version of Boost that is too new or too old. # State that we found a version of Boost that is too new or too old.
@ -1083,12 +1083,12 @@ set(Boost_ERROR_REASON)
if (Boost_FIND_VERSION_PATCH) if (Boost_FIND_VERSION_PATCH)
set(Boost_ERROR_REASON set(Boost_ERROR_REASON
"${Boost_ERROR_REASON}.${Boost_FIND_VERSION_PATCH}") "${Boost_ERROR_REASON}.${Boost_FIND_VERSION_PATCH}")
endif (Boost_FIND_VERSION_PATCH) endif ()
if (NOT Boost_FIND_VERSION_EXACT) if (NOT Boost_FIND_VERSION_EXACT)
set(Boost_ERROR_REASON "${Boost_ERROR_REASON} (or newer)") set(Boost_ERROR_REASON "${Boost_ERROR_REASON} (or newer)")
endif (NOT Boost_FIND_VERSION_EXACT) endif ()
set(Boost_ERROR_REASON "${Boost_ERROR_REASON}.") set(Boost_ERROR_REASON "${Boost_ERROR_REASON}.")
endif (NOT Boost_FOUND) endif ()
# Always check for missing components # Always check for missing components
set(_boost_CHECKED_COMPONENT FALSE) set(_boost_CHECKED_COMPONENT FALSE)
@ -1101,7 +1101,7 @@ set(Boost_ERROR_REASON)
list(APPEND _Boost_MISSING_COMPONENTS ${COMPONENT}) list(APPEND _Boost_MISSING_COMPONENTS ${COMPONENT})
set( Boost_FOUND FALSE) set( Boost_FOUND FALSE)
endif() endif()
endforeach(COMPONENT) endforeach()
if(Boost_DEBUG) if(Boost_DEBUG)
message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] Boost_FOUND = ${Boost_FOUND}") message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] Boost_FOUND = ${Boost_FOUND}")
@ -1115,18 +1115,18 @@ set(Boost_ERROR_REASON)
foreach(COMPONENT ${_Boost_MISSING_COMPONENTS}) foreach(COMPONENT ${_Boost_MISSING_COMPONENTS})
set(Boost_ERROR_REASON set(Boost_ERROR_REASON
"${Boost_ERROR_REASON} boost_${COMPONENT}\n") "${Boost_ERROR_REASON} boost_${COMPONENT}\n")
endforeach(COMPONENT) endforeach()
list(LENGTH Boost_FIND_COMPONENTS Boost_NUM_COMPONENTS_WANTED) list(LENGTH Boost_FIND_COMPONENTS Boost_NUM_COMPONENTS_WANTED)
list(LENGTH _Boost_MISSING_COMPONENTS Boost_NUM_MISSING_COMPONENTS) list(LENGTH _Boost_MISSING_COMPONENTS Boost_NUM_MISSING_COMPONENTS)
if (${Boost_NUM_COMPONENTS_WANTED} EQUAL ${Boost_NUM_MISSING_COMPONENTS}) if (${Boost_NUM_COMPONENTS_WANTED} EQUAL ${Boost_NUM_MISSING_COMPONENTS})
set(Boost_ERROR_REASON set(Boost_ERROR_REASON
"${Boost_ERROR_REASON}No Boost libraries were found. You may need to set BOOST_LIBRARYDIR to the directory containing Boost libraries or BOOST_ROOT to the location of Boost.") "${Boost_ERROR_REASON}No Boost libraries were found. You may need to set BOOST_LIBRARYDIR to the directory containing Boost libraries or BOOST_ROOT to the location of Boost.")
else (${Boost_NUM_COMPONENTS_WANTED} EQUAL ${Boost_NUM_MISSING_COMPONENTS}) else ()
set(Boost_ERROR_REASON set(Boost_ERROR_REASON
"${Boost_ERROR_REASON}Some (but not all) of the required Boost libraries were found. You may need to install these additional Boost libraries. Alternatively, set BOOST_LIBRARYDIR to the directory containing Boost libraries or BOOST_ROOT to the location of Boost.") "${Boost_ERROR_REASON}Some (but not all) of the required Boost libraries were found. You may need to install these additional Boost libraries. Alternatively, set BOOST_LIBRARYDIR to the directory containing Boost libraries or BOOST_ROOT to the location of Boost.")
endif (${Boost_NUM_COMPONENTS_WANTED} EQUAL ${Boost_NUM_MISSING_COMPONENTS}) endif ()
endif (_Boost_MISSING_COMPONENTS) endif ()
if( NOT Boost_LIBRARY_DIRS AND NOT _boost_CHECKED_COMPONENT ) if( NOT Boost_LIBRARY_DIRS AND NOT _boost_CHECKED_COMPONENT )
# Compatibility Code for backwards compatibility with CMake # Compatibility Code for backwards compatibility with CMake
@ -1160,11 +1160,11 @@ set(Boost_ERROR_REASON)
set(Boost_LIBRARY_DIRS ${_boost_LIB_DIR} CACHE FILEPATH "Boost library directory") set(Boost_LIBRARY_DIRS ${_boost_LIB_DIR} CACHE FILEPATH "Boost library directory")
endif() endif()
endif( NOT Boost_LIBRARY_DIRS AND NOT _boost_CHECKED_COMPONENT ) endif()
else(Boost_INCLUDE_DIR) else()
set( Boost_FOUND FALSE) set( Boost_FOUND FALSE)
endif(Boost_INCLUDE_DIR) endif()
# ------------------------------------------------------------------------ # ------------------------------------------------------------------------
# Notification to end user about what was found # Notification to end user about what was found
@ -1176,16 +1176,16 @@ set(Boost_ERROR_REASON)
if(Boost_FIND_COMPONENTS) if(Boost_FIND_COMPONENTS)
message(STATUS "Found the following Boost libraries:") message(STATUS "Found the following Boost libraries:")
endif() endif()
endif(NOT Boost_FIND_QUIETLY) endif()
foreach( COMPONENT ${Boost_FIND_COMPONENTS} ) foreach( COMPONENT ${Boost_FIND_COMPONENTS} )
string( TOUPPER ${COMPONENT} UPPERCOMPONENT ) string( TOUPPER ${COMPONENT} UPPERCOMPONENT )
if( Boost_${UPPERCOMPONENT}_FOUND ) if( Boost_${UPPERCOMPONENT}_FOUND )
if(NOT Boost_FIND_QUIETLY) if(NOT Boost_FIND_QUIETLY)
message (STATUS " ${COMPONENT}") message (STATUS " ${COMPONENT}")
endif(NOT Boost_FIND_QUIETLY) endif()
set(Boost_LIBRARIES ${Boost_LIBRARIES} ${Boost_${UPPERCOMPONENT}_LIBRARY}) set(Boost_LIBRARIES ${Boost_LIBRARIES} ${Boost_${UPPERCOMPONENT}_LIBRARY})
endif( Boost_${UPPERCOMPONENT}_FOUND ) endif()
endforeach(COMPONENT) endforeach()
else() else()
if(Boost_FIND_REQUIRED) if(Boost_FIND_REQUIRED)
message(SEND_ERROR "Unable to find the requested Boost libraries.\n${Boost_ERROR_REASON}") message(SEND_ERROR "Unable to find the requested Boost libraries.\n${Boost_ERROR_REASON}")
@ -1201,7 +1201,7 @@ set(Boost_ERROR_REASON)
message(STATUS "Could NOT find Boost") message(STATUS "Could NOT find Boost")
endif() endif()
endif() endif()
endif(Boost_FIND_REQUIRED) endif()
endif() endif()
# show the Boost_INCLUDE_DIRS AND Boost_LIBRARIES variables only in the advanced view # show the Boost_INCLUDE_DIRS AND Boost_LIBRARIES variables only in the advanced view

View File

@ -25,7 +25,7 @@
if(NOT CABLE) if(NOT CABLE)
find_path(CABLE_BUILD_DIR cableVersion.h) find_path(CABLE_BUILD_DIR cableVersion.h)
endif(NOT CABLE) endif()
if(CABLE_BUILD_DIR) if(CABLE_BUILD_DIR)
load_cache(${CABLE_BUILD_DIR} load_cache(${CABLE_BUILD_DIR}
@ -43,25 +43,25 @@ if(CABLE_BUILD_DIR)
find_library(CABLE_TCL_LIBRARY NAMES CableTclFacility PATHS find_library(CABLE_TCL_LIBRARY NAMES CableTclFacility PATHS
${CABLE_LIBRARY_PATH} ${CABLE_LIBRARY_PATH}
${CABLE_LIBRARY_PATH}/*) ${CABLE_LIBRARY_PATH}/*)
else(CABLE_LIBRARY_PATH) else()
find_library(CABLE_TCL_LIBRARY NAMES CableTclFacility PATHS find_library(CABLE_TCL_LIBRARY NAMES CableTclFacility PATHS
${CABLE_BINARY_DIR}/CableTclFacility ${CABLE_BINARY_DIR}/CableTclFacility
${CABLE_BINARY_DIR}/CableTclFacility/*) ${CABLE_BINARY_DIR}/CableTclFacility/*)
endif(CABLE_LIBRARY_PATH) endif()
if(CABLE_EXECUTABLE_PATH) if(CABLE_EXECUTABLE_PATH)
find_program(CABLE NAMES cable PATHS find_program(CABLE NAMES cable PATHS
${CABLE_EXECUTABLE_PATH} ${CABLE_EXECUTABLE_PATH}
${CABLE_EXECUTABLE_PATH}/*) ${CABLE_EXECUTABLE_PATH}/*)
else(CABLE_EXECUTABLE_PATH) else()
find_program(CABLE NAMES cable PATHS find_program(CABLE NAMES cable PATHS
${CABLE_BINARY_DIR}/Executables ${CABLE_BINARY_DIR}/Executables
${CABLE_BINARY_DIR}/Executables/*) ${CABLE_BINARY_DIR}/Executables/*)
endif(CABLE_EXECUTABLE_PATH) endif()
find_path(CABLE_INCLUDE_DIR CableTclFacility/ctCalls.h find_path(CABLE_INCLUDE_DIR CableTclFacility/ctCalls.h
${CABLE_SOURCE_DIR}) ${CABLE_SOURCE_DIR})
else(CABLE_BUILD_DIR) else()
# Find the cable executable in the path. # Find the cable executable in the path.
find_program(CABLE NAMES cable) find_program(CABLE NAMES cable)
@ -78,4 +78,4 @@ else(CABLE_BUILD_DIR)
# executable. # executable.
find_library(CABLE_TCL_LIBRARY NAMES CableTclFacility PATHS find_library(CABLE_TCL_LIBRARY NAMES CableTclFacility PATHS
${CABLE_ROOT_BIN}/../lib/Cable) ${CABLE_ROOT_BIN}/../lib/Cable)
endif(CABLE_BUILD_DIR) endif()

View File

@ -291,7 +291,7 @@ macro(CUDA_FIND_HELPER_FILE _name _extension)
endif() endif()
# Set this variable as internal, so the user isn't bugged with it. # Set this variable as internal, so the user isn't bugged with it.
set(CUDA_${_name} ${CUDA_${_name}} CACHE INTERNAL "Location of ${_full_name}" FORCE) set(CUDA_${_name} ${CUDA_${_name}} CACHE INTERNAL "Location of ${_full_name}" FORCE)
endmacro(CUDA_FIND_HELPER_FILE) endmacro()
##################################################################### #####################################################################
## CUDA_INCLUDE_NVCC_DEPENDENCIES ## CUDA_INCLUDE_NVCC_DEPENDENCIES
@ -339,12 +339,12 @@ macro(CUDA_INCLUDE_NVCC_DEPENDENCIES dependency_file)
#message("file ${f} not found") #message("file ${f} not found")
set(CUDA_NVCC_DEPEND_REGENERATE TRUE) set(CUDA_NVCC_DEPEND_REGENERATE TRUE)
endif() endif()
endforeach(f) endforeach()
else(CUDA_NVCC_DEPEND) else()
#message("CUDA_NVCC_DEPEND false") #message("CUDA_NVCC_DEPEND false")
# No dependencies, so regenerate the file. # No dependencies, so regenerate the file.
set(CUDA_NVCC_DEPEND_REGENERATE TRUE) set(CUDA_NVCC_DEPEND_REGENERATE TRUE)
endif(CUDA_NVCC_DEPEND) endif()
#message("CUDA_NVCC_DEPEND_REGENERATE = ${CUDA_NVCC_DEPEND_REGENERATE}") #message("CUDA_NVCC_DEPEND_REGENERATE = ${CUDA_NVCC_DEPEND_REGENERATE}")
# No incoming dependencies, so we need to generate them. Make the # No incoming dependencies, so we need to generate them. Make the
@ -354,9 +354,9 @@ macro(CUDA_INCLUDE_NVCC_DEPENDENCIES dependency_file)
set(CUDA_NVCC_DEPEND ${dependency_file}) set(CUDA_NVCC_DEPEND ${dependency_file})
#message("Generating an empty dependency_file: ${dependency_file}") #message("Generating an empty dependency_file: ${dependency_file}")
file(WRITE ${dependency_file} "#FindCUDA.cmake generated file. Do not edit.\n") file(WRITE ${dependency_file} "#FindCUDA.cmake generated file. Do not edit.\n")
endif(CUDA_NVCC_DEPEND_REGENERATE) endif()
endmacro(CUDA_INCLUDE_NVCC_DEPENDENCIES) endmacro()
############################################################################### ###############################################################################
############################################################################### ###############################################################################
@ -482,15 +482,15 @@ if(NOT CUDA_TOOLKIT_ROOT_DIR)
string(REGEX REPLACE "[/\\\\]?bin[64]*[/\\\\]?$" "" CUDA_TOOLKIT_ROOT_DIR ${CUDA_TOOLKIT_ROOT_DIR}) string(REGEX REPLACE "[/\\\\]?bin[64]*[/\\\\]?$" "" CUDA_TOOLKIT_ROOT_DIR ${CUDA_TOOLKIT_ROOT_DIR})
# We need to force this back into the cache. # We need to force this back into the cache.
set(CUDA_TOOLKIT_ROOT_DIR ${CUDA_TOOLKIT_ROOT_DIR} CACHE PATH "Toolkit location." FORCE) set(CUDA_TOOLKIT_ROOT_DIR ${CUDA_TOOLKIT_ROOT_DIR} CACHE PATH "Toolkit location." FORCE)
endif(CUDA_TOOLKIT_ROOT_DIR) endif()
if (NOT EXISTS ${CUDA_TOOLKIT_ROOT_DIR}) if (NOT EXISTS ${CUDA_TOOLKIT_ROOT_DIR})
if(CUDA_FIND_REQUIRED) if(CUDA_FIND_REQUIRED)
message(FATAL_ERROR "Specify CUDA_TOOLKIT_ROOT_DIR") message(FATAL_ERROR "Specify CUDA_TOOLKIT_ROOT_DIR")
elseif(NOT CUDA_FIND_QUIETLY) elseif(NOT CUDA_FIND_QUIETLY)
message("CUDA_TOOLKIT_ROOT_DIR not found or specified") message("CUDA_TOOLKIT_ROOT_DIR not found or specified")
endif() endif()
endif (NOT EXISTS ${CUDA_TOOLKIT_ROOT_DIR}) endif ()
endif (NOT CUDA_TOOLKIT_ROOT_DIR) endif ()
# CUDA_NVCC_EXECUTABLE # CUDA_NVCC_EXECUTABLE
find_program(CUDA_NVCC_EXECUTABLE find_program(CUDA_NVCC_EXECUTABLE
@ -595,7 +595,7 @@ find_library_local_first(CUDA_CUDA_LIBRARY cuda "\"cuda\" library (older version
# Add cuda library to the link line only if it is found. # Add cuda library to the link line only if it is found.
if (CUDA_CUDA_LIBRARY) if (CUDA_CUDA_LIBRARY)
set(CUDA_LIBRARIES ${CUDA_LIBRARIES} ${CUDA_CUDA_LIBRARY}) set(CUDA_LIBRARIES ${CUDA_LIBRARIES} ${CUDA_CUDA_LIBRARY})
endif(CUDA_CUDA_LIBRARY) endif()
mark_as_advanced( mark_as_advanced(
CUDA_CUDA_LIBRARY CUDA_CUDA_LIBRARY
@ -607,7 +607,7 @@ mark_as_advanced(
macro(FIND_CUDA_HELPER_LIBS _name) macro(FIND_CUDA_HELPER_LIBS _name)
find_library_local_first(CUDA_${_name}_LIBRARY ${_name} "\"${_name}\" library") find_library_local_first(CUDA_${_name}_LIBRARY ${_name} "\"${_name}\" library")
mark_as_advanced(CUDA_${_name}_LIBRARY) mark_as_advanced(CUDA_${_name}_LIBRARY)
endmacro(FIND_CUDA_HELPER_LIBS) endmacro()
####################### #######################
# Disable emulation for v3.1 onward # Disable emulation for v3.1 onward
@ -691,9 +691,9 @@ set(CUDA_SDK_SEARCH_PATH
# if(CMAKE_SIZEOF_VOID_P EQUAL 8) # if(CMAKE_SIZEOF_VOID_P EQUAL 8)
# set(cuda_cutil_name cutil64) # set(cuda_cutil_name cutil64)
# else(CMAKE_SIZEOF_VOID_P EQUAL 8) # else()
# set(cuda_cutil_name cutil32) # set(cuda_cutil_name cutil32)
# endif(CMAKE_SIZEOF_VOID_P EQUAL 8) # endif()
# find_library(CUDA_CUT_LIBRARY # find_library(CUDA_CUT_LIBRARY
# NAMES cutil ${cuda_cutil_name} # NAMES cutil ${cuda_cutil_name}
@ -743,8 +743,8 @@ find_package_handle_standard_args(CUDA
macro(CUDA_INCLUDE_DIRECTORIES) macro(CUDA_INCLUDE_DIRECTORIES)
foreach(dir ${ARGN}) foreach(dir ${ARGN})
list(APPEND CUDA_NVCC_INCLUDE_ARGS_USER -I${dir}) list(APPEND CUDA_NVCC_INCLUDE_ARGS_USER -I${dir})
endforeach(dir ${ARGN}) endforeach()
endmacro(CUDA_INCLUDE_DIRECTORIES) endmacro()
############################################################################## ##############################################################################
@ -914,20 +914,20 @@ macro(CUDA_WRAP_SRCS cuda_target format generated_files)
if (CUDA_BUILD_EMULATION) if (CUDA_BUILD_EMULATION)
# Emulation. # Emulation.
set(nvcc_flags ${nvcc_flags} --device-emulation -D_DEVICEEMU -g) set(nvcc_flags ${nvcc_flags} --device-emulation -D_DEVICEEMU -g)
else(CUDA_BUILD_EMULATION) else()
# Device mode. No flags necessary. # Device mode. No flags necessary.
endif(CUDA_BUILD_EMULATION) endif()
if(CUDA_HOST_COMPILATION_CPP) if(CUDA_HOST_COMPILATION_CPP)
set(CUDA_C_OR_CXX CXX) set(CUDA_C_OR_CXX CXX)
else(CUDA_HOST_COMPILATION_CPP) else()
if(CUDA_VERSION VERSION_LESS "3.0") if(CUDA_VERSION VERSION_LESS "3.0")
set(nvcc_flags ${nvcc_flags} --host-compilation C) set(nvcc_flags ${nvcc_flags} --host-compilation C)
else() else()
message(WARNING "--host-compilation flag is deprecated in CUDA version >= 3.0. Removing --host-compilation C flag" ) message(WARNING "--host-compilation flag is deprecated in CUDA version >= 3.0. Removing --host-compilation C flag" )
endif() endif()
set(CUDA_C_OR_CXX C) set(CUDA_C_OR_CXX C)
endif(CUDA_HOST_COMPILATION_CPP) endif()
set(generated_extension ${CMAKE_${CUDA_C_OR_CXX}_OUTPUT_EXTENSION}) set(generated_extension ${CMAKE_${CUDA_C_OR_CXX}_OUTPUT_EXTENSION})
@ -1080,11 +1080,11 @@ macro(CUDA_WRAP_SRCS cuda_target format generated_files)
set(generated_file_basename "${cuda_target}_generated_${basename}.ptx") set(generated_file_basename "${cuda_target}_generated_${basename}.ptx")
set(format_flag "-ptx") set(format_flag "-ptx")
file(MAKE_DIRECTORY "${cuda_compile_output_dir}") file(MAKE_DIRECTORY "${cuda_compile_output_dir}")
else( compile_to_ptx ) else()
set(generated_file_path "${cuda_compile_output_dir}/${CMAKE_CFG_INTDIR}") set(generated_file_path "${cuda_compile_output_dir}/${CMAKE_CFG_INTDIR}")
set(generated_file_basename "${cuda_target}_generated_${basename}${generated_extension}") set(generated_file_basename "${cuda_target}_generated_${basename}${generated_extension}")
set(format_flag "-c") set(format_flag "-c")
endif( compile_to_ptx ) endif()
# Set all of our file names. Make sure that whatever filenames that have # Set all of our file names. Make sure that whatever filenames that have
# generated_file_path in them get passed in through as a command line # generated_file_path in them get passed in through as a command line
@ -1118,17 +1118,17 @@ macro(CUDA_WRAP_SRCS cuda_target format generated_files)
# Convience string for output ########################################### # Convience string for output ###########################################
if(CUDA_BUILD_EMULATION) if(CUDA_BUILD_EMULATION)
set(cuda_build_type "Emulation") set(cuda_build_type "Emulation")
else(CUDA_BUILD_EMULATION) else()
set(cuda_build_type "Device") set(cuda_build_type "Device")
endif(CUDA_BUILD_EMULATION) endif()
# Build the NVCC made dependency file ################################### # Build the NVCC made dependency file ###################################
set(build_cubin OFF) set(build_cubin OFF)
if ( NOT CUDA_BUILD_EMULATION AND CUDA_BUILD_CUBIN ) if ( NOT CUDA_BUILD_EMULATION AND CUDA_BUILD_CUBIN )
if ( NOT compile_to_ptx ) if ( NOT compile_to_ptx )
set ( build_cubin ON ) set ( build_cubin ON )
endif( NOT compile_to_ptx ) endif()
endif( NOT CUDA_BUILD_EMULATION AND CUDA_BUILD_CUBIN ) endif()
# Configure the build script # Configure the build script
configure_file("${CUDA_run_nvcc}" "${custom_target_script}" @ONLY) configure_file("${CUDA_run_nvcc}" "${custom_target_script}" @ONLY)
@ -1203,12 +1203,12 @@ macro(CUDA_WRAP_SRCS cuda_target format generated_files)
list(REMOVE_DUPLICATES CUDA_ADDITIONAL_CLEAN_FILES) list(REMOVE_DUPLICATES CUDA_ADDITIONAL_CLEAN_FILES)
set(CUDA_ADDITIONAL_CLEAN_FILES ${CUDA_ADDITIONAL_CLEAN_FILES} CACHE INTERNAL "List of intermediate files that are part of the cuda dependency scanning.") set(CUDA_ADDITIONAL_CLEAN_FILES ${CUDA_ADDITIONAL_CLEAN_FILES} CACHE INTERNAL "List of intermediate files that are part of the cuda dependency scanning.")
endif(${file} MATCHES ".*\\.cu$" AND NOT _is_header) endif()
endforeach(file) endforeach()
# Set the return parameter # Set the return parameter
set(${generated_files} ${_cuda_wrap_generated_files}) set(${generated_files} ${_cuda_wrap_generated_files})
endmacro(CUDA_WRAP_SRCS) endmacro()
############################################################################### ###############################################################################
@ -1245,7 +1245,7 @@ macro(CUDA_ADD_LIBRARY cuda_target)
LINKER_LANGUAGE ${CUDA_C_OR_CXX} LINKER_LANGUAGE ${CUDA_C_OR_CXX}
) )
endmacro(CUDA_ADD_LIBRARY cuda_target) endmacro()
############################################################################### ###############################################################################
@ -1279,7 +1279,7 @@ macro(CUDA_ADD_EXECUTABLE cuda_target)
LINKER_LANGUAGE ${CUDA_C_OR_CXX} LINKER_LANGUAGE ${CUDA_C_OR_CXX}
) )
endmacro(CUDA_ADD_EXECUTABLE cuda_target) endmacro()
############################################################################### ###############################################################################
@ -1297,7 +1297,7 @@ macro(CUDA_COMPILE generated_files)
set( ${generated_files} ${_generated_files}) set( ${generated_files} ${_generated_files})
endmacro(CUDA_COMPILE) endmacro()
############################################################################### ###############################################################################
@ -1315,7 +1315,7 @@ macro(CUDA_COMPILE_PTX generated_files)
set( ${generated_files} ${_generated_files}) set( ${generated_files} ${_generated_files})
endmacro(CUDA_COMPILE_PTX) endmacro()
############################################################################### ###############################################################################
############################################################################### ###############################################################################
@ -1364,4 +1364,4 @@ macro(CUDA_BUILD_CLEAN_TARGET)
# This is useful so that the files won't persist in the list after targets # This is useful so that the files won't persist in the list after targets
# have been removed. # have been removed.
set(CUDA_ADDITIONAL_CLEAN_FILES "" CACHE INTERNAL "List of intermediate files that are part of the cuda dependency scanning.") set(CUDA_ADDITIONAL_CLEAN_FILES "" CACHE INTERNAL "List of intermediate files that are part of the cuda dependency scanning.")
endmacro(CUDA_BUILD_CLEAN_TARGET) endmacro()

View File

@ -76,7 +76,7 @@ if (${depend_text} MATCHES ".+")
list(APPEND dependency_list "${file_absolute}") list(APPEND dependency_list "${file_absolute}")
endif() endif()
endforeach(file) endforeach()
else() else()
# message("FOUND NO DEPENDS") # message("FOUND NO DEPENDS")

View File

@ -65,11 +65,11 @@ if (${file_text} MATCHES ".+")
# Skip the rest of this block. # Skip the rest of this block.
# message("Skipping ${entry}") # message("Skipping ${entry}")
# set(skip TRUE) # set(skip TRUE)
# else (${entry} MATCHES "^_") # else ()
message("Kernel: ${entry}") message("Kernel: ${entry}")
# endif (${entry} MATCHES "^_") # endif ()
endif(${entry} MATCHES "[^g]name = ([^ ]+)") endif()
# Skip the rest of the block if necessary # Skip the rest of the block if necessary
if(NOT skip) if(NOT skip)
@ -96,14 +96,14 @@ if (${file_text} MATCHES ".+")
message("") message("")
endif() endif()
endif(NOT skip) endif()
endforeach(entry) endforeach()
endif(line MATCHES "^code") endif()
endforeach(line) endforeach()
else() else()
# message("FOUND NO DEPENDS") # message("FOUND NO DEPENDS")

View File

@ -139,7 +139,7 @@ macro(cuda_execute_process status command)
endforeach() endforeach()
# Echo the command # Echo the command
execute_process(COMMAND ${CMAKE_COMMAND} -E echo ${cuda_execute_process_string}) execute_process(COMMAND ${CMAKE_COMMAND} -E echo ${cuda_execute_process_string})
endif(verbose) endif()
# Run the command # Run the command
execute_process(COMMAND ${ARGN} RESULT_VARIABLE CUDA_result ) execute_process(COMMAND ${ARGN} RESULT_VARIABLE CUDA_result )
endmacro() endmacro()
@ -277,4 +277,4 @@ if( build_cubin )
-P "${CUDA_parse_cubin}" -P "${CUDA_parse_cubin}"
) )
endif( build_cubin ) endif()

View File

@ -43,7 +43,7 @@ if(CURL_INCLUDE_DIR)
unset(curl_version_str) unset(curl_version_str)
break() break()
endif() endif()
endforeach(_curl_version_header) endforeach()
endif() endif()
# handle the QUIETLY and REQUIRED arguments and set CURL_FOUND to TRUE if # handle the QUIETLY and REQUIRED arguments and set CURL_FOUND to TRUE if
@ -56,4 +56,4 @@ FIND_PACKAGE_HANDLE_STANDARD_ARGS(CURL
if(CURL_FOUND) if(CURL_FOUND)
set(CURL_LIBRARIES ${CURL_LIBRARY}) set(CURL_LIBRARIES ${CURL_LIBRARY})
set(CURL_INCLUDE_DIRS ${CURL_INCLUDE_DIR}) set(CURL_INCLUDE_DIRS ${CURL_INCLUDE_DIR})
endif(CURL_FOUND) endif()

View File

@ -5,7 +5,7 @@
# find_package(CVS) # find_package(CVS)
# if(CVS_FOUND) # if(CVS_FOUND)
# message("CVS found: ${CVS_EXECUTABLE}") # message("CVS found: ${CVS_EXECUTABLE}")
# endif(CVS_FOUND) # endif()
#============================================================================= #=============================================================================
# Copyright 2008-2009 Kitware, Inc. # Copyright 2008-2009 Kitware, Inc.

Some files were not shown because too many files have changed in this diff Show More