diff options
author | Kitware Robot <kwrobot@kitware.com> | 2012-08-13 17:50:14 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2012-08-13 18:19:16 (GMT) |
commit | 9db3116226cb99fcf54e936c833953abcde9b729 (patch) | |
tree | bd755ed9e616bbf1482a894bc7946980d81b7703 | |
parent | 77543bde41b0e52c3959016698b529835945d62d (diff) | |
download | CMake-9db3116226cb99fcf54e936c833953abcde9b729.zip CMake-9db3116226cb99fcf54e936c833953abcde9b729.tar.gz CMake-9db3116226cb99fcf54e936c833953abcde9b729.tar.bz2 |
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
385 files changed, 4107 insertions, 4107 deletions
diff --git a/CMakeCPack.cmake b/CMakeCPack.cmake index 7a36d5d..480fc62 100644 --- a/CMakeCPack.cmake +++ b/CMakeCPack.cmake @@ -23,7 +23,7 @@ if(EXISTS "${CMAKE_ROOT}/Modules/CPack.cmake") endif() 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_VENDOR "Kitware") @@ -56,17 +56,17 @@ if(EXISTS "${CMAKE_ROOT}/Modules/CPack.cmake") # cygwin is good for the system name if("${CMAKE_SYSTEM_NAME}" STREQUAL "CYGWIN") set(CPACK_SYSTEM_NAME Cygwin) - else("${CMAKE_SYSTEM_NAME}" STREQUAL "CYGWIN") + else() set(CPACK_SYSTEM_NAME ${CMAKE_SYSTEM_NAME}-${CMAKE_SYSTEM_PROCESSOR}) - endif("${CMAKE_SYSTEM_NAME}" STREQUAL "CYGWIN") - endif(NOT DEFINED CPACK_SYSTEM_NAME) + endif() + endif() if(${CPACK_SYSTEM_NAME} MATCHES Windows) if(CMAKE_CL_64) set(CPACK_SYSTEM_NAME win64-x64) - else(CMAKE_CL_64) + else() set(CPACK_SYSTEM_NAME win32-x86) - endif(CMAKE_CL_64) - endif(${CPACK_SYSTEM_NAME} MATCHES Windows) + endif() + endif() if(NOT DEFINED CPACK_PACKAGE_FILE_NAME) # if the CPACK_PACKAGE_FILE_NAME is not defined by the cache @@ -74,11 +74,11 @@ if(EXISTS "${CMAKE_ROOT}/Modules/CPack.cmake") # needed if(CYGWIN) set(CPACK_PACKAGE_FILE_NAME "${CPACK_SOURCE_PACKAGE_FILE_NAME}") - else(CYGWIN) + else() set(CPACK_PACKAGE_FILE_NAME "${CPACK_SOURCE_PACKAGE_FILE_NAME}-${CPACK_SYSTEM_NAME}") - endif(CYGWIN) - endif(NOT DEFINED CPACK_PACKAGE_FILE_NAME) + endif() + endif() 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_SOURCE_STRIP_FILES "") set(CPACK_PACKAGE_EXECUTABLES "ccmake" "CMake") - endif(UNIX) + endif() # cygwin specific packaging stuff if(CYGWIN) @@ -110,7 +110,7 @@ if(EXISTS "${CMAKE_ROOT}/Modules/CPack.cmake") # configures some files and adds some install targets # this file uses some of the package file name variables include(Utilities/Release/Cygwin/CMakeLists.txt) - endif(CYGWIN) + endif() # 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) @@ -120,4 +120,4 @@ if(EXISTS "${CMAKE_ROOT}/Modules/CPack.cmake") # include CPack model once all variables are set include(CPack) -endif(EXISTS "${CMAKE_ROOT}/Modules/CPack.cmake") +endif() diff --git a/CMakeCPackOptions.cmake.in b/CMakeCPackOptions.cmake.in index 868331f..3a72eaa 100644 --- a/CMakeCPackOptions.cmake.in +++ b/CMakeCPackOptions.cmake.in @@ -32,7 +32,7 @@ if(CPACK_GENERATOR MATCHES "NSIS") set(CPACK_NSIS_URL_INFO_ABOUT "http://www.kitware.com") set(CPACK_NSIS_CONTACT @CPACK_PACKAGE_CONTACT@) set(CPACK_NSIS_MODIFY_PATH ON) -endif(CPACK_GENERATOR MATCHES "NSIS") +endif() # include the cpack options for qt dialog if they exisit # 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 set(CPACK_SOURCE_IGNORE_FILES "/CVS/" "/\\.build/" "/\\.svn/" "\\.swp$" "\\.#" "/#" "~$") -endif(CPACK_GENERATOR MATCHES "CygwinSource") +endif() if("${CPACK_GENERATOR}" STREQUAL "PackageMaker") if(CMAKE_PACKAGE_QTGUI) set(CPACK_PACKAGE_DEFAULT_LOCATION "/Applications") - else(CMAKE_PACKAGE_QTGUI) + else() set(CPACK_PACKAGE_DEFAULT_LOCATION "/usr") - endif(CMAKE_PACKAGE_QTGUI) -endif("${CPACK_GENERATOR}" STREQUAL "PackageMaker") + endif() +endif() diff --git a/CMakeLists.txt b/CMakeLists.txt index 0beed62..f0789a3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -67,7 +67,7 @@ macro(CMAKE_HANDLE_SYSTEM_LIBRARIES) else() set(CMAKE_USE_SYSTEM_LIBRARY_${util} OFF) endif() - endforeach(util) + endforeach() if(CMAKE_BOOTSTRAP) unset(CMAKE_USE_SYSTEM_LIBRARIES CACHE) endif() @@ -87,15 +87,15 @@ macro(CMAKE_HANDLE_SYSTEM_LIBRARIES) foreach(util ${UTILITIES}) if(CMAKE_USE_SYSTEM_${util}) message(STATUS "Using system-installed ${util}") - endif(CMAKE_USE_SYSTEM_${util}) - endforeach(util) + endif() + endforeach() # Inform utility library header wrappers whether to use system versions. configure_file(${CMake_SOURCE_DIR}/Utilities/cmThirdParty.h.in ${CMake_BINARY_DIR}/Utilities/cmThirdParty.h @ONLY) -endmacro(CMAKE_HANDLE_SYSTEM_LIBRARIES) +endmacro() @@ -103,7 +103,7 @@ endmacro(CMAKE_HANDLE_SYSTEM_LIBRARIES) set(CMAKE_BUILD_ON_VISUAL_STUDIO 0) if(WIN32 AND NOT UNIX AND NOT BORLAND AND NOT MINGW ) 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) if (NOT DART_ROOT) set(MAKEPROGRAM ${CMAKE_MAKE_PROGRAM}) - endif (NOT DART_ROOT) + endif () if(BUILD_TESTING) set(CMAKE_TEST_GENERATOR "" CACHE STRING @@ -123,28 +123,28 @@ macro(CMAKE_SETUP_TESTING) if(NOT CMAKE_TEST_GENERATOR) set(CMAKE_TEST_GENERATOR "${CMAKE_GENERATOR}") set(CMAKE_TEST_MAKEPROGRAM "${MAKEPROGRAM}") - else(NOT CMAKE_TEST_GENERATOR) + else() set(CMAKE_TEST_DIFFERENT_GENERATOR TRUE) - endif(NOT CMAKE_TEST_GENERATOR) + endif() # Are we testing with the MSVC compiler? set(CMAKE_TEST_MSVC 0) if(MSVC AND NOT CMAKE_TEST_DIFFERENT_GENERATOR) set(CMAKE_TEST_MSVC 1) - else(MSVC AND NOT CMAKE_TEST_DIFFERENT_GENERATOR) + else() if("${CMAKE_TEST_GENERATOR}" MATCHES "NMake" OR "${CMAKE_TEST_GENERATOR}" MATCHES "Visual Studio") set(CMAKE_TEST_MSVC 1) endif("${CMAKE_TEST_GENERATOR}" MATCHES "NMake" OR "${CMAKE_TEST_GENERATOR}" MATCHES "Visual Studio") - endif(MSVC AND NOT CMAKE_TEST_DIFFERENT_GENERATOR) + endif() set(CMAKE_TEST_SYSTEM_LIBRARIES 0) foreach(util CURL EXPAT XMLRPC ZLIB) if(CMAKE_USE_SYSTEM_${util}) set(CMAKE_TEST_SYSTEM_LIBRARIES 1) - endif(CMAKE_USE_SYSTEM_${util}) - endforeach(util) + endif() + endforeach() # This variable is set by cmake, however to # 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_CMAKE_COMMAND "${CMake_BIN_DIR}/cmake") set(CMAKE_CPACK_COMMAND "${CMake_BIN_DIR}/cpack") - endif(BUILD_TESTING) + endif() # configure some files for testing configure_file("${CMAKE_CURRENT_SOURCE_DIR}/Templates/CTestScript.cmake.in" @@ -171,10 +171,10 @@ macro(CMAKE_SETUP_TESTING) if(BUILD_TESTING AND DART_ROOT) configure_file(${CMake_SOURCE_DIR}/CMakeLogo.gif ${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(CURL_TESTING) -endmacro(CMAKE_SETUP_TESTING) +endmacro() # 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() set_property(GLOBAL PROPERTY USE_FOLDERS OFF) endif() -endmacro(CMAKE_SET_TARGET_FOLDER) +endmacro() #----------------------------------------------------------------------- @@ -266,15 +266,15 @@ macro (CMAKE_BUILD_UTILITIES) if(NOT ZLIB_FOUND) message(FATAL_ERROR "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_LIBRARIES ${ZLIB_LIBRARIES}) - else(CMAKE_USE_SYSTEM_ZLIB) + else() set(CMAKE_ZLIB_INCLUDES ${CMake_SOURCE_DIR}/Utilities) set(CMAKE_ZLIB_LIBRARIES cmzlib) add_subdirectory(Utilities/cmzlib) CMAKE_SET_TARGET_FOLDER(cmzlib "Utilities/3rdParty") - endif(CMAKE_USE_SYSTEM_ZLIB) + endif() #--------------------------------------------------------------------- # Build Curl library for CTest. @@ -283,26 +283,26 @@ macro (CMAKE_BUILD_UTILITIES) if(NOT CURL_FOUND) message(FATAL_ERROR "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_LIBRARIES ${CURL_LIBRARIES}) - else(CMAKE_USE_SYSTEM_CURL) + else() set(CURL_SPECIAL_ZLIB_H ${CMAKE_ZLIB_HEADER}) set(CURL_SPECIAL_LIBZ_INCLUDES ${CMAKE_ZLIB_INCLUDES}) set(CURL_SPECIAL_LIBZ ${CMAKE_ZLIB_LIBRARIES}) option(CMAKE_BUILD_CURL_SHARED "Should curl be built shared" FALSE) if(NOT CMAKE_BUILD_CURL_SHARED) add_definitions(-DCURL_STATICLIB) - endif(NOT CMAKE_BUILD_CURL_SHARED) + endif() set(CMAKE_CURL_INCLUDES) set(CMAKE_CURL_LIBRARIES cmcurl) if(CMAKE_TESTS_CDASH_SERVER) set(CMAKE_CURL_TEST_URL "${CMAKE_TESTS_CDASH_SERVER}/user.php") - endif(CMAKE_TESTS_CDASH_SERVER) + endif() add_subdirectory(Utilities/cmcurl) CMAKE_SET_TARGET_FOLDER(cmcurl "Utilities/3rdParty") CMAKE_SET_TARGET_FOLDER(LIBCURL "Utilities/3rdParty") - endif(CMAKE_USE_SYSTEM_CURL) + endif() #--------------------------------------------------------------------- # Build Compress library for CTest. @@ -334,7 +334,7 @@ macro (CMAKE_BUILD_UTILITIES) endif() set(CMAKE_TAR_INCLUDES ${LibArchive_INCLUDE_DIRS}) set(CMAKE_TAR_LIBRARIES ${LibArchive_LIBRARIES}) - else(CMAKE_USE_SYSTEM_LIBARCHIVE) + else() set(ZLIB_INCLUDE_DIR ${CMAKE_ZLIB_INCLUDES}) set(ZLIB_LIBRARY ${CMAKE_ZLIB_LIBRARIES}) add_definitions(-DLIBARCHIVE_STATIC) @@ -346,7 +346,7 @@ macro (CMAKE_BUILD_UTILITIES) add_subdirectory(Utilities/cmlibarchive) CMAKE_SET_TARGET_FOLDER(cmlibarchive "Utilities/3rdParty") set(CMAKE_TAR_LIBRARIES cmlibarchive ${BZIP2_LIBRARIES}) - endif(CMAKE_USE_SYSTEM_LIBARCHIVE) + endif() #--------------------------------------------------------------------- # Build expat library for CMake and CTest. @@ -355,15 +355,15 @@ macro (CMAKE_BUILD_UTILITIES) if(NOT EXPAT_FOUND) message(FATAL_ERROR "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_LIBRARIES ${EXPAT_LIBRARIES}) - else(CMAKE_USE_SYSTEM_EXPAT) + else() set(CMAKE_EXPAT_INCLUDES) set(CMAKE_EXPAT_LIBRARIES cmexpat) add_subdirectory(Utilities/cmexpat) CMAKE_SET_TARGET_FOLDER(cmexpat "Utilities/3rdParty") - endif(CMAKE_USE_SYSTEM_EXPAT) + endif() #--------------------------------------------------------------------- # Build XMLRPC library for CMake and CTest. @@ -372,10 +372,10 @@ macro (CMAKE_BUILD_UTILITIES) if(NOT XMLRPC_FOUND) message(FATAL_ERROR "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_LIBRARIES ${XMLRPC_LIBRARIES}) - endif(CTEST_USE_XMLRPC) + endif() #--------------------------------------------------------------------- # Use curses? @@ -386,20 +386,20 @@ macro (CMAKE_BUILD_UTILITIES) find_package(Curses QUIET) if (CURSES_LIBRARY) 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.") set(BUILD_CursesDialog 0) - endif (CURSES_LIBRARY) - else(NOT "${CMAKE_SYSTEM_NAME}" MATCHES syllable) + endif () + else() set(BUILD_CursesDialog 0) - endif(NOT "${CMAKE_SYSTEM_NAME}" MATCHES syllable) - else (UNIX) + endif() + else () set(BUILD_CursesDialog 0) - endif (UNIX) + endif () if(BUILD_CursesDialog) add_subdirectory(Source/CursesDialog/form) - endif(BUILD_CursesDialog) -endmacro (CMAKE_BUILD_UTILITIES) + endif() +endmacro () #----------------------------------------------------------------------- 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") 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) CMAKE_BUILD_UTILITIES() @@ -524,8 +524,8 @@ if(BUILD_CursesDialog) 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") 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(BUILD_CursesDialog) + endif() +endif() if(BUILD_QtDialog) if(APPLE) @@ -538,16 +538,16 @@ if(BUILD_QtDialog) string(SUBSTRING "${CMAKE_INSTALL_PREFIX}" ${LEN} 1 ENDCH) if(NOT "${ENDCH}" STREQUAL "/") set(CMAKE_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}/") - endif(NOT "${ENDCH}" STREQUAL "/") + endif() set(CMAKE_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}${CMAKE_BUNDLE_NAME}.app/Contents") - endif(APPLE) + endif() 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") 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(BUILD_QtDialog) + endif() +endif() # The same might be true on other systems for other libraries. @@ -563,7 +563,7 @@ if (UNIX) set(CMAKE_BUILD_WITH_INSTALL_RPATH TRUE) 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) -endif (UNIX) +endif () # add the uninstall support diff --git a/CTestCustom.cmake.in b/CTestCustom.cmake.in index 52173f3..1e6224b 100644 --- a/CTestCustom.cmake.in +++ b/CTestCustom.cmake.in @@ -61,14 +61,14 @@ if(NOT "@CMAKE_GENERATOR@" MATCHES "Xcode") ${CTEST_CUSTOM_COVERAGE_EXCLUDE} "XCode" ) -endif (NOT "@CMAKE_GENERATOR@" MATCHES "Xcode") +endif () if(NOT "@CMAKE_GENERATOR@" MATCHES "KDevelop") set(CTEST_CUSTOM_COVERAGE_EXCLUDE ${CTEST_CUSTOM_COVERAGE_EXCLUDE} "Kdevelop" ) -endif (NOT "@CMAKE_GENERATOR@" MATCHES "KDevelop") +endif () set(CTEST_CUSTOM_COVERAGE_EXCLUDE ${CTEST_CUSTOM_COVERAGE_EXCLUDE} diff --git a/CompileFlags.cmake b/CompileFlags.cmake index f144337..b2044e4 100644 --- a/CompileFlags.cmake +++ b/CompileFlags.cmake @@ -15,10 +15,10 @@ # if(CMAKE_GENERATOR MATCHES "Visual Studio 7") set(CMAKE_SKIP_COMPATIBILITY_TESTS 1) -endif(CMAKE_GENERATOR MATCHES "Visual Studio 7") +endif() if(CMAKE_GENERATOR MATCHES "Visual Studio 6") set(CMAKE_SKIP_COMPATIBILITY_TESTS 1) -endif(CMAKE_GENERATOR MATCHES "Visual Studio 6") +endif() include (${CMAKE_ROOT}/Modules/CMakeBackwardCompatibilityCXX.cmake) if(WIN32 AND "${CMAKE_C_COMPILER_ID}" MATCHES "^(Intel)$") @@ -38,27 +38,27 @@ endif() if(CMAKE_SYSTEM MATCHES "AIX.*") if(NOT CMAKE_COMPILER_IS_GNUCXX) set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -bhalt:5 ") - endif(NOT CMAKE_COMPILER_IS_GNUCXX) -endif(CMAKE_SYSTEM MATCHES "AIX.*") + endif() +endif() if(CMAKE_SYSTEM MATCHES "IRIX.*") if(NOT CMAKE_COMPILER_IS_GNUCXX) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wl,-woff84 -no_auto_include") set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,-woff15") - endif(NOT CMAKE_COMPILER_IS_GNUCXX) -endif(CMAKE_SYSTEM MATCHES "IRIX.*") + endif() +endif() if(CMAKE_SYSTEM MATCHES "OSF1-V.*") if(NOT CMAKE_COMPILER_IS_GNUCXX) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -timplicit_local -no_implicit_include ") - endif(NOT CMAKE_COMPILER_IS_GNUCXX) -endif(CMAKE_SYSTEM MATCHES "OSF1-V.*") + endif() +endif() # use the ansi CXX compile flag for building cmake if (CMAKE_ANSI_CXXFLAGS) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CMAKE_ANSI_CXXFLAGS}") -endif (CMAKE_ANSI_CXXFLAGS) +endif () if (CMAKE_ANSI_CFLAGS) set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${CMAKE_ANSI_CFLAGS}") -endif (CMAKE_ANSI_CFLAGS) +endif () diff --git a/Modules/AddFileDependencies.cmake b/Modules/AddFileDependencies.cmake index af7f42f..e88025c 100644 --- a/Modules/AddFileDependencies.cmake +++ b/Modules/AddFileDependencies.cmake @@ -20,10 +20,10 @@ macro(ADD_FILE_DEPENDENCIES _file) get_source_file_property(_deps ${_file} OBJECT_DEPENDS) if (_deps) set(_deps ${_deps} ${ARGN}) - else (_deps) + else () set(_deps ${ARGN}) - endif (_deps) + endif () set_source_files_properties(${_file} PROPERTIES OBJECT_DEPENDS "${_deps}") -endmacro(ADD_FILE_DEPENDENCIES) +endmacro() diff --git a/Modules/BundleUtilities.cmake b/Modules/BundleUtilities.cmake index 0143d59..4557be6 100644 --- a/Modules/BundleUtilities.cmake +++ b/Modules/BundleUtilities.cmake @@ -184,17 +184,17 @@ function(get_bundle_main_executable bundle result_var) if(line_is_main_executable) string(REGEX REPLACE "^.*<string>(.*)</string>.*$" "\\1" bundle_executable "${line}") break() - endif(line_is_main_executable) + endif() if(line MATCHES "^.*<key>CFBundleExecutable</key>.*$") set(line_is_main_executable 1) - endif(line MATCHES "^.*<key>CFBundleExecutable</key>.*$") - endforeach(line) + endif() + endforeach() if(NOT "${bundle_executable}" STREQUAL "") if(EXISTS "${bundle}/Contents/MacOS/${bundle_executable}") set(result "${bundle}/Contents/MacOS/${bundle_executable}") - else(EXISTS "${bundle}/Contents/MacOS/${bundle_executable}") + else() # Ultimate goal: # 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: # set(result "error: '${bundle}/Contents/MacOS/${bundle_executable}' does not exist") - endif(EXISTS "${bundle}/Contents/MacOS/${bundle_executable}") - endif(NOT "${bundle_executable}" STREQUAL "") - else(EXISTS "${bundle}/Contents/Info.plist") + endif() + endif() + else() # # More inclusive technique... (This one would work on Windows and Linux # 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 # base name as the .app directory: # - endif(EXISTS "${bundle}/Contents/Info.plist") + endif() set(${result_var} "${result}" PARENT_SCOPE) -endfunction(get_bundle_main_executable) +endfunction() function(get_dotapp_dir exe dotapp_dir_var) @@ -240,9 +240,9 @@ function(get_dotapp_dir exe dotapp_dir_var) if(sname MATCHES "\\.app$") set(done 1) set(dotapp_dir "${sdir}/${sname}") - endif(sname MATCHES "\\.app$") - endwhile(NOT ${done}) - else(s MATCHES "^.*/.*\\.app/.*$") + endif() + endwhile() + else() # Otherwise use a directory containing the exe # (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) get_filename_component(sdir "${s}" PATH) set(dotapp_dir "${sdir}") - else(is_executable) + else() set(dotapp_dir "${s}") - endif(is_executable) - endif(s MATCHES "^.*/.*\\.app/.*$") + endif() + endif() 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) @@ -273,13 +273,13 @@ function(get_bundle_and_executable app bundle_var executable_var valid_var) set(${executable_var} "${executable}" PARENT_SCOPE) set(valid 1) #message(STATUS "info: handled .app directory case...") - else(EXISTS "${app}" AND EXISTS "${executable}") + else() message(STATUS "warning: *NOT* handled - .app directory case...") - endif(EXISTS "${app}" AND EXISTS "${executable}") - else(app MATCHES "\\.app$") + endif() + else() message(STATUS "warning: *NOT* handled - directory but not .app case...") - endif(app MATCHES "\\.app$") - else(IS_DIRECTORY "${app}") + endif() + else() # Is it an executable file? is_file_executable("${app}" is_executable) if(is_executable) @@ -296,21 +296,21 @@ function(get_bundle_and_executable app bundle_var executable_var valid_var) set(valid 1) #message(STATUS "info: handled executable file in any dir case...") endif() - else(is_executable) + else() message(STATUS "warning: *NOT* handled - not .app dir, not executable file...") - endif(is_executable) - endif(IS_DIRECTORY "${app}") - else(EXISTS "${app}") + endif() + endif() + else() message(STATUS "warning: *NOT* handled - directory/file does not exist...") - endif(EXISTS "${app}") + endif() if(NOT valid) set(${bundle_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) -endfunction(get_bundle_and_executable) +endfunction() 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) if(is_executable) set(exes ${exes} "${f}") - endif(is_executable) - endforeach(f) + endif() + endforeach() set(${exes_var} "${exes}" PARENT_SCOPE) -endfunction(get_bundle_all_executables) +endfunction() function(get_item_key item key_var) @@ -335,7 +335,7 @@ function(get_item_key item key_var) endif() string(REGEX REPLACE "\\." "_" ${key_var} "${item_name}") set(${key_var} ${${key_var}} PARENT_SCOPE) -endfunction(get_item_key) +endfunction() function(clear_bundle_keys keys_var) @@ -346,9 +346,9 @@ function(clear_bundle_keys keys_var) set(${key}_EMBEDDED_ITEM PARENT_SCOPE) set(${key}_RESOLVED_EMBEDDED_ITEM PARENT_SCOPE) set(${key}_COPYFLAG PARENT_SCOPE) - endforeach(key) + endforeach() set(${keys_var} PARENT_SCOPE) -endfunction(clear_bundle_keys) +endfunction() 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}": # 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 # embedded path: # set(embedded_item "${default_embedded_path}/${item_name}") - endif(item MATCHES "[^/]+\\.framework/") + endif() # 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) set(resolved_embedded_item "${resolved_item}") - endif(NOT copyflag) + endif() set(${keys_var} ${${keys_var}} 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}_RESOLVED_EMBEDDED_ITEM "${resolved_embedded_item}" 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") - endif(NOT length_before EQUAL length_after) -endfunction(set_bundle_key_values) + endif() +endfunction() 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}") foreach(pr ${prereqs}) set_bundle_key_values(${keys_var} "${lib}" "${pr}" "${exepath}" "${dirs}" 1) - endforeach(pr) - endforeach(lib) + endforeach() + endforeach() # For each executable found in the bundle, accumulate keys as we go. # 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}") foreach(pr ${prereqs}) set_bundle_key_values(${keys_var} "${exe}" "${pr}" "${exepath}" "${dirs}" 1) - endforeach(pr) - endforeach(exe) + endforeach() + endforeach() # 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}_RESOLVED_EMBEDDED_ITEM "${${key}_RESOLVED_EMBEDDED_ITEM}" PARENT_SCOPE) set(${key}_COPYFLAG "${${key}_COPYFLAG}" PARENT_SCOPE) - endforeach(key) - endif(valid) -endfunction(get_bundle_keys) + endforeach() + endif() +endfunction() 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}") if(UNIX AND NOT APPLE) file(RPATH_REMOVE FILE "${resolved_embedded_item}") - endif(UNIX AND NOT APPLE) + endif() endif() -endfunction(copy_resolved_item_into_bundle) +endfunction() 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() if(UNIX AND NOT APPLE) file(RPATH_REMOVE FILE "${resolved_embedded_item}") - endif(UNIX AND NOT APPLE) + endif() endif() -endfunction(copy_resolved_framework_into_bundle) +endfunction() 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 "") set(changes ${changes} "-change" "${pr}" "${${rkey}_EMBEDDED_ITEM}") - else(NOT "${${rkey}_EMBEDDED_ITEM}" STREQUAL "") + else() message("warning: unexpected reference to '${pr}'") - endif(NOT "${${rkey}_EMBEDDED_ITEM}" STREQUAL "") - endforeach(pr) + endif() + endforeach() if(BU_CHMOD_BUNDLE_ITEMS) 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 ${changes} -id "${${ikey}_EMBEDDED_ITEM}" "${resolved_embedded_item}" ) -endfunction(fixup_bundle_item) +endfunction() function(fixup_bundle app libs dirs) @@ -620,9 +620,9 @@ function(fixup_bundle app libs dirs) math(EXPR i ${i}+1) if(${${key}_COPYFLAG}) message(STATUS "${i}/${n}: copying '${${key}_RESOLVED_ITEM}'") - else(${${key}_COPYFLAG}) + else() message(STATUS "${i}/${n}: *NOT* copying '${${key}_RESOLVED_ITEM}'") - endif(${${key}_COPYFLAG}) + endif() set(show_status 0) if(show_status) @@ -634,7 +634,7 @@ function(fixup_bundle app libs dirs) message(STATUS "resolved_embedded_item='${${key}_RESOLVED_EMBEDDED_ITEM}'") message(STATUS "copyflag='${${key}_COPYFLAG}'") message(STATUS "") - endif(show_status) + endif() if(${${key}_COPYFLAG}) set(item "${${key}_ITEM}") @@ -645,8 +645,8 @@ function(fixup_bundle app libs dirs) copy_resolved_item_into_bundle("${${key}_RESOLVED_ITEM}" "${${key}_RESOLVED_EMBEDDED_ITEM}") endif() - endif(${${key}_COPYFLAG}) - endforeach(key) + endif() + endforeach() message(STATUS "fixup_bundle: fixing...") foreach(key ${keys}) @@ -654,28 +654,28 @@ function(fixup_bundle app libs dirs) if(APPLE) message(STATUS "${i}/${n}: fixing up '${${key}_RESOLVED_EMBEDDED_ITEM}'") 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}'") - endif(APPLE) - endforeach(key) + endif() + endforeach() message(STATUS "fixup_bundle: cleaning up...") clear_bundle_keys(keys) message(STATUS "fixup_bundle: verifying...") verify_app("${app}") - else(valid) + else() message(SEND_ERROR "error: fixup_bundle: not a valid bundle") - endif(valid) + endif() message(STATUS "fixup_bundle: done") -endfunction(fixup_bundle) +endfunction() function(copy_and_fixup_bundle src dst libs dirs) execute_process(COMMAND ${CMAKE_COMMAND} -E copy_directory "${src}" "${dst}") fixup_bundle("${dst}" "${libs}" "${dirs}") -endfunction(copy_and_fixup_bundle) +endfunction() 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}") endif() endif() - endforeach(p) + endforeach() if(external_prereqs) # Found non-system/somehow-unacceptable prerequisites: set(result 0) set(info ${info} "external prerequisites found:\nf='${f}'\nexternal_prereqs='${external_prereqs}'\n") - endif(external_prereqs) - endif(is_executable) - endforeach(f) + endif() + endif() + endforeach() if(result) set(info "Verified ${count} executable files in '${bundle}'") - endif(result) + endif() set(${result_var} "${result}" PARENT_SCOPE) set(${info_var} "${info}" PARENT_SCOPE) -endfunction(verify_bundle_prerequisites) +endfunction() 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(${info_var} "${info}" PARENT_SCOPE) -endfunction(verify_bundle_symlinks) +endfunction() function(verify_app app) @@ -778,9 +778,9 @@ function(verify_app app) message(STATUS "verified='${verified}'") message(STATUS "info='${info}'") message(STATUS "") - endif(verified) + endif() if(NOT verified) message(FATAL_ERROR "error: verify_app failed") - endif(NOT verified) -endfunction(verify_app) + endif() +endfunction() diff --git a/Modules/CMakeASMInformation.cmake b/Modules/CMakeASMInformation.cmake index 69554e4..dce1624 100644 --- a/Modules/CMakeASMInformation.cmake +++ b/Modules/CMakeASMInformation.cmake @@ -14,9 +14,9 @@ if(UNIX) set(CMAKE_ASM${ASM_DIALECT}_OUTPUT_EXTENSION .o) -else(UNIX) +else() set(CMAKE_ASM${ASM_DIALECT}_OUTPUT_EXTENSION .obj) -endif(UNIX) +endif() set(CMAKE_INCLUDE_FLAG_ASM${ASM_DIALECT} "-I") # -I 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") set(CMAKE_BASE_NAME gas) -endif("${CMAKE_BASE_NAME}" STREQUAL "as") +endif() # Load compiler-specific information. set(_INCLUDED_FILE "") if(CMAKE_ASM${ASM_DIALECT}_COMPILER_ID) 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("ASM${ASM_DIALECT}" STREQUAL "ASM") 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) -endif(NOT _INCLUDED_FILE) +endif() 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) if(NOT _INCLUDED_FILE) include(Platform/${CMAKE_SYSTEM_NAME}-${CMAKE_BASE_NAME}-${CMAKE_SYSTEM_PROCESSOR} OPTIONAL) - endif(NOT _INCLUDED_FILE) -endif(CMAKE_SYSTEM_PROCESSOR) + endif() +endif() include(Platform/${CMAKE_SYSTEM_NAME}-${CMAKE_ASM${ASM_DIALECT}_COMPILER_ID}-ASM${ASM_DIALECT} OPTIONAL RESULT_VARIABLE _INCLUDED_FILE) if(NOT _INCLUDED_FILE) include(Platform/${CMAKE_SYSTEM_NAME}-${CMAKE_BASE_NAME} OPTIONAL) -endif(NOT _INCLUDED_FILE) +endif() # Set default assembler file extensions: if(NOT CMAKE_ASM${ASM_DIALECT}_SOURCE_FILE_EXTENSIONS) 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: @@ -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 if(CMAKE_ASM${ASM_DIALECT}_FLAGS_INIT STREQUAL " ") 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 "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) set (CMAKE_BUILD_TYPE ${CMAKE_BUILD_TYPE_INIT} CACHE STRING "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 "Flags used by the assembler during debug builds.") 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.") 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.") -endif(NOT CMAKE_NOT_USING_CONFIG_FLAGS) +endif() mark_as_advanced(CMAKE_ASM${ASM_DIALECT}_FLAGS 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) 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) set(CMAKE_ASM${ASM_DIALECT}_CREATE_STATIC_LIBRARY "<CMAKE_AR> cr <TARGET> <LINK_FLAGS> <OBJECTS> " "<CMAKE_RANLIB> <TARGET> ") -endif(NOT CMAKE_ASM${ASM_DIALECT}_CREATE_STATIC_LIBRARY) +endif() if(NOT 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>") -endif(NOT CMAKE_ASM${ASM_DIALECT}_LINK_EXECUTABLE) +endif() 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}) @@ -119,11 +119,11 @@ endif() # to be done if(NOT 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) 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) diff --git a/Modules/CMakeBackwardCompatibilityC.cmake b/Modules/CMakeBackwardCompatibilityC.cmake index 90ad12e..e3b6c82 100644 --- a/Modules/CMakeBackwardCompatibilityC.cmake +++ b/Modules/CMakeBackwardCompatibilityC.cmake @@ -16,11 +16,11 @@ if(CMAKE_GENERATOR MATCHES "Visual Studio 7") include(CMakeVS7BackwardCompatibility) set(CMAKE_SKIP_COMPATIBILITY_TESTS 1) -endif(CMAKE_GENERATOR MATCHES "Visual Studio 7") +endif() if(CMAKE_GENERATOR MATCHES "Visual Studio 6") include(CMakeVS6BackwardCompatibility) set(CMAKE_SKIP_COMPATIBILITY_TESTS 1) -endif(CMAKE_GENERATOR MATCHES "Visual Studio 6") +endif() if(NOT CMAKE_SKIP_COMPATIBILITY_TESTS) # 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$") 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 "X11 extra flags.") - endif("${X11_X11_INCLUDE_PATH}" MATCHES "^/usr/include$") + endif() set (CMAKE_X_LIBS "${X11_LIBRARIES}" CACHE STRING "Libraries and options used in X11 programs.") 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(__ERASE_CMAKE_TRY_COMPILE_OSX_ARCHITECTURES) endif() -endif(NOT CMAKE_SKIP_COMPATIBILITY_TESTS) +endif() mark_as_advanced( CMAKE_HP_PTHREADS diff --git a/Modules/CMakeBackwardCompatibilityCXX.cmake b/Modules/CMakeBackwardCompatibilityCXX.cmake index 6888636..cfc1d91 100644 --- a/Modules/CMakeBackwardCompatibilityCXX.cmake +++ b/Modules/CMakeBackwardCompatibilityCXX.cmake @@ -26,10 +26,10 @@ if(NOT CMAKE_SKIP_COMPATIBILITY_TESTS) set(CMAKE_TRY_ANSI_CXX_FLAGS "") if(CMAKE_SYSTEM MATCHES "IRIX.*") set(CMAKE_TRY_ANSI_CXX_FLAGS "-LANG:std") - endif(CMAKE_SYSTEM MATCHES "IRIX.*") + endif() if(CMAKE_SYSTEM MATCHES "OSF.*") 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 the compiler accepts it if( CMAKE_TRY_ANSI_CXX_FLAGS MATCHES ".+") @@ -39,9 +39,9 @@ if(NOT CMAKE_SKIP_COMPATIBILITY_TESTS) if(CMAKE_CXX_ACCEPTS_FLAGS) set(CMAKE_ANSI_CXXFLAGS ${CMAKE_TRY_ANSI_CXX_FLAGS} CACHE INTERNAL "What flags are required by the c++ compiler to make it ansi." ) - endif(CMAKE_CXX_ACCEPTS_FLAGS) - endif( CMAKE_TRY_ANSI_CXX_FLAGS MATCHES ".+") - endif(NOT CMAKE_COMPILER_IS_GNUCXX) + endif() + endif() + endif() set(CMAKE_CXX_FLAGS_SAVE ${CMAKE_CXX_FLAGS}) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CMAKE_ANSI_CXXFLAGS}") include(TestForANSIStreamHeaders) @@ -50,5 +50,5 @@ if(NOT CMAKE_SKIP_COMPATIBILITY_TESTS) include(TestForANSIForScope) include(TestForSSTREAM) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS_SAVE}") -endif(NOT CMAKE_SKIP_COMPATIBILITY_TESTS) +endif() diff --git a/Modules/CMakeCCompiler.cmake.in b/Modules/CMakeCCompiler.cmake.in index 6166ec0..b4eabe5 100644 --- a/Modules/CMakeCCompiler.cmake.in +++ b/Modules/CMakeCCompiler.cmake.in @@ -14,13 +14,13 @@ set(CMAKE_COMPILER_IS_CYGWIN @CMAKE_COMPILER_IS_CYGWIN@) if(CMAKE_COMPILER_IS_CYGWIN) set(CYGWIN 1) set(UNIX 1) -endif(CMAKE_COMPILER_IS_CYGWIN) +endif() set(CMAKE_C_COMPILER_ENV_VAR "CC") if(CMAKE_COMPILER_IS_MINGW) set(MINGW 1) -endif(CMAKE_COMPILER_IS_MINGW) +endif() set(CMAKE_C_COMPILER_ID_RUN 1) set(CMAKE_C_SOURCE_FILE_EXTENSIONS c) 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) set(CMAKE_SIZEOF_VOID_P "${CMAKE_C_SIZEOF_DATA_PTR}") -endif(CMAKE_C_SIZEOF_DATA_PTR) +endif() if(CMAKE_C_COMPILER_ABI) set(CMAKE_INTERNAL_PLATFORM_ABI "${CMAKE_C_COMPILER_ABI}") -endif(CMAKE_C_COMPILER_ABI) +endif() if(CMAKE_C_LIBRARY_ARCHITECTURE) set(CMAKE_LIBRARY_ARCHITECTURE "@CMAKE_C_LIBRARY_ARCHITECTURE@") diff --git a/Modules/CMakeCInformation.cmake b/Modules/CMakeCInformation.cmake index f0b7fe8..ce5ce44 100644 --- a/Modules/CMakeCInformation.cmake +++ b/Modules/CMakeCInformation.cmake @@ -22,51 +22,51 @@ # so set the extension here first so it can be overridden by the compiler specific file if(UNIX) set(CMAKE_C_OUTPUT_EXTENSION .o) -else(UNIX) +else() set(CMAKE_C_OUTPUT_EXTENSION .obj) -endif(UNIX) +endif() set(_INCLUDED_FILE 0) # Load compiler-specific information. if(CMAKE_C_COMPILER_ID) include(Compiler/${CMAKE_C_COMPILER_ID}-C OPTIONAL) -endif(CMAKE_C_COMPILER_ID) +endif() set(CMAKE_BASE_NAME) get_filename_component(CMAKE_BASE_NAME ${CMAKE_C_COMPILER} NAME_WE) if(CMAKE_COMPILER_IS_GNUCC) set(CMAKE_BASE_NAME gcc) -endif(CMAKE_COMPILER_IS_GNUCC) +endif() # load a hardware specific file, mostly useful for embedded compilers if(CMAKE_SYSTEM_PROCESSOR) if(CMAKE_C_COMPILER_ID) 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) include(Platform/${CMAKE_SYSTEM_NAME}-${CMAKE_BASE_NAME}-${CMAKE_SYSTEM_PROCESSOR} OPTIONAL) - endif (NOT _INCLUDED_FILE) -endif(CMAKE_SYSTEM_PROCESSOR) + endif () +endif() # load the system- and compiler specific files if(CMAKE_C_COMPILER_ID) include(Platform/${CMAKE_SYSTEM_NAME}-${CMAKE_C_COMPILER_ID}-C OPTIONAL RESULT_VARIABLE _INCLUDED_FILE) -endif(CMAKE_C_COMPILER_ID) +endif() if (NOT _INCLUDED_FILE) include(Platform/${CMAKE_SYSTEM_NAME}-${CMAKE_BASE_NAME} OPTIONAL RESULT_VARIABLE _INCLUDED_FILE) -endif (NOT _INCLUDED_FILE) +endif () # We specify the compiler information in the system file for some # platforms, but this language may not have been enabled when the file # was first included. Include it again to get the language info. # Remove this when all compiler info is removed from system files. if (NOT _INCLUDED_FILE) include(Platform/${CMAKE_SYSTEM_NAME} OPTIONAL) -endif (NOT _INCLUDED_FILE) +endif () if(CMAKE_C_SIZEOF_DATA_PTR) foreach(f ${CMAKE_C_ABI_FILES}) @@ -100,13 +100,13 @@ endif() if(NOT CMAKE_MODULE_EXISTS) set(CMAKE_SHARED_MODULE_C_FLAGS ${CMAKE_SHARED_LIBRARY_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}") # avoid just having a space as the initial value for the cache if(CMAKE_C_FLAGS_INIT STREQUAL " ") set(CMAKE_C_FLAGS_INIT) -endif(CMAKE_C_FLAGS_INIT STREQUAL " ") +endif() set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS_INIT}" CACHE STRING "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) 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.") - endif(NOT CMAKE_NO_BUILD_TYPE) + endif() set (CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG_INIT}" CACHE STRING "Flags used by the compiler during debug builds.") 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).") set (CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO_INIT}" CACHE STRING "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) set(CMAKE_C_STANDARD_LIBRARIES "${CMAKE_C_STANDARD_LIBRARIES_INIT}" CACHE STRING "Libraries linked by defalut with all C applications.") mark_as_advanced(CMAKE_C_STANDARD_LIBRARIES) -endif(CMAKE_C_STANDARD_LIBRARIES_INIT) +endif() include(CMakeCommonLanguageInclude) @@ -165,12 +165,12 @@ include(CMakeCommonLanguageInclude) if(NOT 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>") -endif(NOT CMAKE_C_CREATE_SHARED_LIBRARY) +endif() # create a C shared module just copy the shared library rule if(NOT CMAKE_C_CREATE_SHARED_MODULE) 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. # If CMAKE_C_CREATE_STATIC_LIBRARY is set it will override these. @@ -188,24 +188,24 @@ endif() if(NOT CMAKE_C_COMPILE_OBJECT) set(CMAKE_C_COMPILE_OBJECT "<CMAKE_C_COMPILER> <DEFINES> <FLAGS> -o <OBJECT> -c <SOURCE>") -endif(NOT CMAKE_C_COMPILE_OBJECT) +endif() if(NOT CMAKE_C_LINK_EXECUTABLE) set(CMAKE_C_LINK_EXECUTABLE "<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) 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) 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) 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( CMAKE_C_FLAGS diff --git a/Modules/CMakeCXXCompiler.cmake.in b/Modules/CMakeCXXCompiler.cmake.in index 3cef7f8..b6477df 100644 --- a/Modules/CMakeCXXCompiler.cmake.in +++ b/Modules/CMakeCXXCompiler.cmake.in @@ -14,13 +14,13 @@ set(CMAKE_COMPILER_IS_CYGWIN @CMAKE_COMPILER_IS_CYGWIN@) if(CMAKE_COMPILER_IS_CYGWIN) set(CYGWIN 1) set(UNIX 1) -endif(CMAKE_COMPILER_IS_CYGWIN) +endif() set(CMAKE_CXX_COMPILER_ENV_VAR "CXX") if(CMAKE_COMPILER_IS_MINGW) set(MINGW 1) -endif(CMAKE_COMPILER_IS_MINGW) +endif() 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_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) set(CMAKE_SIZEOF_VOID_P "${CMAKE_CXX_SIZEOF_DATA_PTR}") -endif(CMAKE_CXX_SIZEOF_DATA_PTR) +endif() if(CMAKE_CXX_COMPILER_ABI) set(CMAKE_INTERNAL_PLATFORM_ABI "${CMAKE_CXX_COMPILER_ABI}") -endif(CMAKE_CXX_COMPILER_ABI) +endif() if(CMAKE_CXX_LIBRARY_ARCHITECTURE) set(CMAKE_LIBRARY_ARCHITECTURE "@CMAKE_CXX_LIBRARY_ARCHITECTURE@") diff --git a/Modules/CMakeCXXInformation.cmake b/Modules/CMakeCXXInformation.cmake index 961d9cd..933c15a 100644 --- a/Modules/CMakeCXXInformation.cmake +++ b/Modules/CMakeCXXInformation.cmake @@ -22,50 +22,50 @@ # so set the extension here first so it can be overridden by the compiler specific file if(UNIX) set(CMAKE_CXX_OUTPUT_EXTENSION .o) -else(UNIX) +else() set(CMAKE_CXX_OUTPUT_EXTENSION .obj) -endif(UNIX) +endif() set(_INCLUDED_FILE 0) # Load compiler-specific information. if(CMAKE_CXX_COMPILER_ID) include(Compiler/${CMAKE_CXX_COMPILER_ID}-CXX OPTIONAL) -endif(CMAKE_CXX_COMPILER_ID) +endif() set(CMAKE_BASE_NAME) get_filename_component(CMAKE_BASE_NAME ${CMAKE_CXX_COMPILER} NAME_WE) # since the gnu compiler has several names force g++ if(CMAKE_COMPILER_IS_GNUCXX) set(CMAKE_BASE_NAME g++) -endif(CMAKE_COMPILER_IS_GNUCXX) +endif() # load a hardware specific file, mostly useful for embedded compilers if(CMAKE_SYSTEM_PROCESSOR) if(CMAKE_CXX_COMPILER_ID) 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) include(Platform/${CMAKE_SYSTEM_NAME}-${CMAKE_BASE_NAME}-${CMAKE_SYSTEM_PROCESSOR} OPTIONAL) - endif (NOT _INCLUDED_FILE) -endif(CMAKE_SYSTEM_PROCESSOR) + endif () +endif() # load the system- and compiler specific files if(CMAKE_CXX_COMPILER_ID) 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) include(Platform/${CMAKE_SYSTEM_NAME}-${CMAKE_BASE_NAME} OPTIONAL RESULT_VARIABLE _INCLUDED_FILE) -endif (NOT _INCLUDED_FILE) +endif () # We specify the compiler information in the system file for some # platforms, but this language may not have been enabled when the file # was first included. Include it again to get the language info. # Remove this when all compiler info is removed from system files. if (NOT _INCLUDED_FILE) include(Platform/${CMAKE_SYSTEM_NAME} OPTIONAL) -endif (NOT _INCLUDED_FILE) +endif () if(CMAKE_CXX_SIZEOF_DATA_PTR) 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 if(NOT CMAKE_SHARED_LIBRARY_CREATE_CXX_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) 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) 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) 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) 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) 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) 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) 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) 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) set(CMAKE_EXE_EXPORTS_CXX_FLAG ${CMAKE_EXE_EXPORTS_C_FLAG}) @@ -142,27 +142,27 @@ endif() if(NOT CMAKE_EXECUTABLE_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) 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) 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) 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) set(CMAKE_INCLUDE_FLAG_CXX ${CMAKE_INCLUDE_FLAG_C}) -endif(NOT CMAKE_INCLUDE_FLAG_CXX) +endif() if(NOT CMAKE_INCLUDE_FLAG_SEP_CXX) 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 # 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) set(CMAKE_SHARED_MODULE_CXX_FLAGS ${CMAKE_SHARED_LIBRARY_CXX_FLAGS}) set(CMAKE_SHARED_MODULE_CREATE_CXX_FLAGS ${CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS}) -endif(NOT CMAKE_MODULE_EXISTS) +endif() # repeat for modules if(NOT CMAKE_SHARED_MODULE_CREATE_CXX_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) 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. foreach(type SHARED_LIBRARY SHARED_MODULE EXE) if(NOT CMAKE_${type}_LINK_STATIC_CXX_FLAGS) set(CMAKE_${type}_LINK_STATIC_CXX_FLAGS ${CMAKE_${type}_LINK_STATIC_C_FLAGS}) - endif(NOT CMAKE_${type}_LINK_STATIC_CXX_FLAGS) + endif() if(NOT CMAKE_${type}_LINK_DYNAMIC_CXX_FLAGS) set(CMAKE_${type}_LINK_DYNAMIC_CXX_FLAGS ${CMAKE_${type}_LINK_DYNAMIC_C_FLAGS}) - endif(NOT CMAKE_${type}_LINK_DYNAMIC_CXX_FLAGS) -endforeach(type) + endif() +endforeach() # add the flags to the cache based # 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 if(CMAKE_CXX_FLAGS_INIT STREQUAL " ") set(CMAKE_CXX_FLAGS_INIT) -endif(CMAKE_CXX_FLAGS_INIT STREQUAL " ") +endif() set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS_INIT}" CACHE STRING "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 "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) set(CMAKE_CXX_STANDARD_LIBRARIES "${CMAKE_CXX_STANDARD_LIBRARIES_INIT}" CACHE STRING "Libraries linked by defalut with all C++ applications.") mark_as_advanced(CMAKE_CXX_STANDARD_LIBRARIES) -endif(CMAKE_CXX_STANDARD_LIBRARIES_INIT) +endif() include(CMakeCommonLanguageInclude) @@ -255,12 +255,12 @@ include(CMakeCommonLanguageInclude) if(NOT 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>") -endif(NOT CMAKE_CXX_CREATE_SHARED_LIBRARY) +endif() # create a c++ shared module copy the shared library rule by default if(NOT CMAKE_CXX_CREATE_SHARED_MODULE) 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. @@ -279,12 +279,12 @@ endif() if(NOT CMAKE_CXX_COMPILE_OBJECT) set(CMAKE_CXX_COMPILE_OBJECT "<CMAKE_CXX_COMPILER> <DEFINES> <FLAGS> -o <OBJECT> -c <SOURCE>") -endif(NOT CMAKE_CXX_COMPILE_OBJECT) +endif() if(NOT CMAKE_CXX_LINK_EXECUTABLE) set(CMAKE_CXX_LINK_EXECUTABLE "<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( CMAKE_BUILD_TOOL diff --git a/Modules/CMakeCommonLanguageInclude.cmake b/Modules/CMakeCommonLanguageInclude.cmake index 99b5f11..bf94f9f 100644 --- a/Modules/CMakeCommonLanguageInclude.cmake +++ b/Modules/CMakeCommonLanguageInclude.cmake @@ -25,7 +25,7 @@ if(NOT CMAKE_NOT_USING_CONFIG_FLAGS) if(NOT CMAKE_NO_BUILD_TYPE) 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.") - endif(NOT CMAKE_NO_BUILD_TYPE) + endif() set (CMAKE_EXE_LINKER_FLAGS_DEBUG ${CMAKE_EXE_LINKER_FLAGS_DEBUG_INIT} CACHE STRING "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 "Flags used by the linker during Release with Debug Info builds.") -endif(NOT CMAKE_NOT_USING_CONFIG_FLAGS) +endif() # shared linker flags 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.") diff --git a/Modules/CMakeDependentOption.cmake b/Modules/CMakeDependentOption.cmake index 98cae45..990728f 100644 --- a/Modules/CMakeDependentOption.cmake +++ b/Modules/CMakeDependentOption.cmake @@ -31,21 +31,21 @@ macro(CMAKE_DEPENDENT_OPTION option doc default depends force) foreach(d ${depends}) string(REGEX REPLACE " +" ";" CMAKE_DEPENDENT_OPTION_DEP "${d}") if(${CMAKE_DEPENDENT_OPTION_DEP}) - else(${CMAKE_DEPENDENT_OPTION_DEP}) + else() set(${option}_AVAILABLE 0) - endif(${CMAKE_DEPENDENT_OPTION_DEP}) - endforeach(d) + endif() + endforeach() if(${option}_AVAILABLE) option(${option} "${doc}" "${default}") set(${option} "${${option}}" CACHE BOOL "${doc}" FORCE) - else(${option}_AVAILABLE) + else() if(${option} MATCHES "^${option}$") - else(${option} MATCHES "^${option}$") + else() set(${option} "${${option}}" CACHE INTERNAL "${doc}") - endif(${option} MATCHES "^${option}$") + endif() set(${option} ${force}) - endif(${option}_AVAILABLE) - else(${option}_ISSET MATCHES "^${option}_ISSET$") + endif() + else() set(${option} "${${option}_ISSET}") - endif(${option}_ISSET MATCHES "^${option}_ISSET$") -endmacro(CMAKE_DEPENDENT_OPTION) + endif() +endmacro() diff --git a/Modules/CMakeDetermineASMCompiler.cmake b/Modules/CMakeDetermineASMCompiler.cmake index ad6616c..4cf29dd 100644 --- a/Modules/CMakeDetermineASMCompiler.cmake +++ b/Modules/CMakeDetermineASMCompiler.cmake @@ -20,7 +20,7 @@ if(NOT CMAKE_ASM${ASM_DIALECT}_COMPILER) # prefer the environment variable ASM if($ENV{ASM${ASM_DIALECT}} MATCHES ".+") set(CMAKE_ASM${ASM_DIALECT}_COMPILER_INIT "$ENV{ASM${ASM_DIALECT}}") - endif($ENV{ASM${ASM_DIALECT}} MATCHES ".+") + endif() # finally list compilers to try if("ASM${ASM_DIALECT}" STREQUAL "ASM") # the generic assembler support @@ -47,7 +47,7 @@ if(NOT CMAKE_ASM${ASM_DIALECT}_COMPILER) # Find the compiler. _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 # (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) 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) - endif(CMAKE_ASM${ASM_DIALECT}_COMPILER_WITH_PATH) - endif(NOT _CMAKE_USER_ASM${ASM_DIALECT}_COMPILER_PATH) -endif(NOT CMAKE_ASM${ASM_DIALECT}_COMPILER) + endif() + endif() +endif() mark_as_advanced(CMAKE_ASM${ASM_DIALECT}_COMPILER) if (NOT _CMAKE_TOOLCHAIN_LOCATION) 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) @@ -110,9 +110,9 @@ endif() if(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") -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) if (COMPILER_BASENAME MATCHES "^(.+-)g?as(-[0-9]+\\.[0-9]+\\.[0-9]+)?(\\.exe)?$") set(_CMAKE_TOOLCHAIN_PREFIX ${CMAKE_MATCH_1}) - endif (COMPILER_BASENAME MATCHES "^(.+-)g?as(-[0-9]+\\.[0-9]+\\.[0-9]+)?(\\.exe)?$") -endif (NOT _CMAKE_TOOLCHAIN_PREFIX) + endif () +endif () # Now try the C compiler regexp: if (NOT _CMAKE_TOOLCHAIN_PREFIX) if (COMPILER_BASENAME MATCHES "^(.+-)g?cc(-[0-9]+\\.[0-9]+\\.[0-9]+)?(\\.exe)?$") set(_CMAKE_TOOLCHAIN_PREFIX ${CMAKE_MATCH_1}) - endif (COMPILER_BASENAME MATCHES "^(.+-)g?cc(-[0-9]+\\.[0-9]+\\.[0-9]+)?(\\.exe)?$") -endif (NOT _CMAKE_TOOLCHAIN_PREFIX) + endif () +endif () # Finally try the CXX compiler regexp: if (NOT _CMAKE_TOOLCHAIN_PREFIX) if (COMPILER_BASENAME MATCHES "^(.+-)[gc]\\+\\+(-[0-9]+\\.[0-9]+\\.[0-9]+)?(\\.exe)?$") set(_CMAKE_TOOLCHAIN_PREFIX ${CMAKE_MATCH_1}) - endif (COMPILER_BASENAME MATCHES "^(.+-)[gc]\\+\\+(-[0-9]+\\.[0-9]+\\.[0-9]+)?(\\.exe)?$") -endif (NOT _CMAKE_TOOLCHAIN_PREFIX) + endif () +endif () include(CMakeFindBinUtils) @@ -151,9 +151,9 @@ set(CMAKE_ASM${ASM_DIALECT}_COMPILER_ENV_VAR "ASM${ASM_DIALECT}") if(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") -endif(CMAKE_ASM${ASM_DIALECT}_COMPILER) +endif() set(_CMAKE_ASM_COMPILER "${CMAKE_ASM${ASM_DIALECT}_COMPILER}") diff --git a/Modules/CMakeDetermineASM_MASMCompiler.cmake b/Modules/CMakeDetermineASM_MASMCompiler.cmake index 3649537..665a65c 100644 --- a/Modules/CMakeDetermineASM_MASMCompiler.cmake +++ b/Modules/CMakeDetermineASM_MASMCompiler.cmake @@ -19,9 +19,9 @@ set(ASM_DIALECT "_MASM") # if we are using the 64bit cl compiler, assume we also want the 64bit assembler if(CMAKE_CL_64) set(CMAKE_ASM${ASM_DIALECT}_COMPILER_INIT ml64) -else(CMAKE_CL_64) +else() set(CMAKE_ASM${ASM_DIALECT}_COMPILER_INIT ml) -endif(CMAKE_CL_64) +endif() include(CMakeDetermineASMCompiler) set(ASM_DIALECT) diff --git a/Modules/CMakeDetermineASM_NASMCompiler.cmake b/Modules/CMakeDetermineASM_NASMCompiler.cmake index a9a9e05..50f71dd 100644 --- a/Modules/CMakeDetermineASM_NASMCompiler.cmake +++ b/Modules/CMakeDetermineASM_NASMCompiler.cmake @@ -19,7 +19,7 @@ set(CMAKE_ASM_NASM_COMPILER_INIT nasm yasm) if(NOT CMAKE_ASM_NASM_COMPILER) find_program(CMAKE_ASM_NASM_COMPILER nasm "$ENV{ProgramFiles}/NASM") -endif(NOT CMAKE_ASM_NASM_COMPILER) +endif() # Load the generic DetermineASM compiler file with the DIALECT set properly: set(ASM_DIALECT "_NASM") diff --git a/Modules/CMakeDetermineCCompiler.cmake b/Modules/CMakeDetermineCCompiler.cmake index 6bed021..171eadd 100644 --- a/Modules/CMakeDetermineCCompiler.cmake +++ b/Modules/CMakeDetermineCCompiler.cmake @@ -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) if(CMAKE_C_FLAGS_ENV_INIT) 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}) message(FATAL_ERROR "Could not find compiler set in environment variable CC:\n$ENV{CC}.") - endif(NOT EXISTS ${CMAKE_C_COMPILER_INIT}) - endif($ENV{CC} MATCHES ".+") + endif() + endif() # next try prefer the compiler specified by the generator if(CMAKE_GENERATOR_CC) if(NOT CMAKE_C_COMPILER_INIT) set(CMAKE_C_COMPILER_INIT ${CMAKE_GENERATOR_CC}) - endif(NOT CMAKE_C_COMPILER_INIT) - endif(CMAKE_GENERATOR_CC) + endif() + endif() # finally list compilers to try if(NOT CMAKE_C_COMPILER_INIT) @@ -67,7 +67,7 @@ if(NOT CMAKE_C_COMPILER) _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 # (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) list(GET CMAKE_C_COMPILER 1 CMAKE_C_COMPILER_ARG1) 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, # 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) if(CMAKE_C_COMPILER_WITH_PATH) set(CMAKE_C_COMPILER ${CMAKE_C_COMPILER_WITH_PATH} CACHE STRING "C compiler" FORCE) - endif(CMAKE_C_COMPILER_WITH_PATH) - endif(NOT _CMAKE_USER_C_COMPILER_PATH) -endif(NOT CMAKE_C_COMPILER) + endif() + endif() +endif() mark_as_advanced(CMAKE_C_COMPILER) if (NOT _CMAKE_TOOLCHAIN_LOCATION) 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. if(${CMAKE_GENERATOR} MATCHES "Visual Studio") set(CMAKE_C_COMPILER_ID_RUN 1) set(CMAKE_C_PLATFORM_ID "Windows") set(CMAKE_C_COMPILER_ID "MSVC") -endif(${CMAKE_GENERATOR} MATCHES "Visual Studio") +endif() if(NOT CMAKE_C_COMPILER_ID_RUN) 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. if("${CMAKE_C_COMPILER_ID}" MATCHES "GNU") set(CMAKE_COMPILER_IS_GNUCC 1) - endif("${CMAKE_C_COMPILER_ID}" MATCHES "GNU") + endif() if("${CMAKE_C_PLATFORM_ID}" MATCHES "MinGW") set(CMAKE_COMPILER_IS_MINGW 1) elseif("${CMAKE_C_PLATFORM_ID}" MATCHES "Cygwin") set(CMAKE_COMPILER_IS_CYGWIN 1) - endif("${CMAKE_C_PLATFORM_ID}" MATCHES "MinGW") -endif(NOT CMAKE_C_COMPILER_ID_RUN) + endif() +endif() # 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 @@ -152,13 +152,13 @@ if (CMAKE_CROSSCOMPILING get_filename_component(COMPILER_BASENAME "${CMAKE_C_COMPILER}" NAME) if (COMPILER_BASENAME MATCHES "^(.+-)g?cc(-[0-9]+\\.[0-9]+\\.[0-9]+)?(\\.exe)?$") 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 # but uses the regular ar, objcopy, etc. (instead of llvm-objcopy etc.) if ("${_CMAKE_TOOLCHAIN_PREFIX}" MATCHES "(.+-)?llvm-$") set(_CMAKE_TOOLCHAIN_PREFIX ${CMAKE_MATCH_1}) - endif ("${_CMAKE_TOOLCHAIN_PREFIX}" MATCHES "(.+-)?llvm-$") + endif () endif (CMAKE_CROSSCOMPILING AND "${CMAKE_C_COMPILER_ID}" MATCHES "GNU" @@ -169,7 +169,7 @@ include(CMakeFindBinUtils) if(MSVC_C_ARCHITECTURE_ID) set(SET_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_file(${CMAKE_ROOT}/Modules/CMakeCCompiler.cmake.in "${CMAKE_PLATFORM_ROOT_BIN}/CMakeCCompiler.cmake" diff --git a/Modules/CMakeDetermineCXXCompiler.cmake b/Modules/CMakeDetermineCXXCompiler.cmake index aaabb20..898947a 100644 --- a/Modules/CMakeDetermineCXXCompiler.cmake +++ b/Modules/CMakeDetermineCXXCompiler.cmake @@ -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) if(CMAKE_CXX_FLAGS_ENV_INIT) 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}) 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($ENV{CXX} MATCHES ".+") + endif() + endif() # next prefer the generator specified compiler if(CMAKE_GENERATOR_CXX) if(NOT CMAKE_CXX_COMPILER_INIT) set(CMAKE_CXX_COMPILER_INIT ${CMAKE_GENERATOR_CXX}) - endif(NOT CMAKE_CXX_COMPILER_INIT) - endif(CMAKE_GENERATOR_CXX) + endif() + endif() # finally list compilers to try if(NOT CMAKE_CXX_COMPILER_INIT) @@ -65,7 +65,7 @@ if(NOT CMAKE_CXX_COMPILER) endif() _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 # (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) list(GET CMAKE_CXX_COMPILER 1 CMAKE_CXX_COMPILER_ARG1) 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, # 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) if(CMAKE_CXX_COMPILER_WITH_PATH) set(CMAKE_CXX_COMPILER ${CMAKE_CXX_COMPILER_WITH_PATH} CACHE STRING "CXX compiler" FORCE) - endif(CMAKE_CXX_COMPILER_WITH_PATH) - endif(NOT _CMAKE_USER_CXX_COMPILER_PATH) -endif(NOT CMAKE_CXX_COMPILER) + endif() + endif() +endif() mark_as_advanced(CMAKE_CXX_COMPILER) if (NOT _CMAKE_TOOLCHAIN_LOCATION) 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 # source file. Unless g++ crashes when building a small C++ @@ -109,14 +109,14 @@ endif (NOT _CMAKE_TOOLCHAIN_LOCATION) # if(BEOS) # set(CMAKE_COMPILER_IS_GNUCXX 1) # set(CMAKE_COMPILER_IS_GNUCXX_RUN 1) -# endif(BEOS) +# endif() # Build a small source file to identify the compiler. if(${CMAKE_GENERATOR} MATCHES "Visual Studio") set(CMAKE_CXX_COMPILER_ID_RUN 1) set(CMAKE_CXX_PLATFORM_ID "Windows") set(CMAKE_CXX_COMPILER_ID "MSVC") -endif(${CMAKE_GENERATOR} MATCHES "Visual Studio") +endif() if(NOT CMAKE_CXX_COMPILER_ID_RUN) 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. if("${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU") set(CMAKE_COMPILER_IS_GNUCXX 1) - endif("${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU") + endif() if("${CMAKE_CXX_PLATFORM_ID}" MATCHES "MinGW") set(CMAKE_COMPILER_IS_MINGW 1) elseif("${CMAKE_CXX_PLATFORM_ID}" MATCHES "Cygwin") set(CMAKE_COMPILER_IS_CYGWIN 1) - endif("${CMAKE_CXX_PLATFORM_ID}" MATCHES "MinGW") -endif(NOT CMAKE_CXX_COMPILER_ID_RUN) + endif() +endif() # 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 @@ -159,13 +159,13 @@ if (CMAKE_CROSSCOMPILING get_filename_component(COMPILER_BASENAME "${CMAKE_CXX_COMPILER}" NAME) if (COMPILER_BASENAME MATCHES "^(.+-)[gc]\\+\\+(-[0-9]+\\.[0-9]+\\.[0-9]+)?(\\.exe)?$") 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 # but uses the regular ar, objcopy, etc. (instead of llvm-objcopy etc.) if ("${_CMAKE_TOOLCHAIN_PREFIX}" MATCHES "(.+-)?llvm-$") set(_CMAKE_TOOLCHAIN_PREFIX ${CMAKE_MATCH_1}) - endif ("${_CMAKE_TOOLCHAIN_PREFIX}" MATCHES "(.+-)?llvm-$") + endif () endif (CMAKE_CROSSCOMPILING AND "${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU" @@ -176,7 +176,7 @@ include(CMakeFindBinUtils) if(MSVC_CXX_ARCHITECTURE_ID) set(SET_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_file(${CMAKE_ROOT}/Modules/CMakeCXXCompiler.cmake.in ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeCXXCompiler.cmake diff --git a/Modules/CMakeDetermineCompilerABI.cmake b/Modules/CMakeDetermineCompilerABI.cmake index b79afdf..ae2eb9b 100644 --- a/Modules/CMakeDetermineCompilerABI.cmake +++ b/Modules/CMakeDetermineCompilerABI.cmake @@ -49,21 +49,21 @@ function(CMAKE_DETERMINE_COMPILER_ABI lang src) foreach(info ${ABI_STRINGS}) if("${info}" MATCHES ".*INFO:sizeof_dptr\\[0*([^]]*)\\].*") 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\\[([^]]*)\\].*") string(REGEX REPLACE ".*INFO:abi\\[([^]]*)\\].*" "\\1" ABI_NAME "${info}") - endif("${info}" MATCHES ".*INFO:abi\\[([^]]*)\\].*") - endforeach(info) + endif() + endforeach() if(ABI_SIZEOF_DPTR) set(CMAKE_${lang}_SIZEOF_DATA_PTR "${ABI_SIZEOF_DPTR}" PARENT_SCOPE) elseif(CMAKE_${lang}_SIZEOF_DATA_PTR_DEFAULT) set(CMAKE_${lang}_SIZEOF_DATA_PTR "${CMAKE_${lang}_SIZEOF_DATA_PTR_DEFAULT}" PARENT_SCOPE) - endif(ABI_SIZEOF_DPTR) + endif() if(ABI_NAME) set(CMAKE_${lang}_COMPILER_ABI "${ABI_NAME}" PARENT_SCOPE) - endif(ABI_NAME) + endif() # Parse implicit linker information for this language, if available. set(implicit_dirs "") @@ -122,10 +122,10 @@ function(CMAKE_DETERMINE_COMPILER_ABI lang src) endforeach() endif() - else(CMAKE_DETERMINE_${lang}_ABI_COMPILED) + else() message(STATUS "Detecting ${lang} compiler ABI info - failed") 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") - endif(CMAKE_DETERMINE_${lang}_ABI_COMPILED) - endif(NOT DEFINED CMAKE_DETERMINE_${lang}_ABI_COMPILED) -endfunction(CMAKE_DETERMINE_COMPILER_ABI) + endif() + endif() +endfunction() diff --git a/Modules/CMakeDetermineCompilerId.cmake b/Modules/CMakeDetermineCompilerId.cmake index 6fd0add..f574978 100644 --- a/Modules/CMakeDetermineCompilerId.cmake +++ b/Modules/CMakeDetermineCompilerId.cmake @@ -24,9 +24,9 @@ function(CMAKE_DETERMINE_COMPILER_ID lang flagvar src) # Make sure user-specified compiler flags are used. if(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}}) - endif(CMAKE_${lang}_FLAGS) + endif() string(REGEX REPLACE " " ";" CMAKE_${lang}_COMPILER_ID_FLAGS_LIST "${CMAKE_${lang}_COMPILER_ID_FLAGS}") # 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}") foreach(file ${COMPILER_${lang}_PRODUCED_FILES}) CMAKE_DETERMINE_COMPILER_ID_CHECK("${lang}" "${CMAKE_${lang}_COMPILER_ID_DIR}/${file}" "${src}") - endforeach(file) - endif(NOT CMAKE_${lang}_COMPILER_ID) - endforeach(flags) + endforeach() + endif() + endforeach() # If the compiler is still unknown, try to query its vendor. 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(NOT CMAKE_EXECUTABLE_FORMAT) set(CMAKE_EXECUTABLE_FORMAT "Unknown" CACHE INTERNAL "Executable file format") - endif(NOT CMAKE_EXECUTABLE_FORMAT) + endif() # Display the final identification result. if(CMAKE_${lang}_COMPILER_ID) @@ -62,16 +62,16 @@ function(CMAKE_DETERMINE_COMPILER_ID lang flagvar src) endif() message(STATUS "The ${lang} compiler identification is " "${CMAKE_${lang}_COMPILER_ID}${_version}") - else(CMAKE_${lang}_COMPILER_ID) + else() 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}_PLATFORM_ID "${CMAKE_${lang}_PLATFORM_ID}" PARENT_SCOPE) set(MSVC_${lang}_ARCHITECTURE_ID "${MSVC_${lang}_ARCHITECTURE_ID}" 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. @@ -79,7 +79,7 @@ function(CMAKE_DETERMINE_COMPILER_ID_WRITE lang src) file(READ ${CMAKE_ROOT}/Modules/${src}.in ID_CONTENT_IN) string(CONFIGURE "${ID_CONTENT_IN}" ID_CONTENT_OUT @ONLY) 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 @@ -110,7 +110,7 @@ Id flags: ${testflags} ERROR_VARIABLE CMAKE_${lang}_COMPILER_ID_OUTPUT RESULT_VARIABLE CMAKE_${lang}_COMPILER_ID_RESULT ) - else(COMMAND EXECUTE_PROCESS) + else() exec_program( ${CMAKE_${lang}_COMPILER} ${CMAKE_${lang}_COMPILER_ID_DIR} ARGS ${CMAKE_${lang}_COMPILER_ID_ARG1} @@ -120,7 +120,7 @@ Id flags: ${testflags} OUTPUT_VARIABLE CMAKE_${lang}_COMPILER_ID_OUTPUT RETURN_VALUE CMAKE_${lang}_COMPILER_ID_RESULT ) - endif(COMMAND EXECUTE_PROCESS) + endif() # Check the result of compilation. 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}") #if(NOT CMAKE_${lang}_COMPILER_ID_ALLOW_FAIL) # message(FATAL_ERROR "${MSG}") - #endif(NOT CMAKE_${lang}_COMPILER_ID_ALLOW_FAIL) + #endif() # No output files should be inspected. set(COMPILER_${lang}_PRODUCED_FILES) - else(CMAKE_${lang}_COMPILER_ID_RESULT) + else() # Compilation succeeded. file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log "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 "Compilation of the ${lang} compiler identification source \"" "${src}\" produced \"${file}\"\n\n") - endforeach(file) + endforeach() if(NOT COMPILER_${lang}_PRODUCED_FILES) # No executable was found. @@ -169,12 +169,12 @@ ${CMAKE_${lang}_COMPILER_ID_OUTPUT} "Compilation of the ${lang} compiler identification source \"" "${src}\" did not produce an executable in \"" "${CMAKE_${lang}_COMPILER_ID_DIR}\".\n\n") - endif(NOT COMPILER_${lang}_PRODUCED_FILES) - endif(CMAKE_${lang}_COMPILER_ID_RESULT) + endif() + endif() # Return the files produced by the compilation. 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. @@ -192,24 +192,24 @@ function(CMAKE_DETERMINE_COMPILER_ID_CHECK lang file) if("${info}" MATCHES ".*INFO:compiler\\[([^]\"]*)\\].*") if(COMPILER_ID) set(COMPILER_ID_TWICE 1) - endif(COMPILER_ID) + endif() string(REGEX REPLACE ".*INFO:compiler\\[([^]]*)\\].*" "\\1" COMPILER_ID "${info}") - endif("${info}" MATCHES ".*INFO:compiler\\[([^]\"]*)\\].*") + endif() if("${info}" MATCHES ".*INFO:platform\\[([^]\"]*)\\].*") string(REGEX REPLACE ".*INFO:platform\\[([^]]*)\\].*" "\\1" PLATFORM_ID "${info}") - endif("${info}" MATCHES ".*INFO:platform\\[([^]\"]*)\\].*") + endif() if("${info}" MATCHES ".*INFO:arch\\[([^]\"]*)\\].*") string(REGEX REPLACE ".*INFO:arch\\[([^]]*)\\].*" "\\1" ARCHITECTURE_ID "${info}") - endif("${info}" MATCHES ".*INFO:arch\\[([^]\"]*)\\].*") + endif() if("${info}" MATCHES ".*INFO:compiler_version\\[([^]\"]*)\\].*") 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}") - endif("${info}" MATCHES ".*INFO:compiler_version\\[([^]\"]*)\\].*") - endforeach(info) + endif() + endforeach() # Check if a valid compiler and platform were found. 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(MSVC_${lang}_ARCHITECTURE_ID "${ARCHITECTURE_ID}") set(CMAKE_${lang}_COMPILER_VERSION "${COMPILER_VERSION}") - endif(COMPILER_ID AND NOT COMPILER_ID_TWICE) + endif() # Check the compiler identification string. 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 "The ${lang} compiler identification is ${CMAKE_${lang}_COMPILER_ID}, found in \"" "${file}\"\n\n") - else(CMAKE_${lang}_COMPILER_ID) + else() # The compiler identification could not be found. file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log "The ${lang} compiler identification could not be found in \"" "${file}\"\n\n") - endif(CMAKE_${lang}_COMPILER_ID) - endif(NOT CMAKE_${lang}_COMPILER_ID) + endif() + endif() # try to figure out the executable format: ELF, COFF, Mach-O if(NOT CMAKE_EXECUTABLE_FORMAT) @@ -240,22 +240,22 @@ function(CMAKE_DETERMINE_COMPILER_ID_CHECK lang file) # ELF files start with 0x7f"ELF" if("${CMAKE_EXECUTABLE_MAGIC}" STREQUAL "7f454c46") set(CMAKE_EXECUTABLE_FORMAT "ELF" CACHE INTERNAL "Executable file format") - endif("${CMAKE_EXECUTABLE_MAGIC}" STREQUAL "7f454c46") + endif() # # COFF (.exe) files start with "MZ" # if("${CMAKE_EXECUTABLE_MAGIC}" MATCHES "4d5a....") # 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 # if("${CMAKE_EXECUTABLE_MAGIC}" MATCHES "cafebabe") # set(CMAKE_EXECUTABLE_FORMAT "MACHO" CACHE STRING "Executable file format") -# endif("${CMAKE_EXECUTABLE_MAGIC}" MATCHES "cafebabe") +# endif() # if("${CMAKE_EXECUTABLE_MAGIC}" MATCHES "feedface") # 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) set(CMAKE_EXECUTABLE_FORMAT) endif() @@ -266,7 +266,7 @@ function(CMAKE_DETERMINE_COMPILER_ID_CHECK lang file) PARENT_SCOPE) set(CMAKE_${lang}_COMPILER_VERSION "${CMAKE_${lang}_COMPILER_VERSION}" 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. @@ -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}) file(REMOVE_RECURSE ${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}) @@ -320,4 +320,4 @@ function(CMAKE_DETERMINE_COMPILER_ID_VENDOR lang) endif() endif() endforeach() -endfunction(CMAKE_DETERMINE_COMPILER_ID_VENDOR) +endfunction() diff --git a/Modules/CMakeDetermineFortranCompiler.cmake b/Modules/CMakeDetermineFortranCompiler.cmake index c8e5612..da77e21 100644 --- a/Modules/CMakeDetermineFortranCompiler.cmake +++ b/Modules/CMakeDetermineFortranCompiler.cmake @@ -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) if(CMAKE_Fortran_FLAGS_ENV_INIT) 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}) - else(EXISTS ${CMAKE_Fortran_COMPILER_INIT}) + else() message(FATAL_ERROR "Could not find compiler set in environment variable FC:\n$ENV{FC}.") - endif(EXISTS ${CMAKE_Fortran_COMPILER_INIT}) - endif($ENV{FC} MATCHES ".+") + endif() + endif() # next try prefer the compiler specified by the generator if(CMAKE_GENERATOR_FC) if(NOT CMAKE_Fortran_COMPILER_INIT) set(CMAKE_Fortran_COMPILER_INIT ${CMAKE_GENERATOR_FC}) - endif(NOT CMAKE_Fortran_COMPILER_INIT) - endif(CMAKE_GENERATOR_FC) + endif() + endif() # finally list compilers to try if(NOT CMAKE_Fortran_COMPILER_INIT) @@ -85,7 +85,7 @@ if(NOT CMAKE_Fortran_COMPILER) _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 # (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 @@ -95,7 +95,7 @@ else(NOT CMAKE_Fortran_COMPILER) if("${_CMAKE_Fortran_COMPILER_LIST_LENGTH}" EQUAL 2) list(GET CMAKE_Fortran_COMPILER 1 CMAKE_Fortran_COMPILER_ARG1) 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, # now try to find it with the full path @@ -109,9 +109,9 @@ else(NOT CMAKE_Fortran_COMPILER) if(CMAKE_Fortran_COMPILER_WITH_PATH) set(CMAKE_Fortran_COMPILER ${CMAKE_Fortran_COMPILER_WITH_PATH} CACHE STRING "Fortran compiler" FORCE) - endif(CMAKE_Fortran_COMPILER_WITH_PATH) - endif(NOT _CMAKE_USER_Fortran_COMPILER_PATH) -endif(NOT CMAKE_Fortran_COMPILER) + endif() + endif() +endif() 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_PLATFORM_ID "Windows") set(CMAKE_Fortran_COMPILER_ID "Intel") -endif(${CMAKE_GENERATOR} MATCHES "Visual Studio") +endif() if(NOT CMAKE_Fortran_COMPILER_ID_RUN) 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 "Determining if the Fortran compiler is GNU succeeded with " "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 "Determining if the Fortran compiler is GNU failed with " "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("${CMAKE_COMPILER_OUTPUT}" MATCHES ".*THIS_IS_MINGW.*" ) set(CMAKE_Fortran_PLATFORM_ID "MinGW") - endif("${CMAKE_COMPILER_OUTPUT}" MATCHES ".*THIS_IS_MINGW.*" ) + endif() if("${CMAKE_COMPILER_OUTPUT}" MATCHES ".*THIS_IS_CYGWIN.*" ) set(CMAKE_Fortran_PLATFORM_ID "Cygwin") - endif("${CMAKE_COMPILER_OUTPUT}" MATCHES ".*THIS_IS_CYGWIN.*" ) - endif(NOT CMAKE_Fortran_PLATFORM_ID) - endif(NOT CMAKE_COMPILER_RETURN) - endif(NOT CMAKE_Fortran_COMPILER_ID) + endif() + endif() + endif() + endif() # Set old compiler and platform id variables. if("${CMAKE_Fortran_COMPILER_ID}" MATCHES "GNU") set(CMAKE_COMPILER_IS_GNUG77 1) - endif("${CMAKE_Fortran_COMPILER_ID}" MATCHES "GNU") + endif() if("${CMAKE_Fortran_PLATFORM_ID}" MATCHES "MinGW") set(CMAKE_COMPILER_IS_MINGW 1) elseif("${CMAKE_Fortran_PLATFORM_ID}" MATCHES "Cygwin") set(CMAKE_COMPILER_IS_CYGWIN 1) - endif("${CMAKE_Fortran_PLATFORM_ID}" MATCHES "MinGW") -endif(NOT CMAKE_Fortran_COMPILER_ID_RUN) + endif() +endif() include(CMakeFindBinUtils) diff --git a/Modules/CMakeDetermineJavaCompiler.cmake b/Modules/CMakeDetermineJavaCompiler.cmake index f35b9ff..3f430b4 100644 --- a/Modules/CMakeDetermineJavaCompiler.cmake +++ b/Modules/CMakeDetermineJavaCompiler.cmake @@ -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) if(CMAKE_Java_FLAGS_ENV_INIT) 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}) 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($ENV{JAVA_COMPILER} MATCHES ".+") + endif() + endif() if($ENV{JAVA_RUNTIME} MATCHES ".+") 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}) 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($ENV{JAVA_RUNTIME} MATCHES ".+") + endif() + endif() if($ENV{JAVA_ARCHIVE} MATCHES ".+") 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}) 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($ENV{JAVA_ARCHIVE} MATCHES ".+") + endif() + endif() set(Java_BIN_PATH "[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(CMAKE_Java_COMPILER_INIT) set(CMAKE_Java_COMPILER ${CMAKE_Java_COMPILER_INIT} CACHE PATH "Java Compiler") - else(CMAKE_Java_COMPILER_INIT) + else() find_program(CMAKE_Java_COMPILER NAMES javac PATHS ${Java_BIN_PATH} ) - endif(CMAKE_Java_COMPILER_INIT) + endif() # if no runtime has been specified yet, then look for one if(CMAKE_Java_RUNTIME_INIT) set(CMAKE_Java_RUNTIME ${CMAKE_Java_RUNTIME_INIT} CACHE PATH "Java Compiler") - else(CMAKE_Java_RUNTIME_INIT) + else() find_program(CMAKE_Java_RUNTIME NAMES java PATHS ${Java_BIN_PATH} ) - endif(CMAKE_Java_RUNTIME_INIT) + endif() # if no archive has been specified yet, then look for one if(CMAKE_Java_ARCHIVE_INIT) set(CMAKE_Java_ARCHIVE ${CMAKE_Java_ARCHIVE_INIT} CACHE PATH "Java Compiler") - else(CMAKE_Java_ARCHIVE_INIT) + else() find_program(CMAKE_Java_ARCHIVE NAMES jar PATHS ${Java_BIN_PATH} ) - endif(CMAKE_Java_ARCHIVE_INIT) -endif(NOT CMAKE_Java_COMPILER) + endif() +endif() mark_as_advanced(CMAKE_Java_COMPILER) # configure variables set in this file for fast reload later on diff --git a/Modules/CMakeDetermineRCCompiler.cmake b/Modules/CMakeDetermineRCCompiler.cmake index 41a7af5..669dd16 100644 --- a/Modules/CMakeDetermineRCCompiler.cmake +++ b/Modules/CMakeDetermineRCCompiler.cmake @@ -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) if(CMAKE_RC_FLAGS_ENV_INIT) 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}) - else(EXISTS ${CMAKE_RC_COMPILER_INIT}) + else() message(FATAL_ERROR "Could not find compiler set in environment variable RC:\n$ENV{RC}.") - endif(EXISTS ${CMAKE_RC_COMPILER_INIT}) - endif($ENV{RC} MATCHES ".+") + endif() + endif() # next try prefer the compiler specified by the generator if(CMAKE_GENERATOR_RC) if(NOT CMAKE_RC_COMPILER_INIT) set(CMAKE_RC_COMPILER_INIT ${CMAKE_GENERATOR_RC}) - endif(NOT CMAKE_RC_COMPILER_INIT) - endif(CMAKE_GENERATOR_RC) + endif() + endif() # finally list compilers to try if(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) - endif(CMAKE_RC_COMPILER_INIT) + endif() # Find the compiler. find_program(CMAKE_RC_COMPILER NAMES ${CMAKE_RC_COMPILER_LIST} DOC "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) - endif(CMAKE_RC_COMPILER_INIT AND NOT CMAKE_RC_COMPILER) -endif(NOT CMAKE_RC_COMPILER) + endif() +endif() mark_as_advanced(CMAKE_RC_COMPILER) diff --git a/Modules/CMakeDetermineSystem.cmake b/Modules/CMakeDetermineSystem.cmake index a72bd5f..22c5016 100644 --- a/Modules/CMakeDetermineSystem.cmake +++ b/Modules/CMakeDetermineSystem.cmake @@ -59,23 +59,23 @@ if(CMAKE_HOST_UNIX) if("${val}" GREATER 0) exec_program(uname ARGS -m OUTPUT_VARIABLE CMAKE_HOST_SYSTEM_PROCESSOR RETURN_VALUE val) - endif("${val}" GREATER 0) + endif() endif() # check the return of the last uname -m or -p if("${val}" GREATER 0) set(CMAKE_HOST_SYSTEM_PROCESSOR "unknown") - endif("${val}" GREATER 0) + endif() set(CMAKE_UNAME ${CMAKE_UNAME} CACHE INTERNAL "uname command") # 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}") - endif(CMAKE_UNAME) -else(CMAKE_HOST_UNIX) + endif() +else() if(CMAKE_HOST_WIN32) set (CMAKE_HOST_SYSTEM_NAME "Windows") set (CMAKE_HOST_SYSTEM_PROCESSOR "$ENV{PROCESSOR_ARCHITECTURE}") - endif(CMAKE_HOST_WIN32) -endif(CMAKE_HOST_UNIX) + endif() +endif() # 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_* @@ -87,15 +87,15 @@ if(CMAKE_TOOLCHAIN_FILE) if(NOT _INCLUDED_TOOLCHAIN_FILE) # if the file isn't found there, check the default locations include("${CMAKE_TOOLCHAIN_FILE}" OPTIONAL RESULT_VARIABLE _INCLUDED_TOOLCHAIN_FILE) - endif(NOT _INCLUDED_TOOLCHAIN_FILE) + endif() if(_INCLUDED_TOOLCHAIN_FILE) 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}") set(CMAKE_TOOLCHAIN_FILE "NOTFOUND" CACHE FILEPATH "The CMake toolchain file" FORCE) - endif(_INCLUDED_TOOLCHAIN_FILE) -endif(CMAKE_TOOLCHAIN_FILE) + endif() +endif() # 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(NOT DEFINED CMAKE_CROSSCOMPILING) set(CMAKE_CROSSCOMPILING TRUE) - endif(NOT DEFINED CMAKE_CROSSCOMPILING) + endif() set(PRESET_CMAKE_SYSTEM_NAME TRUE) -else(CMAKE_SYSTEM_NAME) +else() set(CMAKE_SYSTEM_NAME "${CMAKE_HOST_SYSTEM_NAME}") set(CMAKE_SYSTEM_VERSION "${CMAKE_HOST_SYSTEM_VERSION}") set(CMAKE_SYSTEM_PROCESSOR "${CMAKE_HOST_SYSTEM_PROCESSOR}") set(CMAKE_CROSSCOMPILING FALSE) set(PRESET_CMAKE_SYSTEM_NAME FALSE) -endif(CMAKE_SYSTEM_NAME) +endif() macro(ADJUST_CMAKE_SYSTEM_VARIABLES _PREFIX) if(NOT ${_PREFIX}_NAME) set(${_PREFIX}_NAME "UnknownOS") - endif(NOT ${_PREFIX}_NAME) + endif() # fix for BSD/OS , remove the / if(${_PREFIX}_NAME MATCHES BSD.OS) set(${_PREFIX}_NAME BSDOS) - endif(${_PREFIX}_NAME MATCHES BSD.OS) + endif() # fix for GNU/kFreeBSD, remove the GNU/ if(${_PREFIX}_NAME MATCHES kFreeBSD) set(${_PREFIX}_NAME kFreeBSD) - endif(${_PREFIX}_NAME MATCHES kFreeBSD) + endif() # fix for CYGWIN which has windows version in it if(${_PREFIX}_NAME MATCHES CYGWIN) set(${_PREFIX}_NAME CYGWIN) - endif(${_PREFIX}_NAME MATCHES CYGWIN) + endif() # set CMAKE_SYSTEM to the CMAKE_SYSTEM_NAME set(${_PREFIX} ${${_PREFIX}_NAME}) # if there is a CMAKE_SYSTEM_VERSION then add a -${CMAKE_SYSTEM_VERSION} if(${_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_HOST_SYSTEM) @@ -156,21 +156,21 @@ if(CMAKE_BINARY_DIR) "The target system is: ${CMAKE_SYSTEM_NAME} - ${CMAKE_SYSTEM_VERSION} - ${CMAKE_SYSTEM_PROCESSOR}\n") 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") - else(PRESET_CMAKE_SYSTEM_NAME) + else() file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log "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, # 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) if(DEFINED 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_file(${CMAKE_ROOT}/Modules/CMakeSystem.cmake.in ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeSystem.cmake IMMEDIATE @ONLY) -endif(CMAKE_BINARY_DIR) +endif() diff --git a/Modules/CMakeExpandImportedTargets.cmake b/Modules/CMakeExpandImportedTargets.cmake index d698ad8..14551d1 100644 --- a/Modules/CMakeExpandImportedTargets.cmake +++ b/Modules/CMakeExpandImportedTargets.cmake @@ -76,16 +76,16 @@ function(CMAKE_EXPAND_IMPORTED_TARGETS _RESULT ) # guard against infinite loop: abort after 100 iterations ( 100 is arbitrary chosen) if ("${_CCSR_LOOP_COUNTER}" LESS 100) set(_CHECK_FOR_IMPORTED_TARGETS TRUE) -# else ("${_CCSR_LOOP_COUNTER}" LESS 1) +# else () # 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}, # use it, otherwise simply use the first one: list(FIND _importedConfigs "${CEIT_CONFIGURATION}" _configIndexToUse) if("${_configIndexToUse}" EQUAL -1) set(_configIndexToUse 0) - endif("${_configIndexToUse}" EQUAL -1) + endif() list(GET _importedConfigs ${_configIndexToUse} _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}") if(_currentLinkInterfaceLib) list(APPEND _CCSR_NEW_REQ_LIBS "${_currentLinkInterfaceLib}" ) - endif(_currentLinkInterfaceLib) - endforeach(_currentLinkInterfaceLib "${_linkInterfaceLibs}") - endif(_linkInterfaceLibs) - else(_importedConfigs) + endif() + endforeach() + endif() + else() # "Normal" libraries are just used as they are. list(APPEND _CCSR_NEW_REQ_LIBS "${_CURRENT_LIB}" ) # message(STATUS "Appending lib directly: ${_CURRENT_LIB}") - endif(_importedConfigs) - endforeach(_CURRENT_LIB ${_CCSR_REQ_LIBS}) + endif() + endforeach() 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 # 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) list(APPEND _CCSR_NEW_REQ_LIBS "${_CURRENT_LIB}" ) # message(STATUS "final: appending ${_CURRENT_LIB}") - else (NOT _importedConfigs) + else () # message(STATUS "final: skipping ${_CURRENT_LIB}") - endif (NOT _importedConfigs) - endforeach(_CURRENT_LIB ${_CCSR_REQ_LIBS}) + endif () + endforeach() # message(STATUS "setting -${_RESULT}- to -${_CCSR_NEW_REQ_LIBS}-") set(${_RESULT} "${_CCSR_NEW_REQ_LIBS}" PARENT_SCOPE) diff --git a/Modules/CMakeExportBuildSettings.cmake b/Modules/CMakeExportBuildSettings.cmake index 7392e6b..a18f950 100644 --- a/Modules/CMakeExportBuildSettings.cmake +++ b/Modules/CMakeExportBuildSettings.cmake @@ -30,7 +30,7 @@ macro(CMAKE_EXPORT_BUILD_SETTINGS SETTINGS_FILE) if(${SETTINGS_FILE} MATCHES ".+") configure_file(${CMAKE_ROOT}/Modules/CMakeBuildSettings.cmake.in ${SETTINGS_FILE} @ONLY IMMEDIATE) - else(${SETTINGS_FILE} MATCHES ".+") + else() message(SEND_ERROR "CMAKE_EXPORT_BUILD_SETTINGS called with no argument.") - endif(${SETTINGS_FILE} MATCHES ".+") -endmacro(CMAKE_EXPORT_BUILD_SETTINGS) + endif() +endmacro() diff --git a/Modules/CMakeExtraGeneratorDetermineCompilerMacrosAndIncludeDirs.cmake b/Modules/CMakeExtraGeneratorDetermineCompilerMacrosAndIncludeDirs.cmake index 0fe2abb..54a6418 100644 --- a/Modules/CMakeExtraGeneratorDetermineCompilerMacrosAndIncludeDirs.cmake +++ b/Modules/CMakeExtraGeneratorDetermineCompilerMacrosAndIncludeDirs.cmake @@ -44,7 +44,7 @@ macro(_DETERMINE_GCC_SYSTEM_INCLUDE_DIRS _lang _resultIncludeDirs _resultDefines foreach(nextLine ${_includeLines}) string(STRIP "${nextLine}" _includePath) list(APPEND ${_resultIncludeDirs} "${_includePath}") - endforeach(nextLine) + endforeach() endif() @@ -71,9 +71,9 @@ macro(_DETERMINE_GCC_SYSTEM_INCLUDE_DIRS _lang _resultIncludeDirs _resultDefines else() list(APPEND ${_resultDefines} " ") 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 # to "C" that way GCC's "search starts here" text is in English and we can grok it. diff --git a/Modules/CMakeFindBinUtils.cmake b/Modules/CMakeFindBinUtils.cmake index 71537ff..362052f 100644 --- a/Modules/CMakeFindBinUtils.cmake +++ b/Modules/CMakeFindBinUtils.cmake @@ -48,7 +48,7 @@ else("${CMAKE_CXX_COMPILER_ID}" MATCHES "MSVC" find_program(CMAKE_RANLIB NAMES ${_CMAKE_TOOLCHAIN_PREFIX}ranlib HINTS ${_CMAKE_TOOLCHAIN_LOCATION}) if(NOT CMAKE_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_LINKER NAMES ${_CMAKE_TOOLCHAIN_PREFIX}ld HINTS ${_CMAKE_TOOLCHAIN_LOCATION}) @@ -69,7 +69,7 @@ if(APPLE) if(NOT CMAKE_INSTALL_NAME_TOOL) 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) -endif(APPLE) +endif() diff --git a/Modules/CMakeFindCodeBlocks.cmake b/Modules/CMakeFindCodeBlocks.cmake index 6ca7c19..f8d8d59 100644 --- a/Modules/CMakeFindCodeBlocks.cmake +++ b/Modules/CMakeFindCodeBlocks.cmake @@ -19,7 +19,7 @@ find_program(CMAKE_CODEBLOCKS_EXECUTABLE NAMES codeblocks DOC "The CodeBlocks ex if(CMAKE_CODEBLOCKS_EXECUTABLE) set(CMAKE_OPEN_PROJECT_COMMAND "${CMAKE_CODEBLOCKS_EXECUTABLE} <PROJECT_FILE>" ) -endif(CMAKE_CODEBLOCKS_EXECUTABLE) +endif() # Determine builtin macros and include dirs: include(${CMAKE_CURRENT_LIST_DIR}/CMakeExtraGeneratorDetermineCompilerMacrosAndIncludeDirs.cmake) diff --git a/Modules/CMakeFindFrameworks.cmake b/Modules/CMakeFindFrameworks.cmake index b47f444..7fdeb84 100644 --- a/Modules/CMakeFindFrameworks.cmake +++ b/Modules/CMakeFindFrameworks.cmake @@ -25,8 +25,8 @@ if(NOT CMAKE_FIND_FRAMEWORKS_INCLUDED) /Network/Library/Frameworks/${fwk}.framework) if(EXISTS ${dir}) set(${fwk}_FRAMEWORKS ${${fwk}_FRAMEWORKS} ${dir}) - endif(EXISTS ${dir}) - endforeach(dir) - endif(APPLE) - endmacro(CMAKE_FIND_FRAMEWORKS) -endif(NOT CMAKE_FIND_FRAMEWORKS_INCLUDED) + endif() + endforeach() + endif() + endmacro() +endif() diff --git a/Modules/CMakeFindKDevelop3.cmake b/Modules/CMakeFindKDevelop3.cmake index dd14484..2abd523 100644 --- a/Modules/CMakeFindKDevelop3.cmake +++ b/Modules/CMakeFindKDevelop3.cmake @@ -19,5 +19,5 @@ find_program(CMAKE_KDEVELOP3_EXECUTABLE NAMES kdevelop DOC "The KDevelop3 execut if(CMAKE_KDEVELOP3_EXECUTABLE) set(CMAKE_OPEN_PROJECT_COMMAND "${CMAKE_KDEVELOP3_EXECUTABLE} <PROJECT_FILE>" ) -endif(CMAKE_KDEVELOP3_EXECUTABLE) +endif() diff --git a/Modules/CMakeFindPackageMode.cmake b/Modules/CMakeFindPackageMode.cmake index 59c7ba5..30d62bc 100644 --- a/Modules/CMakeFindPackageMode.cmake +++ b/Modules/CMakeFindPackageMode.cmake @@ -179,7 +179,7 @@ if(${NAME}_FOUND OR ${UPPERCASE_NAME}_FOUND) set_compile_flags_var(${NAME}) elseif("${MODE}" STREQUAL "LINK") set_link_flags_var(${NAME}) - else("${MODE}" STREQUAL "LINK") + else() message(FATAL_ERROR "Invalid mode argument ${MODE} given.") endif() diff --git a/Modules/CMakeForceCompiler.cmake b/Modules/CMakeForceCompiler.cmake index c56406b..980cc17 100644 --- a/Modules/CMakeForceCompiler.cmake +++ b/Modules/CMakeForceCompiler.cmake @@ -52,8 +52,8 @@ macro(CMAKE_FORCE_C_COMPILER compiler id) # Set old compiler id variables. if("${CMAKE_C_COMPILER_ID}" MATCHES "GNU") set(CMAKE_COMPILER_IS_GNUCC 1) - endif("${CMAKE_C_COMPILER_ID}" MATCHES "GNU") -endmacro(CMAKE_FORCE_C_COMPILER) + endif() +endmacro() macro(CMAKE_FORCE_CXX_COMPILER compiler id) set(CMAKE_CXX_COMPILER "${compiler}") @@ -65,8 +65,8 @@ macro(CMAKE_FORCE_CXX_COMPILER compiler id) # Set old compiler id variables. if("${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU") set(CMAKE_COMPILER_IS_GNUCXX 1) - endif("${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU") -endmacro(CMAKE_FORCE_CXX_COMPILER) + endif() +endmacro() macro(CMAKE_FORCE_Fortran_COMPILER compiler id) set(CMAKE_Fortran_COMPILER "${compiler}") @@ -78,5 +78,5 @@ macro(CMAKE_FORCE_Fortran_COMPILER compiler id) # Set old compiler id variables. if("${CMAKE_Fortran_COMPILER_ID}" MATCHES "GNU") set(CMAKE_COMPILER_IS_GNUG77 1) - endif("${CMAKE_Fortran_COMPILER_ID}" MATCHES "GNU") -endmacro(CMAKE_FORCE_Fortran_COMPILER) + endif() +endmacro() diff --git a/Modules/CMakeFortranCompiler.cmake.in b/Modules/CMakeFortranCompiler.cmake.in index d590512..c7529fc 100644 --- a/Modules/CMakeFortranCompiler.cmake.in +++ b/Modules/CMakeFortranCompiler.cmake.in @@ -12,7 +12,7 @@ set(CMAKE_COMPILER_IS_CYGWIN @CMAKE_COMPILER_IS_CYGWIN@) if(CMAKE_COMPILER_IS_CYGWIN) set(CYGWIN 1) set(UNIX 1) -endif(CMAKE_COMPILER_IS_CYGWIN) +endif() 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) set(MINGW 1) -endif(CMAKE_COMPILER_IS_MINGW) +endif() 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_IGNORE_EXTENSIONS h;H;o;O;obj;OBJ;def;DEF;rc;RC) set(CMAKE_Fortran_LINKER_PREFERENCE 20) if(UNIX) set(CMAKE_Fortran_OUTPUT_EXTENSION .o) -else(UNIX) +else() set(CMAKE_Fortran_OUTPUT_EXTENSION .obj) -endif(UNIX) +endif() # Save compiler ABI information. set(CMAKE_Fortran_SIZEOF_DATA_PTR "@CMAKE_Fortran_SIZEOF_DATA_PTR@") @@ -42,7 +42,7 @@ endif() if(CMAKE_Fortran_COMPILER_ABI) set(CMAKE_INTERNAL_PLATFORM_ABI "${CMAKE_Fortran_COMPILER_ABI}") -endif(CMAKE_Fortran_COMPILER_ABI) +endif() if(CMAKE_Fortran_LIBRARY_ARCHITECTURE) set(CMAKE_LIBRARY_ARCHITECTURE "@CMAKE_Fortran_LIBRARY_ARCHITECTURE@") diff --git a/Modules/CMakeFortranInformation.cmake b/Modules/CMakeFortranInformation.cmake index c63b3dc..512ec48 100644 --- a/Modules/CMakeFortranInformation.cmake +++ b/Modules/CMakeFortranInformation.cmake @@ -21,28 +21,28 @@ set(_INCLUDED_FILE 0) # Load compiler-specific information. if(CMAKE_Fortran_COMPILER_ID) include(Compiler/${CMAKE_Fortran_COMPILER_ID}-Fortran OPTIONAL) -endif(CMAKE_Fortran_COMPILER_ID) +endif() set(CMAKE_BASE_NAME) get_filename_component(CMAKE_BASE_NAME ${CMAKE_Fortran_COMPILER} NAME_WE) # since the gnu compiler has several names force g++ if(CMAKE_COMPILER_IS_GNUG77) set(CMAKE_BASE_NAME g77) -endif(CMAKE_COMPILER_IS_GNUG77) +endif() if(CMAKE_Fortran_COMPILER_ID) 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) include(Platform/${CMAKE_SYSTEM_NAME}-${CMAKE_BASE_NAME} OPTIONAL RESULT_VARIABLE _INCLUDED_FILE) -endif (NOT _INCLUDED_FILE) +endif () # We specify the compiler information in the system file for some # platforms, but this language may not have been enabled when the file # was first included. Include it again to get the language info. # Remove this when all compiler info is removed from system files. if (NOT _INCLUDED_FILE) include(Platform/${CMAKE_SYSTEM_NAME} OPTIONAL) -endif (NOT _INCLUDED_FILE) +endif () if(CMAKE_Fortran_SIZEOF_DATA_PTR) 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) 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) 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) 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 # For 90% of the systems, these are the same flags as the C versions @@ -127,7 +127,7 @@ endif() if(NOT CMAKE_MODULE_EXISTS) set(CMAKE_SHARED_MODULE_Fortran_FLAGS ${CMAKE_SHARED_LIBRARY_Fortran_FLAGS}) set(CMAKE_SHARED_MODULE_CREATE_Fortran_FLAGS ${CMAKE_SHARED_LIBRARY_CREATE_Fortran_FLAGS}) -endif(NOT CMAKE_MODULE_EXISTS) +endif() # repeat for modules 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) 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) set(CMAKE_INCLUDE_FLAG_Fortran ${CMAKE_INCLUDE_FLAG_C}) -endif(NOT CMAKE_INCLUDE_FLAG_Fortran) +endif() if(NOT CMAKE_INCLUDE_FLAG_SEP_Fortran) 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.") @@ -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 if(CMAKE_Fortran_FLAGS_INIT STREQUAL " ") set(CMAKE_Fortran_FLAGS_INIT) -endif(CMAKE_Fortran_FLAGS_INIT STREQUAL " ") +endif() set (CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS_INIT}" CACHE STRING "Flags for Fortran compiler.") @@ -184,12 +184,12 @@ include(CMakeCommonLanguageInclude) if(NOT 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>") -endif(NOT CMAKE_Fortran_CREATE_SHARED_LIBRARY) +endif() # create a Fortran shared module just copy the shared library rule if(NOT CMAKE_Fortran_CREATE_SHARED_MODULE) 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. # If CMAKE_Fortran_CREATE_STATIC_LIBRARY is set it will override these. @@ -208,19 +208,19 @@ endif() if(NOT CMAKE_Fortran_COMPILE_OBJECT) set(CMAKE_Fortran_COMPILE_OBJECT "<CMAKE_Fortran_COMPILER> <DEFINES> <FLAGS> -c <SOURCE> -o <OBJECT>") -endif(NOT CMAKE_Fortran_COMPILE_OBJECT) +endif() # link a fortran program if(NOT CMAKE_Fortran_LINK_EXECUTABLE) set(CMAKE_Fortran_LINK_EXECUTABLE "<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) set(CMAKE_Fortran_STANDARD_LIBRARIES "${CMAKE_Fortran_STANDARD_LIBRARIES_INIT}" CACHE STRING "Libraries linked by defalut with all Fortran applications.") mark_as_advanced(CMAKE_Fortran_STANDARD_LIBRARIES) -endif(CMAKE_Fortran_STANDARD_LIBRARIES_INIT) +endif() if(NOT CMAKE_NOT_USING_CONFIG_FLAGS) 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 "Flags used by the compiler during Release with Debug Info builds.") -endif(NOT CMAKE_NOT_USING_CONFIG_FLAGS) +endif() mark_as_advanced( CMAKE_Fortran_FLAGS diff --git a/Modules/CMakeGenericSystem.cmake b/Modules/CMakeGenericSystem.cmake index 91904d7..8a14aea 100644 --- a/Modules/CMakeGenericSystem.cmake +++ b/Modules/CMakeGenericSystem.cmake @@ -51,21 +51,21 @@ if(CMAKE_GENERATOR MATCHES "Makefiles") mark_as_advanced(CMAKE_COLOR_MAKEFILE) if(DEFINED CMAKE_RULE_MESSAGES) set_property(GLOBAL PROPERTY RULE_MESSAGES ${CMAKE_RULE_MESSAGES}) - endif(DEFINED CMAKE_RULE_MESSAGES) + endif() if(CMAKE_GENERATOR MATCHES "Unix Makefiles") set(CMAKE_EXPORT_COMPILE_COMMANDS OFF CACHE BOOL "Enable/Disable output of compile commands during generation." ) mark_as_advanced(CMAKE_EXPORT_COMPILE_COMMANDS) - endif(CMAKE_GENERATOR MATCHES "Unix Makefiles") -endif(CMAKE_GENERATOR MATCHES "Makefiles") + endif() +endif() if(CMAKE_GENERATOR MATCHES "Ninja") set(CMAKE_EXPORT_COMPILE_COMMANDS OFF CACHE BOOL "Enable/Disable output of compile commands during generation." ) mark_as_advanced(CMAKE_EXPORT_COMPILE_COMMANDS) -endif(CMAKE_GENERATOR MATCHES "Ninja") +endif() # GetDefaultWindowsPrefixBase # @@ -162,19 +162,19 @@ endfunction() # command line to override it. if(NOT DEFINED CMAKE_INSTALL_PREFIX) set(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT 1) -endif(NOT DEFINED CMAKE_INSTALL_PREFIX) +endif() # Choose a default install prefix for this platform. if(CMAKE_HOST_UNIX) set(CMAKE_INSTALL_PREFIX "/usr/local" CACHE PATH "Install path prefix, prepended onto install directories.") -else(CMAKE_HOST_UNIX) +else() GetDefaultWindowsPrefixBase(CMAKE_GENERIC_PROGRAM_FILES) set(CMAKE_INSTALL_PREFIX "${CMAKE_GENERIC_PROGRAM_FILES}/${PROJECT_NAME}" CACHE PATH "Install path prefix, prepended onto install directories.") set(CMAKE_GENERIC_PROGRAM_FILES) -endif(CMAKE_HOST_UNIX) +endif() # Set a variable which will be used as component name in install() commands # where no COMPONENT has been given: diff --git a/Modules/CMakeImportBuildSettings.cmake b/Modules/CMakeImportBuildSettings.cmake index f0080ec..60b887a 100644 --- a/Modules/CMakeImportBuildSettings.cmake +++ b/Modules/CMakeImportBuildSettings.cmake @@ -18,7 +18,7 @@ # stored settings using the CMAKE_EXPORT_BUILD_SETTINGS macro. macro(CMAKE_IMPORT_BUILD_SETTINGS SETTINGS_FILE) if(${SETTINGS_FILE} MATCHES ".+") - else(${SETTINGS_FILE} MATCHES ".+") + else() message(SEND_ERROR "CMAKE_IMPORT_BUILD_SETTINGS called with no argument.") - endif(${SETTINGS_FILE} MATCHES ".+") -endmacro(CMAKE_IMPORT_BUILD_SETTINGS) + endif() +endmacro() diff --git a/Modules/CMakeJavaInformation.cmake b/Modules/CMakeJavaInformation.cmake index 79208ca..928c6ac 100644 --- a/Modules/CMakeJavaInformation.cmake +++ b/Modules/CMakeJavaInformation.cmake @@ -34,26 +34,26 @@ endif() if(NOT CMAKE_Java_CREATE_STATIC_LIBRARY) # if(WIN32) # set(class_files_mask "*.class") -# else(WIN32) +# else() set(class_files_mask ".") -# endif(WIN32) +# endif() set(CMAKE_Java_CREATE_STATIC_LIBRARY "<CMAKE_Java_ARCHIVE> -cf <TARGET> -C <OBJECT_DIR> ${class_files_mask}") # "${class_files_mask}" should really be "<OBJECTS>" but compling a *.java # file can create more than one *.class file... -endif(NOT CMAKE_Java_CREATE_STATIC_LIBRARY) +endif() # compile a Java file into an object file if(NOT CMAKE_Java_COMPILE_OBJECT) set(CMAKE_Java_COMPILE_OBJECT "<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(CMAKE_INCLUDE_FLAG_Java "-classpath ") if(WIN32 AND NOT CYGWIN) set(CMAKE_INCLUDE_FLAG_SEP_Java ";") -else(WIN32 AND NOT CYGWIN) +else() set(CMAKE_INCLUDE_FLAG_SEP_Java ":") -endif(WIN32 AND NOT CYGWIN) +endif() diff --git a/Modules/CMakeMinGWFindMake.cmake b/Modules/CMakeMinGWFindMake.cmake index 9081e68..efba20a 100644 --- a/Modules/CMakeMinGWFindMake.cmake +++ b/Modules/CMakeMinGWFindMake.cmake @@ -19,6 +19,6 @@ find_program(CMAKE_SH sh.exe ) 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") set(CMAKE_MAKE_PROGRAM NOTFOUND) -endif(CMAKE_SH) +endif() mark_as_advanced(CMAKE_MAKE_PROGRAM CMAKE_SH) diff --git a/Modules/CMakePackageConfigHelpers.cmake b/Modules/CMakePackageConfigHelpers.cmake index 457a7ae..96ecb42 100644 --- a/Modules/CMakePackageConfigHelpers.cmake +++ b/Modules/CMakePackageConfigHelpers.cmake @@ -214,7 +214,7 @@ macro(check_required_components _NAME) set(\${_NAME}_FOUND FALSE) endif() endif() - endforeach(comp) + endforeach() endmacro() ") endif() diff --git a/Modules/CMakeParseArguments.cmake b/Modules/CMakeParseArguments.cmake index 7ce4c49..406780e 100644 --- a/Modules/CMakeParseArguments.cmake +++ b/Modules/CMakeParseArguments.cmake @@ -84,11 +84,11 @@ function(CMAKE_PARSE_ARGUMENTS prefix _optionNames _singleArgNames _multiArgName # first set all result variables to empty/FALSE foreach(arg_name ${_singleArgNames} ${_multiArgNames}) set(${prefix}_${arg_name}) - endforeach(arg_name) + endforeach() foreach(option ${_optionNames}) set(${prefix}_${option} FALSE) - endforeach(option) + endforeach() set(${prefix}_UNPARSED_ARGUMENTS) @@ -109,9 +109,9 @@ function(CMAKE_PARSE_ARGUMENTS prefix _optionNames _singleArgNames _multiArgName elseif("${insideValues}" STREQUAL "MULTI") list(APPEND ${prefix}_${currentArgName} ${currentArg}) endif() - else(insideValues) + else() list(APPEND ${prefix}_UNPARSED_ARGUMENTS ${currentArg}) - endif(insideValues) + endif() else() if(NOT ${optionIndex} EQUAL -1) set(${prefix}_${currentArg} TRUE) @@ -127,12 +127,12 @@ function(CMAKE_PARSE_ARGUMENTS prefix _optionNames _singleArgNames _multiArgName endif() endif() - endforeach(currentArg) + endforeach() # propagate the result variables to the caller: foreach(arg_name ${_singleArgNames} ${_multiArgNames} ${_optionNames}) set(${prefix}_${arg_name} ${${prefix}_${arg_name}} PARENT_SCOPE) - endforeach(arg_name) + endforeach() set(${prefix}_UNPARSED_ARGUMENTS ${${prefix}_UNPARSED_ARGUMENTS} PARENT_SCOPE) -endfunction(CMAKE_PARSE_ARGUMENTS _options _singleArgs _multiArgs) +endfunction() diff --git a/Modules/CMakePushCheckState.cmake b/Modules/CMakePushCheckState.cmake index fa6e81c..08809bf 100644 --- a/Modules/CMakePushCheckState.cmake +++ b/Modules/CMakePushCheckState.cmake @@ -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_LIBRARIES_SAVE_${_CMAKE_PUSH_CHECK_STATE_COUNTER} ${CMAKE_REQUIRED_LIBRARIES}) set(_CMAKE_REQUIRED_FLAGS_SAVE_${_CMAKE_PUSH_CHECK_STATE_COUNTER} ${CMAKE_REQUIRED_FLAGS}) -endmacro(CMAKE_PUSH_CHECK_STATE) +endmacro() 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") endif() -endmacro(CMAKE_POP_CHECK_STATE) +endmacro() diff --git a/Modules/CMakeRCInformation.cmake b/Modules/CMakeRCInformation.cmake index 2f1387c..8ffe50a 100644 --- a/Modules/CMakeRCInformation.cmake +++ b/Modules/CMakeRCInformation.cmake @@ -44,7 +44,7 @@ set(CMAKE_INCLUDE_FLAG_RC "-I") if(NOT CMAKE_RC_COMPILE_OBJECT) set(CMAKE_RC_COMPILE_OBJECT "<CMAKE_RC_COMPILER> <FLAGS> <DEFINES> /fo<OBJECT> <SOURCE>") -endif(NOT CMAKE_RC_COMPILE_OBJECT) +endif() mark_as_advanced( CMAKE_RC_FLAGS diff --git a/Modules/CMakeSystemSpecificInformation.cmake b/Modules/CMakeSystemSpecificInformation.cmake index 6f85ccc..b9f8e0a 100644 --- a/Modules/CMakeSystemSpecificInformation.cmake +++ b/Modules/CMakeSystemSpecificInformation.cmake @@ -44,8 +44,8 @@ if(NOT _INCLUDED_SYSTEM_INFO_FILE) ${CMAKE_BINARY_DIR}/CopyOfCMakeCache.txt COPYONLY) message("Your CMakeCache.txt file was copied to CopyOfCMakeCache.txt. " "Please send that file to cmake@www.cmake.org.") - endif(EXISTS ${CMAKE_BINARY_DIR}/CMakeCache.txt) -endif(NOT _INCLUDED_SYSTEM_INFO_FILE) + endif() +endif() # 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) string(REPLACE " " "" _CMAKE_EXTRA_GENERATOR_NO_SPACES ${CMAKE_EXTRA_GENERATOR} ) 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 @@ -63,7 +63,7 @@ endif(CMAKE_EXTRA_GENERATOR) if(NOT CMAKE_MODULE_EXISTS) set(CMAKE_SHARED_MODULE_PREFIX "${CMAKE_SHARED_LIBRARY_PREFIX}") set(CMAKE_SHARED_MODULE_SUFFIX "${CMAKE_SHARED_LIBRARY_SUFFIX}") -endif(NOT CMAKE_MODULE_EXISTS) +endif() set(CMAKE_SYSTEM_SPECIFIC_INFORMATION_LOADED 1) diff --git a/Modules/CMakeTestCCompiler.cmake b/Modules/CMakeTestCCompiler.cmake index 9881c9d..14291a7 100644 --- a/Modules/CMakeTestCCompiler.cmake +++ b/Modules/CMakeTestCCompiler.cmake @@ -37,7 +37,7 @@ if(NOT CMAKE_C_COMPILER_WORKS) ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/testCCompiler.c OUTPUT_VARIABLE __CMAKE_C_COMPILER_OUTPUT) set(C_TEST_WAS_RUN 1) -endif(NOT CMAKE_C_COMPILER_WORKS) +endif() if(NOT CMAKE_C_COMPILER_WORKS) PrintTestCompilerStatus("C" " -- broken") @@ -53,19 +53,19 @@ if(NOT CMAKE_C_COMPILER_WORKS) "is not able to compile a simple test program.\nIt fails " "with the following output:\n ${__CMAKE_C_COMPILER_OUTPUT}\n\n" "CMake will not be able to correctly generate this project.") -else(NOT CMAKE_C_COMPILER_WORKS) +else() if(C_TEST_WAS_RUN) PrintTestCompilerStatus("C" " -- works") file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log "Determining if the C compiler works passed with " "the following output:\n${__CMAKE_C_COMPILER_OUTPUT}\n\n") - endif(C_TEST_WAS_RUN) + endif() set(CMAKE_C_COMPILER_WORKS 1 CACHE INTERNAL "") if(CMAKE_C_COMPILER_FORCED) # The compiler configuration was forced by the user. # 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 include(${CMAKE_ROOT}/Modules/CMakeDetermineCompilerABI.cmake) 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 ) include(${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeCCompiler.cmake) - endif(CMAKE_C_COMPILER_FORCED) + endif() if(CMAKE_C_SIZEOF_DATA_PTR) foreach(f ${CMAKE_C_ABI_FILES}) include(${f}) endforeach() unset(CMAKE_C_ABI_FILES) endif() -endif(NOT CMAKE_C_COMPILER_WORKS) +endif() unset(__CMAKE_C_COMPILER_OUTPUT) diff --git a/Modules/CMakeTestCXXCompiler.cmake b/Modules/CMakeTestCXXCompiler.cmake index 52eaa3c..5ed826b 100644 --- a/Modules/CMakeTestCXXCompiler.cmake +++ b/Modules/CMakeTestCXXCompiler.cmake @@ -30,7 +30,7 @@ if(NOT CMAKE_CXX_COMPILER_WORKS) ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/testCXXCompiler.cxx OUTPUT_VARIABLE __CMAKE_CXX_COMPILER_OUTPUT) set(CXX_TEST_WAS_RUN 1) -endif(NOT CMAKE_CXX_COMPILER_WORKS) +endif() if(NOT CMAKE_CXX_COMPILER_WORKS) PrintTestCompilerStatus("CXX" " -- broken") @@ -46,19 +46,19 @@ if(NOT CMAKE_CXX_COMPILER_WORKS) "is not able to compile a simple test program.\nIt fails " "with the following output:\n ${__CMAKE_CXX_COMPILER_OUTPUT}\n\n" "CMake will not be able to correctly generate this project.") -else(NOT CMAKE_CXX_COMPILER_WORKS) +else() if(CXX_TEST_WAS_RUN) PrintTestCompilerStatus("CXX" " -- works") file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log "Determining if the CXX compiler works passed with " "the following output:\n${__CMAKE_CXX_COMPILER_OUTPUT}\n\n") - endif(CXX_TEST_WAS_RUN) + endif() set(CMAKE_CXX_COMPILER_WORKS 1 CACHE INTERNAL "") if(CMAKE_CXX_COMPILER_FORCED) # The compiler configuration was forced by the user. # 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 include(${CMAKE_ROOT}/Modules/CMakeDetermineCompilerABI.cmake) 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 ) include(${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeCXXCompiler.cmake) - endif(CMAKE_CXX_COMPILER_FORCED) + endif() if(CMAKE_CXX_SIZEOF_DATA_PTR) foreach(f ${CMAKE_CXX_ABI_FILES}) include(${f}) endforeach() unset(CMAKE_CXX_ABI_FILES) endif() -endif(NOT CMAKE_CXX_COMPILER_WORKS) +endif() unset(__CMAKE_CXX_COMPILER_OUTPUT) diff --git a/Modules/CMakeTestFortranCompiler.cmake b/Modules/CMakeTestFortranCompiler.cmake index 4f711d8..b388d1e 100644 --- a/Modules/CMakeTestFortranCompiler.cmake +++ b/Modules/CMakeTestFortranCompiler.cmake @@ -30,7 +30,7 @@ if(NOT CMAKE_Fortran_COMPILER_WORKS) ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/testFortranCompiler.f OUTPUT_VARIABLE OUTPUT) set(FORTRAN_TEST_WAS_RUN 1) -endif(NOT CMAKE_Fortran_COMPILER_WORKS) +endif() if(NOT CMAKE_Fortran_COMPILER_WORKS) PrintTestCompilerStatus("Fortran" " -- broken") @@ -41,19 +41,19 @@ if(NOT CMAKE_Fortran_COMPILER_WORKS) "is not able to compile a simple test program.\nIt fails " "with the following output:\n ${OUTPUT}\n\n" "CMake will not be able to correctly generate this project.") -else(NOT CMAKE_Fortran_COMPILER_WORKS) +else() if(FORTRAN_TEST_WAS_RUN) PrintTestCompilerStatus("Fortran" " -- works") file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log "Determining if the Fortran compiler works passed with " "the following output:\n${OUTPUT}\n\n") - endif(FORTRAN_TEST_WAS_RUN) + endif() set(CMAKE_Fortran_COMPILER_WORKS 1 CACHE INTERNAL "") if(CMAKE_Fortran_COMPILER_FORCED) # The compiler configuration was forced by the user. # 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 include(${CMAKE_ROOT}/Modules/CMakeDetermineCompilerABI.cmake) 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 " "the following output:\n${OUTPUT}\n\n") 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") file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log "Determining if the Fortran compiler supports Fortran 90 failed with " "the following output:\n${OUTPUT}\n\n") set(CMAKE_Fortran_COMPILER_SUPPORTS_F90 0) - endif(CMAKE_Fortran_COMPILER_SUPPORTS_F90) + endif() unset(CMAKE_Fortran_COMPILER_SUPPORTS_F90 CACHE) - endif(NOT DEFINED CMAKE_Fortran_COMPILER_SUPPORTS_F90) + endif() configure_file( ${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 ) include(${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeFortranCompiler.cmake) - endif(CMAKE_Fortran_COMPILER_FORCED) + endif() if(CMAKE_Fortran_SIZEOF_DATA_PTR) foreach(f ${CMAKE_Fortran_ABI_FILES}) include(${f}) endforeach() unset(CMAKE_Fortran_ABI_FILES) endif() -endif(NOT CMAKE_Fortran_COMPILER_WORKS) +endif() diff --git a/Modules/CMakeVS8FindMake.cmake b/Modules/CMakeVS8FindMake.cmake index 790ca2b..31df026 100644 --- a/Modules/CMakeVS8FindMake.cmake +++ b/Modules/CMakeVS8FindMake.cmake @@ -16,7 +16,7 @@ set( _CMAKE_MAKE_PROGRAM_NAMES devenv) if(NOT CMAKE_CROSSCOMPILING) set( _CMAKE_MAKE_PROGRAM_NAMES ${_CMAKE_MAKE_PROGRAM_NAMES} VCExpress) -endif(NOT CMAKE_CROSSCOMPILING) +endif() find_program(CMAKE_MAKE_PROGRAM NAMES ${_CMAKE_MAKE_PROGRAM_NAMES} diff --git a/Modules/CMakeVS9FindMake.cmake b/Modules/CMakeVS9FindMake.cmake index c7aba36..35e9f98 100644 --- a/Modules/CMakeVS9FindMake.cmake +++ b/Modules/CMakeVS9FindMake.cmake @@ -16,7 +16,7 @@ set( _CMAKE_MAKE_PROGRAM_NAMES devenv) if(NOT CMAKE_CROSSCOMPILING) set( _CMAKE_MAKE_PROGRAM_NAMES ${_CMAKE_MAKE_PROGRAM_NAMES} VCExpress) -endif(NOT CMAKE_CROSSCOMPILING) +endif() find_program(CMAKE_MAKE_PROGRAM NAMES ${_CMAKE_MAKE_PROGRAM_NAMES} diff --git a/Modules/CMakeVerifyManifest.cmake b/Modules/CMakeVerifyManifest.cmake index 1d16e18..aebe77e 100644 --- a/Modules/CMakeVerifyManifest.cmake +++ b/Modules/CMakeVerifyManifest.cmake @@ -47,7 +47,7 @@ function(crt_version file list_var) else() message(FATAL_ERROR "Parse error could not find version in [${s}]") endif() - endforeach(s) + endforeach() if(NOT DEFINED has_match) message("Information: no embeded manifest in: ${file}") return() @@ -57,7 +57,7 @@ function(crt_version file list_var) if(version_list) set(${list_var} ${version_list} PARENT_SCOPE) endif() -endfunction(crt_version) +endfunction() set(fatal_error FALSE) # check_version: @@ -75,7 +75,7 @@ function(check_version file manifest_versions) message("ERROR: ${file} uses ${ver} not found in shipped manifests:[${manifest_versions}].") set(fatal_error TRUE PARENT_SCOPE) endif() - endforeach(ver) + endforeach() list(LENGTH file_versions len) if(${len} GREATER 1) 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") foreach(f ${manifest_files}) crt_version("${f}" manifest_version_list) -endforeach(f) +endforeach() list(LENGTH manifest_version_list LEN) if(LEN EQUAL 0) message(FATAL_ERROR "No .manifest files found, no version check can be done.") diff --git a/Modules/CPack.cmake b/Modules/CPack.cmake index 513e112..6886ed9 100644 --- a/Modules/CPack.cmake +++ b/Modules/CPack.cmake @@ -287,19 +287,19 @@ # Define this var in order to avoid (or warn) concerning multiple inclusion if(CPack_CMake_INCLUDED) message(WARNING "CPack.cmake has already been included!!") -else(CPack_CMake_INCLUDED) +else() set(CPack_CMake_INCLUDED 1) -endif(CPack_CMake_INCLUDED) +endif() # Pick a configuration file set(cpack_input_file "${CMAKE_ROOT}/Templates/CPackConfig.cmake.in") if(EXISTS "${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") if(EXISTS "${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 # 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) if(NOT DEFINED "${name}") set(${name} "${value}") - endif(NOT DEFINED "${name}") -endmacro(cpack_set_if_not_set) + endif() +endmacro() # cpack_encode_variables - Macro to encode variables for the configuration file # find any variable that starts with CPACK and create a variable @@ -324,9 +324,9 @@ macro(cpack_encode_variables) if("xxx${var}" MATCHES "xxxCPACK") set(_CPACK_OTHER_VARIABLES_ "${_CPACK_OTHER_VARIABLES_}\nSET(${var} \"${${var}}\")") - endif("xxx${var}" MATCHES "xxxCPACK") - endforeach(var ${res}) -endmacro(cpack_encode_variables) + endif() + endforeach() +endmacro() # Set the package 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) set(CPACK_NSIS_ENABLE_UNINSTALL_BEFORE_INSTALL ON) -endif(CPACK_NSIS_ENABLE_UNINSTALL_BEFORE_INSTALL) +endif() if(CPACK_NSIS_MODIFY_PATH) set(CPACK_NSIS_MODIFY_PATH ON) -endif(CPACK_NSIS_MODIFY_PATH) +endif() set(__cpack_system_name ${CMAKE_SYSTEM_NAME}) if(${__cpack_system_name} MATCHES Windows) if(CMAKE_CL_64) set(__cpack_system_name win64) - else(CMAKE_CL_64) + else() set(__cpack_system_name win32) - endif(CMAKE_CL_64) -endif(${__cpack_system_name} MATCHES Windows) + endif() +endif() cpack_set_if_not_set(CPACK_SYSTEM_NAME "${__cpack_system_name}") # 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: if(CPACK_PACKAGE_RELOCATABLE) set(CPACK_PACKAGE_RELOCATABLE "true") -else(CPACK_PACKAGE_RELOCATABLE) +else() set(CPACK_PACKAGE_RELOCATABLE "false") -endif(CPACK_PACKAGE_RELOCATABLE) +endif() macro(cpack_check_file_exists file description) if(NOT EXISTS "${file}") message(SEND_ERROR "CPack ${description} file: \"${file}\" could not be found.") - endif(NOT EXISTS "${file}") -endmacro(cpack_check_file_exists) + endif() +endmacro() cpack_check_file_exists("${CPACK_PACKAGE_DESCRIPTION_FILE}" "package description") 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) if(${_cond}) set(${_list} ${${_list}} ${_item}) - endif(${_cond}) -endmacro(cpack_optional_append _list _cond _item) + endif() +endmacro() ##variable # CPACK_BINARY_<GENNAME> - CPack generated options for binary generators. The @@ -420,26 +420,26 @@ if(NOT CPACK_GENERATOR) if(UNIX) if(CYGWIN) option(CPACK_BINARY_CYGWIN "Enable to build Cygwin binary packages" ON) - else(CYGWIN) + else() if(APPLE) 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_PACKAGEMAKER "Enable to build PackageMaker packages" ON) option(CPACK_BINARY_OSXX11 "Enable to build OSX X11 packages" OFF) - else(APPLE) + else() 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_TGZ "Enable to build TGZ packages" ON) option(CPACK_BINARY_TBZ2 "Enable to build TBZ2 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_NSIS "Enable to build NSIS packages" OFF) - endif(CYGWIN) - else(UNIX) + endif() + else() option(CPACK_BINARY_NSIS "Enable to build NSIS packages" ON) 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_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_ZIP ZIP) -endif(NOT CPACK_GENERATOR) +endif() # Provide options to choose source generators if(NOT CPACK_SOURCE_GENERATOR) if(UNIX) if(CYGWIN) 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_TGZ "Enable to build TGZ 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) - endif(CYGWIN) - else(UNIX) + endif() + else() 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_TGZ TGZ) 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_ZIP ZIP) -endif(NOT CPACK_SOURCE_GENERATOR) +endif() # mark the above options as advanced 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) message("CPack warning: both CPACK_COMPONENTS_ALL and CPACK_MONOLITHIC_INSTALL have been set.\nDefaulting to a monolithic installation.") set(CPACK_COMPONENTS_ALL) - else(CPACK_MONOLITHIC_INSTALL) + else() # The user has provided the set of components to be installed as # part of a component-based installation; trust her. set(CPACK_COMPONENTS_ALL_SET_BY_USER TRUE) - endif(CPACK_MONOLITHIC_INSTALL) -else(DEFINED CPACK_COMPONENTS_ALL) + endif() +else() # If the user has not specifically requested a monolithic installer # but has specified components in various "install" commands, tell # CPack about those components. @@ -543,10 +543,10 @@ else(DEFINED CPACK_COMPONENTS_ALL) # (at least, it isn't a component-based installation, but may # become one later if the user uses the cpack_add_* commands). set(CPACK_COMPONENTS_ALL) - endif(CPACK_COMPONENTS_LEN EQUAL 1) + endif() set(CPACK_COMPONENTS_LEN) - endif(NOT CPACK_MONOLITHIC_INSTALL) -endif(DEFINED CPACK_COMPONENTS_ALL) + endif() +endif() # CMake always generates a component named "Unspecified", which is # used to install everything that doesn't have an explicitly-provided diff --git a/Modules/CPackComponent.cmake b/Modules/CPackComponent.cmake index d7d3cf8..c85cfb4 100644 --- a/Modules/CPackComponent.cmake +++ b/Modules/CPackComponent.cmake @@ -283,10 +283,10 @@ macro(cpack_parse_arguments prefix arg_names option_names) set(${prefix}_DEFAULT_ARGS) foreach(arg_name ${arg_names}) set(${prefix}_${arg_name}) - endforeach(arg_name) + endforeach() foreach(option ${option_names}) set(${prefix}_${option} FALSE) - endforeach(option) + endforeach() set(current_arg_name DEFAULT_ARGS) 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(current_arg_name ${arg}) set(current_arg_list) - else (is_arg_name GREATER -1) + else () set(loption_names ${option_names}) list(FIND loption_names "${arg}" is_option) if (is_option GREATER -1) set(${prefix}_${arg} TRUE) - else (is_option GREATER -1) + else () set(current_arg_list ${current_arg_list} ${arg}) - endif (is_option GREATER -1) - endif (is_arg_name GREATER -1) - endforeach(arg) + endif () + endif () + endforeach() 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) # 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}") foreach(APPENDVAL ${${var}}) set(${strvar} "${${strvar}} ${APPENDVAL}") - endforeach(APPENDVAL) + endforeach() set(${strvar} "${${strvar}})\n") - endif (DEFINED ${var}) -endmacro(cpack_append_variable_set_command) + endif () +endmacro() # Macro that appends a SET command for the given variable name (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) if(${CPACK_APP_VALUE_LEN} EQUAL 1) set(${strvar} "${${strvar}}set(${var} \"${${var}}\")\n") - endif(${CPACK_APP_VALUE_LEN} EQUAL 1) - endif (DEFINED ${var}) -endmacro(cpack_append_string_variable_set_command) + endif() + endif () +endmacro() # Macro that appends a SET command for the given variable name (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) if(${CPACK_APP_VALUE_LEN} EQUAL 1) set(${strvar} "${${strvar}}set(${var} TRUE)\n") - endif(${CPACK_APP_VALUE_LEN} EQUAL 1) - endif (${var}) -endmacro(cpack_append_option_set_command) + endif() + endif () +endmacro() # Macro that adds a component to the CPack installer 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") foreach(COMP ${CPACK_ADDCOMP_COMPONENTS}) set(CPACK_ADDCOMP_STR "${CPACK_ADDCOMP_STR} ${COMP}") - endforeach(COMP) + endforeach() set(CPACK_ADDCOMP_STR "${CPACK_ADDCOMP_STR})\n") - endif(NOT CPACK_COMPONENTS_ALL_SET_BY_USER) - endif(NOT CPACK_MONOLITHIC_INSTALL) + endif() + endif() cpack_append_string_variable_set_command( CPACK_COMPONENT_${CPACK_ADDCOMP_UNAME}_DISPLAY_NAME @@ -416,8 +416,8 @@ macro(cpack_add_component compname) # will be encoded by cpack_encode_variables. if(CPack_CMake_INCLUDED) file(APPEND "${CPACK_OUTPUT_CONFIG_FILE}" "${CPACK_ADDCOMP_STR}") - endif(CPack_CMake_INCLUDED) -endmacro(cpack_add_component) + endif() +endmacro() # Macro that adds a component group to the CPack installer macro(cpack_add_component_group grpname) @@ -447,8 +447,8 @@ macro(cpack_add_component_group grpname) # will be encoded by cpack_encode_variables. if(CPack_CMake_INCLUDED) file(APPEND "${CPACK_OUTPUT_CONFIG_FILE}" "${CPACK_ADDGRP_STR}") - endif(CPack_CMake_INCLUDED) -endmacro(cpack_add_component_group) + endif() +endmacro() # Macro that adds an installation type to the CPack installer macro(cpack_add_install_type insttype) @@ -472,8 +472,8 @@ macro(cpack_add_install_type insttype) # will be encoded by cpack_encode_variables. if(CPack_CMake_INCLUDED) file(APPEND "${CPACK_OUTPUT_CONFIG_FILE}" "${CPACK_INSTTYPE_STR}") - endif(CPack_CMake_INCLUDED) -endmacro(cpack_add_install_type) + endif() +endmacro() macro(cpack_configure_downloads site) cpack_parse_arguments(CPACK_DOWNLOAD @@ -497,7 +497,7 @@ macro(cpack_configure_downloads site) CPACK_CONFIG_DL_STR) if (${CPACK_DOWNLOAD_ALL} AND NOT ${CPACK_DOWNLOAD_NO_ADD_REMOVE}) 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}) cpack_append_option_set_command( CPACK_ADD_REMOVE @@ -508,6 +508,6 @@ macro(cpack_configure_downloads site) # will be encoded by cpack_encode_variables. if(CPack_CMake_INCLUDED) file(APPEND "${CPACK_OUTPUT_CONFIG_FILE}" "${CPACK_CONFIG_DL_STR}") - endif(CPack_CMake_INCLUDED) -endmacro(cpack_configure_downloads) -endif(NOT CPackComponent_CMake_INCLUDED) + endif() +endmacro() +endif() diff --git a/Modules/CPackDeb.cmake b/Modules/CPackDeb.cmake index 640cf9a..106b44c 100644 --- a/Modules/CPackDeb.cmake +++ b/Modules/CPackDeb.cmake @@ -187,22 +187,22 @@ if(CMAKE_BINARY_DIR) message(FATAL_ERROR "CPackDeb.cmake may only be used by CPack internally.") -endif(CMAKE_BINARY_DIR) +endif() if(NOT UNIX) message(FATAL_ERROR "CPackDeb.cmake may only be used under UNIX.") -endif(NOT UNIX) +endif() # CPACK_DEBIAN_PACKAGE_SHLIBDEPS # If specify OFF, only user depends are used if(NOT DEFINED CPACK_DEBIAN_PACKAGE_SHLIBDEPS) set(CPACK_DEBIAN_PACKAGE_SHLIBDEPS OFF) -endif(NOT DEFINED CPACK_DEBIAN_PACKAGE_SHLIBDEPS) +endif() find_program(FAKEROOT_EXECUTABLE fakeroot) if(FAKEROOT_EXECUTABLE) set(CPACK_DEBIAN_FAKEROOT_EXECUTABLE ${FAKEROOT_EXECUTABLE}) -endif(FAKEROOT_EXECUTABLE) +endif() if(CPACK_DEBIAN_PACKAGE_SHLIBDEPS) # 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}") if(CPACK_DEBIAN_PACKAGE_DEBUG) 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 execute_process(COMMAND find -type f @@ -260,17 +260,17 @@ if(CPACK_DEBIAN_PACKAGE_SHLIBDEPS) if(CPACK_DEBIAN_PACKAGE_DEBUG) # dpkg-shlibdeps will throw some warnings if some input files are not binary message( "CPackDeb Debug: dpkg-shlibdeps warnings \n${SHLIBDEPS_ERROR}") - endif(CPACK_DEBIAN_PACKAGE_DEBUG) + endif() if (NOT SHLIBDEPS_RESULT EQUAL 0) message (FATAL_ERROR "CPackDeb: dpkg-shlibdeps: ${SHLIBDEPS_ERROR}") - endif (NOT SHLIBDEPS_RESULT EQUAL 0) + endif () #Get rid of prefix generated by dpkg-shlibdeps string (REGEX REPLACE "^.*Depends=" "" CPACK_DEBIAN_PACKAGE_AUTO_DEPENDS ${SHLIBDEPS_OUTPUT}) if(CPACK_DEBIAN_PACKAGE_DEBUG) message( "CPackDeb Debug: Found dependency: ${CPACK_DEBIAN_PACKAGE_AUTO_DEPENDS}") - endif(CPACK_DEBIAN_PACKAGE_DEBUG) + endif() # Remove blank control file # 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 if (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}") - endif (CPACK_DEBIAN_PACKAGE_DEPENDS) + endif () - else (SHLIBDEPS_EXECUTABLE) + else () if(CPACK_DEBIAN_PACKAGE_DEBUG) message( "CPackDeb Debug: Using only user-provided depends because dpkg-shlibdeps is not found.") - endif(CPACK_DEBIAN_PACKAGE_DEBUG) - endif(SHLIBDEPS_EXECUTABLE) + endif() + endif() -else (CPACK_DEBIAN_PACKAGE_SHLIBDEPS) +else () if(CPACK_DEBIAN_PACKAGE_DEBUG) message( "CPackDeb Debug: Using only user-provided depends") - endif(CPACK_DEBIAN_PACKAGE_DEBUG) -endif(CPACK_DEBIAN_PACKAGE_SHLIBDEPS) + endif() +endif() # Let's define the control file found in debian package: @@ -305,15 +305,15 @@ endif(CPACK_DEBIAN_PACKAGE_SHLIBDEPS) # Package: (mandatory) if(NOT CPACK_DEBIAN_PACKAGE_NAME) string(TOLOWER "${CPACK_PACKAGE_NAME}" CPACK_DEBIAN_PACKAGE_NAME) -endif(NOT CPACK_DEBIAN_PACKAGE_NAME) +endif() # Version: (mandatory) if(NOT CPACK_DEBIAN_PACKAGE_VERSION) if(NOT CPACK_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}) -endif(NOT CPACK_DEBIAN_PACKAGE_VERSION) +endif() # Architecture: (mandatory) if(NOT CPACK_DEBIAN_PACKAGE_ARCHITECTURE) @@ -323,12 +323,12 @@ if(NOT CPACK_DEBIAN_PACKAGE_ARCHITECTURE) if(NOT DPKG_CMD) message(STATUS "CPackDeb: Can not find dpkg in your path, default to i386.") set(CPACK_DEBIAN_PACKAGE_ARCHITECTURE i386) - endif(NOT DPKG_CMD) + endif() execute_process(COMMAND "${DPKG_CMD}" --print-architecture OUTPUT_VARIABLE CPACK_DEBIAN_PACKAGE_ARCHITECTURE OUTPUT_STRIP_TRAILING_WHITESPACE ) -endif(NOT CPACK_DEBIAN_PACKAGE_ARCHITECTURE) +endif() # have a look at get_property(result GLOBAL PROPERTY ENABLED_FEATURES), # 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' if(NOT CPACK_DEBIAN_PACKAGE_DEPENDS) message(STATUS "CPACK_DEBIAN_PACKAGE_DEPENDS not set, the package will have no dependencies.") -endif(NOT CPACK_DEBIAN_PACKAGE_DEPENDS) +endif() # Maintainer: (mandatory) if(NOT CPACK_DEBIAN_PACKAGE_MAINTAINER) 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") - endif(NOT CPACK_PACKAGE_CONTACT) + endif() set(CPACK_DEBIAN_PACKAGE_MAINTAINER ${CPACK_PACKAGE_CONTACT}) -endif(NOT CPACK_DEBIAN_PACKAGE_MAINTAINER) +endif() # Description: (mandatory) if(NOT CPACK_DEBIAN_PACKAGE_DESCRIPTION) 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") - endif(NOT CPACK_PACKAGE_DESCRIPTION_SUMMARY) + endif() set(CPACK_DEBIAN_PACKAGE_DESCRIPTION ${CPACK_PACKAGE_DESCRIPTION_SUMMARY}) -endif(NOT CPACK_DEBIAN_PACKAGE_DESCRIPTION) +endif() # Section: (recommended) if(NOT CPACK_DEBIAN_PACKAGE_SECTION) set(CPACK_DEBIAN_PACKAGE_SECTION "devel") -endif(NOT CPACK_DEBIAN_PACKAGE_SECTION) +endif() # Priority: (recommended) if(NOT CPACK_DEBIAN_PACKAGE_PRIORITY) set(CPACK_DEBIAN_PACKAGE_PRIORITY "optional") -endif(NOT CPACK_DEBIAN_PACKAGE_PRIORITY ) +endif() # 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(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) -else(CPACK_DEB_PACKAGE_COMPONENT) +else() set(CPACK_DEB_PACKAGE_COMPONENT_PART_NAME "") set(CPACK_DEB_PACKAGE_COMPONENT_PART_PATH "") 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 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_INSTALL_DIRECTORY = ${CPACK_PACKAGE_INSTALL_DIRECTORY}") message("CPackDeb:Debug: CPACK_TEMPORARY_PACKAGE_FILE_NAME = ${CPACK_TEMPORARY_PACKAGE_FILE_NAME}") -endif(CPACK_DEBIAN_PACKAGE_DEBUG) +endif() # For debian source packages: # debian/control @@ -418,4 +418,4 @@ endif(CPACK_DEBIAN_PACKAGE_DEBUG) # set(CPACK_DEBIAN_PACKAGE_BUILDS_DEPENDS # "debhelper (>> 5.0.0), libncurses5-dev, tcl8.4" # ) -#endif(NOT CPACK_DEBIAN_PACKAGE_BUILDS_DEPENDS) +#endif() diff --git a/Modules/CPackRPM.cmake b/Modules/CPackRPM.cmake index 66237d8..066b295 100644 --- a/Modules/CPackRPM.cmake +++ b/Modules/CPackRPM.cmake @@ -241,11 +241,11 @@ if(CMAKE_BINARY_DIR) message(FATAL_ERROR "CPackRPM.cmake may only be used by CPack internally.") -endif(CMAKE_BINARY_DIR) +endif() if(NOT 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 # it may be a simple (symbolic) link to rpm command. @@ -264,12 +264,12 @@ if(RPMBUILD_EXECUTABLE) ${_TMP_VERSION}) if(CPACK_RPM_PACKAGE_DEBUG) message("CPackRPM:Debug: rpmbuild version is <${RPMBUILD_EXECUTABLE_VERSION}>") - endif(CPACK_RPM_PACKAGE_DEBUG) -endif(RPMBUILD_EXECUTABLE) + endif() +endif() if(NOT RPMBUILD_EXECUTABLE) message(FATAL_ERROR "RPM package requires rpmbuild executable") -endif(NOT RPMBUILD_EXECUTABLE) +endif() # Display lsb_release output if DEBUG mode enable # This will help to diagnose problem with CPackRPM @@ -284,11 +284,11 @@ if(CPACK_RPM_PACKAGE_DEBUG) string(REGEX REPLACE "\n" ", " LSB_RELEASE_OUTPUT ${_TMP_LSB_RELEASE_OUTPUT}) - else (LSB_RELEASE_EXECUTABLE) + else () set(LSB_RELEASE_OUTPUT "lsb_release not installed/found!") - endif(LSB_RELEASE_EXECUTABLE) + endif() message("CPackRPM:Debug: LSB_RELEASE = ${LSB_RELEASE_OUTPUT}") -endif(CPACK_RPM_PACKAGE_DEBUG) +endif() # We may use RPM version in the future in order # to shut down warning about space in buildtree @@ -296,7 +296,7 @@ endif(CPACK_RPM_PACKAGE_DEBUG) # not checked [yet]. 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.") -endif(CPACK_TOPLEVEL_DIRECTORY MATCHES ".* .*") +endif() # If rpmbuild is found # 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) if(ALIEN_EXECUTABLE) message(STATUS "alien found, we may be on a Debian based distro.") -endif(ALIEN_EXECUTABLE) +endif() # Are we packaging components ? if(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(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_PATH "") set(WDIR "${CPACK_TOPLEVEL_DIRECTORY}/${CPACK_PACKAGE_FILE_NAME}") -endif(CPACK_RPM_PACKAGE_COMPONENT) +endif() # # 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(NOT CPACK_PACKAGE_DESCRIPTION_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}) - endif(NOT CPACK_PACKAGE_DESCRIPTION_SUMMARY) -endif(NOT CPACK_RPM_PACKAGE_SUMMARY) + endif() +endif() # CPACK_RPM_PACKAGE_NAME (mandatory) if(NOT 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) if(NOT CPACK_RPM_PACKAGE_VERSION) if(NOT CPACK_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}) -endif(NOT CPACK_RPM_PACKAGE_VERSION) +endif() # Replace '-' in version with '_' # '-' character is an Illegal RPM version character # 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}") if(CPACK_RPM_PACKAGE_DEBUG) message("CPackRPM:Debug: using user-specified build arch = ${CPACK_RPM_PACKAGE_ARCHITECTURE}") - endif(CPACK_RPM_PACKAGE_DEBUG) -else(CPACK_RPM_PACKAGE_ARCHITECTURE) + endif() +else() set(TMP_RPM_BUILDARCH "") -endif(CPACK_RPM_PACKAGE_ARCHITECTURE) +endif() # CPACK_RPM_PACKAGE_RELEASE # 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 CPACK_RPM_PACKAGE_RELEASE) set(CPACK_RPM_PACKAGE_RELEASE 1) -endif(NOT CPACK_RPM_PACKAGE_RELEASE) +endif() # CPACK_RPM_PACKAGE_LICENSE if(NOT CPACK_RPM_PACKAGE_LICENSE) set(CPACK_RPM_PACKAGE_LICENSE "unknown") -endif(NOT CPACK_RPM_PACKAGE_LICENSE) +endif() # CPACK_RPM_PACKAGE_GROUP if(NOT CPACK_RPM_PACKAGE_GROUP) set(CPACK_RPM_PACKAGE_GROUP "unknown") -endif(NOT CPACK_RPM_PACKAGE_GROUP) +endif() # CPACK_RPM_PACKAGE_VENDOR if(NOT CPACK_RPM_PACKAGE_VENDOR) if(CPACK_PACKAGE_VENDOR) set(CPACK_RPM_PACKAGE_VENDOR "${CPACK_PACKAGE_VENDOR}") - else(CPACK_PACKAGE_VENDOR) + else() set(CPACK_RPM_PACKAGE_VENDOR "unknown") - endif(CPACK_PACKAGE_VENDOR) -endif(NOT CPACK_RPM_PACKAGE_VENDOR) + endif() +endif() # CPACK_RPM_PACKAGE_SOURCE # 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 (CPACK_PACKAGE_DESCRIPTION_FILE) 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") - endif (CPACK_PACKAGE_DESCRIPTION_FILE) -endif (NOT CPACK_RPM_PACKAGE_DESCRIPTION) + endif () +endif () # CPACK_RPM_COMPRESSION_TYPE # if (CPACK_RPM_COMPRESSION_TYPE) if(CPACK_RPM_PACKAGE_DEBUG) 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") 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") 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") 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") set(CPACK_RPM_COMPRESSION_TYPE_TMP "%define _binary_payload w9.gzdio") - endif(CPACK_RPM_COMPRESSION_TYPE STREQUAL "gzip") -else(CPACK_RPM_COMPRESSION_TYPE) + endif() +else() set(CPACK_RPM_COMPRESSION_TYPE_TMP "") -endif(CPACK_RPM_COMPRESSION_TYPE) +endif() if(CPACK_PACKAGE_RELOCATABLE) set(CPACK_RPM_PACKAGE_RELOCATABLE TRUE) -endif(CPACK_PACKAGE_RELOCATABLE) +endif() if(CPACK_RPM_PACKAGE_RELOCATABLE) if(CPACK_RPM_PACKAGE_DEBUG) 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")) 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}) - endif(CPACK_SET_DESTDIR AND (NOT CPACK_SET_DESTDIR STREQUAL "I_ON")) -endif(CPACK_RPM_PACKAGE_RELOCATABLE) + endif() +endif() # Check if additional fields for RPM spec header are given # There may be some COMPONENT specific variables as well foreach(_RPM_SPEC_HEADER URL REQUIRES SUGGESTS PROVIDES OBSOLETES PREFIX CONFLICTS AUTOPROV AUTOREQ AUTOREQPROV) if(CPACK_RPM_PACKAGE_DEBUG) message("CPackRPM:Debug: processing ${_RPM_SPEC_HEADER}") - endif(CPACK_RPM_PACKAGE_DEBUG) + endif() if(CPACK_RPM_PACKAGE_COMPONENT) if(CPACK_RPM_${CPACK_RPM_PACKAGE_COMPONENT}_PACKAGE_${_RPM_SPEC_HEADER}) if(CPACK_RPM_PACKAGE_DEBUG) 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}}) else() if(CPACK_RPM_PACKAGE_DEBUG) 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}") - endif(CPACK_RPM_PACKAGE_DEBUG) + endif() set(CPACK_RPM_PACKAGE_${_RPM_SPEC_HEADER}_TMP ${CPACK_RPM_PACKAGE_${_RPM_SPEC_HEADER}}) endif() else() if(CPACK_RPM_PACKAGE_DEBUG) 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}}) 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}") if(CPACK_RPM_PACKAGE_DEBUG) 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}") - else(CPACK_RPM_PACKAGE_${_RPM_SPEC_HEADER}_TMP) + else() # Do not forget to unset previously set header (from previous component) unset(TMP_RPM_${_RPM_SPEC_HEADER}) - endif(CPACK_RPM_PACKAGE_${_RPM_SPEC_HEADER}_TMP) -endforeach(_RPM_SPEC_HEADER) + endif() +endforeach() # CPACK_RPM_SPEC_INSTALL_POST # 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_PACKAGE_DEBUG) 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}") -endif(CPACK_RPM_SPEC_INSTALL_POST) +endif() # 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) @@ -518,39 +518,39 @@ if(CPACK_RPM_PACKAGE_COMPONENT) endif() 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}) - 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}) - endif(CPACK_RPM_${CPACK_RPM_PACKAGE_COMPONENT}_POST_UNINSTALL_SCRIPT_FILE) -else(CPACK_RPM_PACKAGE_COMPONENT) + endif() +else() 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}) -endif(CPACK_RPM_PACKAGE_COMPONENT) +endif() # Handle post-install file if it has been specified if(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) - 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") - endif(EXISTS ${CPACK_RPM_POST_INSTALL_READ_FILE}) -else(CPACK_RPM_POST_INSTALL_READ_FILE) + endif() +else() # reset SPEC var value if no post install file has been specified # (either globally or component-wise) set(CPACK_RPM_SPEC_POSTINSTALL "") -endif(CPACK_RPM_POST_INSTALL_READ_FILE) +endif() # Handle post-uninstall file if it has been specified if(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) - 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") - endif(EXISTS ${CPACK_RPM_POST_UNINSTALL_READ_FILE}) -else(CPACK_RPM_POST_UNINSTALL_READ_FILE) + endif() +else() # reset SPEC var value if no post uninstall file has been specified # (either globally or component-wise) 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_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_${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}) - endif(CPACK_RPM_${CPACK_RPM_PACKAGE_COMPONENT}_PRE_INSTALL_SCRIPT_FILE) + endif() 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}) - 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}) - endif(CPACK_RPM_${CPACK_RPM_PACKAGE_COMPONENT}_PRE_UNINSTALL_SCRIPT_FILE) -else(CPACK_RPM_PACKAGE_COMPONENT) + endif() +else() 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}) -endif(CPACK_RPM_PACKAGE_COMPONENT) +endif() # Handle pre-install file if it has been specified if(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) - 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") - endif(EXISTS ${CPACK_RPM_PRE_INSTALL_READ_FILE}) -else(CPACK_RPM_PRE_INSTALL_READ_FILE) + endif() +else() # reset SPEC var value if no pre-install file has been specified # (either globally or component-wise) set(CPACK_RPM_SPEC_PREINSTALL "") -endif(CPACK_RPM_PRE_INSTALL_READ_FILE) +endif() # Handle pre-uninstall file if it has been specified if(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) - 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") - endif(EXISTS ${CPACK_RPM_PRE_UNINSTALL_READ_FILE}) -else(CPACK_RPM_PRE_UNINSTALL_READ_FILE) + endif() +else() # reset SPEC var value if no pre-uninstall file has been specified # (either globally or component-wise) set(CPACK_RPM_SPEC_PREUNINSTALL "") -endif(CPACK_RPM_PRE_UNINSTALL_READ_FILE) +endif() # CPACK_RPM_CHANGELOG_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(EXISTS ${CPACK_RPM_CHANGELOG_FILE}) 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") - endif(EXISTS ${CPACK_RPM_CHANGELOG_FILE}) -else(CPACK_RPM_CHANGELOG_FILE) + endif() +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)") -endif(CPACK_RPM_CHANGELOG_FILE) +endif() # CPACK_RPM_SPEC_MORE_DEFINE # This is a generated spec rpm file spaceholder if(CPACK_RPM_SPEC_MORE_DEFINE) if(CPACK_RPM_PACKAGE_DEBUG) message("CPackRPM:Debug: User defined more define spec line specified:\n ${CPACK_RPM_SPEC_MORE_DEFINE}") - endif(CPACK_RPM_PACKAGE_DEBUG) -endif(CPACK_RPM_SPEC_MORE_DEFINE) + endif() +endif() # Now we may create the RPM build tree structure set(CPACK_RPM_ROOTDIR "${CPACK_TOPLEVEL_DIRECTORY}") @@ -683,7 +683,7 @@ if(CPACK_RPM_PACKAGE_COMPONENT) if(CPACK_RPM_PACKAGE_DEBUG) message("CPackRPM:Debug: Handling Absolute Destination Files: <${CPACK_ABSOLUTE_DESTINATION_FILES_INTERNAL}>") message("CPackRPM:Debug: in component = ${CPACK_RPM_PACKAGE_COMPONENT}") - endif(CPACK_RPM_PACKAGE_DEBUG) + endif() endif() else() if(CPACK_ABSOLUTE_DESTINATION_FILES) @@ -698,7 +698,7 @@ if(CPACK_RPM_PACKAGE_COMPONENT) if(CPACK_RPM_PACKAGE_DEBUG) message("CPackRPM:Debug: Handling User Filelist: <${CPACK_RPM_USER_FILELIST_INTERNAL}>") message("CPackRPM:Debug: in component = ${CPACK_RPM_PACKAGE_COMPONENT}") - endif(CPACK_RPM_PACKAGE_DEBUG) + endif() else() set(CPACK_RPM_USER_FILELIST_INTERNAL "") endif() @@ -717,7 +717,7 @@ endif() if(CPACK_RPM_USER_FILELIST_INTERNAL) if(CPACK_RPM_PACKAGE_DEBUG) 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 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 "") foreach(F IN LISTS CPACK_RPM_INSTALL_FILES_LIST) set(CPACK_RPM_INSTALL_FILES "${CPACK_RPM_INSTALL_FILES}\"${F}\"\n") - endforeach(F) + endforeach() else() set(CPACK_RPM_USER_INSTALL_FILES "") endif() @@ -755,7 +755,7 @@ endif() if (CPACK_ABSOLUTE_DESTINATION_FILES_INTERNAL) if(CPACK_RPM_PACKAGE_DEBUG) message("CPackRPM:Debug: Handling Absolute Destination Files: ${CPACK_ABSOLUTE_DESTINATION_FILES_INTERNAL}") - endif(CPACK_RPM_PACKAGE_DEBUG) + endif() # Remove trailing space string(STRIP "${CPACK_RPM_INSTALL_FILES}" CPACK_RPM_INSTALL_FILES_LIST) # Transform endline separated - string into CMake List @@ -768,20 +768,20 @@ if (CPACK_ABSOLUTE_DESTINATION_FILES_INTERNAL) set(CPACK_RPM_INSTALL_FILES "") foreach(F IN LISTS CPACK_RPM_INSTALL_FILES_LIST) set(CPACK_RPM_INSTALL_FILES "${CPACK_RPM_INSTALL_FILES}\"${F}\"\n") - endforeach(F) + endforeach() # Build ABSOLUTE_INSTALL_FILES set(CPACK_RPM_ABSOLUTE_INSTALL_FILES "") foreach(F IN LISTS CPACK_ABSOLUTE_DESTINATION_FILES_INTERNAL) set(CPACK_RPM_ABSOLUTE_INSTALL_FILES "${CPACK_RPM_ABSOLUTE_INSTALL_FILES}%config \"${F}\"\n") - endforeach(F) + endforeach() if(CPACK_RPM_PACKAGE_DEBUG) message("CPackRPM:Debug: CPACK_RPM_ABSOLUTE_INSTALL_FILES=${CPACK_RPM_ABSOLUTE_INSTALL_FILES}") message("CPackRPM:Debug: CPACK_RPM_INSTALL_FILES=${CPACK_RPM_INSTALL_FILES}") - endif(CPACK_RPM_PACKAGE_DEBUG) + endif() else() # reset vars in order to avoid leakage of value(s) from one component to another set(CPACK_RPM_ABSOLUTE_INSTALL_FILES "") -endif(CPACK_ABSOLUTE_DESTINATION_FILES_INTERNAL) +endif() # Prepend directories in ${CPACK_RPM_INSTALL_FILES} with %dir # This is necessary to avoid duplicate files since rpmbuild do @@ -799,7 +799,7 @@ foreach(F IN LISTS CPACK_RPM_INSTALL_FILES_LIST) else() set(CPACK_RPM_INSTALL_FILES "${CPACK_RPM_INSTALL_FILES}\"${F}\"\n") endif() -endforeach(F) +endforeach() set(CPACK_RPM_INSTALL_FILES_LIST "") # 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_PACKAGE_INSTALL_DIRECTORY = ${CPACK_PACKAGE_INSTALL_DIRECTORY}") message("CPackRPM:Debug: CPACK_TEMPORARY_PACKAGE_FILE_NAME = ${CPACK_TEMPORARY_PACKAGE_FILE_NAME}") -endif(CPACK_RPM_PACKAGE_DEBUG) +endif() # USER generated spec file handling. # We should generate a spec file template: @@ -900,8 +900,8 @@ ${CPACK_RPM_USER_INSTALL_FILES} # to customize their own spec file. 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") - endif(CPACK_RPM_GENERATE_USER_BINARY_SPECFILE_TEMPLATE) -endif(CPACK_RPM_GENERATE_USER_BINARY_SPECFILE_TEMPLATE OR NOT CPACK_RPM_USER_BINARY_SPECFILE) + endif() +endif() # After that we may either use a user provided spec file # 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}") # The user provided file is processed for @var replacement 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 message("CPackRPM: Will use GENERATED spec file: ${CPACK_RPM_BINARY_SPECFILE}") # Note the just created file is processed for @var replacement configure_file(${CPACK_RPM_BINARY_SPECFILE}.in ${CPACK_RPM_BINARY_SPECFILE} @ONLY) -endif(CPACK_RPM_USER_BINARY_SPECFILE) +endif() if(RPMBUILD_EXECUTABLE) # Now call rpmbuild using the SPECFILE @@ -936,9 +936,9 @@ if(RPMBUILD_EXECUTABLE) message("CPackRPM:Debug: *** ${RPMBUILDERR} ***") message("CPackRPM:Debug: - ${CPACK_TOPLEVEL_DIRECTORY}/rpmbuild${CPACK_RPM_PACKAGE_COMPONENT_PART_NAME}.out") message("CPackRPM:Debug: *** ${RPMBUILDERR} ***") - endif(CPACK_RPM_PACKAGE_DEBUG OR CPACK_RPMBUILD_EXEC_RESULT) -else(RPMBUILD_EXECUTABLE) + endif() +else() if(ALIEN_EXECUTABLE) message(FATAL_ERROR "RPM packaging through alien not done (yet)") - endif(ALIEN_EXECUTABLE) -endif(RPMBUILD_EXECUTABLE) + endif() +endif() diff --git a/Modules/CPackZIP.cmake b/Modules/CPackZIP.cmake index bf7062a..a36589b 100644 --- a/Modules/CPackZIP.cmake +++ b/Modules/CPackZIP.cmake @@ -14,21 +14,21 @@ if(CMAKE_BINARY_DIR) 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") if(ZIP_EXECUTABLE) set(CPACK_ZIP_COMMAND "\"${ZIP_EXECUTABLE}\" -P \"<ARCHIVE>\" @<FILELIST>") set(CPACK_ZIP_NEED_QUOTES TRUE) -endif(ZIP_EXECUTABLE) +endif() if(NOT ZIP_EXECUTABLE) find_program(ZIP_EXECUTABLE 7z PATHS "$ENV{ProgramFiles}/7-Zip") if(ZIP_EXECUTABLE) set(CPACK_ZIP_COMMAND "\"${ZIP_EXECUTABLE}\" a -tzip \"<ARCHIVE>\" @<FILELIST>") set(CPACK_ZIP_NEED_QUOTES TRUE) - endif(ZIP_EXECUTABLE) -endif(NOT ZIP_EXECUTABLE) + endif() +endif() if(NOT ZIP_EXECUTABLE) find_package(Cygwin) @@ -36,6 +36,6 @@ if(NOT ZIP_EXECUTABLE) if(ZIP_EXECUTABLE) set(CPACK_ZIP_COMMAND "\"${ZIP_EXECUTABLE}\" -r \"<ARCHIVE>\" . -i@<FILELIST>") set(CPACK_ZIP_NEED_QUOTES FALSE) - endif(ZIP_EXECUTABLE) -endif(NOT ZIP_EXECUTABLE) + endif() +endif() diff --git a/Modules/CTest.cmake b/Modules/CTest.cmake index 4e861a9..1e2dd5c 100644 --- a/Modules/CTest.cmake +++ b/Modules/CTest.cmake @@ -67,31 +67,31 @@ function(GET_VS_VERSION_STRING generator var) NUMBER "${generator}") if("${generator}" MATCHES "Visual Studio 7 .NET 2003") set(ver_string "vs71") - else("${generator}" MATCHES "Visual Studio 7 .NET 2003") + else() set(ver_string "vs${NUMBER}") - endif("${generator}" MATCHES "Visual Studio 7 .NET 2003") + endif() set(${var} ${ver_string} PARENT_SCOPE) -endfunction(GET_VS_VERSION_STRING) +endfunction() if(BUILD_TESTING) # Setup some auxilary macros macro(SET_IF_NOT_SET var val) if(NOT DEFINED "${var}") set("${var}" "${val}") - endif(NOT DEFINED "${var}") - endmacro(SET_IF_NOT_SET) + endif() + endmacro() macro(SET_IF_SET var val) if(NOT "${val}" MATCHES "^$") set("${var}" "${val}") - endif(NOT "${val}" MATCHES "^$") - endmacro(SET_IF_SET) + endif() + endmacro() macro(SET_IF_SET_AND_NOT_SET var val) if(NOT "${val}" MATCHES "^$") SET_IF_NOT_SET("${var}" "${val}") - endif(NOT "${val}" MATCHES "^$") - endmacro(SET_IF_SET_AND_NOT_SET) + endif() + endmacro() # Make sure testing is enabled 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(TRIGGER_SITE "${CTEST_TRIGGER_SITE}") 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 if(EXISTS "${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 # 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(DROP_METHOD "http") 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") find_program(CVSCOMMAND cvs ) @@ -141,7 +141,7 @@ if(BUILD_TESTING) elseif(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/.git") set(UPDATE_TYPE git) endif() - endif(NOT UPDATE_TYPE) + endif() string(TOLOWER "${UPDATE_TYPE}" _update_type) if("${_update_type}" STREQUAL "cvs") @@ -199,36 +199,36 @@ if(BUILD_TESTING) set(DART_COMPILER "${CMAKE_CXX_COMPILER}") if(NOT DART_COMPILER) set(DART_COMPILER "${CMAKE_C_COMPILER}") - endif(NOT DART_COMPILER) + endif() if(NOT DART_COMPILER) set(DART_COMPILER "unknown") - endif(NOT DART_COMPILER) + endif() if(WIN32) set(DART_NAME_COMPONENT "NAME_WE") - else(WIN32) + else() set(DART_NAME_COMPONENT "NAME") - endif(WIN32) + endif() if(NOT BUILD_NAME_SYSTEM_NAME) set(BUILD_NAME_SYSTEM_NAME "${CMAKE_SYSTEM_NAME}") - endif(NOT BUILD_NAME_SYSTEM_NAME) + endif() if(WIN32) set(BUILD_NAME_SYSTEM_NAME "Win32") - endif(WIN32) + endif() if(UNIX OR BORLAND) get_filename_component(DART_CXX_NAME "${CMAKE_CXX_COMPILER}" ${DART_NAME_COMPONENT}) - else(UNIX OR BORLAND) + else() get_filename_component(DART_CXX_NAME "${CMAKE_BUILD_TOOL}" ${DART_NAME_COMPONENT}) - endif(UNIX OR BORLAND) + endif() if(DART_CXX_NAME MATCHES "msdev") set(DART_CXX_NAME "vs60") - endif(DART_CXX_NAME MATCHES "msdev") + endif() if(DART_CXX_NAME MATCHES "devenv") 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}") - endif(NOT BUILDNAME) + endif() # the build command build_command(MAKECOMMAND_DEFAULT_VALUE @@ -241,11 +241,11 @@ if(BUILD_TESTING) set(DEFAULT_CTEST_CONFIGURATION_TYPE "$ENV{CMAKE_CONFIG_TYPE}") if(DEFAULT_CTEST_CONFIGURATION_TYPE STREQUAL "") set(DEFAULT_CTEST_CONFIGURATION_TYPE "Release") - endif(DEFAULT_CTEST_CONFIGURATION_TYPE STREQUAL "") + endif() if(NOT "${CMAKE_GENERATOR}" MATCHES "Make") set(CTEST_USE_LAUNCHERS 0) - endif(NOT "${CMAKE_GENERATOR}" MATCHES "Make") + endif() 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_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_LINK "${CTEST_LAUNCH_LINK}") set_property(GLOBAL PROPERTY RULE_LAUNCH_CUSTOM "${CTEST_LAUNCH_CUSTOM}") - endif(CTEST_USE_LAUNCHERS) + endif() mark_as_advanced( BZRCOMMAND @@ -282,5 +282,5 @@ if(BUILD_TESTING) set(RUN_FROM_CTEST_OR_DART 1) include(CTestTargets) set(RUN_FROM_CTEST_OR_DART) - endif(NOT RUN_FROM_DART) -endif(BUILD_TESTING) + endif() +endif() diff --git a/Modules/CTestTargets.cmake b/Modules/CTestTargets.cmake index 15be42d..fd4bd80 100644 --- a/Modules/CTestTargets.cmake +++ b/Modules/CTestTargets.cmake @@ -14,7 +14,7 @@ if(NOT RUN_FROM_CTEST_OR_DART) message(FATAL_ERROR "Do not incldue CTestTargets.cmake directly") -endif(NOT RUN_FROM_CTEST_OR_DART) +endif() # make directories in the binary tree file(MAKE_DIRECTORY ${PROJECT_BINARY_DIR}/Testing/Temporary) @@ -30,11 +30,11 @@ if(CTEST_NEW_FORMAT) configure_file( ${CMAKE_ROOT}/Modules/DartConfiguration.tcl.in ${PROJECT_BINARY_DIR}/CTestConfiguration.ini ) -else(CTEST_NEW_FORMAT) +else() configure_file( ${CMAKE_ROOT}/Modules/DartConfiguration.tcl.in ${PROJECT_BINARY_DIR}/DartConfiguration.tcl ) -endif(CTEST_NEW_FORMAT) +endif() # # Section 3: @@ -47,7 +47,7 @@ set(__conf_types "") if(CMAKE_CONFIGURATION_TYPES) # We need to pass the configuration type on the test command line. set(__conf_types -C "${CMAKE_CFG_INTDIR}") -endif(CMAKE_CONFIGURATION_TYPES) +endif() # Add convenience targets. Do this at most once in case of nested # projects. @@ -66,7 +66,7 @@ if(NOT _CTEST_TARGETS_ADDED) ) set_property(TARGET ${mode} PROPERTY RULE_LAUNCH_CUSTOM "") set_property(TARGET ${mode} PROPERTY FOLDER "CTestDashboardTargets") - endforeach(mode) + endforeach() # For Makefile generators add more granular targets. 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 FOLDER "CTestDashboardTargets") - endforeach(testtype) - endforeach(mode) - endif("${CMAKE_GENERATOR}" MATCHES "(Ninja|Make)") + endforeach() + endforeach() + endif() # If requested, add an alias that is the equivalent of the built-in "test" # or "RUN_TESTS" target: @@ -92,4 +92,4 @@ if(NOT _CTEST_TARGETS_ADDED) ${CMAKE_CTEST_COMMAND} ${__conf_types} ) endif() -endif(NOT _CTEST_TARGETS_ADDED) +endif() diff --git a/Modules/CheckCCompilerFlag.cmake b/Modules/CheckCCompilerFlag.cmake index 2f54e39..08e80f7 100644 --- a/Modules/CheckCCompilerFlag.cmake +++ b/Modules/CheckCCompilerFlag.cmake @@ -42,4 +42,4 @@ macro (CHECK_C_COMPILER_FLAG _FLAG _RESULT) FAIL_REGEX "WARNING: unknown flag:" # Open64 ) set (CMAKE_REQUIRED_DEFINITIONS "${SAFE_CMAKE_REQUIRED_DEFINITIONS}") -endmacro (CHECK_C_COMPILER_FLAG) +endmacro () diff --git a/Modules/CheckCSourceCompiles.cmake b/Modules/CheckCSourceCompiles.cmake index 3c6e6a9..b457754 100644 --- a/Modules/CheckCSourceCompiles.cmake +++ b/Modules/CheckCSourceCompiles.cmake @@ -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}") set(CHECK_C_SOURCE_COMPILES_ADD_LIBRARIES "-DLINK_LIBRARIES:STRING=${_ADJUSTED_CMAKE_REQUIRED_LIBRARIES}") - else(CMAKE_REQUIRED_LIBRARIES) + else() set(CHECK_C_SOURCE_COMPILES_ADD_LIBRARIES) - endif(CMAKE_REQUIRED_LIBRARIES) + endif() if(CMAKE_REQUIRED_INCLUDES) set(CHECK_C_SOURCE_COMPILES_ADD_INCLUDES "-DINCLUDE_DIRECTORIES:STRING=${CMAKE_REQUIRED_INCLUDES}") - else(CMAKE_REQUIRED_INCLUDES) + else() set(CHECK_C_SOURCE_COMPILES_ADD_INCLUDES) - endif(CMAKE_REQUIRED_INCLUDES) + endif() file(WRITE "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/src.c" "${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" "${OUTPUT}\n" "Source file was:\n${SOURCE}\n") - else(${VAR}) + else() message(STATUS "Performing Test ${VAR} - Failed") set(${VAR} "" CACHE INTERNAL "Test ${VAR}") file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log "Performing C SOURCE FILE Test ${VAR} failed with the following output:\n" "${OUTPUT}\n" "Source file was:\n${SOURCE}\n") - endif(${VAR}) - endif("${VAR}" MATCHES "^${VAR}$") -endmacro(CHECK_C_SOURCE_COMPILES) + endif() + endif() +endmacro() diff --git a/Modules/CheckCSourceRuns.cmake b/Modules/CheckCSourceRuns.cmake index a8fb554..bc64acd 100644 --- a/Modules/CheckCSourceRuns.cmake +++ b/Modules/CheckCSourceRuns.cmake @@ -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}") set(CHECK_C_SOURCE_COMPILES_ADD_LIBRARIES "-DLINK_LIBRARIES:STRING=${_ADJUSTED_CMAKE_REQUIRED_LIBRARIES}") - else(CMAKE_REQUIRED_LIBRARIES) + else() set(CHECK_C_SOURCE_COMPILES_ADD_LIBRARIES) - endif(CMAKE_REQUIRED_LIBRARIES) + endif() if(CMAKE_REQUIRED_INCLUDES) set(CHECK_C_SOURCE_COMPILES_ADD_INCLUDES "-DINCLUDE_DIRECTORIES:STRING=${CMAKE_REQUIRED_INCLUDES}") - else(CMAKE_REQUIRED_INCLUDES) + else() set(CHECK_C_SOURCE_COMPILES_ADD_INCLUDES) - endif(CMAKE_REQUIRED_INCLUDES) + endif() file(WRITE "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/src.c" "${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(NOT ${VAR}_COMPILED) set(${VAR}_EXITCODE 1) - endif(NOT ${VAR}_COMPILED) + endif() # if the return value was 0 then it worked if("${${VAR}_EXITCODE}" EQUAL 0) set(${VAR} 1 CACHE INTERNAL "Test ${VAR}") @@ -71,12 +71,12 @@ macro(CHECK_C_SOURCE_RUNS SOURCE VAR) "${OUTPUT}\n" "Return value: ${${VAR}}\n" "Source file was:\n${SOURCE}\n") - else("${${VAR}_EXITCODE}" EQUAL 0) + else() if(CMAKE_CROSSCOMPILING AND "${${VAR}_EXITCODE}" MATCHES "FAILED_TO_RUN") set(${VAR} "${${VAR}_EXITCODE}") - else(CMAKE_CROSSCOMPILING AND "${${VAR}_EXITCODE}" MATCHES "FAILED_TO_RUN") + else() set(${VAR} "" CACHE INTERNAL "Test ${VAR}") - endif(CMAKE_CROSSCOMPILING AND "${${VAR}_EXITCODE}" MATCHES "FAILED_TO_RUN") + endif() message(STATUS "Performing Test ${VAR} - Failed") 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" "Source file was:\n${SOURCE}\n") - endif("${${VAR}_EXITCODE}" EQUAL 0) - endif("${VAR}" MATCHES "^${VAR}$") -endmacro(CHECK_C_SOURCE_RUNS) + endif() + endif() +endmacro() diff --git a/Modules/CheckCXXCompilerFlag.cmake b/Modules/CheckCXXCompilerFlag.cmake index 7e763f7..6626403 100644 --- a/Modules/CheckCXXCompilerFlag.cmake +++ b/Modules/CheckCXXCompilerFlag.cmake @@ -44,5 +44,5 @@ macro (CHECK_CXX_COMPILER_FLAG _FLAG _RESULT) FAIL_REGEX "WARNING: unknown flag:" # Open64 ) set (CMAKE_REQUIRED_DEFINITIONS "${SAFE_CMAKE_REQUIRED_DEFINITIONS}") -endmacro (CHECK_CXX_COMPILER_FLAG) +endmacro () diff --git a/Modules/CheckCXXSourceCompiles.cmake b/Modules/CheckCXXSourceCompiles.cmake index d131423..c0be1f7 100644 --- a/Modules/CheckCXXSourceCompiles.cmake +++ b/Modules/CheckCXXSourceCompiles.cmake @@ -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}") set(CHECK_CXX_SOURCE_COMPILES_ADD_LIBRARIES "-DLINK_LIBRARIES:STRING=${_ADJUSTED_CMAKE_REQUIRED_LIBRARIES}") - else(CMAKE_REQUIRED_LIBRARIES) + else() set(CHECK_CXX_SOURCE_COMPILES_ADD_LIBRARIES) - endif(CMAKE_REQUIRED_LIBRARIES) + endif() if(CMAKE_REQUIRED_INCLUDES) set(CHECK_CXX_SOURCE_COMPILES_ADD_INCLUDES "-DINCLUDE_DIRECTORIES:STRING=${CMAKE_REQUIRED_INCLUDES}") - else(CMAKE_REQUIRED_INCLUDES) + else() set(CHECK_CXX_SOURCE_COMPILES_ADD_INCLUDES) - endif(CMAKE_REQUIRED_INCLUDES) + endif() file(WRITE "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/src.cxx" "${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" "${OUTPUT}\n" "Source file was:\n${SOURCE}\n") - else(${VAR}) + else() message(STATUS "Performing Test ${VAR} - Failed") set(${VAR} "" CACHE INTERNAL "Test ${VAR}") file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log "Performing C++ SOURCE FILE Test ${VAR} failed with the following output:\n" "${OUTPUT}\n" "Source file was:\n${SOURCE}\n") - endif(${VAR}) - endif("${VAR}" MATCHES "^${VAR}$") -endmacro(CHECK_CXX_SOURCE_COMPILES) + endif() + endif() +endmacro() diff --git a/Modules/CheckCXXSourceRuns.cmake b/Modules/CheckCXXSourceRuns.cmake index 5159517..47ab161 100644 --- a/Modules/CheckCXXSourceRuns.cmake +++ b/Modules/CheckCXXSourceRuns.cmake @@ -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}") set(CHECK_CXX_SOURCE_COMPILES_ADD_LIBRARIES "-DLINK_LIBRARIES:STRING=${_ADJUSTED_CMAKE_REQUIRED_LIBRARIES}") - else(CMAKE_REQUIRED_LIBRARIES) + else() set(CHECK_CXX_SOURCE_COMPILES_ADD_LIBRARIES) - endif(CMAKE_REQUIRED_LIBRARIES) + endif() if(CMAKE_REQUIRED_INCLUDES) set(CHECK_CXX_SOURCE_COMPILES_ADD_INCLUDES "-DINCLUDE_DIRECTORIES:STRING=${CMAKE_REQUIRED_INCLUDES}") - else(CMAKE_REQUIRED_INCLUDES) + else() set(CHECK_CXX_SOURCE_COMPILES_ADD_INCLUDES) - endif(CMAKE_REQUIRED_INCLUDES) + endif() file(WRITE "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/src.cxx" "${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(NOT ${VAR}_COMPILED) set(${VAR}_EXITCODE 1) - endif(NOT ${VAR}_COMPILED) + endif() # if the return value was 0 then it worked if("${${VAR}_EXITCODE}" EQUAL 0) set(${VAR} 1 CACHE INTERNAL "Test ${VAR}") @@ -72,12 +72,12 @@ macro(CHECK_CXX_SOURCE_RUNS SOURCE VAR) "${OUTPUT}\n" "Return value: ${${VAR}}\n" "Source file was:\n${SOURCE}\n") - else("${${VAR}_EXITCODE}" EQUAL 0) + else() if(CMAKE_CROSSCOMPILING AND "${${VAR}_EXITCODE}" MATCHES "FAILED_TO_RUN") set(${VAR} "${${VAR}_EXITCODE}") - else(CMAKE_CROSSCOMPILING AND "${${VAR}_EXITCODE}" MATCHES "FAILED_TO_RUN") + else() set(${VAR} "" CACHE INTERNAL "Test ${VAR}") - endif(CMAKE_CROSSCOMPILING AND "${${VAR}_EXITCODE}" MATCHES "FAILED_TO_RUN") + endif() message(STATUS "Performing Test ${VAR} - Failed") file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log @@ -85,7 +85,7 @@ macro(CHECK_CXX_SOURCE_RUNS SOURCE VAR) "${OUTPUT}\n" "Return value: ${${VAR}_EXITCODE}\n" "Source file was:\n${SOURCE}\n") - endif("${${VAR}_EXITCODE}" EQUAL 0) - endif("${VAR}" MATCHES "^${VAR}$") -endmacro(CHECK_CXX_SOURCE_RUNS) + endif() + endif() +endmacro() diff --git a/Modules/CheckCXXSymbolExists.cmake b/Modules/CheckCXXSymbolExists.cmake index ebb3a92..2100973 100644 --- a/Modules/CheckCXXSymbolExists.cmake +++ b/Modules/CheckCXXSymbolExists.cmake @@ -39,4 +39,4 @@ include(CheckSymbolExists) macro(CHECK_CXX_SYMBOL_EXISTS SYMBOL FILES VARIABLE) _CHECK_SYMBOL_EXISTS("${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/CheckSymbolExists.cxx" "${SYMBOL}" "${FILES}" "${VARIABLE}" ) -endmacro(CHECK_CXX_SYMBOL_EXISTS) +endmacro() diff --git a/Modules/CheckFortranFunctionExists.cmake b/Modules/CheckFortranFunctionExists.cmake index 0ccf64a..4b9f9b7 100644 --- a/Modules/CheckFortranFunctionExists.cmake +++ b/Modules/CheckFortranFunctionExists.cmake @@ -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}") set(CHECK_FUNCTION_EXISTS_ADD_LIBRARIES "-DLINK_LIBRARIES:STRING=${_ADJUSTED_CMAKE_REQUIRED_LIBRARIES}") - else(CMAKE_REQUIRED_LIBRARIES) + else() set(CHECK_FUNCTION_EXISTS_ADD_LIBRARIES) - endif(CMAKE_REQUIRED_LIBRARIES) + endif() file(WRITE ${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 "Determining if the Fortran ${FUNCTION} exists passed with the following output:\n" "${OUTPUT}\n\n") - else(${VARIABLE}) + else() message(STATUS "Looking for Fortran ${FUNCTION} - not found") set(${VARIABLE} "" CACHE INTERNAL "Have Fortran function ${FUNCTION}") file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log "Determining if the Fortran ${FUNCTION} exists failed with the following output:\n" "${OUTPUT}\n\n") - endif(${VARIABLE}) - endif(NOT DEFINED ${VARIABLE}) -endmacro(CHECK_FORTRAN_FUNCTION_EXISTS) + endif() + endif() +endmacro() diff --git a/Modules/CheckFunctionExists.cmake b/Modules/CheckFunctionExists.cmake index b9c0f26..3f952e0 100644 --- a/Modules/CheckFunctionExists.cmake +++ b/Modules/CheckFunctionExists.cmake @@ -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}") set(CHECK_FUNCTION_EXISTS_ADD_LIBRARIES "-DLINK_LIBRARIES:STRING=${_ADJUSTED_CMAKE_REQUIRED_LIBRARIES}") - else(CMAKE_REQUIRED_LIBRARIES) + else() set(CHECK_FUNCTION_EXISTS_ADD_LIBRARIES) - endif(CMAKE_REQUIRED_LIBRARIES) + endif() if(CMAKE_REQUIRED_INCLUDES) set(CHECK_FUNCTION_EXISTS_ADD_INCLUDES "-DINCLUDE_DIRECTORIES:STRING=${CMAKE_REQUIRED_INCLUDES}") - else(CMAKE_REQUIRED_INCLUDES) + else() set(CHECK_FUNCTION_EXISTS_ADD_INCLUDES) - endif(CMAKE_REQUIRED_INCLUDES) + endif() try_compile(${VARIABLE} ${CMAKE_BINARY_DIR} ${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 "Determining if the function ${FUNCTION} exists passed with the following output:\n" "${OUTPUT}\n\n") - else(${VARIABLE}) + else() message(STATUS "Looking for ${FUNCTION} - not found") set(${VARIABLE} "" CACHE INTERNAL "Have function ${FUNCTION}") file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log "Determining if the function ${FUNCTION} exists failed with the following output:\n" "${OUTPUT}\n\n") - endif(${VARIABLE}) - endif("${VARIABLE}" MATCHES "^${VARIABLE}$") -endmacro(CHECK_FUNCTION_EXISTS) + endif() + endif() +endmacro() diff --git a/Modules/CheckIncludeFile.cmake b/Modules/CheckIncludeFile.cmake index 07d4966..8067e65 100644 --- a/Modules/CheckIncludeFile.cmake +++ b/Modules/CheckIncludeFile.cmake @@ -32,9 +32,9 @@ macro(CHECK_INCLUDE_FILE INCLUDE VARIABLE) if("${VARIABLE}" MATCHES "^${VARIABLE}$") if(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) - endif(CMAKE_REQUIRED_INCLUDES) + endif() set(MACRO_CHECK_INCLUDE_FILE_FLAGS ${CMAKE_REQUIRED_FLAGS}) set(CHECK_INCLUDE_FILE_VAR ${INCLUDE}) configure_file(${CMAKE_ROOT}/Modules/CheckIncludeFile.c.in @@ -43,7 +43,7 @@ macro(CHECK_INCLUDE_FILE INCLUDE VARIABLE) if(${ARGC} EQUAL 3) set(CMAKE_C_FLAGS_SAVE ${CMAKE_C_FLAGS}) set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${ARGV2}") - endif(${ARGC} EQUAL 3) + endif() try_compile(${VARIABLE} ${CMAKE_BINARY_DIR} @@ -56,7 +56,7 @@ macro(CHECK_INCLUDE_FILE INCLUDE VARIABLE) if(${ARGC} EQUAL 3) set(CMAKE_C_FLAGS ${CMAKE_C_FLAGS_SAVE}) - endif(${ARGC} EQUAL 3) + endif() if(${VARIABLE}) message(STATUS "Looking for ${INCLUDE} - found") @@ -65,13 +65,13 @@ macro(CHECK_INCLUDE_FILE INCLUDE VARIABLE) "Determining if the include file ${INCLUDE} " "exists passed with the following output:\n" "${OUTPUT}\n\n") - else(${VARIABLE}) + else() message(STATUS "Looking for ${INCLUDE} - not found") set(${VARIABLE} "" CACHE INTERNAL "Have include ${INCLUDE}") file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log "Determining if the include file ${INCLUDE} " "exists failed with the following output:\n" "${OUTPUT}\n\n") - endif(${VARIABLE}) - endif("${VARIABLE}" MATCHES "^${VARIABLE}$") -endmacro(CHECK_INCLUDE_FILE) + endif() + endif() +endmacro() diff --git a/Modules/CheckIncludeFileCXX.cmake b/Modules/CheckIncludeFileCXX.cmake index adc39f3..22c2d1a 100644 --- a/Modules/CheckIncludeFileCXX.cmake +++ b/Modules/CheckIncludeFileCXX.cmake @@ -32,9 +32,9 @@ macro(CHECK_INCLUDE_FILE_CXX INCLUDE VARIABLE) if("${VARIABLE}" MATCHES "^${VARIABLE}$") if(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) - endif(CMAKE_REQUIRED_INCLUDES) + endif() set(MACRO_CHECK_INCLUDE_FILE_FLAGS ${CMAKE_REQUIRED_FLAGS}) set(CHECK_INCLUDE_FILE_VAR ${INCLUDE}) configure_file(${CMAKE_ROOT}/Modules/CheckIncludeFile.cxx.in @@ -43,7 +43,7 @@ macro(CHECK_INCLUDE_FILE_CXX INCLUDE VARIABLE) if(${ARGC} EQUAL 3) set(CMAKE_CXX_FLAGS_SAVE ${CMAKE_CXX_FLAGS}) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${ARGV2}") - endif(${ARGC} EQUAL 3) + endif() try_compile(${VARIABLE} ${CMAKE_BINARY_DIR} @@ -56,7 +56,7 @@ macro(CHECK_INCLUDE_FILE_CXX INCLUDE VARIABLE) if(${ARGC} EQUAL 3) set(CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS_SAVE}) - endif(${ARGC} EQUAL 3) + endif() if(${VARIABLE}) 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} " "exists passed with the following output:\n" "${OUTPUT}\n\n") - else(${VARIABLE}) + else() message(STATUS "Looking for C++ include ${INCLUDE} - not found") set(${VARIABLE} "" CACHE INTERNAL "Have include ${INCLUDE}") file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log "Determining if the include file ${INCLUDE} " "exists failed with the following output:\n" "${OUTPUT}\n\n") - endif(${VARIABLE}) - endif("${VARIABLE}" MATCHES "^${VARIABLE}$") -endmacro(CHECK_INCLUDE_FILE_CXX) + endif() + endif() +endmacro() diff --git a/Modules/CheckIncludeFiles.cmake b/Modules/CheckIncludeFiles.cmake index 02e3aac..70ab9be 100644 --- a/Modules/CheckIncludeFiles.cmake +++ b/Modules/CheckIncludeFiles.cmake @@ -30,15 +30,15 @@ macro(CHECK_INCLUDE_FILES INCLUDE VARIABLE) set(CMAKE_CONFIGURABLE_FILE_CONTENT "/* */\n") if(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) - endif(CMAKE_REQUIRED_INCLUDES) + endif() set(CHECK_INCLUDE_FILES_CONTENT "/* */\n") set(MACRO_CHECK_INCLUDE_FILES_FLAGS ${CMAKE_REQUIRED_FLAGS}) foreach(FILE ${INCLUDE}) set(CMAKE_CONFIGURABLE_FILE_CONTENT "${CMAKE_CONFIGURABLE_FILE_CONTENT}#include <${FILE}>\n") - endforeach(FILE) + endforeach() set(CMAKE_CONFIGURABLE_FILE_CONTENT "${CMAKE_CONFIGURABLE_FILE_CONTENT}\n\nint main(){return 0;}\n") configure_file("${CMAKE_ROOT}/Modules/CMakeConfigurableFile.in" @@ -70,13 +70,13 @@ macro(CHECK_INCLUDE_FILES INCLUDE VARIABLE) "Determining if files ${INCLUDE} " "exist passed with the following output:\n" "${OUTPUT}\n\n") - else(${VARIABLE}) + else() message(STATUS "Looking for ${_description} - not found.") set(${VARIABLE} "" CACHE INTERNAL "Have includes ${INCLUDE}") file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log "Determining if files ${INCLUDE} " "exist failed with the following output:\n" "${OUTPUT}\nSource:\n${CMAKE_CONFIGURABLE_FILE_CONTENT}\n") - endif(${VARIABLE}) - endif("${VARIABLE}" MATCHES "^${VARIABLE}$") -endmacro(CHECK_INCLUDE_FILES) + endif() + endif() +endmacro() diff --git a/Modules/CheckLibraryExists.cmake b/Modules/CheckLibraryExists.cmake index 447e97d..697f8a4 100644 --- a/Modules/CheckLibraryExists.cmake +++ b/Modules/CheckLibraryExists.cmake @@ -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}") set(CHECK_LIBRARY_EXISTS_LIBRARIES ${CHECK_LIBRARY_EXISTS_LIBRARIES} ${_ADJUSTED_CMAKE_REQUIRED_LIBRARIES}) - endif(CMAKE_REQUIRED_LIBRARIES) + endif() try_compile(${VARIABLE} ${CMAKE_BINARY_DIR} ${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} " "passed with the following output:\n" "${OUTPUT}\n\n") - else(${VARIABLE}) + else() message(STATUS "Looking for ${FUNCTION} in ${LIBRARY} - not found") set(${VARIABLE} "" CACHE INTERNAL "Have library ${LIBRARY}") file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log "Determining if the function ${FUNCTION} exists in the ${LIBRARY} " "failed with the following output:\n" "${OUTPUT}\n\n") - endif(${VARIABLE}) - endif("${VARIABLE}" MATCHES "^${VARIABLE}$") -endmacro(CHECK_LIBRARY_EXISTS) + endif() + endif() +endmacro() diff --git a/Modules/CheckPrototypeDefinition.cmake b/Modules/CheckPrototypeDefinition.cmake index 63d4242..74b94b8 100644 --- a/Modules/CheckPrototypeDefinition.cmake +++ b/Modules/CheckPrototypeDefinition.cmake @@ -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}") set(CHECK_PROTOTYPE_DEFINITION_LIBS "-DLINK_LIBRARIES:STRING=${_ADJUSTED_CMAKE_REQUIRED_LIBRARIES}") - else(CMAKE_REQUIRED_LIBRARIES) + else() set(CHECK_PROTOTYPE_DEFINITION_LIBS) - endif(CMAKE_REQUIRED_LIBRARIES) + endif() if (CMAKE_REQUIRED_INCLUDES) set(CMAKE_SYMBOL_EXISTS_INCLUDES "-DINCLUDE_DIRECTORIES:STRING=${CMAKE_REQUIRED_INCLUDES}") - else(CMAKE_REQUIRED_INCLUDES) + else() set(CMAKE_SYMBOL_EXISTS_INCLUDES) - endif(CMAKE_REQUIRED_INCLUDES) + endif() foreach(_FILE ${_HEADER}) set(CHECK_PROTOTYPE_DEFINITION_HEADER "${CHECK_PROTOTYPE_DEFINITION_HEADER}#include <${_FILE}>\n") - endforeach(_FILE) + endforeach() set(CHECK_PROTOTYPE_DEFINITION_SYMBOL ${_FUNCTION}) 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 "Determining if the prototype ${_FUNCTION} exists for ${_VARIABLE} passed with the following output:\n" "${OUTPUT}\n\n") - else (${_VARIABLE}) + else () message(STATUS "Checking prototype ${_FUNCTION} for ${_VARIABLE} - False") set(${_VARIABLE} 0 CACHE INTERNAL "Have correct prototype for ${_FUNCTION}") file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log "Determining if the prototype ${_FUNCTION} exists for ${_VARIABLE} failed with the following output:\n" "${OUTPUT}\n\n${_SOURCE}\n\n") - endif (${_VARIABLE}) - endif("${_VARIABLE}" MATCHES "^${_VARIABLE}$") + endif () + endif() -endfunction(CHECK_PROTOTYPE_DEFINITION) +endfunction() diff --git a/Modules/CheckStructHasMember.cmake b/Modules/CheckStructHasMember.cmake index fb9703e..ea2891c 100644 --- a/Modules/CheckStructHasMember.cmake +++ b/Modules/CheckStructHasMember.cmake @@ -34,7 +34,7 @@ macro (CHECK_STRUCT_HAS_MEMBER _STRUCT _MEMBER _HEADER _RESULT) set(_INCLUDE_FILES) foreach (it ${_HEADER}) set(_INCLUDE_FILES "${_INCLUDE_FILES}#include <${it}>\n") - endforeach (it) + endforeach () set(_CHECK_STRUCT_MEMBER_SOURCE_CODE " ${_INCLUDE_FILES} @@ -47,5 +47,5 @@ int main() ") CHECK_C_SOURCE_COMPILES("${_CHECK_STRUCT_MEMBER_SOURCE_CODE}" ${_RESULT}) -endmacro (CHECK_STRUCT_HAS_MEMBER) +endmacro () diff --git a/Modules/CheckSymbolExists.cmake b/Modules/CheckSymbolExists.cmake index c843c31..59b9942 100644 --- a/Modules/CheckSymbolExists.cmake +++ b/Modules/CheckSymbolExists.cmake @@ -40,7 +40,7 @@ include("${CMAKE_CURRENT_LIST_DIR}/CMakeExpandImportedTargets.cmake") macro(CHECK_SYMBOL_EXISTS 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) 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}") set(CHECK_SYMBOL_EXISTS_LIBS "-DLINK_LIBRARIES:STRING=${_ADJUSTED_CMAKE_REQUIRED_LIBRARIES}") - else(CMAKE_REQUIRED_LIBRARIES) + else() set(CHECK_SYMBOL_EXISTS_LIBS) - endif(CMAKE_REQUIRED_LIBRARIES) + endif() if(CMAKE_REQUIRED_INCLUDES) set(CMAKE_SYMBOL_EXISTS_INCLUDES "-DINCLUDE_DIRECTORIES:STRING=${CMAKE_REQUIRED_INCLUDES}") - else(CMAKE_REQUIRED_INCLUDES) + else() set(CMAKE_SYMBOL_EXISTS_INCLUDES) - endif(CMAKE_REQUIRED_INCLUDES) + endif() foreach(FILE ${FILES}) set(CMAKE_CONFIGURABLE_FILE_CONTENT "${CMAKE_CONFIGURABLE_FILE_CONTENT}#include <${FILE}>\n") - endforeach(FILE) + endforeach() 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") @@ -88,7 +88,7 @@ macro(_CHECK_SYMBOL_EXISTS SOURCEFILE SYMBOL FILES VARIABLE) "exist passed with the following output:\n" "${OUTPUT}\nFile ${SOURCEFILE}:\n" "${CMAKE_CONFIGURABLE_FILE_CONTENT}\n") - else(${VARIABLE}) + else() message(STATUS "Looking for ${SYMBOL} - not found.") set(${VARIABLE} "" CACHE INTERNAL "Have symbol ${SYMBOL}") 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" "${OUTPUT}\nFile ${SOURCEFILE}:\n" "${CMAKE_CONFIGURABLE_FILE_CONTENT}\n") - endif(${VARIABLE}) - endif("${VARIABLE}" MATCHES "^${VARIABLE}$") -endmacro(_CHECK_SYMBOL_EXISTS) + endif() + endif() +endmacro() diff --git a/Modules/CheckTypeSize.cmake b/Modules/CheckTypeSize.cmake index 1717718..1b9dc9f 100644 --- a/Modules/CheckTypeSize.cmake +++ b/Modules/CheckTypeSize.cmake @@ -142,7 +142,7 @@ function(__check_type_size_impl type var map builtin) file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log "Determining size of ${type} passed with the following output:\n${output}\n\n") set(${var} "${${var}}" CACHE INTERNAL "CHECK_TYPE_SIZE: sizeof(${type})") - else(HAVE_${var}) + else() # The check failed to compile. message(STATUS "Check size of ${type} - failed") 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") set(${var} "" CACHE INTERNAL "CHECK_TYPE_SIZE: ${type} unknown") file(REMOVE ${map}) - endif(HAVE_${var}) + endif() endfunction() #----------------------------------------------------------------------------- diff --git a/Modules/CheckVariableExists.cmake b/Modules/CheckVariableExists.cmake index 48e848b..f9155a0 100644 --- a/Modules/CheckVariableExists.cmake +++ b/Modules/CheckVariableExists.cmake @@ -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}") set(CHECK_VARIABLE_EXISTS_ADD_LIBRARIES "-DLINK_LIBRARIES:STRING=${_ADJUSTED_CMAKE_REQUIRED_LIBRARIES}") - else(CMAKE_REQUIRED_LIBRARIES) + else() set(CHECK_VARIABLE_EXISTS_ADD_LIBRARIES) - endif(CMAKE_REQUIRED_LIBRARIES) + endif() try_compile(${VARIABLE} ${CMAKE_BINARY_DIR} ${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 "Determining if the variable ${VAR} exists passed with the following output:\n" "${OUTPUT}\n\n") - else(${VARIABLE}) + else() set(${VARIABLE} "" CACHE INTERNAL "Have variable ${VAR}") message(STATUS "Looking for ${VAR} - not found") file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log "Determining if the variable ${VAR} exists failed with the following output:\n" "${OUTPUT}\n\n") - endif(${VARIABLE}) - endif("${VARIABLE}" MATCHES "^${VARIABLE}$") -endmacro(CHECK_VARIABLE_EXISTS) + endif() + endif() +endmacro() diff --git a/Modules/Compiler/GNU.cmake b/Modules/Compiler/GNU.cmake index 4f316f6..0827e43 100644 --- a/Modules/Compiler/GNU.cmake +++ b/Modules/Compiler/GNU.cmake @@ -50,5 +50,5 @@ macro(__compiler_gnu lang) set(CMAKE_${lang}_CREATE_ASSEMBLY_SOURCE "<CMAKE_${lang}_COMPILER> <DEFINES> <FLAGS> -S <SOURCE> -o <ASSEMBLY_SOURCE>") if(NOT APPLE) set(CMAKE_INCLUDE_SYSTEM_FLAG_${lang} "-isystem ") - endif(NOT APPLE) + endif() endmacro() diff --git a/Modules/Compiler/Intel-ASM.cmake b/Modules/Compiler/Intel-ASM.cmake index 0dd7b0d..1f064c9 100644 --- a/Modules/Compiler/Intel-ASM.cmake +++ b/Modules/Compiler/Intel-ASM.cmake @@ -8,6 +8,6 @@ set(CMAKE_ASM_FLAGS_RELWITHDEBINFO_INIT "-O2 -g") if(UNIX) set(CMAKE_ASM_SOURCE_FILE_EXTENSIONS s;S) -else(UNIX) +else() set(CMAKE_ASM_SOURCE_FILE_EXTENSIONS asm) -endif(UNIX) +endif() diff --git a/Modules/Compiler/SunPro-ASM.cmake b/Modules/Compiler/SunPro-ASM.cmake index 371e233..97776da 100644 --- a/Modules/Compiler/SunPro-ASM.cmake +++ b/Modules/Compiler/SunPro-ASM.cmake @@ -21,4 +21,4 @@ set(CMAKE_ASM_FLAGS_RELWITHDEBINFO_INIT "-g -xO2") foreach(type SHARED_LIBRARY SHARED_MODULE EXE) set(CMAKE_${type}_LINK_STATIC_ASM_FLAGS "-Bstatic") set(CMAKE_${type}_LINK_DYNAMIC_ASM_FLAGS "-Bdynamic") -endforeach(type) +endforeach() diff --git a/Modules/Compiler/SunPro-C.cmake b/Modules/Compiler/SunPro-C.cmake index 668ddae..9e36051 100644 --- a/Modules/Compiler/SunPro-C.cmake +++ b/Modules/Compiler/SunPro-C.cmake @@ -21,7 +21,7 @@ set(CMAKE_C_FLAGS_RELWITHDEBINFO_INIT "-g -xO2") foreach(type SHARED_LIBRARY SHARED_MODULE EXE) set(CMAKE_${type}_LINK_STATIC_C_FLAGS "-Bstatic") 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_ASSEMBLY_SOURCE "<CMAKE_C_COMPILER> <DEFINES> <FLAGS> -S <SOURCE> -o <ASSEMBLY_SOURCE>") diff --git a/Modules/Compiler/SunPro-CXX.cmake b/Modules/Compiler/SunPro-CXX.cmake index d912eef..af31c7b 100644 --- a/Modules/Compiler/SunPro-CXX.cmake +++ b/Modules/Compiler/SunPro-CXX.cmake @@ -21,7 +21,7 @@ set(CMAKE_CXX_FLAGS_RELWITHDEBINFO_INIT "-g -xO2") foreach(type SHARED_LIBRARY SHARED_MODULE EXE) set(CMAKE_${type}_LINK_STATIC_CXX_FLAGS "-Bstatic") 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_ASSEMBLY_SOURCE "<CMAKE_CXX_COMPILER> <FLAGS> -S <SOURCE> -o <ASSEMBLY_SOURCE>") diff --git a/Modules/Dart.cmake b/Modules/Dart.cmake index 97addcc..bd744b0 100644 --- a/Modules/Dart.cmake +++ b/Modules/Dart.cmake @@ -6,7 +6,7 @@ # include(Dart) # if(BUILD_TESTING) # # ... testing related CMake code ... -# endif(BUILD_TESTING) +# endif() # The BUILD_TESTING option is created by the Dart module to determine # whether testing support should be enabled. The default is ON. @@ -76,7 +76,7 @@ if(BUILD_TESTING) set(HAVE_DART) if(EXISTS "${DART_ROOT}/Source/Client/Dart.conf.in") set(HAVE_DART 1) - endif(EXISTS "${DART_ROOT}/Source/Client/Dart.conf.in") + endif() # # Section #2: @@ -86,7 +86,7 @@ if(BUILD_TESTING) # find a tcl shell command if(HAVE_DART) find_package(Tclsh) - endif(HAVE_DART) + endif() if (HAVE_DART) @@ -110,13 +110,13 @@ if(BUILD_TESTING) set(DART_EXPERIMENTAL_NAME Experimental) if(DART_EXPERIMENTAL_USE_PROJECT_NAME) set(DART_EXPERIMENTAL_NAME "${DART_EXPERIMENTAL_NAME}${PROJECT_NAME}") - endif(DART_EXPERIMENTAL_USE_PROJECT_NAME) - endif (HAVE_DART) + endif() + endif () set(RUN_FROM_CTEST_OR_DART 1) include(CTestTargets) set(RUN_FROM_CTEST_OR_DART) -endif(BUILD_TESTING) +endif() # # End of Dart.cmake diff --git a/Modules/Documentation.cmake b/Modules/Documentation.cmake index ec989f4..d1c3afe 100644 --- a/Modules/Documentation.cmake +++ b/Modules/Documentation.cmake @@ -49,4 +49,4 @@ if (BUILD_DOCUMENTATION) # We will probably need bash to create the custom target # -endif (BUILD_DOCUMENTATION) +endif () diff --git a/Modules/ExternalProject.cmake b/Modules/ExternalProject.cmake index a0a9aea..f0471ff 100644 --- a/Modules/ExternalProject.cmake +++ b/Modules/ExternalProject.cmake @@ -226,7 +226,7 @@ function(_ep_parse_arguments f name ns args) set(key "${arg}") endif() endforeach() -endfunction(_ep_parse_arguments) +endfunction() 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) @@ -377,7 +377,7 @@ message(STATUS \"downloading... done\") " ) -endfunction(_ep_write_downloadfile_script) +endfunction() 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) @@ -502,7 +502,7 @@ message(STATUS \"extracting... done\") " ) -endfunction(_ep_write_extractfile_script) +endfunction() function(_ep_set_directories name) @@ -523,7 +523,7 @@ function(_ep_set_directories name) set(binary_default "${prefix}/src/${name}-build") set(stamp_default "${prefix}/src/${name}-stamp") set(install_default "${prefix}") - else() # assert(base) + else() set(tmp_default "${base}/tmp/${name}") set(download_default "${base}/Download/${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)") endif() endforeach() -endfunction(_ep_set_directories) +endfunction() # 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") endif() configure_file("${script_filename}.in" "${script_filename}") -endfunction(_ep_write_initial_cache) +endfunction() function(ExternalProject_Get_Property name) @@ -645,7 +645,7 @@ function(ExternalProject_Get_Property name) endif() set(${var} "${${var}}" PARENT_SCOPE) endforeach() -endfunction(ExternalProject_Get_Property) +endfunction() 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() -endfunction(_ep_get_configure_command_id) +endfunction() function(_ep_get_build_command name step cmd_var) @@ -710,7 +710,7 @@ function(_ep_get_build_command name step cmd_var) set(args "") endif() endif() - else() # if(cfg_cmd_id STREQUAL "configure") + else() # Non-CMake project. Guess "make" and "make install" and "make test". if("${CMAKE_GENERATOR}" MATCHES "Makefiles") # Try to get the parallel arguments @@ -736,7 +736,7 @@ function(_ep_get_build_command name step cmd_var) endif() set(${cmd_var} "${cmd}" PARENT_SCOPE) -endfunction(_ep_get_build_command) +endfunction() function(_ep_write_log_script name step cmd_var) ExternalProject_Get_Property(${name} stamp_dir) @@ -784,7 +784,7 @@ if(result) set(msg \"Command failed (\${result}):\\n\") foreach(arg IN LISTS command) set(msg \"\${msg} '\${arg}'\") - endforeach(arg) + endforeach() message(FATAL_ERROR \"\${msg}\") endif() ") @@ -823,7 +823,7 @@ if(result) set(msg \"Command failed: \${result}\\n\") foreach(arg IN LISTS command) set(msg \"\${msg} '\${arg}'\") - endforeach(arg) + endforeach() set(msg \"\${msg}\\nSee also\\n ${logbase}-*.log\\n\") message(FATAL_ERROR \"\${msg}\") else() @@ -833,7 +833,7 @@ endif() ") set(command ${CMAKE_COMMAND} ${make} ${config} -P ${script}) set(${cmd_var} "${command}" PARENT_SCOPE) -endfunction(_ep_write_log_script) +endfunction() # This module used to use "/${CMAKE_CFG_INTDIR}" directly and produced # 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}") endif() set(${suffix_var} "${suffix}" PARENT_SCOPE) -endfunction(_ep_get_configuration_subdir_suffix) +endfunction() function(_ep_get_step_stampfile name step stampfile_var) @@ -876,7 +876,7 @@ function(ExternalProject_Add_StepTargets name) add_dependencies(${name}-${step} ${arg}) endforeach() endforeach() -endfunction(ExternalProject_Add_StepTargets) +endfunction() function(ExternalProject_Add_Step name step) @@ -974,7 +974,7 @@ function(ExternalProject_Add_Step name step) break() endif() endforeach() -endfunction(ExternalProject_Add_Step) +endfunction() 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 ${download_dir} ) -endfunction(_ep_add_mkdir_command) +endfunction() function(_ep_get_git_version git_EXECUTABLE git_version_var) @@ -1215,7 +1215,7 @@ function(_ep_add_download_command name) DEPENDEES mkdir ${log} ) -endfunction(_ep_add_download_command) +endfunction() function(_ep_add_update_command name) @@ -1297,7 +1297,7 @@ function(_ep_add_update_command name) DEPENDEES download ${log} ) -endfunction(_ep_add_update_command) +endfunction() function(_ep_add_patch_command name) @@ -1317,7 +1317,7 @@ function(_ep_add_patch_command name) WORKING_DIRECTORY ${work_dir} DEPENDEES download ) -endfunction(_ep_add_patch_command) +endfunction() # TODO: Make sure external projects use the proper compiler @@ -1392,7 +1392,7 @@ function(_ep_add_configure_command name) DEPENDS ${file_deps} ${log} ) -endfunction(_ep_add_configure_command) +endfunction() function(_ep_add_build_command name) @@ -1418,7 +1418,7 @@ function(_ep_add_build_command name) DEPENDEES configure ${log} ) -endfunction(_ep_add_build_command) +endfunction() function(_ep_add_install_command name) @@ -1444,7 +1444,7 @@ function(_ep_add_install_command name) DEPENDEES build ${log} ) -endfunction(_ep_add_install_command) +endfunction() function(_ep_add_test_command name) @@ -1484,7 +1484,7 @@ function(_ep_add_test_command name) ${log} ) endif() -endfunction(_ep_add_test_command) +endfunction() function(ExternalProject_Add name) @@ -1550,4 +1550,4 @@ function(ExternalProject_Add name) # on install. # _ep_add_test_command(${name}) -endfunction(ExternalProject_Add) +endfunction() diff --git a/Modules/FeatureSummary.cmake b/Modules/FeatureSummary.cmake index 718a0d9..41bce1e 100644 --- a/Modules/FeatureSummary.cmake +++ b/Modules/FeatureSummary.cmake @@ -188,7 +188,7 @@ function(ADD_FEATURE_INFO _name _enabled _desc) endif () 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}" ) 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) if(_info) set(_currentFeatureText "${_currentFeatureText} (required version ${_info})") - endif(_info) + endif() get_property(_info GLOBAL PROPERTY _CMAKE_${_currentFeature}_DESCRIPTION) if(_info) set(_currentFeatureText "${_currentFeatureText} , ${_info}") - endif(_info) + endif() get_property(_info GLOBAL PROPERTY _CMAKE_${_currentFeature}_URL) if(_info) set(_currentFeatureText "${_currentFeatureText} , <${_info}>") - endif(_info) + endif() get_property(_info GLOBAL PROPERTY _CMAKE_${_currentFeature}_PURPOSE) foreach(_purpose ${_info}) set(_currentFeatureText "${_currentFeatureText}\n ${_purpose}") endforeach() - endif(includeThisOne) + endif() - endif("${_type}" STREQUAL ANY OR "${_type}" STREQUAL "${_currentType}") + endif() - endforeach(_currentFeature) + endforeach() set(${_var} "${_currentFeatureText}" PARENT_SCOPE) -endfunction(_FS_GET_FEATURE_SUMMARY) +endfunction() @@ -412,11 +412,11 @@ function(FEATURE_SUMMARY) if(_FS_FILENAME) if(_FS_APPEND) file(APPEND "${_FS_FILENAME}" "${_fullText}") - else(_FS_APPEND) + else() file(WRITE "${_FS_FILENAME}" "${_fullText}") endif() - else(_FS_FILENAME) + else() if(NOT _FS_VAR) message(STATUS "${_fullText}") endif() @@ -430,7 +430,7 @@ function(FEATURE_SUMMARY) message(FATAL_ERROR "feature_summary() Error: REQUIRED package(s) are missing, aborting CMake run.") endif() -endfunction(FEATURE_SUMMARY) +endfunction() # The stuff below is only kept for compatibility @@ -445,22 +445,22 @@ function(SET_PACKAGE_INFO _name _desc) if(_purpose MATCHES ".+") set_property(GLOBAL APPEND PROPERTY _CMAKE_${_name}_PURPOSE "${_purpose}" ) endif() -endfunction(SET_PACKAGE_INFO) +endfunction() function(SET_FEATURE_INFO) SET_PACKAGE_INFO(${ARGN}) -endfunction(SET_FEATURE_INFO) +endfunction() function(PRINT_ENABLED_FEATURES) FEATURE_SUMMARY(WHAT ENABLED_FEATURES DESCRIPTION "Enabled features:") -endfunction(PRINT_ENABLED_FEATURES) +endfunction() function(PRINT_DISABLED_FEATURES) FEATURE_SUMMARY(WHAT DISABLED_FEATURES DESCRIPTION "Disabled features:") -endfunction(PRINT_DISABLED_FEATURES) +endfunction() diff --git a/Modules/FindAVIFile.cmake b/Modules/FindAVIFile.cmake index ce4e1e7..93fa400 100644 --- a/Modules/FindAVIFile.cmake +++ b/Modules/FindAVIFile.cmake @@ -33,7 +33,7 @@ if (UNIX) /usr/local/avifile/lib ) -endif (UNIX) +endif () # handle the QUIETLY and REQUIRED arguments and set AVIFILE_FOUND to TRUE if # all listed variables are TRUE diff --git a/Modules/FindArmadillo.cmake b/Modules/FindArmadillo.cmake index 84ed3ca..aad22d2 100644 --- a/Modules/FindArmadillo.cmake +++ b/Modules/FindArmadillo.cmake @@ -66,10 +66,10 @@ if(ARMADILLO_INCLUDE_DIR) # 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}") - endif(EXISTS "${ARMADILLO_INCLUDE_DIR}/armadillo_bits/arma_version.hpp") + endif() 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) set(ARMADILLO_INCLUDE_DIRS ${ARMADILLO_INCLUDE_DIR}) set(ARMADILLO_LIBRARIES ${ARMADILLO_LIBRARY}) -endif (ARMADILLO_FOUND) +endif () # Hide internal variables diff --git a/Modules/FindBISON.cmake b/Modules/FindBISON.cmake index d0e0a22..a0afd34 100644 --- a/Modules/FindBISON.cmake +++ b/Modules/FindBISON.cmake @@ -98,14 +98,14 @@ if(BISON_EXECUTABLE) set(BISON_${Name}_VERBOSE_FILE ${filename}) list(APPEND BISON_TARGET_extraoutputs "${BISON_TARGET_output_path}/${BISON_TARGET_output_name}.output") - endmacro(BISON_TARGET_option_verbose) + endmacro() # internal macro macro(BISON_TARGET_option_extraopts Options) set(BISON_TARGET_extraopts "${Options}") separate_arguments(BISON_TARGET_extraopts) list(APPEND BISON_TARGET_cmdopt ${BISON_TARGET_extraopts}) - endmacro(BISON_TARGET_option_extraopts) + endmacro() #============================================================ # BISON_TARGET (public macro) @@ -161,12 +161,12 @@ if(BISON_EXECUTABLE) set(BISON_${Name}_COMPILE_FLAGS ${BISON_TARGET_cmdopt}) set(BISON_${Name}_OUTPUT_SOURCE "${BisonOutput}") - endif(NOT ${ARGC} EQUAL 3 AND NOT ${ARGC} EQUAL 5 AND NOT ${ARGC} EQUAL 7) - endmacro(BISON_TARGET) + endif() + endmacro() # #============================================================ -endif(BISON_EXECUTABLE) +endif() include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake) FIND_PACKAGE_HANDLE_STANDARD_ARGS(BISON REQUIRED_VARS BISON_EXECUTABLE diff --git a/Modules/FindBLAS.cmake b/Modules/FindBLAS.cmake index 84bc7bb..d9b3c61 100644 --- a/Modules/FindBLAS.cmake +++ b/Modules/FindBLAS.cmake @@ -54,11 +54,11 @@ elseif( (_LANGUAGES_ MATCHES C) OR (_LANGUAGES_ MATCHES CXX) ) else() if(BLAS_FIND_REQUIRED) 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)") return() - endif(BLAS_FIND_REQUIRED) -endif( ) + endif() +endif() macro(Check_Fortran_Libraries LIBRARIES _prefix _name _flags _list _thread) # This macro checks for the existence of the combination of fortran libraries @@ -94,18 +94,18 @@ foreach(_library ${_list}) if (BLA_STATIC) if (WIN32) set(CMAKE_FIND_LIBRARY_SUFFIXES .lib ${CMAKE_FIND_LIBRARY_SUFFIXES}) - endif ( WIN32 ) + endif () if (APPLE) set(CMAKE_FIND_LIBRARY_SUFFIXES .lib ${CMAKE_FIND_LIBRARY_SUFFIXES}) - else (APPLE) + else () set(CMAKE_FIND_LIBRARY_SUFFIXES .a ${CMAKE_FIND_LIBRARY_SUFFIXES}) - endif (APPLE) - else (BLA_STATIC) + endif () + else () if (CMAKE_SYSTEM_NAME STREQUAL "Linux") # for ubuntu's libblas3gf and liblapack3gf packages set(CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES} .so.3gf) endif () - endif (BLA_STATIC) + endif () find_library(${_prefix}_${_library}_LIBRARY NAMES ${_library} PATHS ${_libdir} @@ -113,8 +113,8 @@ foreach(_library ${_list}) mark_as_advanced(${_prefix}_${_library}_LIBRARY) set(${LIBRARIES} ${${LIBRARIES}} ${${_prefix}_${_library}_LIBRARY}) set(_libraries_work ${${_prefix}_${_library}_LIBRARY}) - endif(_libraries_work) -endforeach(_library ${_list}) + endif() +endforeach() if(_libraries_work) # Test this combination of libraries. set(CMAKE_REQUIRED_LIBRARIES ${_flags} ${${LIBRARIES}} ${_thread}) @@ -127,23 +127,23 @@ if(_libraries_work) set(CMAKE_REQUIRED_LIBRARIES) mark_as_advanced(${_prefix}${_combined_name}_WORKS) set(_libraries_work ${${_prefix}${_combined_name}_WORKS}) -endif(_libraries_work) +endif() if(NOT _libraries_work) set(${LIBRARIES} FALSE) -endif(NOT _libraries_work) +endif() #message("DEBUG: ${LIBRARIES} = ${${LIBRARIES}}") -endmacro(Check_Fortran_Libraries) +endmacro() set(BLAS_LINKER_FLAGS) set(BLAS_LIBRARIES) set(BLAS95_LIBRARIES) if ($ENV{BLA_VENDOR} MATCHES ".+") set(BLA_VENDOR $ENV{BLA_VENDOR}) -else ($ENV{BLA_VENDOR} MATCHES ".+") +else () if(NOT BLA_VENDOR) set(BLA_VENDOR "All") - endif(NOT BLA_VENDOR) -endif ($ENV{BLA_VENDOR} MATCHES ".+") + endif() +endif () if (BLA_VENDOR STREQUAL "Goto" OR BLA_VENDOR STREQUAL "All") if(NOT BLAS_LIBRARIES) @@ -156,8 +156,8 @@ if (BLA_VENDOR STREQUAL "Goto" OR BLA_VENDOR STREQUAL "All") "goto2" "" ) - endif(NOT BLAS_LIBRARIES) -endif (BLA_VENDOR STREQUAL "Goto" OR BLA_VENDOR STREQUAL "All") + endif() +endif () if (BLA_VENDOR STREQUAL "ATLAS" OR BLA_VENDOR STREQUAL "All") if(NOT BLAS_LIBRARIES) @@ -170,8 +170,8 @@ if (BLA_VENDOR STREQUAL "ATLAS" OR BLA_VENDOR STREQUAL "All") "f77blas;atlas" "" ) - endif(NOT BLAS_LIBRARIES) -endif (BLA_VENDOR STREQUAL "ATLAS" OR BLA_VENDOR STREQUAL "All") + endif() +endif () # BLAS in PhiPACK libraries? (requires generic BLAS lib, too) 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" "" ) - endif(NOT BLAS_LIBRARIES) -endif (BLA_VENDOR STREQUAL "PhiPACK" OR BLA_VENDOR STREQUAL "All") + endif() +endif () # BLAS in Alpha CXML library? 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" "" ) - endif(NOT BLAS_LIBRARIES) -endif (BLA_VENDOR STREQUAL "CXML" OR BLA_VENDOR STREQUAL "All") + endif() +endif () # BLAS in Alpha DXML library? (now called CXML, see above) 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" "" ) - endif(NOT BLAS_LIBRARIES) -endif (BLA_VENDOR STREQUAL "DXML" OR BLA_VENDOR STREQUAL "All") + endif() +endif () # BLAS in Sun Performance library? 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) set(BLAS_LINKER_FLAGS "-xlic_lib=sunperf") - endif(BLAS_LIBRARIES) - endif(NOT BLAS_LIBRARIES) -endif (BLA_VENDOR STREQUAL "SunPerf" OR BLA_VENDOR STREQUAL "All") + endif() + endif() +endif () # BLAS in SCSL library? (SGI/Cray Scientific Library) 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" "" ) - endif(NOT BLAS_LIBRARIES) -endif (BLA_VENDOR STREQUAL "SCSL" OR BLA_VENDOR STREQUAL "All") + endif() +endif () # BLAS in SGIMATH library? 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" "" ) - endif(NOT BLAS_LIBRARIES) -endif (BLA_VENDOR STREQUAL "SGIMATH" OR BLA_VENDOR STREQUAL "All") + endif() +endif () # BLAS in IBM ESSL library? (requires generic BLAS lib, too) 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" "" ) - endif(NOT BLAS_LIBRARIES) -endif (BLA_VENDOR STREQUAL "IBMESSL" OR BLA_VENDOR STREQUAL "All") + endif() +endif () #BLAS in acml library? 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" ) set( _ACML_COMPILER32 "nag32" ) set( _ACML_COMPILER64 "nag64" ) - else() #if( CMAKE_Fortran_COMPILER_ID STREQUAL "GNU" ) + else() set( _ACML_COMPILER32 "gfortran32" ) set( _ACML_COMPILER64 "gfortran64" ) endif() @@ -330,7 +330,7 @@ if (BLA_VENDOR MATCHES "ACML.*" OR BLA_VENDOR STREQUAL "All") set(_ACML_MP_LIB_DIRS "${_ACML_ROOT}/${_ACML_COMPILER32}_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 "${_ACML_ROOT}/${_ACML_COMPILER32}${_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() endif() endforeach() - else() #if( _BLAS_VENDOR STREQUAL "ACML" ) + else() foreach( BLAS_ACML_LIB_DIRS ${_ACML_LIB_DIRS} ) check_fortran_libraries ( BLAS_LIBRARIES @@ -388,7 +388,7 @@ if (BLA_VENDOR MATCHES "ACML.*" OR BLA_VENDOR STREQUAL "All") "acml;acml_mv" "" ) - endif(NOT BLAS_LIBRARIES) + endif() if(NOT BLAS_LIBRARIES) check_fortran_libraries( BLAS_LIBRARIES @@ -398,7 +398,7 @@ if (BLA_VENDOR MATCHES "ACML.*" OR BLA_VENDOR STREQUAL "All") "acml_mp;acml_mv" "" ) - endif(NOT BLAS_LIBRARIES) + endif() if(NOT BLAS_LIBRARIES) check_fortran_libraries( BLAS_LIBRARIES @@ -408,7 +408,7 @@ if (BLA_VENDOR MATCHES "ACML.*" OR BLA_VENDOR STREQUAL "All") "acml;acml_mv;CALBLAS" "" ) - endif(NOT BLAS_LIBRARIES) + endif() endif () # ACML # Apple BLAS library? @@ -422,8 +422,8 @@ if(NOT BLAS_LIBRARIES) "Accelerate" "" ) - endif(NOT BLAS_LIBRARIES) -endif (BLA_VENDOR STREQUAL "Apple" OR BLA_VENDOR STREQUAL "All") + endif() +endif () if (BLA_VENDOR STREQUAL "NAS" OR BLA_VENDOR STREQUAL "All") if ( NOT BLAS_LIBRARIES ) @@ -435,8 +435,8 @@ if (BLA_VENDOR STREQUAL "NAS" OR BLA_VENDOR STREQUAL "All") "vecLib" "" ) - endif ( NOT BLAS_LIBRARIES ) -endif (BLA_VENDOR STREQUAL "NAS" OR BLA_VENDOR STREQUAL "All") + endif () +endif () # Generic BLAS library? if (BLA_VENDOR STREQUAL "Generic" OR BLA_VENDOR STREQUAL "All") if(NOT BLAS_LIBRARIES) @@ -448,8 +448,8 @@ if (BLA_VENDOR STREQUAL "Generic" OR BLA_VENDOR STREQUAL "All") "blas" "" ) - endif(NOT BLAS_LIBRARIES) -endif (BLA_VENDOR STREQUAL "Generic" OR BLA_VENDOR STREQUAL "All") + endif() +endif () #BLAS in intel mkl 10 library? (em64t 64bit) 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(BLAS_FIND_QUIETLY OR NOT BLAS_FIND_REQUIRED) find_package(Threads) - else(BLAS_FIND_QUIETLY OR NOT BLAS_FIND_REQUIRED) + else() find_package(Threads REQUIRED) - endif(BLAS_FIND_QUIETLY OR NOT BLAS_FIND_REQUIRED) + endif() set(BLAS_SEARCH_LIBS "") @@ -471,7 +471,7 @@ if (BLA_VENDOR MATCHES "Intel*" OR BLA_VENDOR STREQUAL "All") if (WIN32) list(APPEND BLAS_SEARCH_LIBS "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") list(APPEND BLAS_SEARCH_LIBS "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") endif () endif () - endif (WIN32) + endif () if (BLA_VENDOR STREQUAL "Intel10_64lp_seq" OR BLA_VENDOR STREQUAL "All") list(APPEND BLAS_SEARCH_LIBS "mkl_blas95_lp64 mkl_intel_lp64 mkl_sequential mkl_core") endif () - else (BLA_F95) + else () set(BLAS_mkl_SEARCH_SYMBOL sgemm) set(_LIBRARIES BLAS_LIBRARIES) if (WIN32) list(APPEND BLAS_SEARCH_LIBS "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") list(APPEND BLAS_SEARCH_LIBS "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 "mkl_em64t") endif () - endif (WIN32) + endif () if (BLA_VENDOR STREQUAL "Intel10_64lp_seq" OR BLA_VENDOR STREQUAL "All") list(APPEND BLAS_SEARCH_LIBS "mkl_intel_lp64 mkl_sequential mkl_core") endif () - endif (BLA_F95) + endif () foreach (IT ${BLAS_SEARCH_LIBS}) string(REPLACE " " ";" SEARCH_LIBS ${IT}) @@ -553,54 +553,54 @@ if (BLA_VENDOR MATCHES "Intel*" OR BLA_VENDOR STREQUAL "All") endif () endforeach () - endif (_LANGUAGES_ MATCHES C OR _LANGUAGES_ MATCHES CXX) -endif (BLA_VENDOR MATCHES "Intel*" OR BLA_VENDOR STREQUAL "All") + endif () +endif () if(BLA_F95) if(BLAS95_LIBRARIES) set(BLAS95_FOUND TRUE) - else(BLAS95_LIBRARIES) + else() set(BLAS95_FOUND FALSE) - endif(BLAS95_LIBRARIES) + endif() if(NOT BLAS_FIND_QUIETLY) if(BLAS95_FOUND) message(STATUS "A library with BLAS95 API found.") - else(BLAS95_FOUND) + else() if(BLAS_FIND_REQUIRED) message(FATAL_ERROR "A required library with BLAS95 API not found. Please specify library location.") - else(BLAS_FIND_REQUIRED) + else() message(STATUS "A library with BLAS95 API not found. Please specify library location.") - endif(BLAS_FIND_REQUIRED) - endif(BLAS95_FOUND) - endif(NOT BLAS_FIND_QUIETLY) + endif() + endif() + endif() set(BLAS_FOUND TRUE) set(BLAS_LIBRARIES "${BLAS95_LIBRARIES}") -else(BLA_F95) +else() if(BLAS_LIBRARIES) set(BLAS_FOUND TRUE) - else(BLAS_LIBRARIES) + else() set(BLAS_FOUND FALSE) - endif(BLAS_LIBRARIES) + endif() if(NOT BLAS_FIND_QUIETLY) if(BLAS_FOUND) message(STATUS "A library with BLAS API found.") - else(BLAS_FOUND) + else() if(BLAS_FIND_REQUIRED) message(FATAL_ERROR "A required library with BLAS API not found. Please specify library location." ) - else(BLAS_FIND_REQUIRED) + else() message(STATUS "A library with BLAS API not found. Please specify library location." ) - endif(BLAS_FIND_REQUIRED) - endif(BLAS_FOUND) - endif(NOT BLAS_FIND_QUIETLY) -endif(BLA_F95) + endif() + endif() + endif() +endif() set(CMAKE_FIND_LIBRARY_SUFFIXES ${_blas_ORIG_CMAKE_FIND_LIBRARY_SUFFIXES}) diff --git a/Modules/FindBZip2.cmake b/Modules/FindBZip2.cmake index 121d3f0..8b9d235 100644 --- a/Modules/FindBZip2.cmake +++ b/Modules/FindBZip2.cmake @@ -34,12 +34,12 @@ if (NOT BZIP2_LIBRARIES) include(${CMAKE_CURRENT_LIST_DIR}/SelectLibraryConfigurations.cmake) SELECT_LIBRARY_CONFIGURATIONS(BZIP2) -endif (NOT BZIP2_LIBRARIES) +endif () 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]+ ") 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 # all listed variables are TRUE @@ -51,6 +51,6 @@ FIND_PACKAGE_HANDLE_STANDARD_ARGS(BZip2 if (BZIP2_FOUND) include(CheckLibraryExists) CHECK_LIBRARY_EXISTS("${BZIP2_LIBRARIES}" BZ2_bzCompressInit "" BZIP2_NEED_PREFIX) -endif (BZIP2_FOUND) +endif () mark_as_advanced(BZIP2_INCLUDE_DIR) diff --git a/Modules/FindBoost.cmake b/Modules/FindBoost.cmake index e536b6e..607e249 100644 --- a/Modules/FindBoost.cmake +++ b/Modules/FindBoost.cmake @@ -361,16 +361,16 @@ macro(_Boost_ADJUST_LIB_VARS basename) 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") - endif(Boost_${basename}_LIBRARY) + endif() - endif(Boost_INCLUDE_DIR ) + endif() # Make variables changeble to the advanced user mark_as_advanced( Boost_${basename}_LIBRARY Boost_${basename}_LIBRARY_RELEASE 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 # on Mac OS X/Darwin is "xgcc". 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 # the Mac OS X/Darwin version of GCC. set(_boost_COMPILER "") - endif(${Boost_MINOR_VERSION} GREATER 35) - else(Boost_MINOR_VERSION) + endif() + else() # We don't know the Boost version, so assume it's # pre-1.36.0. set(_boost_COMPILER "") - endif(Boost_MINOR_VERSION) + endif() else() set(_boost_COMPILER "-gcc${_boost_COMPILER_VERSION}") endif() endif() - endif (CMAKE_COMPILER_IS_GNUCXX) + endif () else() # TODO at least Boost_DEBUG here? set(_boost_COMPILER "") @@ -525,7 +525,7 @@ if(Boost_FIND_VERSION_EXACT) set(_boost_TEST_VERSIONS "${Boost_FIND_VERSION_MAJOR}.${Boost_FIND_VERSION_MINOR}.${Boost_FIND_VERSION_PATCH}" "${Boost_FIND_VERSION_MAJOR}.${Boost_FIND_VERSION_MINOR}") -else(Boost_FIND_VERSION_EXACT) +else() # The user has not requested an exact version. Among known # versions, find those that are acceptable to the user request. set(_Boost_KNOWN_VERSIONS ${Boost_ADDITIONAL_VERSIONS} @@ -549,12 +549,12 @@ else(Boost_FIND_VERSION_EXACT) # the patch level dropped. list(APPEND _boost_TEST_VERSIONS "${version}") endif() - endforeach(version) - else(Boost_FIND_VERSION) + endforeach() + else() # Any version is acceptable. set(_boost_TEST_VERSIONS "${_Boost_KNOWN_VERSIONS}") - endif(Boost_FIND_VERSION) -endif(Boost_FIND_VERSION_EXACT) + endif() +endif() # 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 @@ -597,7 +597,7 @@ set(Boost_ERROR_REASON) # for linking. set(Boost_LIB_DIAGNOSTIC_DEFINITIONS "-DBOOST_LIB_DIAGNOSTIC" CACHE STRING "Boost diagnostic define") - endif(WIN32) + endif() set(_boost_INCLUDE_SEARCH_DIRS_SYSTEM C:/boost/include @@ -671,7 +671,7 @@ set(Boost_ERROR_REASON) file(TO_CMAKE_PATH ${BOOST_INCLUDEDIR} BOOST_INCLUDEDIR) set(_boost_INCLUDE_SEARCH_DIRS ${BOOST_INCLUDEDIR} ${_boost_INCLUDE_SEARCH_DIRS}) - endif( BOOST_INCLUDEDIR ) + endif() # ------------------------------------------------------------------------ # 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}") - endforeach(_boost_VER) + endforeach() if(Boost_DEBUG) message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] " @@ -717,7 +717,7 @@ set(Boost_ERROR_REASON) PATH_SUFFIXES ${_boost_PATH_SUFFIXES} ${_boost_FIND_OPTIONS} ) - endif( NOT Boost_INCLUDE_DIR ) + endif() # ------------------------------------------------------------------------ # Extract version information from version.hpp @@ -748,16 +748,16 @@ 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}") - endif(NOT "${Boost_VERSION}" STREQUAL "0") + endif() if(Boost_DEBUG) message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] " "version.hpp reveals boost " "${Boost_MAJOR_VERSION}.${Boost_MINOR_VERSION}.${Boost_SUBMINOR_VERSION}") endif() - else(Boost_INCLUDE_DIR) + else() 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.") - endif(Boost_INCLUDE_DIR) + endif() # ------------------------------------------------------------------------ # Suffix initialization and compiler suffix detection. @@ -1007,7 +1007,7 @@ set(Boost_ERROR_REASON) _Boost_ADJUST_LIB_VARS(${UPPERCOMPONENT}) - endforeach(COMPONENT) + endforeach() # Restore the original find library ordering 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}" ) set( Boost_FOUND FALSE ) set(_Boost_VERSION_AGE "old") - endif( Boost_FIND_VERSION_PATCH AND Boost_SUBMINOR_VERSION LESS "${Boost_FIND_VERSION_PATCH}" ) - endif( Boost_MINOR_VERSION LESS "${Boost_FIND_VERSION_MINOR}" ) - endif( Boost_MAJOR_VERSION LESS "${Boost_FIND_VERSION_MAJOR}" ) + endif() + endif() + endif() if (NOT Boost_FOUND) _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 (NOT Boost_FIND_VERSION_PATCH) 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. set(Boost_FOUND FALSE) @@ -1071,10 +1071,10 @@ set(Boost_ERROR_REASON) if(Boost_SUBMINOR_VERSION EQUAL "${Boost_FIND_VERSION_PATCH}" ) set( Boost_FOUND TRUE ) _Boost_MARK_COMPONENTS_FOUND(ON) - endif(Boost_SUBMINOR_VERSION EQUAL "${Boost_FIND_VERSION_PATCH}" ) - endif( Boost_MINOR_VERSION EQUAL "${Boost_FIND_VERSION_MINOR}" ) - endif( Boost_MAJOR_VERSION EQUAL "${Boost_FIND_VERSION_MAJOR}" ) - endif (Boost_FOUND AND Boost_FIND_VERSION_EXACT) + endif() + endif() + endif() + endif () if(NOT Boost_FOUND) # 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) set(Boost_ERROR_REASON "${Boost_ERROR_REASON}.${Boost_FIND_VERSION_PATCH}") - endif (Boost_FIND_VERSION_PATCH) + endif () if (NOT Boost_FIND_VERSION_EXACT) set(Boost_ERROR_REASON "${Boost_ERROR_REASON} (or newer)") - endif (NOT Boost_FIND_VERSION_EXACT) + endif () set(Boost_ERROR_REASON "${Boost_ERROR_REASON}.") - endif (NOT Boost_FOUND) + endif () # Always check for missing components set(_boost_CHECKED_COMPONENT FALSE) @@ -1101,7 +1101,7 @@ set(Boost_ERROR_REASON) list(APPEND _Boost_MISSING_COMPONENTS ${COMPONENT}) set( Boost_FOUND FALSE) endif() - endforeach(COMPONENT) + endforeach() if(Boost_DEBUG) 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}) set(Boost_ERROR_REASON "${Boost_ERROR_REASON} boost_${COMPONENT}\n") - endforeach(COMPONENT) + endforeach() list(LENGTH Boost_FIND_COMPONENTS Boost_NUM_COMPONENTS_WANTED) list(LENGTH _Boost_MISSING_COMPONENTS Boost_NUM_MISSING_COMPONENTS) if (${Boost_NUM_COMPONENTS_WANTED} EQUAL ${Boost_NUM_MISSING_COMPONENTS}) 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.") - else (${Boost_NUM_COMPONENTS_WANTED} EQUAL ${Boost_NUM_MISSING_COMPONENTS}) + else () 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.") - endif (${Boost_NUM_COMPONENTS_WANTED} EQUAL ${Boost_NUM_MISSING_COMPONENTS}) - endif (_Boost_MISSING_COMPONENTS) + endif () + endif () if( NOT Boost_LIBRARY_DIRS AND NOT _boost_CHECKED_COMPONENT ) # 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") endif() - endif( NOT Boost_LIBRARY_DIRS AND NOT _boost_CHECKED_COMPONENT ) + endif() - else(Boost_INCLUDE_DIR) + else() set( Boost_FOUND FALSE) - endif(Boost_INCLUDE_DIR) + endif() # ------------------------------------------------------------------------ # Notification to end user about what was found @@ -1176,16 +1176,16 @@ set(Boost_ERROR_REASON) if(Boost_FIND_COMPONENTS) message(STATUS "Found the following Boost libraries:") endif() - endif(NOT Boost_FIND_QUIETLY) + endif() foreach( COMPONENT ${Boost_FIND_COMPONENTS} ) string( TOUPPER ${COMPONENT} UPPERCOMPONENT ) if( Boost_${UPPERCOMPONENT}_FOUND ) if(NOT Boost_FIND_QUIETLY) message (STATUS " ${COMPONENT}") - endif(NOT Boost_FIND_QUIETLY) + endif() set(Boost_LIBRARIES ${Boost_LIBRARIES} ${Boost_${UPPERCOMPONENT}_LIBRARY}) - endif( Boost_${UPPERCOMPONENT}_FOUND ) - endforeach(COMPONENT) + endif() + endforeach() else() if(Boost_FIND_REQUIRED) 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") endif() endif() - endif(Boost_FIND_REQUIRED) + endif() endif() # show the Boost_INCLUDE_DIRS AND Boost_LIBRARIES variables only in the advanced view diff --git a/Modules/FindCABLE.cmake b/Modules/FindCABLE.cmake index 72a8805..3e2d5d3 100644 --- a/Modules/FindCABLE.cmake +++ b/Modules/FindCABLE.cmake @@ -25,7 +25,7 @@ if(NOT CABLE) find_path(CABLE_BUILD_DIR cableVersion.h) -endif(NOT CABLE) +endif() if(CABLE_BUILD_DIR) load_cache(${CABLE_BUILD_DIR} @@ -43,25 +43,25 @@ if(CABLE_BUILD_DIR) find_library(CABLE_TCL_LIBRARY NAMES CableTclFacility PATHS ${CABLE_LIBRARY_PATH} ${CABLE_LIBRARY_PATH}/*) - else(CABLE_LIBRARY_PATH) + else() find_library(CABLE_TCL_LIBRARY NAMES CableTclFacility PATHS ${CABLE_BINARY_DIR}/CableTclFacility ${CABLE_BINARY_DIR}/CableTclFacility/*) - endif(CABLE_LIBRARY_PATH) + endif() if(CABLE_EXECUTABLE_PATH) find_program(CABLE NAMES cable PATHS ${CABLE_EXECUTABLE_PATH} ${CABLE_EXECUTABLE_PATH}/*) - else(CABLE_EXECUTABLE_PATH) + else() find_program(CABLE NAMES cable PATHS ${CABLE_BINARY_DIR}/Executables ${CABLE_BINARY_DIR}/Executables/*) - endif(CABLE_EXECUTABLE_PATH) + endif() find_path(CABLE_INCLUDE_DIR CableTclFacility/ctCalls.h ${CABLE_SOURCE_DIR}) -else(CABLE_BUILD_DIR) +else() # Find the cable executable in the path. find_program(CABLE NAMES cable) @@ -78,4 +78,4 @@ else(CABLE_BUILD_DIR) # executable. find_library(CABLE_TCL_LIBRARY NAMES CableTclFacility PATHS ${CABLE_ROOT_BIN}/../lib/Cable) -endif(CABLE_BUILD_DIR) +endif() diff --git a/Modules/FindCUDA.cmake b/Modules/FindCUDA.cmake index 94e4500..f152437 100644 --- a/Modules/FindCUDA.cmake +++ b/Modules/FindCUDA.cmake @@ -291,7 +291,7 @@ macro(CUDA_FIND_HELPER_FILE _name _extension) endif() # 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) -endmacro(CUDA_FIND_HELPER_FILE) +endmacro() ##################################################################### ## CUDA_INCLUDE_NVCC_DEPENDENCIES @@ -339,12 +339,12 @@ macro(CUDA_INCLUDE_NVCC_DEPENDENCIES dependency_file) #message("file ${f} not found") set(CUDA_NVCC_DEPEND_REGENERATE TRUE) endif() - endforeach(f) - else(CUDA_NVCC_DEPEND) + endforeach() + else() #message("CUDA_NVCC_DEPEND false") # No dependencies, so regenerate the file. set(CUDA_NVCC_DEPEND_REGENERATE TRUE) - endif(CUDA_NVCC_DEPEND) + endif() #message("CUDA_NVCC_DEPEND_REGENERATE = ${CUDA_NVCC_DEPEND_REGENERATE}") # 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}) #message("Generating an empty dependency_file: ${dependency_file}") 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}) # We need to force this back into the cache. 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(CUDA_FIND_REQUIRED) message(FATAL_ERROR "Specify CUDA_TOOLKIT_ROOT_DIR") elseif(NOT CUDA_FIND_QUIETLY) message("CUDA_TOOLKIT_ROOT_DIR not found or specified") endif() - endif (NOT EXISTS ${CUDA_TOOLKIT_ROOT_DIR}) -endif (NOT CUDA_TOOLKIT_ROOT_DIR) + endif () +endif () # 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. if (CUDA_CUDA_LIBRARY) set(CUDA_LIBRARIES ${CUDA_LIBRARIES} ${CUDA_CUDA_LIBRARY}) -endif(CUDA_CUDA_LIBRARY) +endif() mark_as_advanced( CUDA_CUDA_LIBRARY @@ -607,7 +607,7 @@ mark_as_advanced( macro(FIND_CUDA_HELPER_LIBS _name) find_library_local_first(CUDA_${_name}_LIBRARY ${_name} "\"${_name}\" library") mark_as_advanced(CUDA_${_name}_LIBRARY) -endmacro(FIND_CUDA_HELPER_LIBS) +endmacro() ####################### # Disable emulation for v3.1 onward @@ -691,9 +691,9 @@ set(CUDA_SDK_SEARCH_PATH # if(CMAKE_SIZEOF_VOID_P EQUAL 8) # set(cuda_cutil_name cutil64) -# else(CMAKE_SIZEOF_VOID_P EQUAL 8) +# else() # set(cuda_cutil_name cutil32) -# endif(CMAKE_SIZEOF_VOID_P EQUAL 8) +# endif() # find_library(CUDA_CUT_LIBRARY # NAMES cutil ${cuda_cutil_name} @@ -743,8 +743,8 @@ find_package_handle_standard_args(CUDA macro(CUDA_INCLUDE_DIRECTORIES) foreach(dir ${ARGN}) list(APPEND CUDA_NVCC_INCLUDE_ARGS_USER -I${dir}) - endforeach(dir ${ARGN}) -endmacro(CUDA_INCLUDE_DIRECTORIES) + endforeach() +endmacro() ############################################################################## @@ -914,20 +914,20 @@ macro(CUDA_WRAP_SRCS cuda_target format generated_files) if (CUDA_BUILD_EMULATION) # Emulation. set(nvcc_flags ${nvcc_flags} --device-emulation -D_DEVICEEMU -g) - else(CUDA_BUILD_EMULATION) + else() # Device mode. No flags necessary. - endif(CUDA_BUILD_EMULATION) + endif() if(CUDA_HOST_COMPILATION_CPP) set(CUDA_C_OR_CXX CXX) - else(CUDA_HOST_COMPILATION_CPP) + else() if(CUDA_VERSION VERSION_LESS "3.0") set(nvcc_flags ${nvcc_flags} --host-compilation C) else() message(WARNING "--host-compilation flag is deprecated in CUDA version >= 3.0. Removing --host-compilation C flag" ) endif() set(CUDA_C_OR_CXX C) - endif(CUDA_HOST_COMPILATION_CPP) + endif() 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(format_flag "-ptx") 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_basename "${cuda_target}_generated_${basename}${generated_extension}") set(format_flag "-c") - endif( compile_to_ptx ) + endif() # 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 @@ -1118,17 +1118,17 @@ macro(CUDA_WRAP_SRCS cuda_target format generated_files) # Convience string for output ########################################### if(CUDA_BUILD_EMULATION) set(cuda_build_type "Emulation") - else(CUDA_BUILD_EMULATION) + else() set(cuda_build_type "Device") - endif(CUDA_BUILD_EMULATION) + endif() # Build the NVCC made dependency file ################################### set(build_cubin OFF) if ( NOT CUDA_BUILD_EMULATION AND CUDA_BUILD_CUBIN ) if ( NOT compile_to_ptx ) set ( build_cubin ON ) - endif( NOT compile_to_ptx ) - endif( NOT CUDA_BUILD_EMULATION AND CUDA_BUILD_CUBIN ) + endif() + endif() # Configure the build script 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) 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) - endforeach(file) + endif() + endforeach() # Set the return parameter 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} ) -endmacro(CUDA_ADD_LIBRARY cuda_target) +endmacro() ############################################################################### @@ -1279,7 +1279,7 @@ macro(CUDA_ADD_EXECUTABLE cuda_target) 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}) -endmacro(CUDA_COMPILE) +endmacro() ############################################################################### @@ -1315,7 +1315,7 @@ macro(CUDA_COMPILE_PTX 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 # have been removed. 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() diff --git a/Modules/FindCUDA/make2cmake.cmake b/Modules/FindCUDA/make2cmake.cmake index d41b72d..c2405f4 100644 --- a/Modules/FindCUDA/make2cmake.cmake +++ b/Modules/FindCUDA/make2cmake.cmake @@ -76,7 +76,7 @@ if (${depend_text} MATCHES ".+") list(APPEND dependency_list "${file_absolute}") endif() - endforeach(file) + endforeach() else() # message("FOUND NO DEPENDS") diff --git a/Modules/FindCUDA/parse_cubin.cmake b/Modules/FindCUDA/parse_cubin.cmake index 2518c68..94be7e2 100644 --- a/Modules/FindCUDA/parse_cubin.cmake +++ b/Modules/FindCUDA/parse_cubin.cmake @@ -65,11 +65,11 @@ if (${file_text} MATCHES ".+") # Skip the rest of this block. # message("Skipping ${entry}") # set(skip TRUE) - # else (${entry} MATCHES "^_") + # else () message("Kernel: ${entry}") - # endif (${entry} MATCHES "^_") + # endif () - endif(${entry} MATCHES "[^g]name = ([^ ]+)") + endif() # Skip the rest of the block if necessary if(NOT skip) @@ -96,14 +96,14 @@ if (${file_text} MATCHES ".+") message("") endif() - endif(NOT skip) + endif() - endforeach(entry) + endforeach() - endif(line MATCHES "^code") + endif() - endforeach(line) + endforeach() else() # message("FOUND NO DEPENDS") diff --git a/Modules/FindCUDA/run_nvcc.cmake b/Modules/FindCUDA/run_nvcc.cmake index b31011c..8274cc7 100644 --- a/Modules/FindCUDA/run_nvcc.cmake +++ b/Modules/FindCUDA/run_nvcc.cmake @@ -139,7 +139,7 @@ macro(cuda_execute_process status command) endforeach() # Echo the command execute_process(COMMAND ${CMAKE_COMMAND} -E echo ${cuda_execute_process_string}) - endif(verbose) + endif() # Run the command execute_process(COMMAND ${ARGN} RESULT_VARIABLE CUDA_result ) endmacro() @@ -277,4 +277,4 @@ if( build_cubin ) -P "${CUDA_parse_cubin}" ) -endif( build_cubin ) +endif() diff --git a/Modules/FindCURL.cmake b/Modules/FindCURL.cmake index 5c58b84..e080f1a 100644 --- a/Modules/FindCURL.cmake +++ b/Modules/FindCURL.cmake @@ -43,7 +43,7 @@ if(CURL_INCLUDE_DIR) unset(curl_version_str) break() endif() - endforeach(_curl_version_header) + endforeach() endif() # 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) set(CURL_LIBRARIES ${CURL_LIBRARY}) set(CURL_INCLUDE_DIRS ${CURL_INCLUDE_DIR}) -endif(CURL_FOUND) +endif() diff --git a/Modules/FindCVS.cmake b/Modules/FindCVS.cmake index 84bcaa1..07079bb 100644 --- a/Modules/FindCVS.cmake +++ b/Modules/FindCVS.cmake @@ -5,7 +5,7 @@ # find_package(CVS) # if(CVS_FOUND) # message("CVS found: ${CVS_EXECUTABLE}") -# endif(CVS_FOUND) +# endif() #============================================================================= # Copyright 2008-2009 Kitware, Inc. diff --git a/Modules/FindCoin3D.cmake b/Modules/FindCoin3D.cmake index 914d74b..bbda87b 100644 --- a/Modules/FindCoin3D.cmake +++ b/Modules/FindCoin3D.cmake @@ -28,7 +28,7 @@ if (WIN32) find_path(COIN3D_INCLUDE_DIRS Inventor/So.h) find_library(COIN3D_LIBRARIES Coin) - else (CYGWIN) + else () find_path(COIN3D_INCLUDE_DIRS Inventor/So.h "[HKEY_LOCAL_MACHINE\\SOFTWARE\\SIM\\Coin3D\\2;Installation Path]/include" @@ -45,18 +45,18 @@ if (WIN32) if (COIN3D_LIBRARY_DEBUG AND COIN3D_LIBRARY_RELEASE) set(COIN3D_LIBRARIES optimized ${COIN3D_LIBRARY_RELEASE} debug ${COIN3D_LIBRARY_DEBUG}) - else (COIN3D_LIBRARY_DEBUG AND COIN3D_LIBRARY_RELEASE) + else () if (COIN3D_LIBRARY_DEBUG) set (COIN3D_LIBRARIES ${COIN3D_LIBRARY_DEBUG}) - endif (COIN3D_LIBRARY_DEBUG) + endif () if (COIN3D_LIBRARY_RELEASE) set (COIN3D_LIBRARIES ${COIN3D_LIBRARY_RELEASE}) - endif (COIN3D_LIBRARY_RELEASE) - endif (COIN3D_LIBRARY_DEBUG AND COIN3D_LIBRARY_RELEASE) + endif () + endif () - endif (CYGWIN) + endif () -else (WIN32) +else () if(APPLE) find_path(COIN3D_INCLUDE_DIRS Inventor/So.h /Library/Frameworks/Inventor.framework/Headers @@ -65,14 +65,14 @@ else (WIN32) /Library/Frameworks/Inventor.framework/Libraries ) set(COIN3D_LIBRARIES "-framework Coin3d" CACHE STRING "Coin3D library for OSX") - else(APPLE) + else() find_path(COIN3D_INCLUDE_DIRS Inventor/So.h) find_library(COIN3D_LIBRARIES Coin) - endif(APPLE) + endif() -endif (WIN32) +endif () # handle the QUIETLY and REQUIRED arguments and set COIN3D_FOUND to TRUE if # all listed variables are TRUE diff --git a/Modules/FindCups.cmake b/Modules/FindCups.cmake index 05d2c27..f74366b 100644 --- a/Modules/FindCups.cmake +++ b/Modules/FindCups.cmake @@ -32,7 +32,7 @@ if (CUPS_INCLUDE_DIR AND CUPS_LIBRARIES AND CUPS_REQUIRE_IPP_DELETE_ATTRIBUTE) # ippDeleteAttribute is new in cups-1.1.19 (and used by kdeprint) CHECK_LIBRARY_EXISTS(cups ippDeleteAttribute "" CUPS_HAS_IPP_DELETE_ATTRIBUTE) -endif (CUPS_INCLUDE_DIR AND CUPS_LIBRARIES AND CUPS_REQUIRE_IPP_DELETE_ATTRIBUTE) +endif () if (CUPS_INCLUDE_DIR AND EXISTS "${CUPS_INCLUDE_DIR}/cups/cups.h") file(STRINGS "${CUPS_INCLUDE_DIR}/cups/cups.h" cups_version_str @@ -46,13 +46,13 @@ if (CUPS_INCLUDE_DIR AND EXISTS "${CUPS_INCLUDE_DIR}/cups/cups.h") CUPS_VERSION_PART "${VLINE}") if(CUPS_VERSION_STRING) set(CUPS_VERSION_STRING "${CUPS_VERSION_STRING}.${CUPS_VERSION_PART}") - else(CUPS_VERSION_STRING) + else() set(CUPS_VERSION_STRING "${CUPS_VERSION_PART}") - endif(CUPS_VERSION_STRING) + endif() endif() - endforeach(VLINE) - endforeach(VPART) -endif (CUPS_INCLUDE_DIR AND EXISTS "${CUPS_INCLUDE_DIR}/cups/cups.h") + endforeach() + endforeach() +endif () include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake) @@ -60,10 +60,10 @@ if (CUPS_REQUIRE_IPP_DELETE_ATTRIBUTE) FIND_PACKAGE_HANDLE_STANDARD_ARGS(Cups REQUIRED_VARS CUPS_LIBRARIES CUPS_INCLUDE_DIR CUPS_HAS_IPP_DELETE_ATTRIBUTE VERSION_VAR CUPS_VERSION_STRING) -else (CUPS_REQUIRE_IPP_DELETE_ATTRIBUTE) +else () FIND_PACKAGE_HANDLE_STANDARD_ARGS(Cups REQUIRED_VARS CUPS_LIBRARIES CUPS_INCLUDE_DIR VERSION_VAR CUPS_VERSION_STRING) -endif (CUPS_REQUIRE_IPP_DELETE_ATTRIBUTE) +endif () mark_as_advanced(CUPS_INCLUDE_DIR CUPS_LIBRARIES) diff --git a/Modules/FindCurses.cmake b/Modules/FindCurses.cmake index de71992..6acf421 100644 --- a/Modules/FindCurses.cmake +++ b/Modules/FindCurses.cmake @@ -32,7 +32,7 @@ set(CURSES_USE_NCURSES FALSE) if(CURSES_NCURSES_LIBRARY AND NOT CURSES_CURSES_LIBRARY) set(CURSES_USE_NCURSES TRUE) -endif(CURSES_NCURSES_LIBRARY AND NOT CURSES_CURSES_LIBRARY) +endif() # http://cygwin.com/ml/cygwin-announce/2010-01/msg00002.html # cygwin ncurses stopped providing curses.h symlinks see above # message. Cygwin is an ncurses package, so force ncurses on @@ -65,10 +65,10 @@ if(CURSES_CURSES_LIBRARY AND CURSES_NEED_NCURSES) wsyncup "" CURSES_NCURSES_HAS_WSYNCUP) if( CURSES_NCURSES_HAS_WSYNCUP) set(CURSES_USE_NCURSES TRUE) - endif( CURSES_NCURSES_HAS_WSYNCUP) - endif(CURSES_NCURSES_LIBRARY AND NOT CURSES_CURSES_HAS_WSYNCUP) + endif() + endif() -endif(CURSES_CURSES_LIBRARY AND CURSES_NEED_NCURSES) +endif() if(NOT CURSES_USE_NCURSES) @@ -83,7 +83,7 @@ if(NOT CURSES_USE_NCURSES) CACHE FILEPATH "The curses include path") set(CURSES_LIBRARY "${CURSES_CURSES_LIBRARY}" CACHE FILEPATH "The curses library") -else(NOT CURSES_USE_NCURSES) +else() # we need to find ncurses get_filename_component(_cursesLibDir "${CURSES_NCURSES_LIBRARY}" PATH) get_filename_component(_cursesParentDir "${_cursesLibDir}" PATH) @@ -109,23 +109,23 @@ else(NOT CURSES_USE_NCURSES) if(NOT CURSES_NCURSES_INCLUDE_PATH AND CURSES_HAVE_NCURSES_NCURSES_H) get_filename_component(CURSES_NCURSES_INCLUDE_PATH "${CURSES_HAVE_NCURSES_NCURSES_H}" PATH) - endif(NOT CURSES_NCURSES_INCLUDE_PATH AND CURSES_HAVE_NCURSES_NCURSES_H) + endif() if(CURSES_NCURSES_INCLUDE_PATH AND CURSES_NCURSES_LIBRARY) set( FORCE_IT ) if(CURSES_INCLUDE_PATH MATCHES NOTFOUND) set(FORCE_IT FORCE) - endif(CURSES_INCLUDE_PATH MATCHES NOTFOUND) + endif() set(CURSES_INCLUDE_PATH "${CURSES_NCURSES_INCLUDE_PATH}" CACHE FILEPATH "The curses include path" ${FORCE_IT}) set( FORCE_IT) if(CURSES_LIBRARY MATCHES NOTFOUND) set(FORCE_IT FORCE) - endif(CURSES_LIBRARY MATCHES NOTFOUND) + endif() set(CURSES_LIBRARY "${CURSES_NCURSES_LIBRARY}" CACHE FILEPATH "The curses library" ${FORCE_IT}) - endif(CURSES_NCURSES_INCLUDE_PATH AND CURSES_NCURSES_LIBRARY) + endif() -endif(NOT CURSES_USE_NCURSES) +endif() find_library(CURSES_EXTRA_LIBRARY cur_colr HINTS "${_cursesLibDir}") find_library(CURSES_EXTRA_LIBRARY cur_colr ) @@ -144,11 +144,11 @@ set(CURSES_LIBRARIES ${CURSES_LIBRARY}) if(CURSES_EXTRA_LIBRARY) set(CURSES_LIBRARIES ${CURSES_LIBRARIES} ${CURSES_EXTRA_LIBRARY}) -endif(CURSES_EXTRA_LIBRARY) +endif() if(CURSES_FORM_LIBRARY) set(CURSES_LIBRARIES ${CURSES_LIBRARIES} ${CURSES_FORM_LIBRARY}) -endif(CURSES_FORM_LIBRARY) +endif() # Proper name is *_INCLUDE_DIR set(CURSES_INCLUDE_DIR ${CURSES_INCLUDE_PATH}) diff --git a/Modules/FindCxxTest.cmake b/Modules/FindCxxTest.cmake index 4207961..48de64a 100644 --- a/Modules/FindCxxTest.cmake +++ b/Modules/FindCxxTest.cmake @@ -147,7 +147,7 @@ macro(CXXTEST_ADD_TEST _cxxtest_testname _cxxtest_outfname) add_test(${_cxxtest_testname} ${CMAKE_CURRENT_BINARY_DIR}/${_cxxtest_testname}) endif() -endmacro(CXXTEST_ADD_TEST) +endmacro() #============================================================= # main() diff --git a/Modules/FindCygwin.cmake b/Modules/FindCygwin.cmake index 75e3342..d7ab7cc 100644 --- a/Modules/FindCygwin.cmake +++ b/Modules/FindCygwin.cmake @@ -25,4 +25,4 @@ if (WIN32) mark_as_advanced( CYGWIN_INSTALL_PATH ) -endif (WIN32) +endif () diff --git a/Modules/FindDoxygen.cmake b/Modules/FindDoxygen.cmake index d63044f..d2ede6a 100644 --- a/Modules/FindDoxygen.cmake +++ b/Modules/FindDoxygen.cmake @@ -35,7 +35,7 @@ # For backwards compatibility support if(Doxygen_FIND_QUIETLY) set(DOXYGEN_FIND_QUIETLY TRUE) -endif(Doxygen_FIND_QUIETLY) +endif() # ===== Rationale for OS X AppBundle mods below ===== # With the OS X GUI version, Doxygen likes to be installed to /Applications and @@ -109,7 +109,7 @@ if(NOT DOXYGEN_SKIP_DOT) get_filename_component(DOXYGEN_DOT_PATH "${DOXYGEN_DOT_EXECUTABLE}" PATH CACHE) endif() -endif(NOT DOXYGEN_SKIP_DOT) +endif() # # Backwards compatibility... diff --git a/Modules/FindEXPAT.cmake b/Modules/FindEXPAT.cmake index e8523a0..c681a0d 100644 --- a/Modules/FindEXPAT.cmake +++ b/Modules/FindEXPAT.cmake @@ -36,13 +36,13 @@ if (EXPAT_INCLUDE_DIR AND EXISTS "${EXPAT_INCLUDE_DIR}/expat.h") EXPAT_VERSION_PART "${VLINE}") if(EXPAT_VERSION_STRING) set(EXPAT_VERSION_STRING "${EXPAT_VERSION_STRING}.${EXPAT_VERSION_PART}") - else(EXPAT_VERSION_STRING) + else() set(EXPAT_VERSION_STRING "${EXPAT_VERSION_PART}") - endif(EXPAT_VERSION_STRING) + endif() endif() - endforeach(VLINE) - endforeach(VPART) -endif (EXPAT_INCLUDE_DIR AND EXISTS "${EXPAT_INCLUDE_DIR}/expat.h") + endforeach() + endforeach() +endif () # handle the QUIETLY and REQUIRED arguments and set EXPAT_FOUND to TRUE if # all listed variables are TRUE @@ -55,6 +55,6 @@ FIND_PACKAGE_HANDLE_STANDARD_ARGS(EXPAT if(EXPAT_FOUND) set(EXPAT_LIBRARIES ${EXPAT_LIBRARY}) set(EXPAT_INCLUDE_DIRS ${EXPAT_INCLUDE_DIR}) -endif(EXPAT_FOUND) +endif() mark_as_advanced(EXPAT_INCLUDE_DIR EXPAT_LIBRARY) diff --git a/Modules/FindFLEX.cmake b/Modules/FindFLEX.cmake index 64c1d53..e397d28 100644 --- a/Modules/FindFLEX.cmake +++ b/Modules/FindFLEX.cmake @@ -129,7 +129,7 @@ if(FLEX_EXECUTABLE) set(FLEX_${Name}_OUTPUTS ${Output}) set(FLEX_${Name}_INPUT ${Input}) set(FLEX_${Name}_COMPILE_FLAGS ${FLEX_EXECUTABLE_opts}) - endmacro(FLEX_TARGET) + endmacro() #============================================================ @@ -149,10 +149,10 @@ if(FLEX_EXECUTABLE) set_source_files_properties(${FLEX_${FlexTarget}_OUTPUTS} PROPERTIES OBJECT_DEPENDS ${BISON_${BisonTarget}_OUTPUT_HEADER}) - endmacro(ADD_FLEX_BISON_DEPENDENCY) + endmacro() #============================================================ -endif(FLEX_EXECUTABLE) +endif() include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake) FIND_PACKAGE_HANDLE_STANDARD_ARGS(FLEX REQUIRED_VARS FLEX_EXECUTABLE diff --git a/Modules/FindFLTK.cmake b/Modules/FindFLTK.cmake index 402fe2f..a02d031 100644 --- a/Modules/FindFLTK.cmake +++ b/Modules/FindFLTK.cmake @@ -51,26 +51,26 @@ if(WIN32) if(NOT CYGWIN) if(BORLAND) set( FLTK_PLATFORM_DEPENDENT_LIBS import32 ) - else(BORLAND) + else() set( FLTK_PLATFORM_DEPENDENT_LIBS wsock32 comctl32 ) - endif(BORLAND) - endif(NOT CYGWIN) -endif(WIN32) + endif() + endif() +endif() if(UNIX) include(FindX11) find_library(FLTK_MATH_LIBRARY m) set( FLTK_PLATFORM_DEPENDENT_LIBS ${X11_LIBRARIES} ${FLTK_MATH_LIBRARY}) -endif(UNIX) +endif() if(APPLE) set( FLTK_PLATFORM_DEPENDENT_LIBS "-framework Carbon -framework Cocoa -framework ApplicationServices -lz") -endif(APPLE) +endif() # If FLTK_INCLUDE_DIR is already defined we assigne its value to FLTK_DIR if(FLTK_INCLUDE_DIR) set(FLTK_DIR ${FLTK_INCLUDE_DIR}) -endif(FLTK_INCLUDE_DIR) +endif() # If FLTK has been built using CMake we try to find everything directly @@ -85,7 +85,7 @@ if(NOT FLTK_DIR) set(FLTK_DIR_SEARCH "") foreach(dir ${FLTK_DIR_SEARCH2}) set(FLTK_DIR_SEARCH ${FLTK_DIR_SEARCH} "${dir}/../lib/fltk") - endforeach(dir) + endforeach() string(REPLACE "//" "/" FLTK_DIR_SEARCH "${FLTK_DIR_SEARCH}") # @@ -122,12 +122,12 @@ if(NOT FLTK_DIR) # Help the user find it if we cannot. DOC "The ${FLTK_DIR_STRING}" ) -endif(NOT FLTK_DIR) +endif() # Check if FLTK was built using CMake if(EXISTS ${FLTK_DIR}/FLTKConfig.cmake) set(FLTK_BUILT_WITH_CMAKE 1) - endif(EXISTS ${FLTK_DIR}/FLTKConfig.cmake) + endif() if(FLTK_BUILT_WITH_CMAKE) set(FLTK_FOUND 1) @@ -136,14 +136,14 @@ endif(NOT FLTK_DIR) # Fluid if(FLUID_COMMAND) set(FLTK_FLUID_EXECUTABLE ${FLUID_COMMAND} CACHE FILEPATH "Fluid executable") - else(FLUID_COMMAND) + else() find_program(FLTK_FLUID_EXECUTABLE fluid PATHS ${FLTK_EXECUTABLE_DIRS} ${FLTK_EXECUTABLE_DIRS}/RelWithDebInfo ${FLTK_EXECUTABLE_DIRS}/Debug ${FLTK_EXECUTABLE_DIRS}/Release NO_SYSTEM_PATH) - endif(FLUID_COMMAND) + endif() # mark_as_advanced(FLTK_FLUID_EXECUTABLE) set(FLTK_INCLUDE_DIR ${FLTK_DIR}) @@ -165,17 +165,17 @@ endif(NOT FLTK_DIR) set(FLTK_IMAGES_LIBS "") if(FLFLTK_USE_SYSTEM_JPEG) set(FLTK_IMAGES_LIBS ${FLTK_IMAGES_LIBS} fltk_jpeg) - endif(FLFLTK_USE_SYSTEM_JPEG) + endif() if(FLFLTK_USE_SYSTEM_PNG) set(FLTK_IMAGES_LIBS ${FLTK_IMAGES_LIBS} fltk_png) - endif(FLFLTK_USE_SYSTEM_PNG) + endif() if(FLFLTK_USE_SYSTEM_ZLIB) set(FLTK_IMAGES_LIBS ${FLTK_IMAGES_LIBS} fltk_zlib) - endif(FLFLTK_USE_SYSTEM_ZLIB) + endif() set(FLTK_IMAGES_LIBS "${FLTK_IMAGES_LIBS}" CACHE INTERNAL "Extra libraries for fltk_images library.") - else(FLTK_BUILT_WITH_CMAKE) + else() # if FLTK was not built using CMake # Find fluid executable. @@ -191,7 +191,7 @@ endif(NOT FLTK_DIR) set(FLTK_LIBRARY_SEARCH_PATH ${FLTK_LIBRARY_SEARCH_PATH} ${FLTK_BIN_DIR}/../lib) set(FLTK_WRAP_UI 1) - endif(FLTK_FLUID_EXECUTABLE) + endif() # # Try to find FLTK include dir using fltk-config @@ -209,7 +209,7 @@ endif(NOT FLTK_DIR) string(STRIP ${_dir} _output) list(APPEND _FLTK_POSSIBLE_INCLUDE_DIRS ${_output}) endforeach() - endif(FLTK_CXXFLAGS) + endif() endif() endif() endif() @@ -265,11 +265,11 @@ endif(NOT FLTK_DIR) # the file that originally included this module. Save the answer. set(FLTK_IMAGES_LIBS "${FLTK_IMAGES_LIBS}" CACHE INTERNAL "Extra libraries for fltk_images library.") - endif("${FLTK_IMAGES_LDFLAGS}" MATCHES "${FLTK_LIBS_EXTRACT_REGEX}") - endif(FLTK_CONFIG_SCRIPT) - endif(UNIX) + endif() + endif() + endif() - endif(FLTK_BUILT_WITH_CMAKE) + endif() # Append all of the required libraries together (by default, everything) set(FLTK_LIBRARIES) @@ -296,14 +296,14 @@ endif() if(FLTK_FOUND) if(APPLE) set(FLTK_LIBRARIES ${FLTK_PLATFORM_DEPENDENT_LIBS} ${FLTK_LIBRARIES}) - else(APPLE) + else() set(FLTK_LIBRARIES ${FLTK_LIBRARIES} ${FLTK_PLATFORM_DEPENDENT_LIBS}) - endif(APPLE) + endif() # The following deprecated settings are for compatibility with CMake 1.4 set (HAS_FLTK ${FLTK_FOUND}) set (FLTK_INCLUDE_PATH ${FLTK_INCLUDE_DIR}) set (FLTK_FLUID_EXE ${FLTK_FLUID_EXECUTABLE}) set (FLTK_LIBRARY ${FLTK_LIBRARIES}) -endif(FLTK_FOUND) +endif() diff --git a/Modules/FindFLTK2.cmake b/Modules/FindFLTK2.cmake index 059ecdb..3ea558c 100644 --- a/Modules/FindFLTK2.cmake +++ b/Modules/FindFLTK2.cmake @@ -30,27 +30,27 @@ if(WIN32) if(NOT CYGWIN) if(BORLAND) set( FLTK2_PLATFORM_DEPENDENT_LIBS import32 ) - else(BORLAND) + else() set( FLTK2_PLATFORM_DEPENDENT_LIBS wsock32 comctl32 ) - endif(BORLAND) - endif(NOT CYGWIN) -endif(WIN32) + endif() + endif() +endif() if(UNIX) include(${CMAKE_ROOT}/Modules/FindX11.cmake) set( FLTK2_PLATFORM_DEPENDENT_LIBS ${X11_LIBRARIES} -lm) -endif(UNIX) +endif() if(APPLE) set( FLTK2_PLATFORM_DEPENDENT_LIBS "-framework Carbon -framework Cocoa -framework ApplicationServices -lz") -endif(APPLE) +endif() # If FLTK2_INCLUDE_DIR is already defined we assigne its value to FLTK2_DIR if(FLTK2_INCLUDE_DIR) set(FLTK2_DIR ${FLTK2_INCLUDE_DIR}) -else(FLTK2_INCLUDE_DIR) +else() set(FLTK2_INCLUDE_DIR ${FLTK2_DIR}) -endif(FLTK2_INCLUDE_DIR) +endif() # If FLTK2 has been built using CMake we try to find everything directly @@ -65,7 +65,7 @@ if(NOT FLTK2_DIR) set(FLTK2_DIR_SEARCH "") foreach(dir ${FLTK2_DIR_SEARCH2}) set(FLTK2_DIR_SEARCH ${FLTK2_DIR_SEARCH} "${dir}/../lib/fltk") - endforeach(dir) + endforeach() string(REPLACE "//" "/" FLTK2_DIR_SEARCH "${FLTK2_DIR_SEARCH}") # @@ -103,9 +103,9 @@ if(NOT FLTK2_DIR) if(NOT FLTK2_DIR) find_path(FLTK2_DIR fltk/run.h ${FLTK2_INCLUDE_SEARCH_PATH}) - endif(NOT FLTK2_DIR) + endif() -endif(NOT FLTK2_DIR) +endif() # If FLTK2 was found, load the configuration file to get the rest of the @@ -115,7 +115,7 @@ if(FLTK2_DIR) # Check if FLTK2 was built using CMake if(EXISTS ${FLTK2_DIR}/FLTK2Config.cmake) set(FLTK2_BUILT_WITH_CMAKE 1) - endif(EXISTS ${FLTK2_DIR}/FLTK2Config.cmake) + endif() if(FLTK2_BUILT_WITH_CMAKE) set(FLTK2_FOUND 1) @@ -124,14 +124,14 @@ if(FLTK2_DIR) # Fluid if(FLUID_COMMAND) set(FLTK2_FLUID_EXECUTABLE ${FLUID_COMMAND} CACHE FILEPATH "Fluid executable") - else(FLUID_COMMAND) + else() find_program(FLTK2_FLUID_EXECUTABLE fluid2 PATHS ${FLTK2_EXECUTABLE_DIRS} ${FLTK2_EXECUTABLE_DIRS}/RelWithDebInfo ${FLTK2_EXECUTABLE_DIRS}/Debug ${FLTK2_EXECUTABLE_DIRS}/Release NO_SYSTEM_PATH) - endif(FLUID_COMMAND) + endif() mark_as_advanced(FLTK2_FLUID_EXECUTABLE) set( FLTK_FLUID_EXECUTABLE ${FLTK2_FLUID_EXECUTABLE} ) @@ -157,17 +157,17 @@ if(FLTK2_DIR) set(FLTK2_IMAGES_LIBS "") if(FLFLTK2_USE_SYSTEM_JPEG) set(FLTK2_IMAGES_LIBS ${FLTK2_IMAGES_LIBS} fltk2_jpeg) - endif(FLFLTK2_USE_SYSTEM_JPEG) + endif() if(FLFLTK2_USE_SYSTEM_PNG) set(FLTK2_IMAGES_LIBS ${FLTK2_IMAGES_LIBS} fltk2_png) - endif(FLFLTK2_USE_SYSTEM_PNG) + endif() if(FLFLTK2_USE_SYSTEM_ZLIB) set(FLTK2_IMAGES_LIBS ${FLTK2_IMAGES_LIBS} fltk2_zlib) - endif(FLFLTK2_USE_SYSTEM_ZLIB) + endif() set(FLTK2_IMAGES_LIBS "${FLTK2_IMAGES_LIBS}" CACHE INTERNAL "Extra libraries for fltk2_images library.") - else(FLTK2_BUILT_WITH_CMAKE) + else() # if FLTK2 was not built using CMake # Find fluid executable. @@ -184,7 +184,7 @@ if(FLTK2_DIR) set(FLTK2_LIBRARY_SEARCH_PATH ${FLTK2_LIBRARY_SEARCH_PATH} ${FLTK2_BIN_DIR}/../lib) set(FLTK2_WRAP_UI 1) - endif(FLTK2_FLUID_EXECUTABLE) + endif() set(FLTK2_INCLUDE_SEARCH_PATH ${FLTK2_INCLUDE_SEARCH_PATH} /usr/local/fltk2 @@ -221,12 +221,12 @@ if(FLTK2_DIR) # the file that originally included this module. Save the answer. set(FLTK2_IMAGES_LIBS "${FLTK2_IMAGES_LIBS}" CACHE INTERNAL "Extra libraries for fltk_images library.") - endif("${FLTK2_IMAGES_LDFLAGS}" MATCHES "${FLTK2_LIBS_EXTRACT_REGEX}") - endif(FLTK2_CONFIG_SCRIPT) - endif(UNIX) + endif() + endif() + endif() - endif(FLTK2_BUILT_WITH_CMAKE) -endif(FLTK2_DIR) + endif() +endif() set(FLTK2_FOUND 1) @@ -236,32 +236,32 @@ foreach(var FLTK2_FLUID_EXECUTABLE FLTK2_INCLUDE_DIR if(NOT ${var}) message( STATUS "${var} not found" ) set(FLTK2_FOUND 0) - endif(NOT ${var}) -endforeach(var) + endif() +endforeach() if(FLTK2_FOUND) set(FLTK2_LIBRARIES ${FLTK2_IMAGES_LIBRARY} ${FLTK2_IMAGES_LIBS} ${FLTK2_BASE_LIBRARY} ${FLTK2_GL_LIBRARY} ) if(APPLE) set(FLTK2_LIBRARIES ${FLTK2_PLATFORM_DEPENDENT_LIBS} ${FLTK2_LIBRARIES}) - else(APPLE) + else() set(FLTK2_LIBRARIES ${FLTK2_LIBRARIES} ${FLTK2_PLATFORM_DEPENDENT_LIBS}) - endif(APPLE) + endif() # The following deprecated settings are for compatibility with CMake 1.4 set (HAS_FLTK2 ${FLTK2_FOUND}) set (FLTK2_INCLUDE_PATH ${FLTK2_INCLUDE_DIR}) set (FLTK2_FLUID_EXE ${FLTK2_FLUID_EXECUTABLE}) set (FLTK2_LIBRARY ${FLTK2_LIBRARIES}) -else(FLTK2_FOUND) +else() # make FIND_PACKAGE friendly if(NOT FLTK2_FIND_QUIETLY) if(FLTK2_FIND_REQUIRED) message(FATAL_ERROR "FLTK2 required, please specify its location with FLTK2_DIR.") - else(FLTK2_FIND_REQUIRED) + else() message(STATUS "FLTK2 was not found.") - endif(FLTK2_FIND_REQUIRED) - endif(NOT FLTK2_FIND_QUIETLY) -endif(FLTK2_FOUND) + endif() + endif() +endif() diff --git a/Modules/FindFreetype.cmake b/Modules/FindFreetype.cmake index d896833..08b4a0d 100644 --- a/Modules/FindFreetype.cmake +++ b/Modules/FindFreetype.cmake @@ -75,7 +75,7 @@ find_library(FREETYPE_LIBRARY # set the user variables if(FREETYPE_INCLUDE_DIR_ft2build AND FREETYPE_INCLUDE_DIR_freetype2) set(FREETYPE_INCLUDE_DIRS "${FREETYPE_INCLUDE_DIR_ft2build};${FREETYPE_INCLUDE_DIR_freetype2}") -endif(FREETYPE_INCLUDE_DIR_ft2build AND FREETYPE_INCLUDE_DIR_freetype2) +endif() set(FREETYPE_LIBRARIES "${FREETYPE_LIBRARY}") if(FREETYPE_INCLUDE_DIR_freetype2 AND EXISTS "${FREETYPE_INCLUDE_DIR_freetype2}/freetype/freetype.h") @@ -90,14 +90,14 @@ if(FREETYPE_INCLUDE_DIR_freetype2 AND EXISTS "${FREETYPE_INCLUDE_DIR_freetype2}/ FREETYPE_VERSION_PART "${VLINE}") if(FREETYPE_VERSION_STRING) set(FREETYPE_VERSION_STRING "${FREETYPE_VERSION_STRING}.${FREETYPE_VERSION_PART}") - else(FREETYPE_VERSION_STRING) + else() set(FREETYPE_VERSION_STRING "${FREETYPE_VERSION_PART}") - endif(FREETYPE_VERSION_STRING) + endif() unset(FREETYPE_VERSION_PART) endif() - endforeach(VLINE) - endforeach(VPART) -endif(FREETYPE_INCLUDE_DIR_freetype2 AND EXISTS "${FREETYPE_INCLUDE_DIR_freetype2}/freetype/freetype.h") + endforeach() + endforeach() +endif() # handle the QUIETLY and REQUIRED arguments and set FREETYPE_FOUND to TRUE if diff --git a/Modules/FindGLU.cmake b/Modules/FindGLU.cmake index 3db2ce4..d87945a 100644 --- a/Modules/FindGLU.cmake +++ b/Modules/FindGLU.cmake @@ -24,5 +24,5 @@ include(FindOpenGL) if (OPENGL_GLU_FOUND) set (GLU_LIBRARY ${OPENGL_LIBRARIES}) set (GLU_INCLUDE_PATH ${OPENGL_INCLUDE_DIR}) -endif (OPENGL_GLU_FOUND) +endif () diff --git a/Modules/FindGLUT.cmake b/Modules/FindGLUT.cmake index edff53c..55790ae 100644 --- a/Modules/FindGLUT.cmake +++ b/Modules/FindGLUT.cmake @@ -28,7 +28,7 @@ if (WIN32) ${OPENGL_LIBRARY_DIR} ${GLUT_ROOT_PATH}/Release ) -else (WIN32) +else () if (APPLE) # These values for Apple could probably do with improvement. @@ -38,7 +38,7 @@ else (WIN32) ) set(GLUT_glut_LIBRARY "-framework GLUT" CACHE STRING "GLUT library for OSX") set(GLUT_cocoa_LIBRARY "-framework Cocoa" CACHE STRING "Cocoa framework for OSX") - else (APPLE) + else () find_path( GLUT_INCLUDE_DIR GL/glut.h /usr/include/GL @@ -60,9 +60,9 @@ else (WIN32) /usr/openwin/lib ) - endif (APPLE) + endif () -endif (WIN32) +endif () include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake) FIND_PACKAGE_HANDLE_STANDARD_ARGS(GLUT REQUIRED_VARS GLUT_glut_LIBRARY GLUT_INCLUDE_DIR) @@ -80,7 +80,7 @@ if (GLUT_FOUND) #The following deprecated settings are for backwards compatibility with CMake1.4 set (GLUT_LIBRARY ${GLUT_LIBRARIES}) set (GLUT_INCLUDE_PATH ${GLUT_INCLUDE_DIR}) -endif(GLUT_FOUND) +endif() mark_as_advanced( GLUT_INCLUDE_DIR diff --git a/Modules/FindGTK.cmake b/Modules/FindGTK.cmake index 780932e..505a051 100644 --- a/Modules/FindGTK.cmake +++ b/Modules/FindGTK.cmake @@ -120,13 +120,13 @@ if(UNIX) if(GTK_gmodule_LIBRARY) set(GTK_LIBRARIES ${GTK_LIBRARIES} ${GTK_gmodule_LIBRARY}) - endif(GTK_gmodule_LIBRARY) + endif() if(GTK_gthread_LIBRARY) set(GTK_LIBRARIES ${GTK_LIBRARIES} ${GTK_gthread_LIBRARY}) - endif(GTK_gthread_LIBRARY) + endif() if(GTK_Xi_LIBRARY) set(GTK_LIBRARIES ${GTK_LIBRARIES} ${GTK_Xi_LIBRARY}) - endif(GTK_Xi_LIBRARY) + endif() if(GTK_gtkgl_INCLUDE_PATH AND GTK_gtkgl_LIBRARY) set( GTK_GL_FOUND "YES" ) @@ -137,7 +137,7 @@ if(UNIX) GTK_gtkgl_LIBRARY GTK_gtkgl_INCLUDE_PATH ) - endif(GTK_gtkgl_INCLUDE_PATH AND GTK_gtkgl_LIBRARY) + endif() endif(GTK_gtk_INCLUDE_PATH AND GTK_glibconfig_INCLUDE_PATH @@ -159,7 +159,7 @@ if(UNIX) GTK_gtkgl_LIBRARY ) -endif(UNIX) +endif() diff --git a/Modules/FindGTK2.cmake b/Modules/FindGTK2.cmake index f734b3b..d10b419 100644 --- a/Modules/FindGTK2.cmake +++ b/Modules/FindGTK2.cmake @@ -214,7 +214,7 @@ function(_GTK2_FIND_INCLUDE_DIR _var _hdr) endif() endif() -endfunction(_GTK2_FIND_INCLUDE_DIR) +endfunction() #============================================================= # _GTK2_FIND_LIBRARY @@ -343,7 +343,7 @@ function(_GTK2_FIND_LIBRARY _var _lib _expand_vc _append_version) set(${_var}_DEBUG ${${_var}}) set(${_var}_DEBUG ${${_var}} PARENT_SCOPE) endif() -endfunction(_GTK2_FIND_LIBRARY) +endfunction() #============================================================= diff --git a/Modules/FindGettext.cmake b/Modules/FindGettext.cmake index a801a29..c4774d9 100644 --- a/Modules/FindGettext.cmake +++ b/Modules/FindGettext.cmake @@ -52,7 +52,7 @@ if(GETTEXT_MSGMERGE_EXECUTABLE) string(REGEX REPLACE "^msgmerge \\([^\\)]*\\) ([0-9\\.]+[^ \n]*).*" "\\1" GETTEXT_VERSION_STRING "${gettext_version}") endif() unset(gettext_version) -endif(GETTEXT_MSGMERGE_EXECUTABLE) +endif() include(FindPackageHandleStandardArgs) FIND_PACKAGE_HANDLE_STANDARD_ARGS(Gettext @@ -85,7 +85,7 @@ macro(GETTEXT_CREATE_TRANSLATIONS _potFile _firstPoFileArg) if(${_firstPoFile} STREQUAL "ALL") set(_addToAll "ALL") set(_firstPoFile) - endif(${_firstPoFile} STREQUAL "ALL") + endif() foreach (_currentPoFile ${_firstPoFile} ${ARGN}) get_filename_component(_absFile ${_currentPoFile} ABSOLUTE) @@ -103,7 +103,7 @@ macro(GETTEXT_CREATE_TRANSLATIONS _potFile _firstPoFileArg) install(FILES ${_gmoFile} DESTINATION share/locale/${_lang}/LC_MESSAGES RENAME ${_potBasename}.mo) set(_gmoFiles ${_gmoFiles} ${_gmoFile}) - endforeach (_currentPoFile ) + endforeach () if(NOT TARGET translations) add_custom_target(translations) @@ -115,7 +115,7 @@ macro(GETTEXT_CREATE_TRANSLATIONS _potFile _firstPoFileArg) add_dependencies(translations ${uniqueTargetName}) -endmacro(GETTEXT_CREATE_TRANSLATIONS ) +endmacro() function(GETTEXT_PROCESS_POT_FILE _potFile) @@ -148,9 +148,9 @@ function(GETTEXT_PROCESS_POT_FILE _potFile) if(_parsedArguments_INSTALL_DESTINATION) install(FILES ${_gmoFile} DESTINATION ${_parsedArguments_INSTALL_DESTINATION}/${_lang}/LC_MESSAGES RENAME ${_potBasename}.mo) - endif(_parsedArguments_INSTALL_DESTINATION) + endif() list(APPEND _gmoFiles ${_gmoFile}) - endforeach (_lang ) + endforeach () if(NOT TARGET potfiles) add_custom_target(potfiles) @@ -160,13 +160,13 @@ function(GETTEXT_PROCESS_POT_FILE _potFile) if(_parsedArguments_ALL) add_custom_target(${uniqueTargetName} ALL DEPENDS ${_gmoFiles}) - else(_parsedArguments_ALL) + else() add_custom_target(${uniqueTargetName} DEPENDS ${_gmoFiles}) - endif(_parsedArguments_ALL) + endif() add_dependencies(potfiles ${uniqueTargetName}) -endfunction(GETTEXT_PROCESS_POT_FILE) +endfunction() function(GETTEXT_PROCESS_PO_FILES _lang) @@ -189,9 +189,9 @@ function(GETTEXT_PROCESS_PO_FILES _lang) if(_parsedArguments_INSTALL_DESTINATION) install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${_basename}.gmo DESTINATION ${_parsedArguments_INSTALL_DESTINATION}/${_lang}/LC_MESSAGES/ RENAME ${_basename}.mo) - endif(_parsedArguments_INSTALL_DESTINATION) + endif() list(APPEND _gmoFiles ${_gmoFile}) - endforeach(_current_PO_FILE) + endforeach() if(NOT TARGET pofiles) @@ -202,19 +202,19 @@ function(GETTEXT_PROCESS_PO_FILES _lang) if(_parsedArguments_ALL) add_custom_target(${uniqueTargetName} ALL DEPENDS ${_gmoFiles}) - else(_parsedArguments_ALL) + else() add_custom_target(${uniqueTargetName} DEPENDS ${_gmoFiles}) - endif(_parsedArguments_ALL) + endif() add_dependencies(pofiles ${uniqueTargetName}) -endfunction(GETTEXT_PROCESS_PO_FILES) +endfunction() if (GETTEXT_MSGMERGE_EXECUTABLE AND GETTEXT_MSGFMT_EXECUTABLE ) set(GETTEXT_FOUND TRUE) -else (GETTEXT_MSGMERGE_EXECUTABLE AND GETTEXT_MSGFMT_EXECUTABLE ) +else () set(GETTEXT_FOUND FALSE) if (GetText_REQUIRED) message(FATAL_ERROR "GetText not found") - endif (GetText_REQUIRED) -endif (GETTEXT_MSGMERGE_EXECUTABLE AND GETTEXT_MSGFMT_EXECUTABLE ) + endif () +endif () diff --git a/Modules/FindGit.cmake b/Modules/FindGit.cmake index f89d1af..41d2a7a 100644 --- a/Modules/FindGit.cmake +++ b/Modules/FindGit.cmake @@ -51,7 +51,7 @@ if(GIT_EXECUTABLE) string(REPLACE "git version " "" GIT_VERSION_STRING "${git_version}") endif() unset(git_version) -endif(GIT_EXECUTABLE) +endif() # Handle the QUIETLY and REQUIRED arguments and set GIT_FOUND to TRUE if # all listed variables are TRUE diff --git a/Modules/FindGnuTLS.cmake b/Modules/FindGnuTLS.cmake index a05efe6..7315f1d 100644 --- a/Modules/FindGnuTLS.cmake +++ b/Modules/FindGnuTLS.cmake @@ -29,7 +29,7 @@ if (GNUTLS_INCLUDE_DIR AND GNUTLS_LIBRARY) # in cache already set(gnutls_FIND_QUIETLY TRUE) -endif (GNUTLS_INCLUDE_DIR AND GNUTLS_LIBRARY) +endif () if (NOT WIN32) # try using pkg-config to get the directories and then use these values @@ -39,7 +39,7 @@ if (NOT WIN32) PKG_CHECK_MODULES(PC_GNUTLS QUIET gnutls) set(GNUTLS_DEFINITIONS ${PC_GNUTLS_CFLAGS_OTHER}) set(GNUTLS_VERSION_STRING ${PC_GNUTLS_VERSION}) -endif (NOT WIN32) +endif () find_path(GNUTLS_INCLUDE_DIR gnutls/gnutls.h HINTS diff --git a/Modules/FindHTMLHelp.cmake b/Modules/FindHTMLHelp.cmake index d51b398..c69e9e9 100644 --- a/Modules/FindHTMLHelp.cmake +++ b/Modules/FindHTMLHelp.cmake @@ -51,4 +51,4 @@ if(WIN32) HTML_HELP_LIBRARY ) -endif(WIN32) +endif() diff --git a/Modules/FindImageMagick.cmake b/Modules/FindImageMagick.cmake index 436bb4b..bf09616 100644 --- a/Modules/FindImageMagick.cmake +++ b/Modules/FindImageMagick.cmake @@ -104,8 +104,8 @@ function(FIND_IMAGEMAGICK_API component header) ${ImageMagick_${component}_LIBRARY} ) set(ImageMagick_LIBRARIES ${ImageMagick_LIBRARIES} PARENT_SCOPE) - endif(ImageMagick_${component}_INCLUDE_DIR AND ImageMagick_${component}_LIBRARY) -endfunction(FIND_IMAGEMAGICK_API) + endif() +endfunction() function(FIND_IMAGEMAGICK_EXE component) set(_IMAGEMAGICK_EXECUTABLE @@ -116,10 +116,10 @@ function(FIND_IMAGEMAGICK_EXE component) PARENT_SCOPE ) set(ImageMagick_${component}_FOUND TRUE PARENT_SCOPE) - else(EXISTS ${_IMAGEMAGICK_EXECUTABLE}) + else() set(ImageMagick_${component}_FOUND FALSE PARENT_SCOPE) - endif(EXISTS ${_IMAGEMAGICK_EXECUTABLE}) -endfunction(FIND_IMAGEMAGICK_EXE) + endif() +endfunction() #--------------------------------------------------------------------- # Start Actual Work @@ -160,23 +160,23 @@ foreach(component ${ImageMagick_FIND_COMPONENTS} Magick MagickCore CORE_RL_magick_ ) list(APPEND ImageMagick_REQUIRED_VARS ImageMagick_MagickCore_LIBRARY) - else(component STREQUAL "Magick++") + else() if(ImageMagick_EXECUTABLE_DIR) FIND_IMAGEMAGICK_EXE(${component}) - endif(ImageMagick_EXECUTABLE_DIR) + endif() if(ImageMagick_FIND_COMPONENTS) list(FIND ImageMagick_FIND_COMPONENTS ${component} is_requested) if(is_requested GREATER -1) list(APPEND ImageMagick_REQUIRED_VARS ImageMagick_${component}_EXECUTABLE) - endif(is_requested GREATER -1) + endif() elseif(ImageMagick_${component}_EXECUTABLE) # if no components were requested explicitly put all (default) executables # in the list list(APPEND ImageMagick_DEFAULT_EXECUTABLES ImageMagick_${component}_EXECUTABLE) - endif(ImageMagick_FIND_COMPONENTS) - endif(component STREQUAL "Magick++") -endforeach(component) + endif() + endif() +endforeach() if(NOT ImageMagick_FIND_COMPONENTS AND NOT ImageMagick_DEFAULT_EXECUTABLES) # No components were requested, and none of the default components were @@ -199,7 +199,7 @@ if(ImageMagick_mogrify_EXECUTABLE) string(REGEX REPLACE "^Version: ImageMagick ([-0-9\\.]+).*" "\\1" ImageMagick_VERSION_STRING "${imagemagick_version}") endif() unset(imagemagick_version) -endif(ImageMagick_mogrify_EXECUTABLE) +endif() #--------------------------------------------------------------------- # Standard Package Output diff --git a/Modules/FindJNI.cmake b/Modules/FindJNI.cmake index 1dae07e..0de3f79 100644 --- a/Modules/FindJNI.cmake +++ b/Modules/FindJNI.cmake @@ -59,15 +59,15 @@ macro(java_append_library_directories _var) set(_java_libarch "${CMAKE_SYSTEM_PROCESSOR}" "s390" "s390x") elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "^sh") set(_java_libarch "sh") - else(CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64") + else() set(_java_libarch "${CMAKE_SYSTEM_PROCESSOR}") - endif(CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64") + endif() # Append default list architectures if CMAKE_SYSTEM_PROCESSOR was empty or # system is non-Linux (where the code above has not been well tested) if(NOT _java_libarch OR NOT (CMAKE_SYSTEM_NAME MATCHES "Linux")) list(APPEND _java_libarch "i386" "amd64" "ppc") - endif(NOT _java_libarch OR NOT (CMAKE_SYSTEM_NAME MATCHES "Linux")) + endif() # Sometimes ${CMAKE_SYSTEM_PROCESSOR} is added to the list to prefer # current value to a hardcoded list. Remove possible duplicates. @@ -78,12 +78,12 @@ macro(java_append_library_directories _var) foreach(_libarch ${_java_libarch}) string(REPLACE "{libarch}" "${_libarch}" _newpath "${_path}") list(APPEND ${_var} "${_newpath}") - endforeach(_libarch) - else(_path MATCHES "{libarch}") + endforeach() + else() list(APPEND ${_var} "${_path}") - endif(_path MATCHES "{libarch}") - endforeach(_path) -endmacro(java_append_library_directories) + endif() + endforeach() +endmacro() get_filename_component(java_install_version "[HKEY_LOCAL_MACHINE\\SOFTWARE\\JavaSoft\\Java Development Kit;CurrentVersion]" NAME) @@ -130,7 +130,7 @@ foreach(dir ${JAVA_AWT_LIBRARY_DIRECTORIES}) "${dir}/client" "${dir}/server" ) -endforeach(dir) +endforeach() set(JAVA_AWT_INCLUDE_DIRECTORIES @@ -160,43 +160,43 @@ foreach(JAVA_PROG "${JAVA_RUNTIME}" "${JAVA_COMPILE}" "${JAVA_ARCHIVE}") foreach(JAVA_INC_PATH ../include ../java/include ../share/java/include) if(EXISTS ${jpath}/${JAVA_INC_PATH}) set(JAVA_AWT_INCLUDE_DIRECTORIES ${JAVA_AWT_INCLUDE_DIRECTORIES} "${jpath}/${JAVA_INC_PATH}") - endif(EXISTS ${jpath}/${JAVA_INC_PATH}) - endforeach(JAVA_INC_PATH) + endif() + endforeach() foreach(JAVA_LIB_PATH ../lib ../jre/lib ../jre/lib/i386 ../java/lib ../java/jre/lib ../java/jre/lib/i386 ../share/java/lib ../share/java/jre/lib ../share/java/jre/lib/i386) if(EXISTS ${jpath}/${JAVA_LIB_PATH}) set(JAVA_AWT_LIBRARY_DIRECTORIES ${JAVA_AWT_LIBRARY_DIRECTORIES} "${jpath}/${JAVA_LIB_PATH}") - endif(EXISTS ${jpath}/${JAVA_LIB_PATH}) - endforeach(JAVA_LIB_PATH) -endforeach(JAVA_PROG) + endif() + endforeach() +endforeach() if(APPLE) if(EXISTS ~/Library/Frameworks/JavaVM.framework) set(JAVA_HAVE_FRAMEWORK 1) - endif(EXISTS ~/Library/Frameworks/JavaVM.framework) + endif() if(EXISTS /Library/Frameworks/JavaVM.framework) set(JAVA_HAVE_FRAMEWORK 1) - endif(EXISTS /Library/Frameworks/JavaVM.framework) + endif() if(EXISTS /System/Library/Frameworks/JavaVM.framework) set(JAVA_HAVE_FRAMEWORK 1) - endif(EXISTS /System/Library/Frameworks/JavaVM.framework) + endif() if(JAVA_HAVE_FRAMEWORK) if(NOT JAVA_AWT_LIBRARY) set (JAVA_AWT_LIBRARY "-framework JavaVM" CACHE FILEPATH "Java Frameworks" FORCE) - endif(NOT JAVA_AWT_LIBRARY) + endif() if(NOT JAVA_JVM_LIBRARY) set (JAVA_JVM_LIBRARY "-framework JavaVM" CACHE FILEPATH "Java Frameworks" FORCE) - endif(NOT JAVA_JVM_LIBRARY) + endif() if(NOT JAVA_AWT_INCLUDE_PATH) if(EXISTS /System/Library/Frameworks/JavaVM.framework/Headers/jawt.h) set (JAVA_AWT_INCLUDE_PATH "/System/Library/Frameworks/JavaVM.framework/Headers" CACHE FILEPATH "jawt.h location" FORCE) - endif(EXISTS /System/Library/Frameworks/JavaVM.framework/Headers/jawt.h) - endif(NOT JAVA_AWT_INCLUDE_PATH) + endif() + endif() # If using "-framework JavaVM", prefer its headers *before* the others in # JAVA_AWT_INCLUDE_DIRECTORIES... (*prepend* to the list here) @@ -207,15 +207,15 @@ if(APPLE) /System/Library/Frameworks/JavaVM.framework/Headers ${JAVA_AWT_INCLUDE_DIRECTORIES} ) - endif(JAVA_HAVE_FRAMEWORK) -else(APPLE) + endif() +else() find_library(JAVA_AWT_LIBRARY jawt PATHS ${JAVA_AWT_LIBRARY_DIRECTORIES} ) find_library(JAVA_JVM_LIBRARY NAMES jvm JavaVM PATHS ${JAVA_JVM_LIBRARY_DIRECTORIES} ) -endif(APPLE) +endif() # add in the include path find_path(JAVA_INCLUDE_PATH jni.h diff --git a/Modules/FindJPEG.cmake b/Modules/FindJPEG.cmake index 9b0d8f4..7c1f0fd 100644 --- a/Modules/FindJPEG.cmake +++ b/Modules/FindJPEG.cmake @@ -32,12 +32,12 @@ FIND_PACKAGE_HANDLE_STANDARD_ARGS(JPEG DEFAULT_MSG JPEG_LIBRARY JPEG_INCLUDE_DIR if(JPEG_FOUND) set(JPEG_LIBRARIES ${JPEG_LIBRARY}) -endif(JPEG_FOUND) +endif() # Deprecated declarations. set (NATIVE_JPEG_INCLUDE_PATH ${JPEG_INCLUDE_DIR} ) if(JPEG_LIBRARY) get_filename_component (NATIVE_JPEG_LIB_PATH ${JPEG_LIBRARY} PATH) -endif(JPEG_LIBRARY) +endif() mark_as_advanced(JPEG_LIBRARY JPEG_INCLUDE_DIR ) diff --git a/Modules/FindJasper.cmake b/Modules/FindJasper.cmake index c5b865a..136056b 100644 --- a/Modules/FindJasper.cmake +++ b/Modules/FindJasper.cmake @@ -31,13 +31,13 @@ if (NOT JASPER_LIBRARIES) include(${CMAKE_CURRENT_LIST_DIR}/SelectLibraryConfigurations.cmake) SELECT_LIBRARY_CONFIGURATIONS(JASPER) -endif (NOT JASPER_LIBRARIES) +endif () if (JASPER_INCLUDE_DIR AND EXISTS "${JASPER_INCLUDE_DIR}/jasper/jas_config.h") file(STRINGS "${JASPER_INCLUDE_DIR}/jasper/jas_config.h" jasper_version_str REGEX "^#define[\t ]+JAS_VERSION[\t ]+\".*\".*") string(REGEX REPLACE "^#define[\t ]+JAS_VERSION[\t ]+\"([^\"]+)\".*" "\\1" JASPER_VERSION_STRING "${jasper_version_str}") -endif (JASPER_INCLUDE_DIR AND EXISTS "${JASPER_INCLUDE_DIR}/jasper/jas_config.h") +endif () # handle the QUIETLY and REQUIRED arguments and set JASPER_FOUND to TRUE if # all listed variables are TRUE @@ -48,6 +48,6 @@ FIND_PACKAGE_HANDLE_STANDARD_ARGS(Jasper if (JASPER_FOUND) set(JASPER_LIBRARIES ${JASPER_LIBRARIES} ${JPEG_LIBRARIES} ) -endif (JASPER_FOUND) +endif () mark_as_advanced(JASPER_INCLUDE_DIR) diff --git a/Modules/FindJava.cmake b/Modules/FindJava.cmake index 24af0e0..1b4593d 100644 --- a/Modules/FindJava.cmake +++ b/Modules/FindJava.cmake @@ -118,7 +118,7 @@ if(Java_JAVA_EXECUTABLE) else() if(NOT Java_FIND_QUIETLY) message(WARNING "regex not supported: ${var}. Please report") - endif(NOT Java_FIND_QUIETLY) + endif() endif() string( REGEX REPLACE "([0-9]+).*" "\\1" Java_VERSION_MAJOR "${Java_VERSION_STRING}" ) string( REGEX REPLACE "[0-9]+\\.([0-9]+).*" "\\1" Java_VERSION_MINOR "${Java_VERSION_STRING}" ) @@ -127,12 +127,12 @@ if(Java_JAVA_EXECUTABLE) string( REGEX REPLACE "[0-9]+\\.[0-9]+\\.[0-9]+[_\\.]?([0-9]*).*$" "\\1" Java_VERSION_TWEAK "${Java_VERSION_STRING}" ) if( Java_VERSION_TWEAK STREQUAL "" ) # check case where tweak is not defined set(Java_VERSION ${Java_VERSION_MAJOR}.${Java_VERSION_MINOR}.${Java_VERSION_PATCH}) - else( ) + else() set(Java_VERSION ${Java_VERSION_MAJOR}.${Java_VERSION_MINOR}.${Java_VERSION_PATCH}.${Java_VERSION_TWEAK}) - endif( ) + endif() endif() -endif(Java_JAVA_EXECUTABLE) +endif() find_program(Java_JAR_EXECUTABLE @@ -178,7 +178,7 @@ if(Java_FIND_COMPONENTS) message(FATAL_ERROR "Comp: ${component} is not handled") endif() set(Java_${component}_FOUND TRUE) - endforeach(component) + endforeach() else() # Check for everything find_package_handle_standard_args(Java diff --git a/Modules/FindKDE3.cmake b/Modules/FindKDE3.cmake index a8d30a8..a092116 100644 --- a/Modules/FindKDE3.cmake +++ b/Modules/FindKDE3.cmake @@ -79,19 +79,19 @@ if(NOT UNIX AND KDE3_FIND_REQUIRED) message(FATAL_ERROR "Compiling KDE3 applications and libraries under Windows is not supported") -endif(NOT UNIX AND KDE3_FIND_REQUIRED) +endif() # If Qt4 has already been found, fail. if(QT4_FOUND) if(KDE3_FIND_REQUIRED) message( FATAL_ERROR "KDE3/Qt3 and Qt4 cannot be used together in one project.") - else(KDE3_FIND_REQUIRED) + else() if(NOT KDE3_FIND_QUIETLY) message( STATUS "KDE3/Qt3 and Qt4 cannot be used together in one project.") - endif(NOT KDE3_FIND_QUIETLY) + endif() return() - endif(KDE3_FIND_REQUIRED) -endif(QT4_FOUND) + endif() +endif() set(QT_MT_REQUIRED TRUE) @@ -100,7 +100,7 @@ set(QT_MT_REQUIRED TRUE) #this line includes FindQt.cmake, which searches the Qt library and headers if(KDE3_FIND_REQUIRED) set(_REQ_STRING_KDE3 "REQUIRED") -endif(KDE3_FIND_REQUIRED) +endif() find_package(Qt3 ${_REQ_STRING_KDE3}) find_package(X11 ${_REQ_STRING_KDE3}) @@ -126,8 +126,8 @@ if(KDECONFIG_EXECUTABLE) OUTPUT_VARIABLE kdedir ) string(REGEX REPLACE "\n" "" KDE3PREFIX "${kdedir}") - endif ("${kde_version}" MATCHES "KDE: 3\\.") -endif(KDECONFIG_EXECUTABLE) + endif () +endif() @@ -161,10 +161,10 @@ get_filename_component(KDE3_LIB_DIR ${KDE3_KDECORE_LIBRARY} PATH ) if(NOT KDE3_LIBTOOL_DIR) if(KDE3_KDECORE_LIBRARY MATCHES lib64) set(KDE3_LIBTOOL_DIR /lib64/kde3) - else(KDE3_KDECORE_LIBRARY MATCHES lib64) + else() set(KDE3_LIBTOOL_DIR /lib/kde3) - endif(KDE3_KDECORE_LIBRARY MATCHES lib64) -endif(NOT KDE3_LIBTOOL_DIR) + endif() +endif() #now search for the dcop utilities find_program(KDE3_DCOPIDL_EXECUTABLE NAMES dcopidl @@ -198,9 +198,9 @@ find_program(KDE3_KCFGC_EXECUTABLE NAMES kconfig_compiler #SET KDE3_FOUND if (KDE3_INCLUDE_DIR AND KDE3_LIB_DIR AND KDE3_DCOPIDL_EXECUTABLE AND KDE3_DCOPIDL2CPP_EXECUTABLE AND KDE3_KCFGC_EXECUTABLE) set(KDE3_FOUND TRUE) -else (KDE3_INCLUDE_DIR AND KDE3_LIB_DIR AND KDE3_DCOPIDL_EXECUTABLE AND KDE3_DCOPIDL2CPP_EXECUTABLE AND KDE3_KCFGC_EXECUTABLE) +else () set(KDE3_FOUND FALSE) -endif (KDE3_INCLUDE_DIR AND KDE3_LIB_DIR AND KDE3_DCOPIDL_EXECUTABLE AND KDE3_DCOPIDL2CPP_EXECUTABLE AND KDE3_KCFGC_EXECUTABLE) +endif () # add some KDE specific stuff set(KDE3_DEFINITIONS -DQT_CLEAN_NAMESPACE -D_GNU_SOURCE) @@ -216,32 +216,32 @@ if(KDE3_FOUND) # I guess 2.95 also doesn't then if("${out}" MATCHES "2.9[56]") set(_KDE3_USE_FLAGS FALSE) - endif("${out}" MATCHES "2.9[56]") - endif(CMAKE_COMPILER_IS_GNUCXX) + endif() + endif() #only on linux, but NOT e.g. on FreeBSD: if(CMAKE_SYSTEM_NAME MATCHES "Linux" AND _KDE3_USE_FLAGS) set (KDE3_DEFINITIONS ${KDE3_DEFINITIONS} -D_XOPEN_SOURCE=500 -D_BSD_SOURCE) set ( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-long-long -ansi -Wundef -Wcast-align -Wconversion -Wchar-subscripts -Wall -W -Wpointer-arith -Wwrite-strings -Wformat-security -Wmissing-format-attribute -fno-common") set ( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wnon-virtual-dtor -Wno-long-long -ansi -Wundef -Wcast-align -Wconversion -Wchar-subscripts -Wall -W -Wpointer-arith -Wwrite-strings -Wformat-security -fno-exceptions -fno-check-new -fno-common") - endif(CMAKE_SYSTEM_NAME MATCHES "Linux" AND _KDE3_USE_FLAGS) + endif() # works on FreeBSD, NOT tested on NetBSD and OpenBSD if (CMAKE_SYSTEM_NAME MATCHES BSD AND _KDE3_USE_FLAGS) set ( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-long-long -ansi -Wundef -Wcast-align -Wconversion -Wchar-subscripts -Wall -W -Wpointer-arith -Wwrite-strings -Wformat-security -Wmissing-format-attribute -fno-common") set ( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wnon-virtual-dtor -Wno-long-long -Wundef -Wcast-align -Wconversion -Wchar-subscripts -Wall -W -Wpointer-arith -Wwrite-strings -Wformat-security -Wmissing-format-attribute -fno-exceptions -fno-check-new -fno-common") - endif (CMAKE_SYSTEM_NAME MATCHES BSD AND _KDE3_USE_FLAGS) + endif () # if no special buildtype is selected, add -O2 as default optimization if (NOT CMAKE_BUILD_TYPE AND _KDE3_USE_FLAGS) set ( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -O2") set ( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O2") - endif (NOT CMAKE_BUILD_TYPE AND _KDE3_USE_FLAGS) + endif () #set(CMAKE_SHARED_LINKER_FLAGS "-avoid-version -module -Wl,--no-undefined -Wl,--allow-shlib-undefined") #set(CMAKE_SHARED_LINKER_FLAGS "-Wl,--fatal-warnings -avoid-version -Wl,--no-undefined -lc") #set(CMAKE_MODULE_LINKER_FLAGS "-Wl,--fatal-warnings -avoid-version -Wl,--no-undefined -lc") -endif(KDE3_FOUND) +endif() # KDE3Macros.cmake contains all the KDE specific macros @@ -251,35 +251,35 @@ include(KDE3Macros) macro (KDE3_PRINT_RESULTS) if(KDE3_INCLUDE_DIR) message(STATUS "Found KDE3 include dir: ${KDE3_INCLUDE_DIR}") - else(KDE3_INCLUDE_DIR) + else() message(STATUS "Didn't find KDE3 headers") - endif(KDE3_INCLUDE_DIR) + endif() if(KDE3_LIB_DIR) message(STATUS "Found KDE3 library dir: ${KDE3_LIB_DIR}") - else(KDE3_LIB_DIR) + else() message(STATUS "Didn't find KDE3 core library") - endif(KDE3_LIB_DIR) + endif() if(KDE3_DCOPIDL_EXECUTABLE) message(STATUS "Found KDE3 dcopidl preprocessor: ${KDE3_DCOPIDL_EXECUTABLE}") - else(KDE3_DCOPIDL_EXECUTABLE) + else() message(STATUS "Didn't find the KDE3 dcopidl preprocessor") - endif(KDE3_DCOPIDL_EXECUTABLE) + endif() if(KDE3_DCOPIDL2CPP_EXECUTABLE) message(STATUS "Found KDE3 dcopidl2cpp preprocessor: ${KDE3_DCOPIDL2CPP_EXECUTABLE}") - else(KDE3_DCOPIDL2CPP_EXECUTABLE) + else() message(STATUS "Didn't find the KDE3 dcopidl2cpp preprocessor") - endif(KDE3_DCOPIDL2CPP_EXECUTABLE) + endif() if(KDE3_KCFGC_EXECUTABLE) message(STATUS "Found KDE3 kconfig_compiler preprocessor: ${KDE3_KCFGC_EXECUTABLE}") - else(KDE3_KCFGC_EXECUTABLE) + else() message(STATUS "Didn't find the KDE3 kconfig_compiler preprocessor") - endif(KDE3_KCFGC_EXECUTABLE) + endif() -endmacro (KDE3_PRINT_RESULTS) +endmacro () if (KDE3_FIND_REQUIRED AND NOT KDE3_FOUND) @@ -287,12 +287,12 @@ if (KDE3_FIND_REQUIRED AND NOT KDE3_FOUND) KDE3_PRINT_RESULTS() message(FATAL_ERROR "Could NOT find everything required for compiling KDE 3 programs") -endif (KDE3_FIND_REQUIRED AND NOT KDE3_FOUND) +endif () if (NOT KDE3_FIND_QUIETLY) KDE3_PRINT_RESULTS() -endif (NOT KDE3_FIND_QUIETLY) +endif () #add the found Qt and KDE include directories to the current include path set(KDE3_INCLUDE_DIRS ${QT_INCLUDE_DIR} ${KDE3_INCLUDE_DIR}) diff --git a/Modules/FindKDE4.cmake b/Modules/FindKDE4.cmake index 9cff20e..c653a04 100644 --- a/Modules/FindKDE4.cmake +++ b/Modules/FindKDE4.cmake @@ -27,13 +27,13 @@ if(QT_QT_LIBRARY) if(KDE4_FIND_REQUIRED) message( FATAL_ERROR "KDE4/Qt4 and Qt3 cannot be used together in one project.") - else(KDE4_FIND_REQUIRED) + else() if(NOT KDE4_FIND_QUIETLY) message( STATUS "KDE4/Qt4 and Qt3 cannot be used together in one project.") - endif(NOT KDE4_FIND_QUIETLY) + endif() return() - endif(KDE4_FIND_REQUIRED) -endif(QT_QT_LIBRARY) + endif() +endif() file(TO_CMAKE_PATH "$ENV{KDEDIRS}" _KDEDIRS) @@ -56,8 +56,8 @@ find_program(KDE4_KDECONFIG_EXECUTABLE NAMES kde4-config if (NOT KDE4_KDECONFIG_EXECUTABLE) if (KDE4_FIND_REQUIRED) message(FATAL_ERROR "ERROR: Could not find KDE4 kde4-config") - endif (KDE4_FIND_REQUIRED) -endif (NOT KDE4_KDECONFIG_EXECUTABLE) + endif () +endif () # when cross compiling, KDE4_DATA_DIR may be already preset @@ -66,7 +66,7 @@ if(NOT KDE4_DATA_DIR) # when cross compiling, don't run kde4-config but use its location as install dir get_filename_component(KDE4_DATA_DIR "${KDE4_KDECONFIG_EXECUTABLE}" PATH) get_filename_component(KDE4_DATA_DIR "${KDE4_DATA_DIR}" PATH) - else(CMAKE_CROSSCOMPILING) + else() # then ask kde4-config for the kde data dirs if(KDE4_KDECONFIG_EXECUTABLE) @@ -74,9 +74,9 @@ if(NOT KDE4_DATA_DIR) file(TO_CMAKE_PATH "${_data_DIR}" _data_DIR) # then check the data dirs for FindKDE4Internal.cmake find_path(KDE4_DATA_DIR cmake/modules/FindKDE4Internal.cmake HINTS ${_data_DIR}) - endif(KDE4_KDECONFIG_EXECUTABLE) - endif(CMAKE_CROSSCOMPILING) -endif(NOT KDE4_DATA_DIR) + endif() + endif() +endif() # if it has been found... if (KDE4_DATA_DIR) @@ -85,16 +85,16 @@ if (KDE4_DATA_DIR) if (KDE4_FIND_QUIETLY) set(_quiet QUIET) - endif (KDE4_FIND_QUIETLY) + endif () if (KDE4_FIND_REQUIRED) set(_req REQUIRED) - endif (KDE4_FIND_REQUIRED) + endif () # use FindKDE4Internal.cmake to do the rest find_package(KDE4Internal ${_req} ${_quiet}) -else (KDE4_DATA_DIR) +else () if (KDE4_FIND_REQUIRED) message(FATAL_ERROR "ERROR: cmake/modules/FindKDE4Internal.cmake not found in ${_data_DIR}") - endif (KDE4_FIND_REQUIRED) -endif (KDE4_DATA_DIR) + endif () +endif () diff --git a/Modules/FindLAPACK.cmake b/Modules/FindLAPACK.cmake index b867f21..430e45f 100644 --- a/Modules/FindLAPACK.cmake +++ b/Modules/FindLAPACK.cmake @@ -41,9 +41,9 @@ set(_lapack_ORIG_CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES}) get_property(_LANGUAGES_ GLOBAL PROPERTY ENABLED_LANGUAGES) if (NOT _LANGUAGES_ MATCHES Fortran) include(CheckFunctionExists) -else (NOT _LANGUAGES_ MATCHES Fortran) +else () include(CheckFortranFunctionExists) -endif (NOT _LANGUAGES_ MATCHES Fortran) +endif () set(LAPACK_FOUND FALSE) set(LAPACK95_FOUND FALSE) @@ -81,18 +81,18 @@ foreach(_library ${_list}) if (BLA_STATIC) if (WIN32) set(CMAKE_FIND_LIBRARY_SUFFIXES .lib ${CMAKE_FIND_LIBRARY_SUFFIXES}) - endif ( WIN32 ) + endif () if (APPLE) set(CMAKE_FIND_LIBRARY_SUFFIXES .lib ${CMAKE_FIND_LIBRARY_SUFFIXES}) - else (APPLE) + else () set(CMAKE_FIND_LIBRARY_SUFFIXES .a ${CMAKE_FIND_LIBRARY_SUFFIXES}) - endif (APPLE) - else (BLA_STATIC) + endif () + else () if (CMAKE_SYSTEM_NAME STREQUAL "Linux") # for ubuntu's libblas3gf and liblapack3gf packages set(CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES} .so.3gf) endif () - endif (BLA_STATIC) + endif () find_library(${_prefix}_${_library}_LIBRARY NAMES ${_library} PATHS ${_libdir} @@ -100,35 +100,35 @@ foreach(_library ${_list}) mark_as_advanced(${_prefix}_${_library}_LIBRARY) set(${LIBRARIES} ${${LIBRARIES}} ${${_prefix}_${_library}_LIBRARY}) set(_libraries_work ${${_prefix}_${_library}_LIBRARY}) - endif(_libraries_work) -endforeach(_library ${_list}) + endif() +endforeach() if(_libraries_work) # Test this combination of libraries. if(UNIX AND BLA_STATIC) set(CMAKE_REQUIRED_LIBRARIES ${_flags} "-Wl,--start-group" ${${LIBRARIES}} ${_blas} "-Wl,--end-group" ${_threads}) - else(UNIX AND BLA_STATIC) + else() set(CMAKE_REQUIRED_LIBRARIES ${_flags} ${${LIBRARIES}} ${_blas} ${_threads}) - endif(UNIX AND BLA_STATIC) + endif() # message("DEBUG: CMAKE_REQUIRED_LIBRARIES = ${CMAKE_REQUIRED_LIBRARIES}") if (NOT _LANGUAGES_ MATCHES Fortran) check_function_exists("${_name}_" ${_prefix}${_combined_name}_WORKS) - else (NOT _LANGUAGES_ MATCHES Fortran) + else () check_fortran_function_exists(${_name} ${_prefix}${_combined_name}_WORKS) - endif (NOT _LANGUAGES_ MATCHES Fortran) + endif () set(CMAKE_REQUIRED_LIBRARIES) mark_as_advanced(${_prefix}${_combined_name}_WORKS) set(_libraries_work ${${_prefix}${_combined_name}_WORKS}) #message("DEBUG: ${LIBRARIES} = ${${LIBRARIES}}") -endif(_libraries_work) +endif() if(_libraries_work) set(${LIBRARIES} ${${LIBRARIES}} ${_blas} ${_threads}) - else(_libraries_work) + else() set(${LIBRARIES} FALSE) - endif(_libraries_work) + endif() -endmacro(Check_Lapack_Libraries) +endmacro() set(LAPACK_LINKER_FLAGS) @@ -138,20 +138,20 @@ set(LAPACK95_LIBRARIES) if(LAPACK_FIND_QUIETLY OR NOT LAPACK_FIND_REQUIRED) find_package(BLAS) -else(LAPACK_FIND_QUIETLY OR NOT LAPACK_FIND_REQUIRED) +else() find_package(BLAS REQUIRED) -endif(LAPACK_FIND_QUIETLY OR NOT LAPACK_FIND_REQUIRED) +endif() if(BLAS_FOUND) set(LAPACK_LINKER_FLAGS ${BLAS_LINKER_FLAGS}) if ($ENV{BLA_VENDOR} MATCHES ".+") set(BLA_VENDOR $ENV{BLA_VENDOR}) - else ($ENV{BLA_VENDOR} MATCHES ".+") + else () if(NOT BLA_VENDOR) set(BLA_VENDOR "All") - endif(NOT BLA_VENDOR) - endif ($ENV{BLA_VENDOR} MATCHES ".+") + endif() + endif () if (BLA_VENDOR STREQUAL "Goto" OR BLA_VENDOR STREQUAL "All") if(NOT LAPACK_LIBRARIES) @@ -164,8 +164,8 @@ if (BLA_VENDOR STREQUAL "Goto" OR BLA_VENDOR STREQUAL "All") "${BLAS_LIBRARIES}" "" ) - endif(NOT LAPACK_LIBRARIES) -endif (BLA_VENDOR STREQUAL "Goto" OR BLA_VENDOR STREQUAL "All") + endif() +endif () #acml lapack @@ -187,8 +187,8 @@ if (BLA_VENDOR STREQUAL "Apple" OR BLA_VENDOR STREQUAL "All") "${BLAS_LIBRARIES}" "" ) - endif(NOT LAPACK_LIBRARIES) -endif (BLA_VENDOR STREQUAL "Apple" OR BLA_VENDOR STREQUAL "All") + endif() +endif () if (BLA_VENDOR STREQUAL "NAS" OR BLA_VENDOR STREQUAL "All") if ( NOT LAPACK_LIBRARIES ) check_lapack_libraries( @@ -200,8 +200,8 @@ if (BLA_VENDOR STREQUAL "NAS" OR BLA_VENDOR STREQUAL "All") "${BLAS_LIBRARIES}" "" ) - endif ( NOT LAPACK_LIBRARIES ) -endif (BLA_VENDOR STREQUAL "NAS" OR BLA_VENDOR STREQUAL "All") + endif () +endif () # Generic LAPACK library? if (BLA_VENDOR STREQUAL "Generic" OR BLA_VENDOR STREQUAL "ATLAS" OR @@ -216,7 +216,7 @@ if (BLA_VENDOR STREQUAL "Generic" OR "${BLAS_LIBRARIES}" "" ) - endif ( NOT LAPACK_LIBRARIES ) + endif () endif () #intel lapack if (BLA_VENDOR MATCHES "Intel*" OR BLA_VENDOR STREQUAL "All") @@ -226,9 +226,9 @@ if (BLA_VENDOR MATCHES "Intel*" OR BLA_VENDOR STREQUAL "All") if (_LANGUAGES_ MATCHES C OR _LANGUAGES_ MATCHES CXX) if(LAPACK_FIND_QUIETLY OR NOT LAPACK_FIND_REQUIRED) find_PACKAGE(Threads) - else(LAPACK_FIND_QUIETLY OR NOT LAPACK_FIND_REQUIRED) + else() find_package(Threads REQUIRED) - endif(LAPACK_FIND_QUIETLY OR NOT LAPACK_FIND_REQUIRED) + endif() if (BLA_F95) if(NOT LAPACK95_LIBRARIES) # old @@ -241,7 +241,7 @@ if (BLA_VENDOR MATCHES "Intel*" OR BLA_VENDOR STREQUAL "All") "${BLAS95_LIBRARIES}" "${CMAKE_THREAD_LIBS_INIT};${LM}" ) - endif(NOT LAPACK95_LIBRARIES) + endif() if(NOT LAPACK95_LIBRARIES) # new >= 10.3 check_lapack_libraries( @@ -253,8 +253,8 @@ if (BLA_VENDOR MATCHES "Intel*" OR BLA_VENDOR STREQUAL "All") "${BLAS95_LIBRARIES}" "${CMAKE_THREAD_LIBS_INIT};${LM}" ) - endif(NOT LAPACK95_LIBRARIES) - else(BLA_F95) + endif() + else() if(NOT LAPACK_LIBRARIES) # old check_lapack_libraries( @@ -266,7 +266,7 @@ if (BLA_VENDOR MATCHES "Intel*" OR BLA_VENDOR STREQUAL "All") "${BLAS_LIBRARIES}" "${CMAKE_THREAD_LIBS_INIT};${LM}" ) - endif(NOT LAPACK_LIBRARIES) + endif() if(NOT LAPACK_LIBRARIES) # new >= 10.3 check_lapack_libraries( @@ -278,59 +278,59 @@ if (BLA_VENDOR MATCHES "Intel*" OR BLA_VENDOR STREQUAL "All") "${BLAS_LIBRARIES}" "${CMAKE_THREAD_LIBS_INIT};${LM}" ) - endif(NOT LAPACK_LIBRARIES) - endif(BLA_F95) - endif (_LANGUAGES_ MATCHES C OR _LANGUAGES_ MATCHES CXX) -endif(BLA_VENDOR MATCHES "Intel*" OR BLA_VENDOR STREQUAL "All") -else(BLAS_FOUND) + endif() + endif() + endif () +endif() +else() message(STATUS "LAPACK requires BLAS") -endif(BLAS_FOUND) +endif() if(BLA_F95) if(LAPACK95_LIBRARIES) set(LAPACK95_FOUND TRUE) - else(LAPACK95_LIBRARIES) + else() set(LAPACK95_FOUND FALSE) - endif(LAPACK95_LIBRARIES) + endif() if(NOT LAPACK_FIND_QUIETLY) if(LAPACK95_FOUND) message(STATUS "A library with LAPACK95 API found.") - else(LAPACK95_FOUND) + else() if(LAPACK_FIND_REQUIRED) message(FATAL_ERROR "A required library with LAPACK95 API not found. Please specify library location." ) - else(LAPACK_FIND_REQUIRED) + else() message(STATUS "A library with LAPACK95 API not found. Please specify library location." ) - endif(LAPACK_FIND_REQUIRED) - endif(LAPACK95_FOUND) - endif(NOT LAPACK_FIND_QUIETLY) + endif() + endif() + endif() set(LAPACK_FOUND "${LAPACK95_FOUND}") set(LAPACK_LIBRARIES "${LAPACK95_LIBRARIES}") -else(BLA_F95) +else() if(LAPACK_LIBRARIES) set(LAPACK_FOUND TRUE) - else(LAPACK_LIBRARIES) + else() set(LAPACK_FOUND FALSE) - endif(LAPACK_LIBRARIES) + endif() if(NOT LAPACK_FIND_QUIETLY) if(LAPACK_FOUND) message(STATUS "A library with LAPACK API found.") - else(LAPACK_FOUND) + else() if(LAPACK_FIND_REQUIRED) message(FATAL_ERROR "A required library with LAPACK API not found. Please specify library location." ) - else(LAPACK_FIND_REQUIRED) + else() message(STATUS "A library with LAPACK API not found. Please specify library location." ) - endif(LAPACK_FIND_REQUIRED) - endif(LAPACK_FOUND) - endif(NOT LAPACK_FIND_QUIETLY) -endif(BLA_F95) + endif() + endif() + endif() +endif() set(CMAKE_FIND_LIBRARY_SUFFIXES ${_lapack_ORIG_CMAKE_FIND_LIBRARY_SUFFIXES}) diff --git a/Modules/FindLATEX.cmake b/Modules/FindLATEX.cmake index 0202727..bc752a9 100644 --- a/Modules/FindLATEX.cmake +++ b/Modules/FindLATEX.cmake @@ -58,7 +58,7 @@ if (WIN32) ) mark_as_advanced(GHOSTSCRIPT_LIBRARY_PATH) -endif (WIN32) +endif () find_program(LATEX_COMPILER NAMES latex @@ -101,11 +101,11 @@ if (WIN32) NAMES ps2pdf14.bat PATHS ${GHOSTSCRIPT_LIBRARY_PATH} ) -else (WIN32) +else () find_program(PS2PDF_CONVERTER NAMES ps2pdf14 ps2pdf ) -endif (WIN32) +endif () find_program(LATEX2HTML_CONVERTER NAMES latex2html diff --git a/Modules/FindLibLZMA.cmake b/Modules/FindLibLZMA.cmake index 852d613..37cace8 100644 --- a/Modules/FindLibLZMA.cmake +++ b/Modules/FindLibLZMA.cmake @@ -40,7 +40,7 @@ if(LIBLZMA_INCLUDE_DIR AND EXISTS "${LIBLZMA_INCLUDE_DIR}/lzma/version.h") string(REGEX REPLACE ".*#define LZMA_VERSION_PATCH ([0-9]+).*" "\\1" LIBLZMA_VERSION_PATCH "${LIBLZMA_HEADER_CONTENTS}") set(LIBLZMA_VERSION_STRING "${LIBLZMA_VERSION_MAJOR}.${LIBLZMA_VERSION_MINOR}.${LIBLZMA_VERSION_PATCH}") -endif(LIBLZMA_INCLUDE_DIR AND EXISTS "${LIBLZMA_INCLUDE_DIR}/lzma/version.h") +endif() # We're using new code known now as XZ, even library still been called LZMA # it can be found in http://tukaani.org/xz/ @@ -50,7 +50,7 @@ if (LIBLZMA_LIBRARY) CHECK_LIBRARY_EXISTS(${LIBLZMA_LIBRARY} lzma_auto_decoder "" LIBLZMA_HAS_AUTO_DECODER) CHECK_LIBRARY_EXISTS(${LIBLZMA_LIBRARY} lzma_easy_encoder "" LIBLZMA_HAS_EASY_ENCODER) CHECK_LIBRARY_EXISTS(${LIBLZMA_LIBRARY} lzma_lzma_preset "" LIBLZMA_HAS_LZMA_PRESET) -endif (LIBLZMA_LIBRARY) +endif () include(FindPackageHandleStandardArgs) FIND_PACKAGE_HANDLE_STANDARD_ARGS(LibLZMA REQUIRED_VARS LIBLZMA_INCLUDE_DIR @@ -64,6 +64,6 @@ FIND_PACKAGE_HANDLE_STANDARD_ARGS(LibLZMA REQUIRED_VARS LIBLZMA_INCLUDE_DIR if (LIBLZMA_FOUND) set(LIBLZMA_LIBRARIES ${LIBLZMA_LIBRARY}) set(LIBLZMA_INCLUDE_DIRS ${LIBLZMA_INCLUDE_DIR}) -endif (LIBLZMA_FOUND) +endif () mark_as_advanced( LIBLZMA_INCLUDE_DIR LIBLZMA_LIBRARY ) diff --git a/Modules/FindLua50.cmake b/Modules/FindLua50.cmake index cfe2e72..2b8ee97 100644 --- a/Modules/FindLua50.cmake +++ b/Modules/FindLua50.cmake @@ -55,7 +55,7 @@ find_library(LUA_LIBRARY_lua # (like GLU in OpenGL.framework) if(${LUA_LIBRARY_lua} MATCHES "framework") set( LUA_LIBRARIES "${LUA_LIBRARY_lua}" CACHE STRING "Lua framework") -else(${LUA_LIBRARY_lua} MATCHES "framework") +else() find_library(LUA_LIBRARY_lualib NAMES lualib50 lualib5.0 lualib5 lualib HINTS @@ -74,11 +74,11 @@ else(${LUA_LIBRARY_lua} MATCHES "framework") find_library(MATH_LIBRARY_FOR_LUA m) set( LUA_LIBRARIES "${LUA_LIBRARY_lualib};${LUA_LIBRARY_lua};${MATH_LIBRARY_FOR_LUA}" CACHE STRING "This is the concatentation of lua and lualib libraries") # For Windows and Mac, don't need to explicitly include the math library - else(UNIX AND NOT APPLE) + else() set( LUA_LIBRARIES "${LUA_LIBRARY_lualib};${LUA_LIBRARY_lua}" CACHE STRING "This is the concatentation of lua and lualib libraries") - endif(UNIX AND NOT APPLE) - endif(LUA_LIBRARY_lualib AND LUA_LIBRARY_lua) -endif(${LUA_LIBRARY_lua} MATCHES "framework") + endif() + endif() +endif() include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake) diff --git a/Modules/FindLua51.cmake b/Modules/FindLua51.cmake index 2d189e4..b5a5471 100644 --- a/Modules/FindLua51.cmake +++ b/Modules/FindLua51.cmake @@ -58,10 +58,10 @@ if(LUA_LIBRARY) find_library(LUA_MATH_LIBRARY m) set( LUA_LIBRARIES "${LUA_LIBRARY};${LUA_MATH_LIBRARY}" CACHE STRING "Lua Libraries") # For Windows and Mac, don't need to explicitly include the math library - else(UNIX AND NOT APPLE) + else() set( LUA_LIBRARIES "${LUA_LIBRARY}" CACHE STRING "Lua Libraries") - endif(UNIX AND NOT APPLE) -endif(LUA_LIBRARY) + endif() +endif() if(LUA_INCLUDE_DIR AND EXISTS "${LUA_INCLUDE_DIR}/lua.h") file(STRINGS "${LUA_INCLUDE_DIR}/lua.h" lua_version_str REGEX "^#define[ \t]+LUA_RELEASE[ \t]+\"Lua .+\"") diff --git a/Modules/FindMFC.cmake b/Modules/FindMFC.cmake index f45046d..4ff7586 100644 --- a/Modules/FindMFC.cmake +++ b/Modules/FindMFC.cmake @@ -24,7 +24,7 @@ set(MFC_FOUND "NO") set(MFC_ATTEMPT_TRY_COMPILE 0) if(WIN32 AND NOT UNIX AND NOT BORLAND AND NOT MINGW) set(MFC_ATTEMPT_TRY_COMPILE 1) -endif(WIN32 AND NOT UNIX AND NOT BORLAND AND NOT MINGW) +endif() if(MFC_ATTEMPT_TRY_COMPILE) if("MFC_HAVE_MFC" MATCHES "^MFC_HAVE_MFC$") @@ -45,16 +45,16 @@ if(MFC_ATTEMPT_TRY_COMPILE) file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log "Determining if MFC exists passed with the following output:\n" "${OUTPUT}\n\n") - else(MFC_HAVE_MFC) + else() message(STATUS "Looking for MFC - not found") set(MFC_HAVE_MFC 0 CACHE INTERNAL "Have MFC?") file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log "Determining if MFC exists failed with the following output:\n" "${OUTPUT}\n\n") - endif(MFC_HAVE_MFC) - endif("MFC_HAVE_MFC" MATCHES "^MFC_HAVE_MFC$") + endif() + endif() if(MFC_HAVE_MFC) set(MFC_FOUND "YES") - endif(MFC_HAVE_MFC) -endif(MFC_ATTEMPT_TRY_COMPILE) + endif() +endif() diff --git a/Modules/FindMPEG.cmake b/Modules/FindMPEG.cmake index 698329e..f99f87b 100644 --- a/Modules/FindMPEG.cmake +++ b/Modules/FindMPEG.cmake @@ -39,6 +39,6 @@ FIND_PACKAGE_HANDLE_STANDARD_ARGS(MPEG DEFAULT_MSG MPEG_INCLUDE_DIR MPEG_mpeg2_L if(MPEG_FOUND) set( MPEG_LIBRARIES ${MPEG_mpeg2_LIBRARY} ${MPEG_vo_LIBRARY} ) -endif(MPEG_FOUND) +endif() mark_as_advanced(MPEG_INCLUDE_DIR MPEG_mpeg2_LIBRARY MPEG_vo_LIBRARY) diff --git a/Modules/FindMPEG2.cmake b/Modules/FindMPEG2.cmake index 153ed7f..0290eca 100644 --- a/Modules/FindMPEG2.cmake +++ b/Modules/FindMPEG2.cmake @@ -48,7 +48,7 @@ if(MPEG2_FOUND) include( FindSDL ) if(SDL_FOUND) set( MPEG2_LIBRARIES ${MPEG2_LIBRARIES} ${SDL_LIBRARY}) - endif(SDL_FOUND) -endif(MPEG2_FOUND) + endif() +endif() mark_as_advanced(MPEG2_INCLUDE_DIR MPEG2_mpeg2_LIBRARY MPEG2_vo_LIBRARY) diff --git a/Modules/FindMatlab.cmake b/Modules/FindMatlab.cmake index 20dc1da..8038488 100644 --- a/Modules/FindMatlab.cmake +++ b/Modules/FindMatlab.cmake @@ -23,22 +23,22 @@ set(MATLAB_FOUND 0) if(WIN32) if(${CMAKE_GENERATOR} MATCHES "Visual Studio 6") set(MATLAB_ROOT "[HKEY_LOCAL_MACHINE\\SOFTWARE\\MathWorks\\MATLAB\\7.0;MATLABROOT]/extern/lib/win32/microsoft/msvc60") - else(${CMAKE_GENERATOR} MATCHES "Visual Studio 6") + else() if(${CMAKE_GENERATOR} MATCHES "Visual Studio 7") # Assume people are generally using 7.1, # if using 7.0 need to link to: ../extern/lib/win32/microsoft/msvc70 set(MATLAB_ROOT "[HKEY_LOCAL_MACHINE\\SOFTWARE\\MathWorks\\MATLAB\\7.0;MATLABROOT]/extern/lib/win32/microsoft/msvc71") - else(${CMAKE_GENERATOR} MATCHES "Visual Studio 7") + else() if(${CMAKE_GENERATOR} MATCHES "Borland") # Same here, there are also: bcc50 and bcc51 directories set(MATLAB_ROOT "[HKEY_LOCAL_MACHINE\\SOFTWARE\\MathWorks\\MATLAB\\7.0;MATLABROOT]/extern/lib/win32/microsoft/bcc54") - else(${CMAKE_GENERATOR} MATCHES "Borland") + else() if(MATLAB_FIND_REQUIRED) message(FATAL_ERROR "Generator not compatible: ${CMAKE_GENERATOR}") - endif(MATLAB_FIND_REQUIRED) - endif(${CMAKE_GENERATOR} MATCHES "Borland") - endif(${CMAKE_GENERATOR} MATCHES "Visual Studio 7") - endif(${CMAKE_GENERATOR} MATCHES "Visual Studio 6") + endif() + endif() + endif() + endif() find_library(MATLAB_MEX_LIBRARY libmex ${MATLAB_ROOT} @@ -56,7 +56,7 @@ if(WIN32) "mex.h" "[HKEY_LOCAL_MACHINE\\SOFTWARE\\MathWorks\\MATLAB\\7.0;MATLABROOT]/extern/include" ) -else( WIN32 ) +else() if(CMAKE_SIZEOF_VOID_P EQUAL 4) # Regular x86 set(MATLAB_ROOT @@ -65,7 +65,7 @@ else( WIN32 ) $ENV{HOME}/matlab-7sp1/bin/glnx86/ $ENV{HOME}/redhat-matlab/bin/glnx86/ ) - else(CMAKE_SIZEOF_VOID_P EQUAL 4) + else() # AMD64: set(MATLAB_ROOT /usr/local/matlab-7sp1/bin/glnxa64/ @@ -74,7 +74,7 @@ else( WIN32 ) $ENV{HOME}/matlab-7sp1/bin/glnxa64/ $ENV{HOME}/redhat-matlab/bin/glnxa64/ ) - endif(CMAKE_SIZEOF_VOID_P EQUAL 4) + endif() find_library(MATLAB_MEX_LIBRARY mex ${MATLAB_ROOT} @@ -95,7 +95,7 @@ else( WIN32 ) "$ENV{HOME}/redhat-matlab/extern/include/" ) -endif(WIN32) +endif() # This is common to UNIX and Win32: set(MATLAB_LIBRARIES @@ -106,7 +106,7 @@ set(MATLAB_LIBRARIES if(MATLAB_INCLUDE_DIR AND MATLAB_LIBRARIES) set(MATLAB_FOUND 1) -endif(MATLAB_INCLUDE_DIR AND MATLAB_LIBRARIES) +endif() mark_as_advanced( MATLAB_LIBRARIES diff --git a/Modules/FindMotif.cmake b/Modules/FindMotif.cmake index 5b7e6a1..5065e3a 100644 --- a/Modules/FindMotif.cmake +++ b/Modules/FindMotif.cmake @@ -30,7 +30,7 @@ if(UNIX) /usr/openwin/lib ) -endif(UNIX) +endif() # handle the QUIETLY and REQUIRED arguments and set MOTIF_FOUND to TRUE if # all listed variables are TRUE diff --git a/Modules/FindOpenGL.cmake b/Modules/FindOpenGL.cmake index 1565011..a6f4503 100644 --- a/Modules/FindOpenGL.cmake +++ b/Modules/FindOpenGL.cmake @@ -37,19 +37,19 @@ if (WIN32) find_library(OPENGL_glu_LIBRARY glu32 ) - else (CYGWIN) + else () if(BORLAND) set (OPENGL_gl_LIBRARY import32 CACHE STRING "OpenGL library for win32") set (OPENGL_glu_LIBRARY import32 CACHE STRING "GLU library for win32") - else(BORLAND) + else() set (OPENGL_gl_LIBRARY opengl32 CACHE STRING "OpenGL library for win32") set (OPENGL_glu_LIBRARY glu32 CACHE STRING "GLU library for win32") - endif(BORLAND) + endif() - endif (CYGWIN) + endif () -else (WIN32) +else () if (APPLE) @@ -57,16 +57,16 @@ else (WIN32) find_library(OPENGL_glu_LIBRARY AGL DOC "AGL lib for OSX") find_path(OPENGL_INCLUDE_DIR OpenGL/gl.h DOC "Include for OpenGL on OSX") - else(APPLE) + else() # Handle HP-UX cases where we only want to find OpenGL in either hpux64 # or hpux32 depending on if we're doing a 64 bit build. if(CMAKE_SIZEOF_VOID_P EQUAL 4) set(HPUX_IA_OPENGL_LIB_PATH /opt/graphics/OpenGL/lib/hpux32/) - else(CMAKE_SIZEOF_VOID_P EQUAL 4) + else() set(HPUX_IA_OPENGL_LIB_PATH /opt/graphics/OpenGL/lib/hpux64/ /opt/graphics/OpenGL/lib/pa20_64) - endif(CMAKE_SIZEOF_VOID_P EQUAL 4) + endif() # The first line below is to make sure that the proper headers # are used on a Linux machine with the NVidia drivers installed. @@ -104,13 +104,13 @@ else (WIN32) if (OPENGL_gl_LIBRARY) if(NOT X11_FOUND) include(FindX11) - endif(NOT X11_FOUND) + endif() if (X11_FOUND) if (NOT APPLE) set (OPENGL_LIBRARIES ${X11_LIBRARIES}) - endif (NOT APPLE) - endif (X11_FOUND) - endif (OPENGL_gl_LIBRARY) + endif () + endif () + endif () find_library(OPENGL_glu_LIBRARY NAMES GLU MesaGLU @@ -120,29 +120,29 @@ else (WIN32) /usr/shlib /usr/X11R6/lib ) - endif(APPLE) -endif (WIN32) + endif() +endif () if(OPENGL_gl_LIBRARY) if(OPENGL_xmesa_INCLUDE_DIR) set( OPENGL_XMESA_FOUND "YES" ) - else(OPENGL_xmesa_INCLUDE_DIR) + else() set( OPENGL_XMESA_FOUND "NO" ) - endif(OPENGL_xmesa_INCLUDE_DIR) + endif() set( OPENGL_LIBRARIES ${OPENGL_gl_LIBRARY} ${OPENGL_LIBRARIES}) if(OPENGL_glu_LIBRARY) set( OPENGL_GLU_FOUND "YES" ) set( OPENGL_LIBRARIES ${OPENGL_glu_LIBRARY} ${OPENGL_LIBRARIES} ) - else(OPENGL_glu_LIBRARY) + else() set( OPENGL_GLU_FOUND "NO" ) - endif(OPENGL_glu_LIBRARY) + endif() # This deprecated setting is for backward compatibility with CMake1.4 set (OPENGL_LIBRARY ${OPENGL_LIBRARIES}) -endif(OPENGL_gl_LIBRARY) +endif() # This deprecated setting is for backward compatibility with CMake1.4 set(OPENGL_INCLUDE_PATH ${OPENGL_INCLUDE_DIR}) diff --git a/Modules/FindOpenMP.cmake b/Modules/FindOpenMP.cmake index 87c9d03..ad15d8c 100644 --- a/Modules/FindOpenMP.cmake +++ b/Modules/FindOpenMP.cmake @@ -72,7 +72,7 @@ function(_OPENMP_FLAG_CANDIDATES LANG) endif() set(OpenMP_${LANG}_FLAG_CANDIDATES "${OpenMP_FLAG_CANDIDATES}" PARENT_SCOPE) -endfunction(_OPENMP_FLAG_CANDIDATES) +endfunction() # sample openmp source code to test set(OpenMP_C_TEST_SOURCE @@ -108,8 +108,8 @@ if(CMAKE_C_COMPILER_LOADED) if(OpenMP_FLAG_DETECTED) set(OpenMP_C_FLAGS_INTERNAL "${FLAG}") break() - endif(OpenMP_FLAG_DETECTED) - endforeach(FLAG ${OpenMP_C_FLAG_CANDIDATES}) + endif() + endforeach() set(OpenMP_C_FLAGS "${OpenMP_C_FLAGS_INTERNAL}" CACHE STRING "C compiler flags for OpenMP parallization") @@ -142,8 +142,8 @@ if(CMAKE_CXX_COMPILER_LOADED) if(OpenMP_FLAG_DETECTED) set(OpenMP_CXX_FLAGS_INTERNAL "${FLAG}") break() - endif(OpenMP_FLAG_DETECTED) - endforeach(FLAG ${OpenMP_CXX_FLAG_CANDIDATES}) + endif() + endforeach() set(OpenMP_CXX_FLAGS "${OpenMP_CXX_FLAGS_INTERNAL}" CACHE STRING "C++ compiler flags for OpenMP parallization") diff --git a/Modules/FindOpenSSL.cmake b/Modules/FindOpenSSL.cmake index b812b22..e2cc427 100644 --- a/Modules/FindOpenSSL.cmake +++ b/Modules/FindOpenSSL.cmake @@ -27,7 +27,7 @@ if (UNIX) find_package(PkgConfig QUIET) pkg_check_modules(_OPENSSL QUIET openssl) -endif (UNIX) +endif () if (WIN32) # http://www.slproweb.com/products/Win32OpenSSL.html @@ -162,7 +162,7 @@ if(WIN32 AND NOT CYGWIN) set( OPENSSL_LIBRARIES ${SSL_EAY} ${LIB_EAY} ) unset(LIB_EAY_NAMES) unset(SSL_EAY_NAMES) - else(MSVC) + else() # Not sure what to pick for -say- intel, let's use the toplevel ones and hope someone report issues: find_library(LIB_EAY NAMES @@ -186,8 +186,8 @@ if(WIN32 AND NOT CYGWIN) mark_as_advanced(SSL_EAY LIB_EAY) set( OPENSSL_LIBRARIES ${SSL_EAY} ${LIB_EAY} ) - endif(MSVC) -else(WIN32 AND NOT CYGWIN) + endif() +else() find_library(OPENSSL_SSL_LIBRARY NAMES @@ -219,7 +219,7 @@ else(WIN32 AND NOT CYGWIN) set(OPENSSL_LIBRARIES ${OPENSSL_SSL_LIBRARY} ${OPENSSL_CRYPTO_LIBRARY}) -endif(WIN32 AND NOT CYGWIN) +endif() function(from_hex HEX DEC) string(TOUPPER "${HEX}" HEX) @@ -250,7 +250,7 @@ function(from_hex HEX DEC) endwhile() set(${DEC} ${_res} PARENT_SCOPE) -endfunction(from_hex) +endfunction() if (OPENSSL_INCLUDE_DIR) if (_OPENSSL_VERSION) @@ -284,11 +284,11 @@ if (OPENSSL_INCLUDE_DIR) # this should be updated to handle that, too. This has not happened yet # so it is simply ignored here for now. string(ASCII "${OPENSSL_VERSION_PATCH_ASCII}" OPENSSL_VERSION_PATCH_STRING) - endif (NOT OPENSSL_VERSION_PATCH STREQUAL "00") + endif () set(OPENSSL_VERSION "${OPENSSL_VERSION_MAJOR}.${OPENSSL_VERSION_MINOR}.${OPENSSL_VERSION_FIX}${OPENSSL_VERSION_PATCH_STRING}") - endif (_OPENSSL_VERSION) -endif (OPENSSL_INCLUDE_DIR) + endif () +endif () include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake) @@ -302,11 +302,11 @@ if (OPENSSL_VERSION) FAIL_MESSAGE "Could NOT find OpenSSL, try to set the path to OpenSSL root folder in the system variable OPENSSL_ROOT_DIR" ) -else (OPENSSL_VERSION) +else () find_package_handle_standard_args(OpenSSL "Could NOT find OpenSSL, try to set the path to OpenSSL root folder in the system variable OPENSSL_ROOT_DIR" OPENSSL_LIBRARIES OPENSSL_INCLUDE_DIR ) -endif (OPENSSL_VERSION) +endif () mark_as_advanced(OPENSSL_INCLUDE_DIR OPENSSL_LIBRARIES) diff --git a/Modules/FindPHP4.cmake b/Modules/FindPHP4.cmake index 2c6a7c8..4267ac1 100644 --- a/Modules/FindPHP4.cmake +++ b/Modules/FindPHP4.cmake @@ -39,9 +39,9 @@ if(PHP4_FOUND_INCLUDE_PATH) set(php4_paths "${PHP4_POSSIBLE_INCLUDE_PATHS}") foreach(php4_path Zend main TSRM) set(php4_paths ${php4_paths} "${PHP4_FOUND_INCLUDE_PATH}/${php4_path}") - endforeach(php4_path Zend main TSRM) + endforeach() set(PHP4_INCLUDE_PATH "${php4_paths}" INTERNAL "PHP4 include paths") -endif(PHP4_FOUND_INCLUDE_PATH) +endif() find_program(PHP4_EXECUTABLE NAMES php4 php ) @@ -78,8 +78,8 @@ if(APPLE) ) set(CMAKE_SHARED_MODULE_CREATE_C_FLAGS "${CMAKE_SHARED_MODULE_CREATE_C_FLAGS},-U,${symbol}") - endforeach(symbol) -endif(APPLE) + endforeach() +endif() include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake) FIND_PACKAGE_HANDLE_STANDARD_ARGS(PHP4 DEFAULT_MSG PHP4_EXECUTABLE PHP4_INCLUDE_PATH) diff --git a/Modules/FindPNG.cmake b/Modules/FindPNG.cmake index 50cb7d8..d96d2cc 100644 --- a/Modules/FindPNG.cmake +++ b/Modules/FindPNG.cmake @@ -30,7 +30,7 @@ if(PNG_FIND_QUIETLY) set(_FIND_ZLIB_ARG QUIET) -endif(PNG_FIND_QUIETLY) +endif() find_package(ZLIB ${_FIND_ZLIB_ARG}) if(ZLIB_FOUND) @@ -50,20 +50,20 @@ if(ZLIB_FOUND) if (CYGWIN) if(BUILD_SHARED_LIBS) # No need to define PNG_USE_DLL here, because it's default for Cygwin. - else(BUILD_SHARED_LIBS) + else() set (PNG_DEFINITIONS -DPNG_STATIC) - endif(BUILD_SHARED_LIBS) - endif (CYGWIN) + endif() + endif () - endif (PNG_LIBRARY AND PNG_PNG_INCLUDE_DIR) + endif () if (PNG_PNG_INCLUDE_DIR AND EXISTS "${PNG_PNG_INCLUDE_DIR}/png.h") file(STRINGS "${PNG_PNG_INCLUDE_DIR}/png.h" png_version_str REGEX "^#define[ \t]+PNG_LIBPNG_VER_STRING[ \t]+\".+\"") string(REGEX REPLACE "^#define[ \t]+PNG_LIBPNG_VER_STRING[ \t]+\"([^\"]+)\".*" "\\1" PNG_VERSION_STRING "${png_version_str}") unset(png_version_str) - endif (PNG_PNG_INCLUDE_DIR AND EXISTS "${PNG_PNG_INCLUDE_DIR}/png.h") -endif(ZLIB_FOUND) + endif () +endif() # handle the QUIETLY and REQUIRED arguments and set PNG_FOUND to TRUE if # all listed variables are TRUE diff --git a/Modules/FindPackageHandleStandardArgs.cmake b/Modules/FindPackageHandleStandardArgs.cmake index 1dd8652..449fd9f 100644 --- a/Modules/FindPackageHandleStandardArgs.cmake +++ b/Modules/FindPackageHandleStandardArgs.cmake @@ -95,12 +95,12 @@ include(CMakeParseArguments) macro(_FPHSA_FAILURE_MESSAGE _msg) if (${_NAME}_FIND_REQUIRED) message(FATAL_ERROR "${_msg}") - else (${_NAME}_FIND_REQUIRED) + else () if (NOT ${_NAME}_FIND_QUIETLY) message(STATUS "${_msg}") - endif (NOT ${_NAME}_FIND_QUIETLY) - endif (${_NAME}_FIND_REQUIRED) -endmacro(_FPHSA_FAILURE_MESSAGE _msg) + endif () + endif () +endmacro() # internal helper macro to generate the failure message when used in CONFIG_MODE: @@ -108,7 +108,7 @@ macro(_FPHSA_HANDLE_FAILURE_CONFIG_MODE) # <name>_CONFIG is set, but FOUND is false, this means that some other of the REQUIRED_VARS was not found: if(${_NAME}_CONFIG) _FPHSA_FAILURE_MESSAGE("${FPHSA_FAIL_MESSAGE}: missing: ${MISSING_VARS} (found ${${_NAME}_CONFIG} ${VERSION_MSG})") - else(${_NAME}_CONFIG) + else() # If _CONSIDERED_CONFIGS is set, the config-file has been found, but no suitable version. # List them all in the error message: if(${_NAME}_CONSIDERED_CONFIGS) @@ -119,15 +119,15 @@ macro(_FPHSA_HANDLE_FAILURE_CONFIG_MODE) list(GET ${_NAME}_CONSIDERED_CONFIGS ${currentConfigIndex} filename) list(GET ${_NAME}_CONSIDERED_VERSIONS ${currentConfigIndex} version) set(configsText "${configsText} ${filename} (version ${version})\n") - endforeach(currentConfigIndex) + endforeach() _FPHSA_FAILURE_MESSAGE("${FPHSA_FAIL_MESSAGE} ${VERSION_MSG}, checked the following files:\n${configsText}") - else(${_NAME}_CONSIDERED_CONFIGS) + else() # Simple case: No Config-file was found at all: _FPHSA_FAILURE_MESSAGE("${FPHSA_FAIL_MESSAGE}: found neither ${_NAME}Config.cmake nor ${_NAME_LOWER}-config.cmake ${VERSION_MSG}") - endif(${_NAME}_CONSIDERED_CONFIGS) - endif(${_NAME}_CONFIG) -endmacro(_FPHSA_HANDLE_FAILURE_CONFIG_MODE) + endif() + endif() +endmacro() function(FIND_PACKAGE_HANDLE_STANDARD_ARGS _NAME _FIRST_ARG) @@ -144,24 +144,24 @@ function(FIND_PACKAGE_HANDLE_STANDARD_ARGS _NAME _FIRST_ARG) set(FPHSA_FAIL_MESSAGE ${_FIRST_ARG}) set(FPHSA_REQUIRED_VARS ${ARGN}) set(FPHSA_VERSION_VAR) - else(${INDEX} EQUAL -1) + else() CMAKE_PARSE_ARGUMENTS(FPHSA "${options}" "${oneValueArgs}" "${multiValueArgs}" ${_FIRST_ARG} ${ARGN}) if(FPHSA_UNPARSED_ARGUMENTS) message(FATAL_ERROR "Unknown keywords given to FIND_PACKAGE_HANDLE_STANDARD_ARGS(): \"${FPHSA_UNPARSED_ARGUMENTS}\"") - endif(FPHSA_UNPARSED_ARGUMENTS) + endif() if(NOT FPHSA_FAIL_MESSAGE) set(FPHSA_FAIL_MESSAGE "DEFAULT_MSG") - endif(NOT FPHSA_FAIL_MESSAGE) - endif(${INDEX} EQUAL -1) + endif() + endif() # now that we collected all arguments, process them if("${FPHSA_FAIL_MESSAGE}" STREQUAL "DEFAULT_MSG") set(FPHSA_FAIL_MESSAGE "Could NOT find ${_NAME}") - endif("${FPHSA_FAIL_MESSAGE}" STREQUAL "DEFAULT_MSG") + endif() # In config-mode, we rely on the variable <package>_CONFIG, which is set by find_package() # when it successfully found the config-file, including version checking: @@ -169,11 +169,11 @@ function(FIND_PACKAGE_HANDLE_STANDARD_ARGS _NAME _FIRST_ARG) list(INSERT FPHSA_REQUIRED_VARS 0 ${_NAME}_CONFIG) list(REMOVE_DUPLICATES FPHSA_REQUIRED_VARS) set(FPHSA_VERSION_VAR ${_NAME}_VERSION) - endif(FPHSA_CONFIG_MODE) + endif() if(NOT FPHSA_REQUIRED_VARS) message(FATAL_ERROR "No REQUIRED_VARS specified for FIND_PACKAGE_HANDLE_STANDARD_ARGS()") - endif(NOT FPHSA_REQUIRED_VARS) + endif() list(GET FPHSA_REQUIRED_VARS 0 _FIRST_REQUIRED_VAR) @@ -190,10 +190,10 @@ function(FIND_PACKAGE_HANDLE_STANDARD_ARGS _NAME _FIRST_ARG) if(NOT ${_CURRENT_VAR}) set(${_NAME_UPPER}_FOUND FALSE) set(MISSING_VARS "${MISSING_VARS} ${_CURRENT_VAR}") - else(NOT ${_CURRENT_VAR}) + else() set(DETAILS "${DETAILS}[${${_CURRENT_VAR}}]") - endif(NOT ${_CURRENT_VAR}) - endforeach(_CURRENT_VAR) + endif() + endforeach() # component handling unset(FOUND_COMPONENTS_MSG) @@ -221,10 +221,10 @@ function(FIND_PACKAGE_HANDLE_STANDARD_ARGS _NAME _FIRST_ARG) endif() endif() - endforeach(comp) + endforeach() set(COMPONENT_MSG "${FOUND_COMPONENTS_MSG} ${MISSING_COMPONENTS_MSG}") set(DETAILS "${DETAILS}[c${COMPONENT_MSG}]") - endif(FPHSA_HANDLE_COMPONENTS) + endif() # version handling: set(VERSION_MSG "") @@ -238,59 +238,59 @@ function(FIND_PACKAGE_HANDLE_STANDARD_ARGS _NAME _FIRST_ARG) if (NOT "${${_NAME}_FIND_VERSION}" VERSION_EQUAL "${VERSION}") set(VERSION_MSG "Found unsuitable version \"${VERSION}\", but required is exact version \"${${_NAME}_FIND_VERSION}\"") set(VERSION_OK FALSE) - else (NOT "${${_NAME}_FIND_VERSION}" VERSION_EQUAL "${VERSION}") + else () set(VERSION_MSG "(found suitable exact version \"${VERSION}\")") - endif (NOT "${${_NAME}_FIND_VERSION}" VERSION_EQUAL "${VERSION}") + endif () - else(${_NAME}_FIND_VERSION_EXACT) # minimum version specified: + else() # minimum version specified: if ("${${_NAME}_FIND_VERSION}" VERSION_GREATER "${VERSION}") set(VERSION_MSG "Found unsuitable version \"${VERSION}\", but required is at least \"${${_NAME}_FIND_VERSION}\"") set(VERSION_OK FALSE) - else ("${${_NAME}_FIND_VERSION}" VERSION_GREATER "${VERSION}") + else () set(VERSION_MSG "(found suitable version \"${VERSION}\", required is \"${${_NAME}_FIND_VERSION}\")") - endif ("${${_NAME}_FIND_VERSION}" VERSION_GREATER "${VERSION}") - endif(${_NAME}_FIND_VERSION_EXACT) + endif () + endif() - else(VERSION) + else() # if the package was not found, but a version was given, add that to the output: if(${_NAME}_FIND_VERSION_EXACT) set(VERSION_MSG "(Required is exact version \"${${_NAME}_FIND_VERSION}\")") - else(${_NAME}_FIND_VERSION_EXACT) + else() set(VERSION_MSG "(Required is at least version \"${${_NAME}_FIND_VERSION}\")") - endif(${_NAME}_FIND_VERSION_EXACT) + endif() - endif(VERSION) - else (${_NAME}_FIND_VERSION) + endif() + else () if(VERSION) set(VERSION_MSG "(found version \"${VERSION}\")") - endif(VERSION) - endif (${_NAME}_FIND_VERSION) + endif() + endif () if(VERSION_OK) set(DETAILS "${DETAILS}[v${VERSION}(${${_NAME}_FIND_VERSION})]") - else(VERSION_OK) + else() set(${_NAME_UPPER}_FOUND FALSE) - endif(VERSION_OK) + endif() # print the result: if (${_NAME_UPPER}_FOUND) FIND_PACKAGE_MESSAGE(${_NAME} "Found ${_NAME}: ${${_FIRST_REQUIRED_VAR}} ${VERSION_MSG} ${COMPONENT_MSG}" "${DETAILS}") - else (${_NAME_UPPER}_FOUND) + else () if(FPHSA_CONFIG_MODE) _FPHSA_HANDLE_FAILURE_CONFIG_MODE() - else(FPHSA_CONFIG_MODE) + else() if(NOT VERSION_OK) _FPHSA_FAILURE_MESSAGE("${FPHSA_FAIL_MESSAGE}: ${VERSION_MSG} (found ${${_FIRST_REQUIRED_VAR}})") - else(NOT VERSION_OK) + else() _FPHSA_FAILURE_MESSAGE("${FPHSA_FAIL_MESSAGE} (missing: ${MISSING_VARS}) ${VERSION_MSG}") - endif(NOT VERSION_OK) - endif(FPHSA_CONFIG_MODE) + endif() + endif() - endif (${_NAME_UPPER}_FOUND) + endif () set(${_NAME_UPPER}_FOUND ${${_NAME_UPPER}_FOUND} PARENT_SCOPE) -endfunction(FIND_PACKAGE_HANDLE_STANDARD_ARGS _FIRST_ARG) +endfunction() diff --git a/Modules/FindPackageMessage.cmake b/Modules/FindPackageMessage.cmake index f78792d..5cea43e 100644 --- a/Modules/FindPackageMessage.cmake +++ b/Modules/FindPackageMessage.cmake @@ -14,9 +14,9 @@ # if(X11_FOUND) # FIND_PACKAGE_MESSAGE(X11 "Found X11: ${X11_X11_LIB}" # "[${X11_X11_LIB}][${X11_INCLUDE_DIR}]") -# else(X11_FOUND) +# else() # ... -# endif(X11_FOUND) +# endif() #============================================================================= # Copyright 2008-2009 Kitware, Inc. @@ -44,6 +44,6 @@ function(FIND_PACKAGE_MESSAGE pkg msg details) # message again. set("${DETAILS_VAR}" "${details}" CACHE INTERNAL "Details about finding ${pkg}") - endif(NOT "${details}" STREQUAL "${${DETAILS_VAR}}") - endif(NOT ${pkg}_FIND_QUIETLY) -endfunction(FIND_PACKAGE_MESSAGE) + endif() + endif() +endfunction() diff --git a/Modules/FindPerl.cmake b/Modules/FindPerl.cmake index 4f45da6..e908a65 100644 --- a/Modules/FindPerl.cmake +++ b/Modules/FindPerl.cmake @@ -33,7 +33,7 @@ if(WIN32) "C:/Perl/bin" [HKEY_LOCAL_MACHINE\\SOFTWARE\\ActiveState\\ActivePerl\\${ActivePerl_CurrentVersion}]/bin ) -endif(WIN32) +endif() find_program(PERL_EXECUTABLE NAMES perl @@ -68,7 +68,7 @@ if(PERL_EXECUTABLE) string(REGEX REPLACE ".*This is perl, version ([0-9\\._]+) +.*" "\\1" PERL_VERSION_STRING ${PERL_VERSION_OUTPUT_VARIABLE}) endif() endif() -endif(PERL_EXECUTABLE) +endif() # Deprecated settings for compatibility with CMake1.4 set(PERL ${PERL_EXECUTABLE}) diff --git a/Modules/FindPerlLibs.cmake b/Modules/FindPerlLibs.cmake index 101aebf..e9313ad 100644 --- a/Modules/FindPerlLibs.cmake +++ b/Modules/FindPerlLibs.cmake @@ -53,7 +53,7 @@ if (PERL_EXECUTABLE) if (NOT PERL_PREFIX_RESULT_VARIABLE) string(REGEX REPLACE "prefix='([^']+)'.*" "\\1" PERL_PREFIX ${PERL_PREFIX_OUTPUT_VARIABLE}) - endif (NOT PERL_PREFIX_RESULT_VARIABLE) + endif () ### PERL_ARCHNAME execute_process( @@ -66,7 +66,7 @@ if (PERL_EXECUTABLE) ) if (NOT PERL_ARCHNAME_RESULT_VARIABLE) string(REGEX REPLACE "archname='([^']+)'.*" "\\1" PERL_ARCHNAME ${PERL_ARCHNAME_OUTPUT_VARIABLE}) - endif (NOT PERL_ARCHNAME_RESULT_VARIABLE) + endif () @@ -81,7 +81,7 @@ if (PERL_EXECUTABLE) ) if (NOT PERL_CPPFLAGS_RESULT_VARIABLE) string(REGEX REPLACE "cppflags='([^']+)'.*" "\\1" PERL_EXTRA_C_FLAGS ${PERL_CPPFLAGS_OUTPUT_VARIABLE}) - endif (NOT PERL_CPPFLAGS_RESULT_VARIABLE) + endif () ### PERL_SITESEARCH execute_process( @@ -95,7 +95,7 @@ if (PERL_EXECUTABLE) if (NOT PERL_SITESEARCH_RESULT_VARIABLE) string(REGEX REPLACE "install[a-z]+='([^']+)'.*" "\\1" PERL_SITESEARCH ${PERL_SITESEARCH_OUTPUT_VARIABLE}) file(TO_CMAKE_PATH "${PERL_SITESEARCH}" PERL_SITESEARCH) - endif (NOT PERL_SITESEARCH_RESULT_VARIABLE) + endif () ### PERL_SITELIB execute_process( @@ -109,7 +109,7 @@ if (PERL_EXECUTABLE) if (NOT PERL_SITELIB_RESULT_VARIABLE) string(REGEX REPLACE "install[a-z]+='([^']+)'.*" "\\1" PERL_SITELIB ${PERL_SITELIB_OUTPUT_VARIABLE}) file(TO_CMAKE_PATH "${PERL_SITELIB}" PERL_SITELIB) - endif (NOT PERL_SITELIB_RESULT_VARIABLE) + endif () ### PERL_VENDORARCH execute_process( @@ -123,7 +123,7 @@ if (PERL_EXECUTABLE) if (NOT PERL_VENDORARCH_RESULT_VARIABLE) string(REGEX REPLACE "install[a-z]+='([^']+)'.*" "\\1" PERL_VENDORARCH ${PERL_VENDORARCH_OUTPUT_VARIABLE}) file(TO_CMAKE_PATH "${PERL_VENDORARCH}" PERL_VENDORARCH) - endif (NOT PERL_VENDORARCH_RESULT_VARIABLE) + endif () ### PERL_VENDORLIB execute_process( @@ -137,7 +137,7 @@ if (PERL_EXECUTABLE) if (NOT PERL_VENDORLIB_RESULT_VARIABLE) string(REGEX REPLACE "install[a-z]+='([^']+)'.*" "\\1" PERL_VENDORLIB ${PERL_VENDORLIB_OUTPUT_VARIABLE}) file(TO_CMAKE_PATH "${PERL_VENDORLIB}" PERL_VENDORLIB) - endif (NOT PERL_VENDORLIB_RESULT_VARIABLE) + endif () macro(perl_adjust_darwin_lib_variable varname) string( TOUPPER PERL_${varname} FINDPERL_VARNAME ) @@ -160,9 +160,9 @@ if (PERL_EXECUTABLE) if (PERL_NEEDS_ADJUSTMENT) string(REGEX REPLACE "(.*)/Updates/" "/System/\\1/" ${FINDPERL_VARNAME} ${${FINDPERL_VARNAME}}) - endif (PERL_NEEDS_ADJUSTMENT) + endif () - endif (NOT PERL_MINUSV_RESULT_VARIABLE) + endif () endmacro() ### PERL_ARCHLIB @@ -178,7 +178,7 @@ if (PERL_EXECUTABLE) string(REGEX REPLACE "install[a-z]+='([^']+)'.*" "\\1" PERL_ARCHLIB ${PERL_ARCHLIB_OUTPUT_VARIABLE}) perl_adjust_darwin_lib_variable( ARCHLIB ) file(TO_CMAKE_PATH "${PERL_ARCHLIB}" PERL_ARCHLIB) - endif (NOT PERL_ARCHLIB_RESULT_VARIABLE) + endif () ### PERL_PRIVLIB execute_process( @@ -193,7 +193,7 @@ if (PERL_EXECUTABLE) string(REGEX REPLACE "install[a-z]+='([^']+)'.*" "\\1" PERL_PRIVLIB ${PERL_PRIVLIB_OUTPUT_VARIABLE}) perl_adjust_darwin_lib_variable( PRIVLIB ) file(TO_CMAKE_PATH "${PERL_PRIVLIB}" PERL_PRIVLIB) - endif (NOT PERL_PRIVLIB_RESULT_VARIABLE) + endif () ### PERL_POSSIBLE_LIBRARY_NAMES execute_process( @@ -206,9 +206,9 @@ if (PERL_EXECUTABLE) ) if (NOT PERL_LIBRARY_RESULT_VARIABLE) string(REGEX REPLACE "libperl='([^']+)'.*" "\\1" PERL_POSSIBLE_LIBRARY_NAMES ${PERL_LIBRARY_OUTPUT_VARIABLE}) - else (NOT PERL_LIBRARY_RESULT_VARIABLE) + else () set(PERL_POSSIBLE_LIBRARY_NAMES perl${PERL_VERSION_STRING} perl) - endif (NOT PERL_LIBRARY_RESULT_VARIABLE) + endif () ### PERL_INCLUDE_PATH find_path(PERL_INCLUDE_PATH @@ -234,7 +234,7 @@ if (PERL_EXECUTABLE) /usr/lib/perl/${PERL_VERSION_STRING}/CORE ) -endif (PERL_EXECUTABLE) +endif () # handle the QUIETLY and REQUIRED arguments and set PERLLIBS_FOUND to TRUE if # all listed variables are TRUE diff --git a/Modules/FindPkgConfig.cmake b/Modules/FindPkgConfig.cmake index 99b2c1f..2766f97 100644 --- a/Modules/FindPkgConfig.cmake +++ b/Modules/FindPkgConfig.cmake @@ -96,7 +96,7 @@ if (PKG_CONFIG_EXECUTABLE) OUTPUT_VARIABLE PKG_CONFIG_VERSION_STRING ERROR_QUIET OUTPUT_STRIP_TRAILING_WHITESPACE) -endif (PKG_CONFIG_EXECUTABLE) +endif () include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake) find_package_handle_standard_args(PkgConfig @@ -111,11 +111,11 @@ set(PKG_CONFIG_FOUND "${PKGCONFIG_FOUND}") # Unsets the given variables macro(_pkgconfig_unset var) set(${var} "" CACHE INTERNAL "") -endmacro(_pkgconfig_unset) +endmacro() macro(_pkgconfig_set var value) set(${var} ${value} CACHE INTERNAL "") -endmacro(_pkgconfig_set) +endmacro() # Invokes pkgconfig, cleans up the result and sets variables macro(_pkgconfig_invoke _pkglist _prefix _varname _regexp) @@ -129,28 +129,28 @@ macro(_pkgconfig_invoke _pkglist _prefix _varname _regexp) if (_pkgconfig_failed) set(_pkgconfig_${_varname} "") _pkgconfig_unset(${_prefix}_${_varname}) - else(_pkgconfig_failed) + else() string(REGEX REPLACE "[\r\n]" " " _pkgconfig_invoke_result "${_pkgconfig_invoke_result}") string(REGEX REPLACE " +$" "" _pkgconfig_invoke_result "${_pkgconfig_invoke_result}") if (NOT ${_regexp} STREQUAL "") string(REGEX REPLACE "${_regexp}" " " _pkgconfig_invoke_result "${_pkgconfig_invoke_result}") - endif(NOT ${_regexp} STREQUAL "") + endif() separate_arguments(_pkgconfig_invoke_result) #message(STATUS " ${_varname} ... ${_pkgconfig_invoke_result}") set(_pkgconfig_${_varname} ${_pkgconfig_invoke_result}) _pkgconfig_set(${_prefix}_${_varname} "${_pkgconfig_invoke_result}") - endif(_pkgconfig_failed) -endmacro(_pkgconfig_invoke) + endif() +endmacro() # Invokes pkgconfig two times; once without '--static' and once with # '--static' macro(_pkgconfig_invoke_dyn _pkglist _prefix _varname cleanup_regexp) _pkgconfig_invoke("${_pkglist}" ${_prefix} ${_varname} "${cleanup_regexp}" ${ARGN}) _pkgconfig_invoke("${_pkglist}" ${_prefix} STATIC_${_varname} "${cleanup_regexp}" --static ${ARGN}) -endmacro(_pkgconfig_invoke_dyn) +endmacro() # Splits given arguments into options and a package list macro(_pkgconfig_parse_options _result _is_req _is_silent) @@ -160,16 +160,16 @@ macro(_pkgconfig_parse_options _result _is_req _is_silent) foreach(_pkg ${ARGN}) if (_pkg STREQUAL "REQUIRED") set(${_is_req} 1) - endif (_pkg STREQUAL "REQUIRED") + endif () if (_pkg STREQUAL "QUIET") set(${_is_silent} 1) - endif (_pkg STREQUAL "QUIET") - endforeach(_pkg ${ARGN}) + endif () + endforeach() set(${_result} ${ARGN}) list(REMOVE_ITEM ${_result} "REQUIRED") list(REMOVE_ITEM ${_result} "QUIET") -endmacro(_pkgconfig_parse_options) +endmacro() ### macro(_pkg_check_modules_internal _is_required _is_silent _prefix) @@ -203,10 +203,10 @@ macro(_pkg_check_modules_internal _is_required _is_silent _prefix) if (NOT ${_is_silent}) if (_pkg_check_modules_cnt EQUAL 1) message(STATUS "checking for module '${_pkg_check_modules_list}'") - else(_pkg_check_modules_cnt EQUAL 1) + else() message(STATUS "checking for modules '${_pkg_check_modules_list}'") - endif(_pkg_check_modules_cnt EQUAL 1) - endif(NOT ${_is_silent}) + endif() + endif() set(_pkg_check_modules_packages) set(_pkg_check_modules_failed) @@ -220,24 +220,24 @@ macro(_pkg_check_modules_internal _is_required _is_silent _prefix) string(REGEX REPLACE "(.*[^><])(>=|=|<=)(.*)" "\\1" _pkg_check_modules_pkg_name "${_pkg_check_modules_pkg}") string(REGEX REPLACE "(.*[^><])(>=|=|<=)(.*)" "\\2" _pkg_check_modules_pkg_op "${_pkg_check_modules_pkg}") string(REGEX REPLACE "(.*[^><])(>=|=|<=)(.*)" "\\3" _pkg_check_modules_pkg_ver "${_pkg_check_modules_pkg}") - else(_pkg_check_modules_pkg MATCHES ".*(>=|=|<=).*") + else() set(_pkg_check_modules_pkg_name "${_pkg_check_modules_pkg}") set(_pkg_check_modules_pkg_op) set(_pkg_check_modules_pkg_ver) - endif(_pkg_check_modules_pkg MATCHES ".*(>=|=|<=).*") + endif() # handle the operands if (_pkg_check_modules_pkg_op STREQUAL ">=") list(APPEND _pkg_check_modules_exist_query --atleast-version) - endif(_pkg_check_modules_pkg_op STREQUAL ">=") + endif() if (_pkg_check_modules_pkg_op STREQUAL "=") list(APPEND _pkg_check_modules_exist_query --exact-version) - endif(_pkg_check_modules_pkg_op STREQUAL "=") + endif() if (_pkg_check_modules_pkg_op STREQUAL "<=") list(APPEND _pkg_check_modules_exist_query --max-version) - endif(_pkg_check_modules_pkg_op STREQUAL "<=") + endif() # create the final query which is of the format: # * --atleast-version <version> <pkg-name> @@ -246,9 +246,9 @@ macro(_pkg_check_modules_internal _is_required _is_silent _prefix) # * --exists <pkg-name> if (_pkg_check_modules_pkg_op) list(APPEND _pkg_check_modules_exist_query "${_pkg_check_modules_pkg_ver}") - else(_pkg_check_modules_pkg_op) + else() list(APPEND _pkg_check_modules_exist_query --exists) - endif(_pkg_check_modules_pkg_op) + endif() _pkgconfig_unset(${_prefix}_${_pkg_check_modules_pkg_name}_VERSION) _pkgconfig_unset(${_prefix}_${_pkg_check_modules_pkg_name}_PREFIX) @@ -267,18 +267,18 @@ macro(_pkg_check_modules_internal _is_required _is_silent _prefix) if (_pkgconfig_retval) if(NOT ${_is_silent}) message(STATUS " package '${_pkg_check_modules_pkg}' not found") - endif(NOT ${_is_silent}) + endif() set(_pkg_check_modules_failed 1) - endif(_pkgconfig_retval) - endforeach(_pkg_check_modules_pkg) + endif() + endforeach() if(_pkg_check_modules_failed) # fail when requested if (${_is_required}) message(SEND_ERROR "A required package was not found") - endif (${_is_required}) - else(_pkg_check_modules_failed) + endif () + else() # when we are here, we checked whether requested modules # exist. Now, go through them and set variables @@ -290,9 +290,9 @@ macro(_pkg_check_modules_internal _is_required _is_silent _prefix) # handle case when there is only one package required if (pkg_count EQUAL 1) set(_pkg_check_prefix "${_prefix}") - else(pkg_count EQUAL 1) + else() set(_pkg_check_prefix "${_prefix}_${_pkg_check_modules_pkg}") - endif(pkg_count EQUAL 1) + endif() _pkgconfig_invoke(${_pkg_check_modules_pkg} "${_pkg_check_prefix}" VERSION "" --modversion ) _pkgconfig_invoke(${_pkg_check_modules_pkg} "${_pkg_check_prefix}" PREFIX "" --variable=prefix ) @@ -301,8 +301,8 @@ macro(_pkg_check_modules_internal _is_required _is_silent _prefix) if (NOT ${_is_silent}) message(STATUS " found ${_pkg_check_modules_pkg}, version ${_pkgconfig_VERSION}") - endif (NOT ${_is_silent}) - endforeach(_pkg_check_modules_pkg) + endif () + endforeach() # set variables which are combined for multiple modules _pkgconfig_invoke_dyn("${_pkg_check_modules_packages}" "${_prefix}" LIBRARIES "(^| )-l" --libs-only-l ) @@ -313,13 +313,13 @@ macro(_pkg_check_modules_internal _is_required _is_silent _prefix) _pkgconfig_invoke_dyn("${_pkg_check_modules_packages}" "${_prefix}" INCLUDE_DIRS "(^| )-I" --cflags-only-I ) _pkgconfig_invoke_dyn("${_pkg_check_modules_packages}" "${_prefix}" CFLAGS "" --cflags ) _pkgconfig_invoke_dyn("${_pkg_check_modules_packages}" "${_prefix}" CFLAGS_OTHER "" --cflags-only-other ) - endif(_pkg_check_modules_failed) - else(PKG_CONFIG_EXECUTABLE) + endif() + else() if (${_is_required}) message(SEND_ERROR "pkg-config tool not found") - endif (${_is_required}) - endif(PKG_CONFIG_EXECUTABLE) -endmacro(_pkg_check_modules_internal) + endif () + endif() +endmacro() ### ### User visible macros start here @@ -333,8 +333,8 @@ macro(pkg_check_modules _prefix _module0) _pkg_check_modules_internal("${_pkg_is_required}" "${_pkg_is_silent}" "${_prefix}" ${_pkg_modules}) _pkgconfig_set(__pkg_config_checked_${_prefix} ${PKG_CONFIG_VERSION}) - endif(NOT DEFINED __pkg_config_checked_${_prefix} OR __pkg_config_checked_${_prefix} LESS ${PKG_CONFIG_VERSION} OR NOT ${_prefix}_FOUND) -endmacro(pkg_check_modules) + endif() +endmacro() ### macro(pkg_search_module _prefix _module0) @@ -345,28 +345,28 @@ macro(pkg_search_module _prefix _module0) if (NOT ${_pkg_is_silent}) message(STATUS "checking for one of the modules '${_pkg_modules_alt}'") - endif (NOT ${_pkg_is_silent}) + endif () # iterate through all modules and stop at the first working one. foreach(_pkg_alt ${_pkg_modules_alt}) if(NOT _pkg_modules_found) _pkg_check_modules_internal(0 1 "${_prefix}" "${_pkg_alt}") - endif(NOT _pkg_modules_found) + endif() if (${_prefix}_FOUND) set(_pkg_modules_found 1) - endif(${_prefix}_FOUND) - endforeach(_pkg_alt) + endif() + endforeach() if (NOT ${_prefix}_FOUND) if(${_pkg_is_required}) message(SEND_ERROR "None of the required '${_pkg_modules_alt}' found") - endif(${_pkg_is_required}) - endif(NOT ${_prefix}_FOUND) + endif() + endif() _pkgconfig_set(__pkg_config_checked_${_prefix} ${PKG_CONFIG_VERSION}) - endif(NOT DEFINED __pkg_config_checked_${_prefix} OR __pkg_config_checked_${_prefix} LESS ${PKG_CONFIG_VERSION} OR NOT ${_prefix}_FOUND) -endmacro(pkg_search_module) + endif() +endmacro() ### Local Variables: ### mode: cmake diff --git a/Modules/FindPostgreSQL.cmake b/Modules/FindPostgreSQL.cmake index ad67160..699cd41 100644 --- a/Modules/FindPostgreSQL.cmake +++ b/Modules/FindPostgreSQL.cmake @@ -77,7 +77,7 @@ set(PostgreSQL_ROOT_DIR_MESSAGE "Set the PostgreSQL_ROOT system variable to wher set(PostgreSQL_ROOT_DIRECTORIES $ENV{PostgreSQL_ROOT}) if(PostgreSQL_ROOT_DIRECTORIES) file(TO_CMAKE_PATH ${PostgreSQL_ROOT_DIRECTORIES} PostgreSQL_ROOT_DIRECTORIES) -endif(PostgreSQL_ROOT_DIRECTORIES) +endif() set(PostgreSQL_KNOWN_VERSIONS ${PostgreSQL_ADDITIONAL_VERSIONS} "9.1" "9.0" "8.4" "8.3" "8.2" "8.1" "8.0") @@ -86,8 +86,8 @@ set(PostgreSQL_KNOWN_VERSIONS ${PostgreSQL_ADDITIONAL_VERSIONS} if ( WIN32 ) foreach (suffix ${PostgreSQL_KNOWN_VERSIONS} ) set(PostgreSQL_ADDITIONAL_SEARCH_PATHS ${PostgreSQL_ADDITIONAL_SEARCH_PATHS} "C:/Program Files/PostgreSQL/${suffix}" ) - endforeach(suffix) -endif( WIN32 ) + endforeach() +endif() set( PostgreSQL_ROOT_DIRECTORIES ${PostgreSQL_ROOT_DIRECTORIES} ${PostgreSQL_ROOT} @@ -167,6 +167,6 @@ if(PostgreSQL_FOUND) #message("Final PostgreSQL include dir: ${PostgreSQL_INCLUDE_DIRS}") #message("Final PostgreSQL library dir: ${PostgreSQL_LIBRARY_DIRS}") #message("Final PostgreSQL libraries: ${PostgreSQL_LIBRARIES}") -endif(PostgreSQL_FOUND) +endif() mark_as_advanced(PostgreSQL_INCLUDE_DIR PostgreSQL_TYPE_INCLUDE_DIR PostgreSQL_LIBRARY ) diff --git a/Modules/FindProtobuf.cmake b/Modules/FindProtobuf.cmake index c8616cc..af0c2dd 100644 --- a/Modules/FindProtobuf.cmake +++ b/Modules/FindProtobuf.cmake @@ -78,7 +78,7 @@ function(PROTOBUF_GENERATE_CPP SRCS HDRS) if(NOT ARGN) message(SEND_ERROR "Error: PROTOBUF_GENERATE_CPP() called without any proto files") return() - endif(NOT ARGN) + endif() if(PROTOBUF_GENERATE_CPP_APPEND_PATH) # Create an include path for each file specified diff --git a/Modules/FindPythonInterp.cmake b/Modules/FindPythonInterp.cmake index a131c5f..7fb65b8 100644 --- a/Modules/FindPythonInterp.cmake +++ b/Modules/FindPythonInterp.cmake @@ -47,16 +47,16 @@ if(PythonInterp_FIND_VERSION) list(APPEND _PYTHON_FIND_OTHER_VERSIONS ${_PYTHON_V}) endif() endforeach() - endif(NOT PythonInterp_FIND_VERSION_EXACT) + endif() unset(_PYTHON_FIND_MAJ_MIN) unset(_PYTHON_FIND_MAJ) - else(PythonInterp_FIND_VERSION MATCHES "^[0-9]+\\.[0-9]+(\\.[0-9]+.*)?$") + else() list(APPEND _Python_NAMES python${PythonInterp_FIND_VERSION}) set(_PYTHON_FIND_OTHER_VERSIONS ${_PYTHON${PythonInterp_FIND_VERSION}_VERSIONS}) - endif(PythonInterp_FIND_VERSION MATCHES "^[0-9]+\\.[0-9]+(\\.[0-9]+.*)?$") -else(PythonInterp_FIND_VERSION) + endif() +else() set(_PYTHON_FIND_OTHER_VERSIONS ${_PYTHON3_VERSIONS} ${_PYTHON2_VERSIONS} ${_PYTHON1_VERSIONS}) -endif(PythonInterp_FIND_VERSION) +endif() list(APPEND _Python_NAMES python) @@ -131,7 +131,7 @@ if(PYTHON_EXECUTABLE) endif() unset(_PYTHON_VERSION_RESULT) unset(_VERSION) -endif(PYTHON_EXECUTABLE) +endif() # handle the QUIETLY and REQUIRED arguments and set PYTHONINTERP_FOUND to TRUE if # all listed variables are TRUE diff --git a/Modules/FindPythonLibs.cmake b/Modules/FindPythonLibs.cmake index 932fbdc..0a9a990 100644 --- a/Modules/FindPythonLibs.cmake +++ b/Modules/FindPythonLibs.cmake @@ -48,24 +48,24 @@ if(PythonLibs_FIND_VERSION) if(PythonLibs_FIND_VERSION_EXACT) if(_PYTHON_FIND_MAJ_MIN STREQUAL PythonLibs_FIND_VERSION) set(_PYTHON_FIND_OTHER_VERSIONS "${PythonLibs_FIND_VERSION}") - else(_PYTHON_FIND_MAJ_MIN STREQUAL PythonLibs_FIND_VERSION) + else() set(_PYTHON_FIND_OTHER_VERSIONS "${PythonLibs_FIND_VERSION}" "${_PYTHON_FIND_MAJ_MIN}") - endif(_PYTHON_FIND_MAJ_MIN STREQUAL PythonLibs_FIND_VERSION) - else(PythonLibs_FIND_VERSION_EXACT) + endif() + else() foreach(_PYTHON_V ${_PYTHON${_PYTHON_FIND_MAJ}_VERSIONS}) if(NOT _PYTHON_V VERSION_LESS _PYTHON_FIND_MAJ_MIN) list(APPEND _PYTHON_FIND_OTHER_VERSIONS ${_PYTHON_V}) endif() endforeach() - endif(PythonLibs_FIND_VERSION_EXACT) + endif() unset(_PYTHON_FIND_MAJ_MIN) unset(_PYTHON_FIND_MAJ) - else(PythonLibs_FIND_VERSION MATCHES "^[0-9]+\\.[0-9]+(\\.[0-9]+.*)?$") + else() set(_PYTHON_FIND_OTHER_VERSIONS ${_PYTHON${PythonLibs_FIND_VERSION}_VERSIONS}) - endif(PythonLibs_FIND_VERSION MATCHES "^[0-9]+\\.[0-9]+(\\.[0-9]+.*)?$") -else(PythonLibs_FIND_VERSION) + endif() +else() set(_PYTHON_FIND_OTHER_VERSIONS ${_PYTHON3_VERSIONS} ${_PYTHON2_VERSIONS} ${_PYTHON1_VERSIONS}) -endif(PythonLibs_FIND_VERSION) +endif() # Set up the versions we know about, in the order we will search. Always add # the user supplied additional versions to the front. @@ -90,7 +90,7 @@ foreach(_CURRENT_VERSION ${_Python_VERSIONS}) [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\${_CURRENT_VERSION}\\InstallPath]/libs [HKEY_CURRENT_USER\\SOFTWARE\\Python\\PythonCore\\${_CURRENT_VERSION}\\InstallPath]/libs ) - endif(WIN32) + endif() find_library(PYTHON_LIBRARY NAMES @@ -119,15 +119,15 @@ foreach(_CURRENT_VERSION ${_Python_VERSIONS}) if(DEFINED PYTHON_INCLUDE_PATH AND NOT DEFINED PYTHON_INCLUDE_DIR) set(PYTHON_INCLUDE_DIR "${PYTHON_INCLUDE_PATH}" CACHE PATH "Path to where Python.h is found" FORCE) - endif(DEFINED PYTHON_INCLUDE_PATH AND NOT DEFINED PYTHON_INCLUDE_DIR) + endif() set(PYTHON_FRAMEWORK_INCLUDES) if(Python_FRAMEWORKS AND NOT PYTHON_INCLUDE_DIR) foreach(dir ${Python_FRAMEWORKS}) set(PYTHON_FRAMEWORK_INCLUDES ${PYTHON_FRAMEWORK_INCLUDES} ${dir}/Versions/${_CURRENT_VERSION}/include/python${_CURRENT_VERSION}) - endforeach(dir) - endif(Python_FRAMEWORKS AND NOT PYTHON_INCLUDE_DIR) + endforeach() + endif() find_path(PYTHON_INCLUDE_DIR NAMES Python.h @@ -151,12 +151,12 @@ foreach(_CURRENT_VERSION ${_Python_VERSIONS}) string(REGEX REPLACE "^#define[ \t]+PY_VERSION[ \t]+\"([^\"]+)\".*" "\\1" PYTHONLIBS_VERSION_STRING "${python_version_str}") unset(python_version_str) - endif(PYTHON_INCLUDE_DIR AND EXISTS "${PYTHON_INCLUDE_DIR}/patchlevel.h") + endif() if(PYTHON_LIBRARY AND PYTHON_INCLUDE_DIR) break() - endif(PYTHON_LIBRARY AND PYTHON_INCLUDE_DIR) -endforeach(_CURRENT_VERSION) + endif() +endforeach() mark_as_advanced( PYTHON_DEBUG_LIBRARY @@ -204,10 +204,10 @@ function(PYTHON_ADD_MODULE _NAME ) if(PYTHON_ENABLE_MODULE_${_NAME}) if(PYTHON_MODULE_${_NAME}_BUILD_SHARED) set(PY_MODULE_TYPE MODULE) - else(PYTHON_MODULE_${_NAME}_BUILD_SHARED) + else() set(PY_MODULE_TYPE STATIC) set_property(GLOBAL APPEND PROPERTY PY_STATIC_MODULES_LIST ${_NAME}) - endif(PYTHON_MODULE_${_NAME}_BUILD_SHARED) + endif() set_property(GLOBAL APPEND PROPERTY PY_MODULES_LIST ${_NAME}) add_library(${_NAME} ${PY_MODULE_TYPE} ${ARGN}) @@ -217,11 +217,11 @@ function(PYTHON_ADD_MODULE _NAME ) set_target_properties(${_NAME} PROPERTIES PREFIX "${PYTHON_MODULE_PREFIX}") if(WIN32 AND NOT CYGWIN) set_target_properties(${_NAME} PROPERTIES SUFFIX ".pyd") - endif(WIN32 AND NOT CYGWIN) - endif(PYTHON_MODULE_${_NAME}_BUILD_SHARED) + endif() + endif() - endif(PYTHON_ENABLE_MODULE_${_NAME}) -endfunction(PYTHON_ADD_MODULE) + endif() +endfunction() function(PYTHON_WRITE_MODULES_HEADER _filename) @@ -248,7 +248,7 @@ extern \"C\" { foreach(_currentModule ${PY_STATIC_MODULES_LIST}) file(APPEND ${_filenameTmp} "extern void init${PYTHON_MODULE_PREFIX}${_currentModule}(void);\n\n") - endforeach(_currentModule ${PY_STATIC_MODULES_LIST}) + endforeach() file(APPEND ${_filenameTmp} "#ifdef __cplusplus @@ -260,16 +260,16 @@ extern \"C\" { foreach(_currentModule ${PY_STATIC_MODULES_LIST}) file(APPEND ${_filenameTmp} "int ${_name}_${_currentModule}(void) \n{\n static char name[]=\"${PYTHON_MODULE_PREFIX}${_currentModule}\"; return PyImport_AppendInittab(name, init${PYTHON_MODULE_PREFIX}${_currentModule});\n}\n\n") - endforeach(_currentModule ${PY_STATIC_MODULES_LIST}) + endforeach() file(APPEND ${_filenameTmp} "void ${_name}_LoadAllPythonModules(void)\n{\n") foreach(_currentModule ${PY_STATIC_MODULES_LIST}) file(APPEND ${_filenameTmp} " ${_name}_${_currentModule}();\n") - endforeach(_currentModule ${PY_STATIC_MODULES_LIST}) + endforeach() file(APPEND ${_filenameTmp} "}\n\n") file(APPEND ${_filenameTmp} "#ifndef EXCLUDE_LOAD_ALL_FUNCTION\nvoid CMakeLoadAllPythonModules(void)\n{\n ${_name}_LoadAllPythonModules();\n}\n#endif\n\n#endif\n") # with configure_file() cmake complains that you may not use a file created using file(WRITE) as input file for configure_file() execute_process(COMMAND ${CMAKE_COMMAND} -E copy_if_different "${_filenameTmp}" "${_filename}" OUTPUT_QUIET ERROR_QUIET) -endfunction(PYTHON_WRITE_MODULES_HEADER) +endfunction() diff --git a/Modules/FindQt.cmake b/Modules/FindQt.cmake index 53b1da7..eeeaf59 100644 --- a/Modules/FindQt.cmake +++ b/Modules/FindQt.cmake @@ -34,26 +34,26 @@ file(GLOB GLOB_TEMP_VAR /usr/lib/qt-3*/bin/qmake) if(GLOB_TEMP_VAR) set(QT3_INSTALLED TRUE) -endif(GLOB_TEMP_VAR) +endif() set(GLOB_TEMP_VAR) file(GLOB GLOB_TEMP_VAR /usr/local/qt-x11-commercial-3*/bin/qmake) if(GLOB_TEMP_VAR) set(QT3_INSTALLED TRUE) -endif(GLOB_TEMP_VAR) +endif() set(GLOB_TEMP_VAR) # look for qt4 installations file(GLOB GLOB_TEMP_VAR /usr/local/qt-x11-commercial-4*/bin/qmake) if(GLOB_TEMP_VAR) set(QT4_INSTALLED TRUE) -endif(GLOB_TEMP_VAR) +endif() set(GLOB_TEMP_VAR) file(GLOB GLOB_TEMP_VAR /usr/local/Trolltech/Qt-4*/bin/qmake) if(GLOB_TEMP_VAR) set(QT4_INSTALLED TRUE) -endif(GLOB_TEMP_VAR) +endif() set(GLOB_TEMP_VAR) # now find qmake @@ -64,17 +64,17 @@ if(QT_QMAKE_EXECUTABLE_FINDQT) if(QTVERSION MATCHES "4.*") set(QT_QMAKE_EXECUTABLE ${QT_QMAKE_EXECUTABLE_FINDQT} CACHE PATH "QT4 qmake program.") set(QT4_INSTALLED TRUE) - endif(QTVERSION MATCHES "4.*") + endif() if(QTVERSION MATCHES "Unknown") set(QT3_INSTALLED TRUE) - endif(QTVERSION MATCHES "Unknown") -endif(QT_QMAKE_EXECUTABLE_FINDQT) + endif() +endif() if(QT_QMAKE_EXECUTABLE_FINDQT) exec_program( ${QT_QMAKE_EXECUTABLE_FINDQT} ARGS "-query QT_INSTALL_HEADERS" OUTPUT_VARIABLE qt_headers ) -endif(QT_QMAKE_EXECUTABLE_FINDQT) +endif() find_file( QT4_QGLOBAL_H_FILE qglobal.h "${QT_SEARCH_PATH}/Qt/include" @@ -91,7 +91,7 @@ find_file( QT4_QGLOBAL_H_FILE qglobal.h if(QT4_QGLOBAL_H_FILE) set(QT4_INSTALLED TRUE) -endif(QT4_QGLOBAL_H_FILE) +endif() find_file( QT3_QGLOBAL_H_FILE qglobal.h "${QT_SEARCH_PATH}/Qt/include" @@ -111,50 +111,50 @@ find_file( QT3_QGLOBAL_H_FILE qglobal.h if(QT3_QGLOBAL_H_FILE) set(QT3_INSTALLED TRUE) -endif(QT3_QGLOBAL_H_FILE) +endif() if(QT3_INSTALLED AND QT4_INSTALLED ) # force user to pick if we have both set(DESIRED_QT_VERSION 0 CACHE STRING "Pick a version of QT to use: 3 or 4") -else(QT3_INSTALLED AND QT4_INSTALLED ) +else() # if only one found then pick that one if(QT3_INSTALLED) set(DESIRED_QT_VERSION 3 CACHE STRING "Pick a version of QT to use: 3 or 4") - endif(QT3_INSTALLED) + endif() if(QT4_INSTALLED) set(DESIRED_QT_VERSION 4 CACHE STRING "Pick a version of QT to use: 3 or 4") - endif(QT4_INSTALLED) -endif(QT3_INSTALLED AND QT4_INSTALLED ) + endif() +endif() if(DESIRED_QT_VERSION MATCHES 3) set(Qt3_FIND_REQUIRED ${Qt_FIND_REQUIRED}) set(Qt3_FIND_QUIETLY ${Qt_FIND_QUIETLY}) include(FindQt3) -endif(DESIRED_QT_VERSION MATCHES 3) +endif() if(DESIRED_QT_VERSION MATCHES 4) set(Qt4_FIND_REQUIRED ${Qt_FIND_REQUIRED}) set(Qt4_FIND_QUIETLY ${Qt_FIND_QUIETLY}) include(FindQt4) -endif(DESIRED_QT_VERSION MATCHES 4) +endif() if(NOT QT3_INSTALLED AND NOT QT4_INSTALLED) if(QT_REQUIRED) message(SEND_ERROR "CMake was unable to find any QT versions, put qmake in your path, or set QT_QMAKE_EXECUTABLE.") - endif(QT_REQUIRED) -else(NOT QT3_INSTALLED AND NOT QT4_INSTALLED) + endif() +else() if(NOT QT_FOUND AND NOT DESIRED_QT_VERSION) if(QT_REQUIRED) message(SEND_ERROR "Multiple versions of QT found please set DESIRED_QT_VERSION") - else(QT_REQUIRED) + else() message("Multiple versions of QT found please set DESIRED_QT_VERSION") - endif(QT_REQUIRED) - endif(NOT QT_FOUND AND NOT DESIRED_QT_VERSION) + endif() + endif() if(NOT QT_FOUND AND DESIRED_QT_VERSION) if(QT_REQUIRED) message(FATAL_ERROR "CMake was unable to find QT version: ${DESIRED_QT_VERSION}. Set advanced values QT_QMAKE_EXECUTABLE and QT${DESIRED_QT_VERSION}_QGLOBAL_FILE, if those are set then QT_QT_LIBRARY or QT_LIBRARY_DIR.") - else(QT_REQUIRED) + else() message( "CMake was unable to find desired QT version: ${DESIRED_QT_VERSION}. Set advanced values QT_QMAKE_EXECUTABLE and QT${DESIRED_QT_VERSION}_QGLOBAL_FILE.") - endif(QT_REQUIRED) - endif(NOT QT_FOUND AND DESIRED_QT_VERSION) -endif(NOT QT3_INSTALLED AND NOT QT4_INSTALLED) + endif() + endif() +endif() mark_as_advanced(QT3_QGLOBAL_H_FILE QT4_QGLOBAL_H_FILE QT_QMAKE_EXECUTABLE_FINDQT) diff --git a/Modules/FindQt3.cmake b/Modules/FindQt3.cmake index 0440a85..15fbc0b 100644 --- a/Modules/FindQt3.cmake +++ b/Modules/FindQt3.cmake @@ -38,19 +38,19 @@ if(QT4_FOUND) if(Qt3_FIND_REQUIRED) message( FATAL_ERROR "Qt3 and Qt4 cannot be used together in one project.") - else(Qt3_FIND_REQUIRED) + else() if(NOT Qt3_FIND_QUIETLY) message( STATUS "Qt3 and Qt4 cannot be used together in one project.") - endif(NOT Qt3_FIND_QUIETLY) + endif() return() - endif(Qt3_FIND_REQUIRED) -endif(QT4_FOUND) + endif() +endif() file(GLOB GLOB_PATHS /usr/lib/qt-3*) foreach(GLOB_PATH ${GLOB_PATHS}) list(APPEND GLOB_PATHS_BIN "${GLOB_PATH}/bin") -endforeach(GLOB_PATH) +endforeach() find_path(QT_INCLUDE_DIR qt.h "[HKEY_CURRENT_USER\\Software\\Trolltech\\Qt3Versions\\3.2.1;InstallDir]/include/Qt" "[HKEY_CURRENT_USER\\Software\\Trolltech\\Qt3Versions\\3.2.0;InstallDir]/include/Qt" @@ -70,7 +70,7 @@ find_path(QT_INCLUDE_DIR qt.h # QT_INCLUDE_DIR to NOTFOUND if(NOT EXISTS ${QT_INCLUDE_DIR}/qglobal.h) set(QT_INCLUDE_DIR QT_INCLUDE_DIR-NOTFOUND CACHE PATH "path to Qt3 include directory" FORCE) -endif(NOT EXISTS ${QT_INCLUDE_DIR}/qglobal.h) +endif() if(QT_INCLUDE_DIR) #extract the version string from qglobal.h @@ -82,7 +82,7 @@ if(QT_INCLUDE_DIR) # version X.Y.Z, so we need to remove the dots from version string(REGEX REPLACE "\\." "" qt_version_str_lib "${qt_version_str}") set(QT_VERSION_STRING "${qt_version_str}") -endif(QT_INCLUDE_DIR) +endif() file(GLOB GLOB_PATHS_LIB /usr/lib/qt-3*/lib/) if (QT_MT_REQUIRED) @@ -104,7 +104,7 @@ if (QT_MT_REQUIRED) C:/Progra~1/qt/lib ) -else (QT_MT_REQUIRED) +else () find_library(QT_QT_LIBRARY NAMES qt qt-${qt_version_str_lib} qt-edu${qt_version_str_lib} @@ -123,7 +123,7 @@ else (QT_MT_REQUIRED) /usr/share/qt3/lib C:/Progra~1/qt/lib ) -endif (QT_MT_REQUIRED) +endif () find_library(QT_QASSISTANTCLIENT_LIBRARY @@ -162,7 +162,7 @@ find_program(QT_MOC_EXECUTABLE if(QT_MOC_EXECUTABLE) set ( QT_WRAP_CPP "YES") -endif(QT_MOC_EXECUTABLE) +endif() # qt 3 should prefer QTDIR over the PATH find_program(QT_UIC_EXECUTABLE @@ -184,7 +184,7 @@ find_program(QT_UIC_EXECUTABLE if(QT_UIC_EXECUTABLE) set ( QT_WRAP_UI "YES") -endif(QT_UIC_EXECUTABLE) +endif() if (WIN32) find_library(QT_QTMAIN_LIBRARY qtmain @@ -198,12 +198,12 @@ if (WIN32) "C:/Program Files/qt/lib" DOC "This Library is only needed by and included with Qt3 on MSWindows. It should be NOTFOUND, undefined or IGNORE otherwise." ) -endif (WIN32) +endif () #support old QT_MIN_VERSION if set, but not if version is supplied by find_package() if(NOT Qt3_FIND_VERSION AND QT_MIN_VERSION) set(Qt3_FIND_VERSION ${QT_MIN_VERSION}) -endif(NOT Qt3_FIND_VERSION AND QT_MIN_VERSION) +endif() # if the include a library are found then we have it include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake) @@ -222,23 +222,23 @@ if(QT_FOUND) set (QT_DEFINITIONS -DQT_DLL -DQT_THREAD_SUPPORT -DNO_DEBUG) set (QT_LIBRARIES imm32.lib ${QT_QT_LIBRARY} ${QT_QTMAIN_LIBRARY} ) set (QT_LIBRARIES ${QT_LIBRARIES} winmm wsock32) - else (QT_QTMAIN_LIBRARY) + else () # for version 2 set (QT_LIBRARIES imm32.lib ws2_32.lib ${QT_QT_LIBRARY} ) - endif (QT_QTMAIN_LIBRARY) - else (WIN32 AND NOT CYGWIN) + endif () + else () set (QT_LIBRARIES ${QT_QT_LIBRARY} ) set (QT_DEFINITIONS -DQT_SHARED -DQT_NO_DEBUG) if(QT_QT_LIBRARY MATCHES "qt-mt") set (QT_DEFINITIONS ${QT_DEFINITIONS} -DQT_THREAD_SUPPORT -D_REENTRANT) - endif(QT_QT_LIBRARY MATCHES "qt-mt") + endif() - endif (WIN32 AND NOT CYGWIN) + endif () if (QT_QASSISTANTCLIENT_LIBRARY) set (QT_LIBRARIES ${QT_QASSISTANTCLIENT_LIBRARY} ${QT_LIBRARIES}) - endif (QT_QASSISTANTCLIENT_LIBRARY) + endif () # Backwards compatibility for CMake1.4 and 1.2 set (QT_MOC_EXE ${QT_MOC_EXECUTABLE} ) @@ -248,47 +248,47 @@ if(QT_FOUND) find_package(X11) if (X11_FOUND) set (QT_LIBRARIES ${QT_LIBRARIES} ${X11_LIBRARIES}) - endif (X11_FOUND) + endif () if (CMAKE_DL_LIBS) set (QT_LIBRARIES ${QT_LIBRARIES} ${CMAKE_DL_LIBS}) - endif (CMAKE_DL_LIBS) - endif(UNIX) + endif () + endif() if(QT_QT_LIBRARY MATCHES "qt-mt") find_package(Threads) set(QT_LIBRARIES ${QT_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT}) - endif(QT_QT_LIBRARY MATCHES "qt-mt") -endif(QT_FOUND) + endif() +endif() if(QT_MOC_EXECUTABLE) execute_process(COMMAND ${QT_MOC_EXECUTABLE} "-v" OUTPUT_VARIABLE QTVERSION_MOC ERROR_QUIET) -endif(QT_MOC_EXECUTABLE) +endif() if(QT_UIC_EXECUTABLE) execute_process(COMMAND ${QT_UIC_EXECUTABLE} "-version" OUTPUT_VARIABLE QTVERSION_UIC ERROR_QUIET) -endif(QT_UIC_EXECUTABLE) +endif() set(_QT_UIC_VERSION_3 FALSE) if("${QTVERSION_UIC}" MATCHES ".* 3..*") set(_QT_UIC_VERSION_3 TRUE) -endif("${QTVERSION_UIC}" MATCHES ".* 3..*") +endif() set(_QT_MOC_VERSION_3 FALSE) if("${QTVERSION_MOC}" MATCHES ".* 3..*") set(_QT_MOC_VERSION_3 TRUE) -endif("${QTVERSION_MOC}" MATCHES ".* 3..*") +endif() set(QT_WRAP_CPP FALSE) if (QT_MOC_EXECUTABLE AND _QT_MOC_VERSION_3) set ( QT_WRAP_CPP TRUE) -endif (QT_MOC_EXECUTABLE AND _QT_MOC_VERSION_3) +endif () set(QT_WRAP_UI FALSE) if (QT_UIC_EXECUTABLE AND _QT_UIC_VERSION_3) set ( QT_WRAP_UI TRUE) -endif (QT_UIC_EXECUTABLE AND _QT_UIC_VERSION_3) +endif () mark_as_advanced( QT_INCLUDE_DIR diff --git a/Modules/FindQt4.cmake b/Modules/FindQt4.cmake index e20e764..e7d25c9 100644 --- a/Modules/FindQt4.cmake +++ b/Modules/FindQt4.cmake @@ -339,30 +339,30 @@ if( Qt4_FIND_COMPONENTS ) foreach( component ${Qt4_FIND_COMPONENTS} ) string( TOUPPER ${component} _COMPONENT ) set( QT_USE_${_COMPONENT} 1 ) - endforeach( component ) + endforeach() # To make sure we don't use QtCore or QtGui when not in COMPONENTS if(NOT QT_USE_QTCORE) set( QT_DONT_USE_QTCORE 1 ) - endif(NOT QT_USE_QTCORE) + endif() if(NOT QT_USE_QTGUI) set( QT_DONT_USE_QTGUI 1 ) - endif(NOT QT_USE_QTGUI) + endif() -endif( Qt4_FIND_COMPONENTS ) +endif() # If Qt3 has already been found, fail. if(QT_QT_LIBRARY) if(Qt4_FIND_REQUIRED) message( FATAL_ERROR "Qt3 and Qt4 cannot be used together in one project. If switching to Qt4, the CMakeCache.txt needs to be cleaned.") - else(Qt4_FIND_REQUIRED) + else() if(NOT Qt4_FIND_QUIETLY) message( STATUS "Qt3 and Qt4 cannot be used together in one project. If switching to Qt4, the CMakeCache.txt needs to be cleaned.") - endif(NOT Qt4_FIND_QUIETLY) + endif() return() - endif(Qt4_FIND_REQUIRED) -endif(QT_QT_LIBRARY) + endif() +endif() include(CheckCXXSymbolExists) @@ -393,7 +393,7 @@ macro (_QT4_ADJUST_LIB_VARS _camelCaseBasename) else() set_property(TARGET Qt4::${_camelCaseBasename} PROPERTY IMPORTED_LOCATION_RELEASE "${QT_${basename}_LIBRARY_RELEASE}" ) endif() - endif (QT_${basename}_LIBRARY_RELEASE) + endif () if (QT_${basename}_LIBRARY_DEBUG) set_property(TARGET Qt4::${_camelCaseBasename} APPEND PROPERTY IMPORTED_CONFIGURATIONS DEBUG) @@ -402,8 +402,8 @@ macro (_QT4_ADJUST_LIB_VARS _camelCaseBasename) else() set_property(TARGET Qt4::${_camelCaseBasename} PROPERTY IMPORTED_LOCATION_DEBUG "${QT_${basename}_LIBRARY_DEBUG}" ) endif() - endif (QT_${basename}_LIBRARY_DEBUG) - endif(NOT TARGET Qt4::${_camelCaseBasename}) + endif () + endif() # If QT_USE_IMPORTED_TARGETS is enabled, the QT_QTFOO_LIBRARY variables are set to point at these # imported targets. This works better in general, and is also in almost all cases fully @@ -416,7 +416,7 @@ macro (_QT4_ADJUST_LIB_VARS _camelCaseBasename) if(QT_USE_IMPORTED_TARGETS) set(QT_${basename}_LIBRARY Qt4::${_camelCaseBasename} ) set(QT_${basename}_LIBRARIES Qt4::${_camelCaseBasename} ) - else(QT_USE_IMPORTED_TARGETS) + else() # if the release- as well as the debug-version of the library have been found: if (QT_${basename}_LIBRARY_DEBUG AND QT_${basename}_LIBRARY_RELEASE) @@ -424,49 +424,49 @@ macro (_QT4_ADJUST_LIB_VARS _camelCaseBasename) # optimized and debug libraries, or if the CMAKE_BUILD_TYPE has a value if (CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE) set(QT_${basename}_LIBRARY optimized ${QT_${basename}_LIBRARY_RELEASE} debug ${QT_${basename}_LIBRARY_DEBUG}) - else(CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE) + else() # if there are no configuration types and CMAKE_BUILD_TYPE has no value # then just use the release libraries set(QT_${basename}_LIBRARY ${QT_${basename}_LIBRARY_RELEASE} ) - endif(CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE) + endif() set(QT_${basename}_LIBRARIES optimized ${QT_${basename}_LIBRARY_RELEASE} debug ${QT_${basename}_LIBRARY_DEBUG}) - endif (QT_${basename}_LIBRARY_DEBUG AND QT_${basename}_LIBRARY_RELEASE) + endif () # if only the release version was found, set the debug variable also to the release version if (QT_${basename}_LIBRARY_RELEASE AND NOT QT_${basename}_LIBRARY_DEBUG) set(QT_${basename}_LIBRARY_DEBUG ${QT_${basename}_LIBRARY_RELEASE}) set(QT_${basename}_LIBRARY ${QT_${basename}_LIBRARY_RELEASE}) set(QT_${basename}_LIBRARIES ${QT_${basename}_LIBRARY_RELEASE}) - endif (QT_${basename}_LIBRARY_RELEASE AND NOT QT_${basename}_LIBRARY_DEBUG) + endif () # if only the debug version was found, set the release variable also to the debug version if (QT_${basename}_LIBRARY_DEBUG AND NOT QT_${basename}_LIBRARY_RELEASE) set(QT_${basename}_LIBRARY_RELEASE ${QT_${basename}_LIBRARY_DEBUG}) set(QT_${basename}_LIBRARY ${QT_${basename}_LIBRARY_DEBUG}) set(QT_${basename}_LIBRARIES ${QT_${basename}_LIBRARY_DEBUG}) - endif (QT_${basename}_LIBRARY_DEBUG AND NOT QT_${basename}_LIBRARY_RELEASE) + endif () # put the value in the cache: set(QT_${basename}_LIBRARY ${QT_${basename}_LIBRARY} CACHE STRING "The Qt ${basename} library" FORCE) - endif(QT_USE_IMPORTED_TARGETS) + endif() set(QT_${basename}_FOUND 1) - else (QT_${basename}_LIBRARY_RELEASE OR QT_${basename}_LIBRARY_DEBUG) + else () set(QT_${basename}_LIBRARY "" CACHE STRING "The Qt ${basename} library" FORCE) - endif (QT_${basename}_LIBRARY_RELEASE OR QT_${basename}_LIBRARY_DEBUG) + endif () if (QT_${basename}_INCLUDE_DIR) #add the include directory to QT_INCLUDES set(QT_INCLUDES "${QT_${basename}_INCLUDE_DIR}" ${QT_INCLUDES}) - endif (QT_${basename}_INCLUDE_DIR) + endif () # Make variables changeble to the advanced user mark_as_advanced(QT_${basename}_LIBRARY QT_${basename}_LIBRARY_RELEASE QT_${basename}_LIBRARY_DEBUG QT_${basename}_INCLUDE_DIR) -endmacro (_QT4_ADJUST_LIB_VARS) +endmacro () function(_QT4_QUERY_QMAKE VAR RESULT) execute_process(COMMAND "${QT_QMAKE_EXECUTABLE}" -query ${VAR} @@ -476,8 +476,8 @@ function(_QT4_QUERY_QMAKE VAR RESULT) if(NOT return_code) file(TO_CMAKE_PATH "${output}" output) set(${RESULT} ${output} PARENT_SCOPE) - endif(NOT return_code) -endfunction(_QT4_QUERY_QMAKE) + endif() +endfunction() set(QT4_INSTALLED_VERSION_TOO_OLD FALSE) @@ -499,7 +499,7 @@ if (QT_QMAKE_EXECUTABLE) if(QT_QMAKE_EXECUTABLE_LAST) string(COMPARE NOTEQUAL "${QT_QMAKE_EXECUTABLE_LAST}" "${QT_QMAKE_EXECUTABLE}" QT_QMAKE_CHANGED) - endif(QT_QMAKE_EXECUTABLE_LAST) + endif() set(QT_QMAKE_EXECUTABLE_LAST "${QT_QMAKE_EXECUTABLE}" CACHE INTERNAL "" FORCE) @@ -516,10 +516,10 @@ if (QT_QMAKE_EXECUTABLE) ) if(QT_QMAKE_EXECUTABLE) _qt4_query_qmake(QT_VERSION QTVERSION) - endif(QT_QMAKE_EXECUTABLE) - endif(NOT QTVERSION) + endif() + endif() -endif (QT_QMAKE_EXECUTABLE) +endif () if (QT_QMAKE_EXECUTABLE AND QTVERSION) @@ -531,11 +531,11 @@ if (QT_QMAKE_EXECUTABLE AND QTVERSION) # and windows should already use ; as a separator if(NOT WIN32) string(REPLACE ":" ";" qt_mkspecs_dirs "${qt_mkspecs_dirs}") - endif(NOT WIN32) + endif() set(qt_cross_paths) foreach(qt_cross_path ${CMAKE_FIND_ROOT_PATH}) set(qt_cross_paths ${qt_cross_paths} "${qt_cross_path}/mkspecs") - endforeach(qt_cross_path) + endforeach() set(QT_MKSPECS_DIR NOTFOUND) find_path(QT_MKSPECS_DIR NAMES qconfig.pri HINTS ${qt_cross_paths} ${qt_mkspecs_dirs} @@ -549,10 +549,10 @@ if (QT_QMAKE_EXECUTABLE AND QTVERSION) string(REGEX MATCH "EDITION[^\n]+" QT_EDITION "${_qconfig_FILE_contents}") string(REGEX MATCH "QT_LIBINFIX[^\n]+" _qconfig_qt_libinfix "${_qconfig_FILE_contents}") string(REGEX REPLACE "QT_LIBINFIX *= *([^\n]*)" "\\1" QT_LIBINFIX "${_qconfig_qt_libinfix}") - endif(EXISTS "${QT_MKSPECS_DIR}/qconfig.pri") + endif() if("${QT_EDITION}" MATCHES "DesktopLight") set(QT_EDITION_DESKTOPLIGHT 1) - endif("${QT_EDITION}" MATCHES "DesktopLight") + endif() # ask qmake for the library dir as a hint, then search for QtCore library and use that as a reference for finding the # others and for setting QT_LIBRARY_DIR @@ -580,14 +580,14 @@ if (QT_QMAKE_EXECUTABLE AND QTVERSION) NAMES QtCore${QT_LIBINFIX}_debug QtCore${QT_LIBINFIX}d QtCore${QT_LIBINFIX}d4 HINTS ${QT_LIBRARY_DIR_TMP} ) - endif(NOT QT_QTCORE_LIBRARY_RELEASE AND NOT QT_QTCORE_LIBRARY_DEBUG) + endif() # try dropping a hint if trying to use Visual Studio with Qt built by mingw if(NOT QT_QTCORE_LIBRARY_RELEASE AND MSVC) if(EXISTS ${QT_LIBRARY_DIR_TMP}/libqtmain.a) message( FATAL_ERROR "It appears you're trying to use Visual Studio with Qt built by mingw. Those compilers do not produce code compatible with each other.") - endif(EXISTS ${QT_LIBRARY_DIR_TMP}/libqtmain.a) - endif(NOT QT_QTCORE_LIBRARY_RELEASE AND MSVC) + endif() + endif() endif () @@ -606,25 +606,25 @@ if (QT_QMAKE_EXECUTABLE AND QTVERSION) "Qt is NOT installed correctly for the target build environment.") if(Qt4_FIND_REQUIRED) message( FATAL_ERROR "Could NOT find QtCore. Check ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log for more details.") - endif(Qt4_FIND_REQUIRED) + endif() endif() # ask qmake for the binary dir if (NOT QT_BINARY_DIR OR QT_QMAKE_CHANGED) _qt4_query_qmake(QT_INSTALL_BINS qt_bins) set(QT_BINARY_DIR ${qt_bins} CACHE INTERNAL "" FORCE) - endif (NOT QT_BINARY_DIR OR QT_QMAKE_CHANGED) + endif () if (APPLE) set(CMAKE_FIND_FRAMEWORK_OLD ${CMAKE_FIND_FRAMEWORK}) if (EXISTS ${QT_LIBRARY_DIR}/QtCore.framework) set(QT_USE_FRAMEWORKS ON CACHE INTERNAL "" FORCE) set(CMAKE_FIND_FRAMEWORK FIRST) - else (EXISTS ${QT_LIBRARY_DIR}/QtCore.framework) + else () set(QT_USE_FRAMEWORKS OFF CACHE INTERNAL "" FORCE) set(CMAKE_FIND_FRAMEWORK LAST) - endif (EXISTS ${QT_LIBRARY_DIR}/QtCore.framework) - endif (APPLE) + endif () + endif () # ask qmake for the include dir if (QT_LIBRARY_DIR AND (NOT QT_QTCORE_INCLUDE_DIR OR NOT QT_HEADERS_DIR OR QT_QMAKE_CHANGED)) @@ -639,10 +639,10 @@ if (QT_QMAKE_EXECUTABLE AND QTVERSION) if(QT_QTCORE_INCLUDE_DIR) if(QT_USE_FRAMEWORKS) set(QT_HEADERS_DIR "${qt_headers}" CACHE INTERNAL "" FORCE) - else(QT_USE_FRAMEWORKS) + else() get_filename_component(qt_headers "${QT_QTCORE_INCLUDE_DIR}/../" ABSOLUTE) set(QT_HEADERS_DIR "${qt_headers}" CACHE INTERNAL "" FORCE) - endif(QT_USE_FRAMEWORKS) + endif() elseif() message("Warning: QT_QMAKE_EXECUTABLE reported QT_INSTALL_HEADERS as ${qt_headers}") message("Warning: But QtCore couldn't be found. Qt must NOT be installed correctly.") @@ -651,7 +651,7 @@ if (QT_QMAKE_EXECUTABLE AND QTVERSION) if(APPLE) set(CMAKE_FIND_FRAMEWORK ${CMAKE_FIND_FRAMEWORK_OLD}) - endif(APPLE) + endif() # Set QT_INCLUDE_DIR based on QT_HEADERS_DIR if(QT_HEADERS_DIR) @@ -660,10 +660,10 @@ if (QT_QMAKE_EXECUTABLE AND QTVERSION) # One is the framework include for which CMake will add a -F flag # and the other is an include dir for non-framework Qt modules set(QT_INCLUDE_DIR ${QT_HEADERS_DIR} ${QT_QTCORE_LIBRARY_RELEASE} ) - else(QT_USE_FRAMEWORKS) + else() set(QT_INCLUDE_DIR ${QT_HEADERS_DIR}) - endif(QT_USE_FRAMEWORKS) - endif(QT_HEADERS_DIR) + endif() + endif() # Set QT_INCLUDES set( QT_INCLUDES ${QT_MKSPECS_DIR}/default ${QT_INCLUDE_DIR} ${QT_QTCORE_INCLUDE_DIR}) @@ -673,7 +673,7 @@ if (QT_QMAKE_EXECUTABLE AND QTVERSION) if (QT_LIBRARY_DIR AND NOT QT_DOC_DIR OR QT_QMAKE_CHANGED) _qt4_query_qmake(QT_INSTALL_DOCS qt_doc_dir) set(QT_DOC_DIR ${qt_doc_dir} CACHE PATH "The location of the Qt docs" FORCE) - endif (QT_LIBRARY_DIR AND NOT QT_DOC_DIR OR QT_QMAKE_CHANGED) + endif () # ask qmake for the plugins directory @@ -682,17 +682,17 @@ if (QT_QMAKE_EXECUTABLE AND QTVERSION) set(QT_PLUGINS_DIR NOTFOUND) foreach(qt_cross_path ${CMAKE_FIND_ROOT_PATH}) set(qt_cross_paths ${qt_cross_paths} "${qt_cross_path}/plugins") - endforeach(qt_cross_path) + endforeach() find_path(QT_PLUGINS_DIR NAMES accessible imageformats sqldrivers codecs designer HINTS ${qt_cross_paths} ${qt_plugins_dir} DOC "The location of the Qt plugins") - endif (QT_LIBRARY_DIR AND NOT QT_PLUGINS_DIR OR QT_QMAKE_CHANGED) + endif () # ask qmake for the translations directory if (QT_LIBRARY_DIR AND NOT QT_TRANSLATIONS_DIR OR QT_QMAKE_CHANGED) _qt4_query_qmake(QT_INSTALL_TRANSLATIONS qt_translations_dir) set(QT_TRANSLATIONS_DIR ${qt_translations_dir} CACHE PATH "The location of the Qt translations" FORCE) - endif (QT_LIBRARY_DIR AND NOT QT_TRANSLATIONS_DIR OR QT_QMAKE_CHANGED) + endif () # ask qmake for the imports directory if (QT_LIBRARY_DIR AND NOT QT_IMPORTS_DIR OR QT_QMAKE_CHANGED) @@ -701,15 +701,15 @@ if (QT_QMAKE_EXECUTABLE AND QTVERSION) set(QT_IMPORTS_DIR NOTFOUND) foreach(qt_cross_path ${CMAKE_FIND_ROOT_PATH}) set(qt_cross_paths ${qt_cross_paths} "${qt_cross_path}/imports") - endforeach(qt_cross_path) + endforeach() find_path(QT_IMPORTS_DIR NAMES Qt HINTS ${qt_cross_paths} ${qt_imports_dir} DOC "The location of the Qt imports" NO_CMAKE_PATH NO_CMAKE_ENVIRONMENT_PATH NO_SYSTEM_ENVIRONMENT_PATH NO_CMAKE_SYSTEM_PATH) mark_as_advanced(QT_IMPORTS_DIR) - endif(qt_imports_dir) - endif (QT_LIBRARY_DIR AND NOT QT_IMPORTS_DIR OR QT_QMAKE_CHANGED) + endif() + endif () # Make variables changeble to the advanced user mark_as_advanced( QT_LIBRARY_DIR QT_DOC_DIR QT_MKSPECS_DIR @@ -736,16 +736,16 @@ if (QT_QMAKE_EXECUTABLE AND QTVERSION) if(Q_WS_MAC) if(QT_QMAKE_CHANGED) unset(QT_MAC_USE_COCOA CACHE) - endif(QT_QMAKE_CHANGED) + endif() CHECK_CXX_SYMBOL_EXISTS(QT_MAC_USE_COCOA "QtCore/qconfig.h" QT_MAC_USE_COCOA) - endif(Q_WS_MAC) + endif() if (QT_QTCOPY_REQUIRED) CHECK_CXX_SYMBOL_EXISTS(QT_IS_QTCOPY "QtCore/qglobal.h" QT_KDE_QT_COPY) if (NOT QT_IS_QTCOPY) message(FATAL_ERROR "qt-copy is required, but hasn't been found") - endif (NOT QT_IS_QTCOPY) - endif (QT_QTCOPY_REQUIRED) + endif () + endif () # Restore CMAKE_REQUIRED_INCLUDES and CMAKE_REQUIRED_FLAGS variables set(CMAKE_REQUIRED_INCLUDES ${CMAKE_REQUIRED_INCLUDES_SAVE}) @@ -768,7 +768,7 @@ if (QT_QMAKE_EXECUTABLE AND QTVERSION) if(Q_WS_X11) set(QT_MODULES ${QT_MODULES} QtMotif) - endif(Q_WS_X11) + endif() if(QT_QMAKE_CHANGED) foreach(QT_MODULE ${QT_MODULES}) @@ -776,7 +776,7 @@ if (QT_QMAKE_EXECUTABLE AND QTVERSION) set(QT_${_upper_qt_module}_INCLUDE_DIR NOTFOUND) set(QT_${_upper_qt_module}_LIBRARY_RELEASE NOTFOUND) set(QT_${_upper_qt_module}_LIBRARY_DEBUG NOTFOUND) - endforeach(QT_MODULE) + endforeach() set(QT_QTDESIGNERCOMPONENTS_INCLUDE_DIR NOTFOUND) set(QT_QTDESIGNERCOMPONENTS_LIBRARY_RELEASE NOTFOUND) set(QT_QTDESIGNERCOMPONENTS_LIBRARY_DEBUG NOTFOUND) @@ -797,8 +797,8 @@ if (QT_QMAKE_EXECUTABLE AND QTVERSION) if(Q_WS_WIN) set(QT_QTMAIN_LIBRARY_DEBUG NOTFOUND) set(QT_QTMAIN_LIBRARY_RELEASE NOTFOUND) - endif(Q_WS_WIN) - endif(QT_QMAKE_CHANGED) + endif() + endif() foreach(QT_MODULE ${QT_MODULES}) string(TOUPPER ${QT_MODULE} _upper_qt_module) @@ -817,8 +817,8 @@ if (QT_QMAKE_EXECUTABLE AND QTVERSION) ${QT_LIBRARY_DIR}/${QT_MODULE}.framework/Headers NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH ) - endif(${QT_MODULE} STREQUAL "phonon") - endforeach(QT_MODULE) + endif() + endforeach() if(Q_WS_WIN) set(QT_MODULES ${QT_MODULES} QAxContainer QAxServer) @@ -831,7 +831,7 @@ if (QT_QMAKE_EXECUTABLE AND QTVERSION) PATHS ${QT_HEADERS_DIR}/ActiveQt NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH ) - endif(Q_WS_WIN) + endif() # Set QT_QTDESIGNERCOMPONENTS_INCLUDE_DIR find_path(QT_QTDESIGNERCOMPONENTS_INCLUDE_DIR QDesignerComponents @@ -874,13 +874,13 @@ if (QT_QMAKE_EXECUTABLE AND QTVERSION) NAMES ${QT_MODULE}${QT_LIBINFIX}_debug ${QT_MODULE}${QT_LIBINFIX}d ${QT_MODULE}${QT_LIBINFIX}d4 PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH ) - endforeach(QT_MODULE) + endforeach() # QtUiTools is sometimes not in the same directory as the other found libraries # e.g. on Mac, its never a framework like the others are if(QT_QTCORE_LIBRARY_RELEASE AND NOT QT_QTUITOOLS_LIBRARY_RELEASE) find_library(QT_QTUITOOLS_LIBRARY_RELEASE NAMES QtUiTools${QT_LIBINFIX} PATHS ${QT_LIBRARY_DIR}) - endif(QT_QTCORE_LIBRARY_RELEASE AND NOT QT_QTUITOOLS_LIBRARY_RELEASE) + endif() # Set QT_QTDESIGNERCOMPONENTS_LIBRARY find_library(QT_QTDESIGNERCOMPONENTS_LIBRARY_RELEASE NAMES QtDesignerComponents${QT_LIBINFIX} QtDesignerComponents${QT_LIBINFIX}4 PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH) @@ -890,7 +890,7 @@ if (QT_QMAKE_EXECUTABLE AND QTVERSION) if(Q_WS_WIN) find_library(QT_QTMAIN_LIBRARY_RELEASE NAMES qtmain${QT_LIBINFIX} PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH) find_library(QT_QTMAIN_LIBRARY_DEBUG NAMES qtmain${QT_LIBINFIX}d PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH) - endif(Q_WS_WIN) + endif() # Set QT_QTASSISTANTCLIENT_LIBRARY find_library(QT_QTASSISTANTCLIENT_LIBRARY_RELEASE NAMES QtAssistantClient${QT_LIBINFIX} QtAssistantClient${QT_LIBINFIX}4 PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH) @@ -905,7 +905,7 @@ if (QT_QMAKE_EXECUTABLE AND QTVERSION) find_library(QT_QTCLUCENE_LIBRARY_DEBUG NAMES QtCLucene${QT_LIBINFIX}_debug QtCLucene${QT_LIBINFIX}d QtCLucene${QT_LIBINFIX}d4 PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH) if(Q_WS_MAC AND QT_QTCORE_LIBRARY_RELEASE AND NOT QT_QTCLUCENE_LIBRARY_RELEASE) find_library(QT_QTCLUCENE_LIBRARY_RELEASE NAMES QtCLucene${QT_LIBINFIX} PATHS ${QT_LIBRARY_DIR}) - endif(Q_WS_MAC AND QT_QTCORE_LIBRARY_RELEASE AND NOT QT_QTCLUCENE_LIBRARY_RELEASE) + endif() ############################################ @@ -921,7 +921,7 @@ if (QT_QMAKE_EXECUTABLE AND QTVERSION) foreach(QT_MODULE ${QT_MODULES}) _QT4_ADJUST_LIB_VARS(${QT_MODULE}) - endforeach(QT_MODULE) + endforeach() _QT4_ADJUST_LIB_VARS(QtAssistant) _QT4_ADJUST_LIB_VARS(QtAssistantClient) @@ -933,7 +933,7 @@ if (QT_QMAKE_EXECUTABLE AND QTVERSION) _QT4_ADJUST_LIB_VARS(qtmain) _QT4_ADJUST_LIB_VARS(QAxServer) _QT4_ADJUST_LIB_VARS(QAxContainer) - endif(Q_WS_WIN) + endif() ####################################### @@ -956,7 +956,7 @@ if (QT_QMAKE_EXECUTABLE AND QTVERSION) set(QT_QCOLLECTIONGENERATOR_EXECUTABLE NOTFOUND) set(QT_DESIGNER_EXECUTABLE NOTFOUND) set(QT_LINGUIST_EXECUTABLE NOTFOUND) - endif(QT_QMAKE_CHANGED) + endif() find_program(QT_MOC_EXECUTABLE NAMES moc-qt4 moc @@ -1026,11 +1026,11 @@ if (QT_QMAKE_EXECUTABLE AND QTVERSION) if (QT_MOC_EXECUTABLE) set(QT_WRAP_CPP "YES") - endif (QT_MOC_EXECUTABLE) + endif () if (QT_UIC_EXECUTABLE) set(QT_WRAP_UI "YES") - endif (QT_UIC_EXECUTABLE) + endif () @@ -1100,9 +1100,9 @@ if (QT_QMAKE_EXECUTABLE AND QTVERSION) unset(QT_${_upper_qt_plugin}_PLUGIN_RELEASE CACHE) unset(QT_${_upper_qt_plugin}_PLUGIN_DEBUG CACHE) unset(QT_${_upper_qt_plugin}_PLUGIN CACHE) - endforeach(QT_PLUGIN) - endforeach(QT_PLUGIN_TYPE) - endif(QT_QMAKE_CHANGED) + endforeach() + endforeach() + endif() # find_library works better than find_file but we need to set prefixes to only match plugins foreach(QT_PLUGIN_TYPE ${QT_PLUGIN_TYPES}) @@ -1120,7 +1120,7 @@ if (QT_QMAKE_EXECUTABLE AND QTVERSION) PATHS ${QT_${_upper_qt_plugin_type}_PLUGINS_DIR} NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH ) _QT4_ADJUST_LIB_VARS(${QT_PLUGIN}) - else(QT_IS_STATIC) + else() # find_library works easier/better than find_file but we need to set suffixes to only match plugins set(CMAKE_FIND_LIBRARY_SUFFIXES_DEFAULT ${CMAKE_FIND_LIBRARY_SUFFIXES}) set(CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_SHARED_MODULE_SUFFIX} ${CMAKE_SHARED_LIBRARY_SUFFIX}) @@ -1134,9 +1134,9 @@ if (QT_QMAKE_EXECUTABLE AND QTVERSION) ) mark_as_advanced(QT_${_upper_qt_plugin}_PLUGIN_RELEASE QT_${_upper_qt_plugin}_PLUGIN_DEBUG) set(CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES_DEFAULT}) - endif(QT_IS_STATIC) - endforeach(QT_PLUGIN) - endforeach(QT_PLUGIN_TYPE) + endif() + endforeach() + endforeach() ###################################### @@ -1152,12 +1152,12 @@ if (QT_QMAKE_EXECUTABLE AND QTVERSION) string(REGEX REPLACE "^[0-9]+\\.([0-9])+\\.[0-9]+.*" "\\1" QT_VERSION_MINOR "${QTVERSION}") string(REGEX REPLACE "^[0-9]+\\.[0-9]+\\.([0-9]+).*" "\\1" QT_VERSION_PATCH "${QTVERSION}") -endif(QT_QMAKE_EXECUTABLE AND QTVERSION) +endif() #support old QT_MIN_VERSION if set, but not if version is supplied by find_package() if(NOT Qt4_FIND_VERSION AND QT_MIN_VERSION) set(Qt4_FIND_VERSION ${QT_MIN_VERSION}) -endif(NOT Qt4_FIND_VERSION AND QT_MIN_VERSION) +endif() if( Qt4_FIND_COMPONENTS ) @@ -1168,34 +1168,34 @@ if( Qt4_FIND_COMPONENTS ) if(${_COMPONENT} STREQUAL "QTMAIN") if(Q_WS_WIN) set(_QT4_FOUND_REQUIRED_VARS ${_QT4_FOUND_REQUIRED_VARS} QT_${_COMPONENT}_LIBRARY) - endif(Q_WS_WIN) - else(${_COMPONENT} STREQUAL "QTMAIN") + endif() + else() set(_QT4_FOUND_REQUIRED_VARS ${_QT4_FOUND_REQUIRED_VARS} QT_${_COMPONENT}_INCLUDE_DIR QT_${_COMPONENT}_LIBRARY) - endif(${_COMPONENT} STREQUAL "QTMAIN") - endforeach( component ) + endif() + endforeach() if(Qt4_FIND_COMPONENTS MATCHES QtGui) set(_QT4_FOUND_REQUIRED_VARS ${_QT4_FOUND_REQUIRED_VARS} QT_UIC_EXECUTABLE) - endif(Qt4_FIND_COMPONENTS MATCHES QtGui) + endif() -else( Qt4_FIND_COMPONENTS ) +else() # if no components specified, we'll make a default set of required variables to say Qt is found set(_QT4_FOUND_REQUIRED_VARS QT_QMAKE_EXECUTABLE QT_MOC_EXECUTABLE QT_RCC_EXECUTABLE QT_UIC_EXECUTABLE QT_INCLUDE_DIR QT_LIBRARY_DIR QT_QTCORE_LIBRARY) -endif( Qt4_FIND_COMPONENTS ) +endif() if (QT_VERSION_MAJOR GREATER 4) set(VERSION_MSG "Found unsuitable Qt version \"${QTVERSION}\" from ${QT_QMAKE_EXECUTABLE}") set(QT4_FOUND FALSE) if(Qt4_FIND_REQUIRED) message( FATAL_ERROR "${VERSION_MSG}, this code requires Qt 4.x") - else(Qt4_FIND_REQUIRED) + else() if(NOT Qt4_FIND_QUIETLY) message( STATUS "${VERSION_MSG}") - endif(NOT Qt4_FIND_QUIETLY) - endif(Qt4_FIND_REQUIRED) + endif() + endif() else() FIND_PACKAGE_HANDLE_STANDARD_ARGS(Qt4 REQUIRED_VARS ${_QT4_FOUND_REQUIRED_VARS} diff --git a/Modules/FindQuickTime.cmake b/Modules/FindQuickTime.cmake index 518f423..57de737 100644 --- a/Modules/FindQuickTime.cmake +++ b/Modules/FindQuickTime.cmake @@ -28,7 +28,7 @@ if(APPLE) find_path(QUICKTIME_INCLUDE_DIR QuickTime/QuickTime.h) find_library(QUICKTIME_LIBRARY QuickTime) -else(APPLE) +else() find_path(QUICKTIME_INCLUDE_DIR QuickTime.h HINTS $ENV{QUICKTIME_DIR}/include @@ -39,7 +39,7 @@ else(APPLE) $ENV{QUICKTIME_DIR}/lib $ENV{QUICKTIME_DIR} ) -endif(APPLE) +endif() # handle the QUIETLY and REQUIRED arguments and set QUICKTIME_FOUND to TRUE if # all listed variables are TRUE diff --git a/Modules/FindRTI.cmake b/Modules/FindRTI.cmake index e806e03..eef0dae 100644 --- a/Modules/FindRTI.cmake +++ b/Modules/FindRTI.cmake @@ -32,14 +32,14 @@ macro(RTI_MESSAGE_QUIETLY QUIET TYPE MSG) if(NOT ${QUIET}) message(${TYPE} "${MSG}") - endif(NOT ${QUIET}) -endmacro(RTI_MESSAGE_QUIETLY QUIET TYPE MSG) + endif() +endmacro() # Detect the CERTI installation, http://www.cert.fr/CERTI if ("$ENV{CERTI_HOME}" STRGREATER "") file(TO_CMAKE_PATH "$ENV{CERTI_HOME}" CERTI_HOME) RTI_MESSAGE_QUIETLY(RTI_FIND_QUIETLY STATUS "Using environment defined CERTI_HOME: ${CERTI_HOME}") -endif ("$ENV{CERTI_HOME}" STRGREATER "") +endif () set(RTI_DEFINITIONS "-DRTI_USES_STD_FSTREAM") @@ -65,9 +65,9 @@ find_library(RTI_LIBRARY if (RTI_LIBRARY) set(RTI_LIBRARIES ${RTI_LIBRARY}) RTI_MESSAGE_QUIETLY(RTI_FIND_QUIETLY STATUS "RTI library found: ${RTI_LIBRARY}") -else (RTI_LIBRARY) +else () RTI_MESSAGE_QUIETLY(RTI_FIND_QUIETLY STATUS "RTI library NOT found") -endif (RTI_LIBRARY) +endif () find_library(RTI_FEDTIME_LIBRARY NAMES FedTime @@ -78,7 +78,7 @@ find_library(RTI_FEDTIME_LIBRARY if (RTI_FEDTIME_LIBRARY) set(RTI_LIBRARIES ${RTI_LIBRARIES} ${RTI_FEDTIME_LIBRARY}) RTI_MESSAGE_QUIETLY(RTI_FIND_QUIETLY STATUS "RTI FedTime found: ${RTI_FEDTIME_LIBRARY}") -endif (RTI_FEDTIME_LIBRARY) +endif () find_path(RTI_INCLUDE_DIR NAMES RTI.hh @@ -88,9 +88,9 @@ find_path(RTI_INCLUDE_DIR if (RTI_INCLUDE_DIR) RTI_MESSAGE_QUIETLY(RTI_FIND_QUIETLY STATUS "RTI headers found: ${RTI_INCLUDE_DIR}") -else (RTI_INCLUDE_DIR) +else () RTI_MESSAGE_QUIETLY(RTI_FIND_QUIETLY STATUS "RTI headers NOT found") -endif (RTI_INCLUDE_DIR) +endif () # Set the modified system variables back to the original value. set(CMAKE_FIND_LIBRARY_PREFIXES "${RTI_OLD_FIND_LIBRARY_PREFIXES}") diff --git a/Modules/FindRuby.cmake b/Modules/FindRuby.cmake index b4a306a..119cb63 100644 --- a/Modules/FindRuby.cmake +++ b/Modules/FindRuby.cmake @@ -46,16 +46,16 @@ set(_RUBY_POSSIBLE_EXECUTABLE_NAMES ruby) # if 1.9 is required, don't look for ruby18 and ruby1.8, default to version 1.8 if(Ruby_FIND_VERSION_MAJOR AND Ruby_FIND_VERSION_MINOR) set(Ruby_FIND_VERSION_SHORT_NODOT "${Ruby_FIND_VERSION_MAJOR}${RUBY_FIND_VERSION_MINOR}") -else(Ruby_FIND_VERSION_MAJOR AND Ruby_FIND_VERSION_MINOR) +else() set(Ruby_FIND_VERSION_SHORT_NODOT "18") -endif(Ruby_FIND_VERSION_MAJOR AND Ruby_FIND_VERSION_MINOR) +endif() set(_RUBY_POSSIBLE_EXECUTABLE_NAMES ${_RUBY_POSSIBLE_EXECUTABLE_NAMES} ruby1.9 ruby19) # if we want a version below 1.9, also look for ruby 1.8 if("${Ruby_FIND_VERSION_SHORT_NODOT}" VERSION_LESS "19") set(_RUBY_POSSIBLE_EXECUTABLE_NAMES ${_RUBY_POSSIBLE_EXECUTABLE_NAMES} ruby1.8 ruby18) -endif("${Ruby_FIND_VERSION_SHORT_NODOT}" VERSION_LESS "19") +endif() find_program(RUBY_EXECUTABLE NAMES ${_RUBY_POSSIBLE_EXECUTABLE_NAMES}) @@ -71,9 +71,9 @@ if(RUBY_EXECUTABLE AND NOT RUBY_VERSION_MAJOR) RESULT_VARIABLE _RUBY_SUCCESS OUTPUT_VARIABLE _RUBY_OUTPUT ERROR_QUIET) - endif(_RUBY_SUCCESS OR NOT _RUBY_OUTPUT) + endif() set(${OUTVAR} "${_RUBY_OUTPUT}" PARENT_SCOPE) - endfunction(_RUBY_CONFIG_VAR) + endfunction() # query the ruby version @@ -99,7 +99,7 @@ if(RUBY_EXECUTABLE AND NOT RUBY_VERSION_MAJOR) if(RUBY_HAS_VENDOR_RUBY) _RUBY_CONFIG_VAR("vendorlibdir" RUBY_VENDORLIB_DIR) _RUBY_CONFIG_VAR("vendorarchdir" RUBY_VENDORARCH_DIR) - endif(RUBY_HAS_VENDOR_RUBY) + endif() # save the results in the cache so we don't have to run ruby the next time again set(RUBY_VERSION_MAJOR ${RUBY_VERSION_MAJOR} CACHE PATH "The Ruby major version" FORCE) @@ -130,7 +130,7 @@ if(RUBY_EXECUTABLE AND NOT RUBY_VERSION_MAJOR) RUBY_VERSION_MINOR RUBY_VERSION_PATCH ) -endif(RUBY_EXECUTABLE AND NOT RUBY_VERSION_MAJOR) +endif() # In case RUBY_EXECUTABLE could not be executed (e.g. cross compiling) # try to detect which version we found. This is not too good. @@ -143,15 +143,15 @@ if(RUBY_EXECUTABLE AND NOT RUBY_VERSION_MAJOR) if(${RUBY_EXECUTABLE} MATCHES "ruby1.?9" OR RUBY_HDR_DIR) set(RUBY_VERSION_MAJOR 1) set(RUBY_VERSION_MINOR 9) - endif(${RUBY_EXECUTABLE} MATCHES "ruby1.?9" OR RUBY_HDR_DIR) -endif(RUBY_EXECUTABLE AND NOT RUBY_VERSION_MAJOR) + endif() +endif() if(RUBY_VERSION_MAJOR) set(RUBY_VERSION "${RUBY_VERSION_MAJOR}.${RUBY_VERSION_MINOR}.${RUBY_VERSION_PATCH}") set(_RUBY_VERSION_SHORT "${RUBY_VERSION_MAJOR}.${RUBY_VERSION_MINOR}") set(_RUBY_VERSION_SHORT_NODOT "${RUBY_VERSION_MAJOR}${RUBY_VERSION_MINOR}") set(_RUBY_NODOT_VERSION "${RUBY_VERSION_MAJOR}${RUBY_VERSION_MINOR}${RUBY_VERSION_PATCH}") -endif(RUBY_VERSION_MAJOR) +endif() find_path(RUBY_INCLUDE_DIR NAMES ruby.h @@ -172,7 +172,7 @@ if( "${Ruby_FIND_VERSION_SHORT_NODOT}" GREATER 18 OR "${_RUBY_VERSION_SHORT_NO ) set(RUBY_INCLUDE_DIRS ${RUBY_INCLUDE_DIRS} ${RUBY_CONFIG_INCLUDE_DIR} ) -endif( "${Ruby_FIND_VERSION_SHORT_NODOT}" GREATER 18 OR "${_RUBY_VERSION_SHORT_NODOT}" GREATER 18 OR RUBY_HDR_DIR) +endif() # Determine the list of possible names for the ruby library @@ -182,26 +182,26 @@ if(WIN32) set( _RUBY_MSVC_RUNTIME "" ) if( MSVC60 ) set( _RUBY_MSVC_RUNTIME "60" ) - endif( MSVC60 ) + endif() if( MSVC70 ) set( _RUBY_MSVC_RUNTIME "70" ) - endif( MSVC70 ) + endif() if( MSVC71 ) set( _RUBY_MSVC_RUNTIME "71" ) - endif( MSVC71 ) + endif() if( MSVC80 ) set( _RUBY_MSVC_RUNTIME "80" ) - endif( MSVC80 ) + endif() if( MSVC90 ) set( _RUBY_MSVC_RUNTIME "90" ) - endif( MSVC90 ) + endif() list(APPEND _RUBY_POSSIBLE_LIB_NAMES "msvcr${_RUBY_MSVC_RUNTIME}-ruby${_RUBY_NODOT_VERSION}" "msvcr${_RUBY_MSVC_RUNTIME}-ruby${_RUBY_NODOT_VERSION}-static" "msvcrt-ruby${_RUBY_NODOT_VERSION}" "msvcrt-ruby${_RUBY_NODOT_VERSION}-static" ) -endif(WIN32) +endif() find_library(RUBY_LIBRARY NAMES ${_RUBY_POSSIBLE_LIB_NAMES} HINTS ${RUBY_POSSIBLE_LIB_DIR} ) @@ -209,7 +209,7 @@ include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake) set(_RUBY_REQUIRED_VARS RUBY_EXECUTABLE RUBY_INCLUDE_DIR RUBY_LIBRARY) if(_RUBY_VERSION_SHORT_NODOT GREATER 18) list(APPEND _RUBY_REQUIRED_VARS RUBY_CONFIG_INCLUDE_DIR) -endif(_RUBY_VERSION_SHORT_NODOT GREATER 18) +endif() if(_RUBY_DEBUG_OUTPUT) message(STATUS "--------FindRuby.cmake debug------------") @@ -225,7 +225,7 @@ if(_RUBY_DEBUG_OUTPUT) message(STATUS "RUBY_INCLUDE_DIR: ${RUBY_INCLUDE_DIR}") message(STATUS "RUBY_CONFIG_INCLUDE_DIR: ${RUBY_CONFIG_INCLUDE_DIR}") message(STATUS "--------------------") -endif(_RUBY_DEBUG_OUTPUT) +endif() FIND_PACKAGE_HANDLE_STANDARD_ARGS(Ruby REQUIRED_VARS ${_RUBY_REQUIRED_VARS} VERSION_VAR RUBY_VERSION ) diff --git a/Modules/FindSDL.cmake b/Modules/FindSDL.cmake index 65fea84..806b659 100644 --- a/Modules/FindSDL.cmake +++ b/Modules/FindSDL.cmake @@ -113,8 +113,8 @@ if(NOT SDL_BUILDING_LIBRARY) /opt/csw /opt ) - endif(NOT ${SDL_INCLUDE_DIR} MATCHES ".framework") -endif(NOT SDL_BUILDING_LIBRARY) + endif() +endif() # SDL may require threads on your system. # The Apple build may not need an explicit flag because one of the @@ -122,22 +122,22 @@ endif(NOT SDL_BUILDING_LIBRARY) # But for non-OSX systems, I will use the CMake Threads package. if(NOT APPLE) find_package(Threads) -endif(NOT APPLE) +endif() # MinGW needs an additional library, mwindows # It's total link flags should look like -lmingw32 -lSDLmain -lSDL -lmwindows # (Actually on second look, I think it only needs one of the m* libraries.) if(MINGW) set(MINGW32_LIBRARY mingw32 CACHE STRING "mwindows for MinGW") -endif(MINGW) +endif() if(SDL_LIBRARY_TEMP) # For SDLmain if(NOT SDL_BUILDING_LIBRARY) if(SDLMAIN_LIBRARY) set(SDL_LIBRARY_TEMP ${SDLMAIN_LIBRARY} ${SDL_LIBRARY_TEMP}) - endif(SDLMAIN_LIBRARY) - endif(NOT SDL_BUILDING_LIBRARY) + endif() + endif() # For OS X, SDL uses Cocoa as a backend so it must link to Cocoa. # CMake doesn't display the -framework Cocoa string in the UI even @@ -147,25 +147,25 @@ if(SDL_LIBRARY_TEMP) # "real" variable in one-shot. if(APPLE) set(SDL_LIBRARY_TEMP ${SDL_LIBRARY_TEMP} "-framework Cocoa") - endif(APPLE) + endif() # For threads, as mentioned Apple doesn't need this. # In fact, there seems to be a problem if I used the Threads package # and try using this line, so I'm just skipping it entirely for OS X. if(NOT APPLE) set(SDL_LIBRARY_TEMP ${SDL_LIBRARY_TEMP} ${CMAKE_THREAD_LIBS_INIT}) - endif(NOT APPLE) + endif() # For MinGW library if(MINGW) set(SDL_LIBRARY_TEMP ${MINGW32_LIBRARY} ${SDL_LIBRARY_TEMP}) - endif(MINGW) + endif() # Set the final string here so the GUI reflects the final state. set(SDL_LIBRARY ${SDL_LIBRARY_TEMP} CACHE STRING "Where the SDL Library can be found") # Set the temp variable to INTERNAL so it is not seen in the CMake GUI set(SDL_LIBRARY_TEMP "${SDL_LIBRARY_TEMP}" CACHE INTERNAL "") -endif(SDL_LIBRARY_TEMP) +endif() include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake) diff --git a/Modules/FindSDL_sound.cmake b/Modules/FindSDL_sound.cmake index 06ae203..3685956 100644 --- a/Modules/FindSDL_sound.cmake +++ b/Modules/FindSDL_sound.cmake @@ -172,7 +172,7 @@ if(SDL_FOUND AND SDL_SOUND_INCLUDE_DIR AND SDL_SOUND_LIBRARY) set(TMP_TRY_LIBS) foreach(lib ${SDL_SOUND_LIBRARY} ${SDL_LIBRARY}) set(TMP_TRY_LIBS "${TMP_TRY_LIBS} \"${lib}\"") - endforeach(lib) + endforeach() # message("TMP_TRY_LIBS ${TMP_TRY_LIBS}") @@ -225,8 +225,8 @@ if(SDL_FOUND AND SDL_SOUND_INCLUDE_DIR AND SDL_SOUND_LIBRARY) ) if(MIKMOD_LIBRARY) set(SDL_SOUND_LIBRARIES_TMP ${SDL_SOUND_LIBRARIES_TMP} ${MIKMOD_LIBRARY}) - endif(MIKMOD_LIBRARY) - endif("${MY_OUTPUT}" MATCHES "MikMod_") + endif() + endif() # Find ModPlug if("${MY_OUTPUT}" MATCHES "MODPLUG_") @@ -246,8 +246,8 @@ if(SDL_FOUND AND SDL_SOUND_INCLUDE_DIR AND SDL_SOUND_LIBRARY) ) if(MODPLUG_LIBRARY) set(SDL_SOUND_LIBRARIES_TMP ${SDL_SOUND_LIBRARIES_TMP} ${MODPLUG_LIBRARY}) - endif(MODPLUG_LIBRARY) - endif("${MY_OUTPUT}" MATCHES "MODPLUG_") + endif() + endif() # Find Ogg and Vorbis @@ -270,7 +270,7 @@ if(SDL_FOUND AND SDL_SOUND_INCLUDE_DIR AND SDL_SOUND_LIBRARY) ) if(VORBIS_LIBRARY) set(SDL_SOUND_LIBRARIES_TMP ${SDL_SOUND_LIBRARIES_TMP} ${VORBIS_LIBRARY}) - endif(VORBIS_LIBRARY) + endif() find_library(OGG_LIBRARY NAMES ogg Ogg OGG @@ -290,8 +290,8 @@ if(SDL_FOUND AND SDL_SOUND_INCLUDE_DIR AND SDL_SOUND_LIBRARY) ) if(OGG_LIBRARY) set(SDL_SOUND_LIBRARIES_TMP ${SDL_SOUND_LIBRARIES_TMP} ${OGG_LIBRARY}) - endif(OGG_LIBRARY) - endif("${MY_OUTPUT}" MATCHES "ov_") + endif() + endif() # Find SMPEG @@ -312,8 +312,8 @@ if(SDL_FOUND AND SDL_SOUND_INCLUDE_DIR AND SDL_SOUND_LIBRARY) ) if(SMPEG_LIBRARY) set(SDL_SOUND_LIBRARIES_TMP ${SDL_SOUND_LIBRARIES_TMP} ${SMPEG_LIBRARY}) - endif(SMPEG_LIBRARY) - endif("${MY_OUTPUT}" MATCHES "SMPEG_") + endif() + endif() # Find FLAC @@ -334,8 +334,8 @@ if(SDL_FOUND AND SDL_SOUND_INCLUDE_DIR AND SDL_SOUND_LIBRARY) ) if(FLAC_LIBRARY) set(SDL_SOUND_LIBRARIES_TMP ${SDL_SOUND_LIBRARIES_TMP} ${FLAC_LIBRARY}) - endif(FLAC_LIBRARY) - endif("${MY_OUTPUT}" MATCHES "FLAC_") + endif() + endif() # Hmmm...Speex seems to depend on Ogg. This might be a problem if @@ -359,7 +359,7 @@ if(SDL_FOUND AND SDL_SOUND_INCLUDE_DIR AND SDL_SOUND_LIBRARY) ) if(SPEEX_LIBRARY) set(SDL_SOUND_LIBRARIES_TMP ${SDL_SOUND_LIBRARIES_TMP} ${SPEEX_LIBRARY}) - endif(SPEEX_LIBRARY) + endif() # Find OGG (needed for Speex) # We might have already found Ogg for Vorbis, so skip it if so. @@ -384,16 +384,16 @@ if(SDL_FOUND AND SDL_SOUND_INCLUDE_DIR AND SDL_SOUND_LIBRARY) ) if(OGG_LIBRARY) set(SDL_SOUND_LIBRARIES_TMP ${SDL_SOUND_LIBRARIES_TMP} ${OGG_LIBRARY}) - endif(OGG_LIBRARY) - endif(NOT OGG_LIBRARY) - endif("${MY_OUTPUT}" MATCHES "speex_") + endif() + endif() + endif() - else(NOT MY_RESULT) + else() set(SDL_SOUND_LIBRARIES "${SDL_SOUND_EXTRAS} ${SDL_SOUND_LIBRARY}" CACHE INTERNAL "SDL_sound and dependent libraries") - endif(NOT MY_RESULT) + endif() set(SDL_SOUND_LIBRARIES "${SDL_SOUND_EXTRAS} ${SDL_SOUND_LIBRARIES_TMP}" CACHE INTERNAL "SDL_sound and dependent libraries") - endif(SDL_FOUND AND SDL_SOUND_INCLUDE_DIR AND SDL_SOUND_LIBRARY) + endif() include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake) diff --git a/Modules/FindSWIG.cmake b/Modules/FindSWIG.cmake index 33cf9d1..db60b88 100644 --- a/Modules/FindSWIG.cmake +++ b/Modules/FindSWIG.cmake @@ -38,10 +38,10 @@ if(SWIG_EXECUTABLE) if(SWIG_swiglib_result) if(SWIG_FIND_REQUIRED) message(SEND_ERROR "Command \"${SWIG_EXECUTABLE} -swiglib\" failed with output:\n${SWIG_swiglib_error}") - else(SWIG_FIND_REQUIRED) + else() message(STATUS "Command \"${SWIG_EXECUTABLE} -swiglib\" failed with output:\n${SWIG_swiglib_error}") - endif(SWIG_FIND_REQUIRED) - else(SWIG_swiglib_result) + endif() + else() string(REGEX REPLACE "[\n\r]+" ";" SWIG_swiglib_output ${SWIG_swiglib_output}) # force the path to be computed each time in case SWIG_EXECUTABLE has changed. set(SWIG_DIR SWIG_DIR-NOTFOUND) @@ -54,14 +54,14 @@ if(SWIG_EXECUTABLE) RESULT_VARIABLE SWIG_version_result) if(SWIG_version_result) message(SEND_ERROR "Command \"${SWIG_EXECUTABLE} -version\" failed with output:\n${SWIG_version_output}") - else(SWIG_version_result) + else() string(REGEX REPLACE ".*SWIG Version[^0-9.]*\([0-9.]+\).*" "\\1" SWIG_version_output "${SWIG_version_output}") set(SWIG_VERSION ${SWIG_version_output} CACHE STRING "Swig version" FORCE) - endif(SWIG_version_result) - endif(SWIG_DIR) - endif(SWIG_swiglib_result) -endif(SWIG_EXECUTABLE) + endif() + endif() + endif() +endif() include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake) FIND_PACKAGE_HANDLE_STANDARD_ARGS(SWIG REQUIRED_VARS SWIG_EXECUTABLE SWIG_DIR diff --git a/Modules/FindSelfPackers.cmake b/Modules/FindSelfPackers.cmake index 7d44661..7726dce 100644 --- a/Modules/FindSelfPackers.cmake +++ b/Modules/FindSelfPackers.cmake @@ -49,18 +49,18 @@ mark_as_advanced( if (SELF_PACKER_FOR_EXECUTABLE MATCHES "upx") set (SELF_PACKER_FOR_EXECUTABLE_FLAGS "-q" CACHE STRING "Flags for the executable self-packer.") -else (SELF_PACKER_FOR_EXECUTABLE MATCHES "upx") +else () set (SELF_PACKER_FOR_EXECUTABLE_FLAGS "" CACHE STRING "Flags for the executable self-packer.") -endif (SELF_PACKER_FOR_EXECUTABLE MATCHES "upx") +endif () if (SELF_PACKER_FOR_SHARED_LIB MATCHES "upx") set (SELF_PACKER_FOR_SHARED_LIB_FLAGS "-q" CACHE STRING "Flags for the shared lib self-packer.") -else (SELF_PACKER_FOR_SHARED_LIB MATCHES "upx") +else () set (SELF_PACKER_FOR_SHARED_LIB_FLAGS "" CACHE STRING "Flags for the shared lib self-packer.") -endif (SELF_PACKER_FOR_SHARED_LIB MATCHES "upx") +endif () mark_as_advanced( SELF_PACKER_FOR_EXECUTABLE_FLAGS diff --git a/Modules/FindSquish.cmake b/Modules/FindSquish.cmake index 0127edc..b44ba70 100644 --- a/Modules/FindSquish.cmake +++ b/Modules/FindSquish.cmake @@ -20,7 +20,7 @@ # find_package(Squish) # if (SQUISH_FOUND) # SQUISH_ADD_TEST(myTestName myApplication testSuiteName testCaseName) -# endif (SQUISH_FOUND) +# endif () # #============================================================================= @@ -49,7 +49,7 @@ if(NOT SQUISH_INSTALL_DIR) set(SQUISH_INSTALL_DIR_SEARCH "") foreach(dir ${SQUISH_INSTALL_DIR_SEARCH2}) set(SQUISH_INSTALL_DIR_SEARCH ${SQUISH_INSTALL_DIR_SEARCH} "${dir}/../lib/fltk") - endforeach(dir) + endforeach() string(REPLACE "//" "/" SQUISH_INSTALL_DIR_SEARCH "${SQUISH_INSTALL_DIR_SEARCH}") # Look for an installation @@ -65,7 +65,7 @@ if(NOT SQUISH_INSTALL_DIR) DOC "The ${SQUISH_INSTALL_DIR_STRING}" ) -endif(NOT SQUISH_INSTALL_DIR) +endif() # search for the executables if(SQUISH_INSTALL_DIR) @@ -74,37 +74,37 @@ if(SQUISH_INSTALL_DIR) # find the client program if(NOT SQUISH_CLIENT_EXECUTABLE) find_program(SQUISH_CLIENT_EXECUTABLE ${SQUISH_INSTALL_DIR}/bin/squishrunner DOC "The ${SQUISH_CLIENT_EXECUTABLE_STRING}") - endif(NOT SQUISH_CLIENT_EXECUTABLE) + endif() # find the server program if(NOT SQUISH_SERVER_EXECUTABLE) find_program(SQUISH_SERVER_EXECUTABLE ${SQUISH_INSTALL_DIR}/bin/squishserver DOC "The ${SQUISH_SERVER_EXECUTABLE_STRING}") - endif(NOT SQUISH_SERVER_EXECUTABLE) + endif() -else(SQUISH_INSTALL_DIR) +else() set(SQUISH_INSTALL_DIR_FOUND 0) -endif(SQUISH_INSTALL_DIR) +endif() # record if executables are set if(SQUISH_CLIENT_EXECUTABLE) set(SQUISH_CLIENT_EXECUTABLE_FOUND 1) -else(SQUISH_CLIENT_EXECUTABLE) +else() set(SQUISH_CLIENT_EXECUTABLE_FOUND 0) -endif(SQUISH_CLIENT_EXECUTABLE) +endif() if(SQUISH_SERVER_EXECUTABLE) set(SQUISH_SERVER_EXECUTABLE_FOUND 1) -else(SQUISH_SERVER_EXECUTABLE) +else() set(SQUISH_SERVER_EXECUTABLE_FOUND 0) -endif(SQUISH_SERVER_EXECUTABLE) +endif() # record if Squish was found set(SQUISH_FOUND 1) foreach(var SQUISH_INSTALL_DIR_FOUND SQUISH_CLIENT_EXECUTABLE_FOUND SQUISH_SERVER_EXECUTABLE_FOUND) if(NOT ${var}) set(SQUISH_FOUND 0) - endif(NOT ${var}) -endforeach(var) + endif() +endforeach() macro(SQUISH_ADD_TEST testName testAUT testCase envVars testWraper) add_test(${testName} @@ -121,5 +121,5 @@ macro(SQUISH_ADD_TEST testName testAUT testCase envVars testWraper) set_tests_properties(${testName} PROPERTIES FAIL_REGULAR_EXPRESSION "FAILED;ERROR;FATAL" ) -endmacro(SQUISH_ADD_TEST) +endmacro() diff --git a/Modules/FindSubversion.cmake b/Modules/FindSubversion.cmake index 85c5105..f1bfc75 100644 --- a/Modules/FindSubversion.cmake +++ b/Modules/FindSubversion.cmake @@ -31,7 +31,7 @@ # message("Current revision is ${Project_WC_REVISION}") # Subversion_WC_LOG(${PROJECT_SOURCE_DIR} Project) # message("Last changed log is ${Project_LAST_CHANGED_LOG}") -# endif(SUBVERSION_FOUND) +# endif() #============================================================================= # Copyright 2006-2009 Kitware, Inc. @@ -81,7 +81,7 @@ if(Subversion_SVN_EXECUTABLE) if(NOT ${Subversion_svn_info_result} EQUAL 0) message(SEND_ERROR "Command \"${Subversion_SVN_EXECUTABLE} info ${dir}\" failed with output:\n${Subversion_svn_info_error}") - else(NOT ${Subversion_svn_info_result} EQUAL 0) + else() string(REGEX REPLACE "^(.*\n)?URL: ([^\n]+).*" "\\2" ${prefix}_WC_URL "${${prefix}_WC_INFO}") @@ -96,12 +96,12 @@ if(Subversion_SVN_EXECUTABLE) string(REGEX REPLACE "^(.*\n)?Last Changed Date: ([^\n]+).*" "\\2" ${prefix}_WC_LAST_CHANGED_DATE "${${prefix}_WC_INFO}") - endif(NOT ${Subversion_svn_info_result} EQUAL 0) + endif() # restore the previous LC_ALL set(ENV{LC_ALL} ${_Subversion_SAVED_LC_ALL}) - endmacro(Subversion_WC_INFO) + endmacro() macro(Subversion_WC_LOG dir prefix) # This macro can block if the certificate is not signed: @@ -117,10 +117,10 @@ if(Subversion_SVN_EXECUTABLE) if(NOT ${Subversion_svn_log_result} EQUAL 0) message(SEND_ERROR "Command \"${Subversion_SVN_EXECUTABLE} log -r BASE ${dir}\" failed with output:\n${Subversion_svn_log_error}") - endif(NOT ${Subversion_svn_log_result} EQUAL 0) - endmacro(Subversion_WC_LOG) + endif() + endmacro() -endif(Subversion_SVN_EXECUTABLE) +endif() include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake) FIND_PACKAGE_HANDLE_STANDARD_ARGS(Subversion REQUIRED_VARS Subversion_SVN_EXECUTABLE diff --git a/Modules/FindTCL.cmake b/Modules/FindTCL.cmake index 9fe2c7a..0d20da5 100644 --- a/Modules/FindTCL.cmake +++ b/Modules/FindTCL.cmake @@ -50,12 +50,12 @@ include(FindWish) if(TCLSH_VERSION_STRING) set(TCL_TCLSH_VERSION "${TCLSH_VERSION_STRING}") -else(TCLSH_VERSION_STRING) +else() get_filename_component(TCL_TCLSH_PATH "${TCL_TCLSH}" PATH) get_filename_component(TCL_TCLSH_PATH_PARENT "${TCL_TCLSH_PATH}" PATH) string(REGEX REPLACE "^.*tclsh([0-9]\\.*[0-9]).*$" "\\1" TCL_TCLSH_VERSION "${TCL_TCLSH}") -endif(TCLSH_VERSION_STRING) +endif() get_filename_component(TK_WISH_PATH "${TK_WISH}" PATH) get_filename_component(TK_WISH_PATH_PARENT "${TK_WISH_PATH}" PATH) @@ -101,7 +101,7 @@ if(WIN32) "C:/Program Files/Tcl/lib" "C:/Tcl/lib" ) -endif(WIN32) +endif() find_library(TCL_LIBRARY NAMES @@ -137,9 +137,9 @@ if(Tcl_FRAMEWORKS) if(NOT TCL_INCLUDE_PATH) foreach(dir ${Tcl_FRAMEWORKS}) set(TCL_FRAMEWORK_INCLUDES ${TCL_FRAMEWORK_INCLUDES} ${dir}/Headers) - endforeach(dir) - endif(NOT TCL_INCLUDE_PATH) -endif(Tcl_FRAMEWORKS) + endforeach() + endif() +endif() set(TK_FRAMEWORK_INCLUDES) if(Tk_FRAMEWORKS) @@ -147,9 +147,9 @@ if(Tk_FRAMEWORKS) foreach(dir ${Tk_FRAMEWORKS}) set(TK_FRAMEWORK_INCLUDES ${TK_FRAMEWORK_INCLUDES} ${dir}/Headers ${dir}/PrivateHeaders) - endforeach(dir) - endif(NOT TK_INCLUDE_PATH) -endif(Tk_FRAMEWORKS) + endforeach() + endif() +endif() set(TCLTK_POSSIBLE_INCLUDE_PATHS "${TCL_LIBRARY_PATH_PARENT}/include" @@ -183,7 +183,7 @@ if(WIN32) "C:/Program Files/Tcl/include" "C:/Tcl/include" ) -endif(WIN32) +endif() find_path(TCL_INCLUDE_PATH NAMES tcl.h diff --git a/Modules/FindTIFF.cmake b/Modules/FindTIFF.cmake index c09c4c9..b48fb0e 100644 --- a/Modules/FindTIFF.cmake +++ b/Modules/FindTIFF.cmake @@ -43,6 +43,6 @@ FIND_PACKAGE_HANDLE_STANDARD_ARGS(TIFF if(TIFF_FOUND) set( TIFF_LIBRARIES ${TIFF_LIBRARY} ) -endif(TIFF_FOUND) +endif() mark_as_advanced(TIFF_INCLUDE_DIR TIFF_LIBRARY) diff --git a/Modules/FindTclStub.cmake b/Modules/FindTclStub.cmake index cb77271..e66f7bc 100644 --- a/Modules/FindTclStub.cmake +++ b/Modules/FindTclStub.cmake @@ -85,7 +85,7 @@ if(WIN32) "C:/Program Files/Tcl/lib" "C:/Tcl/lib" ) -endif(WIN32) +endif() find_library(TCL_STUB_LIBRARY NAMES diff --git a/Modules/FindTclsh.cmake b/Modules/FindTclsh.cmake index 1e356f5..0f091e6 100644 --- a/Modules/FindTclsh.cmake +++ b/Modules/FindTclsh.cmake @@ -22,7 +22,7 @@ if(CYGWIN) find_program(TCL_TCLSH NAMES cygtclsh83 cygtclsh80) -endif(CYGWIN) +endif() get_filename_component(TK_WISH_PATH "${TK_WISH}" PATH) get_filename_component(TK_WISH_PATH_PARENT "${TK_WISH_PATH}" PATH) @@ -64,7 +64,7 @@ if(WIN32) "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Scriptics\\Tcl\\8.2;Root]/bin" "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Scriptics\\Tcl\\8.0;Root]/bin" ) -endif(WIN32) +endif() set(TCL_TCLSH_NAMES tclsh @@ -88,7 +88,7 @@ if(TCL_TCLSH) OUTPUT_VARIABLE TCLSH_VERSION_STRING ERROR_QUIET OUTPUT_STRIP_TRAILING_WHITESPACE) -endif(TCL_TCLSH) +endif() # handle the QUIETLY and REQUIRED arguments and set TIFF_FOUND to TRUE if # all listed variables are TRUE diff --git a/Modules/FindThreads.cmake b/Modules/FindThreads.cmake index 22bffef..5d76777 100644 --- a/Modules/FindThreads.cmake +++ b/Modules/FindThreads.cmake @@ -78,9 +78,9 @@ else() set(CMAKE_HAVE_THREADS_LIBRARY 1) set(Threads_FOUND TRUE) endif() - endif(CMAKE_SYSTEM MATCHES "SunOS.*") - endif(NOT CMAKE_HAVE_THREADS_LIBRARY) - endif(NOT THREADS_HAVE_PTHREAD_ARG) + endif() + endif() + endif() if(NOT CMAKE_HAVE_THREADS_LIBRARY) # If we did not found -lpthread, -lpthread, or -lthread, look for -pthread @@ -109,15 +109,15 @@ else() "Determining if compiler accepts -pthread failed with the following output:\n${OUTPUT}\n\n") endif() - endif("THREADS_HAVE_PTHREAD_ARG" MATCHES "^THREADS_HAVE_PTHREAD_ARG") + endif() if(THREADS_HAVE_PTHREAD_ARG) set(Threads_FOUND TRUE) set(CMAKE_THREAD_LIBS_INIT "-pthread") endif() - endif(NOT CMAKE_HAVE_THREADS_LIBRARY) - endif(CMAKE_HAVE_PTHREAD_H) + endif() + endif() endif() if(CMAKE_THREAD_LIBS_INIT OR CMAKE_HAVE_LIBC_CREATE) @@ -145,7 +145,7 @@ if(CMAKE_USE_PTHREADS_INIT) set(CMAKE_THREAD_LIBS_INIT "-lcma") set(CMAKE_HP_PTHREADS_INIT 1) set(Threads_FOUND TRUE) - endif(CMAKE_HAVE_HP_CMA) + endif() set(CMAKE_USE_PTHREADS_INIT 1) endif() @@ -160,7 +160,7 @@ if(CMAKE_USE_PTHREADS_INIT) set(CMAKE_THREAD_LIBS_INIT ) set(CMAKE_USE_WIN32_THREADS_INIT 0) endif() -endif(CMAKE_USE_PTHREADS_INIT) +endif() include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake) FIND_PACKAGE_HANDLE_STANDARD_ARGS(Threads DEFAULT_MSG Threads_FOUND) diff --git a/Modules/FindVTK.cmake b/Modules/FindVTK.cmake index a6257f5..b60845d 100644 --- a/Modules/FindVTK.cmake +++ b/Modules/FindVTK.cmake @@ -80,11 +80,11 @@ if(_VTK_40_ALLOW AND NOT VTK_DIR) set(VTK_DIR_SEARCH_LEGACY "") if(VTK_BINARY_PATH AND USE_BUILT_VTK) set(VTK_DIR_SEARCH_LEGACY ${VTK_DIR_SEARCH_LEGACY} ${VTK_BINARY_PATH}) - endif(VTK_BINARY_PATH AND USE_BUILT_VTK) + endif() if(VTK_INSTALL_PATH AND USE_INSTALLED_VTK) set(VTK_DIR_SEARCH_LEGACY ${VTK_DIR_SEARCH_LEGACY} ${VTK_INSTALL_PATH}/lib/vtk) - endif(VTK_INSTALL_PATH AND USE_INSTALLED_VTK) + endif() # Look for UseVTK.cmake in build trees or under <prefix>/include/vtk. find_path(VTK_DIR @@ -129,13 +129,13 @@ endif() if(VTK_FOUND) # Set USE_VTK_FILE for backward-compatability. set(USE_VTK_FILE ${VTK_USE_FILE}) -else(VTK_FOUND) +else() # VTK not found, explain to the user how to specify its location. if(VTK_FIND_REQUIRED) message(FATAL_ERROR ${VTK_DIR_MESSAGE}) - else(VTK_FIND_REQUIRED) + else() if(NOT VTK_FIND_QUIETLY) message(STATUS ${VTK_DIR_MESSAGE}) - endif(NOT VTK_FIND_QUIETLY) - endif(VTK_FIND_REQUIRED) -endif(VTK_FOUND) + endif() + endif() +endif() diff --git a/Modules/FindWish.cmake b/Modules/FindWish.cmake index 5f17890..11b29f2 100644 --- a/Modules/FindWish.cmake +++ b/Modules/FindWish.cmake @@ -22,7 +22,7 @@ if(UNIX) find_program(TK_WISH cygwish80 ) -endif(UNIX) +endif() get_filename_component(TCL_TCLSH_PATH "${TCL_TCLSH}" PATH) get_filename_component(TCL_TCLSH_PATH_PARENT "${TCL_TCLSH_PATH}" PATH) @@ -64,7 +64,7 @@ if(WIN32) "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Scriptics\\Tcl\\8.2;Root]/bin" "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Scriptics\\Tcl\\8.0;Root]/bin" ) -endif(WIN32) +endif() set(TK_WISH_NAMES wish diff --git a/Modules/FindX11.cmake b/Modules/FindX11.cmake index 1c16af5..0b63bc9 100644 --- a/Modules/FindX11.cmake +++ b/Modules/FindX11.cmake @@ -151,184 +151,184 @@ if (UNIX) set(X11_LIBRARY_DIR "") if(X11_X11_LIB) get_filename_component(X11_LIBRARY_DIR ${X11_X11_LIB} PATH) - endif(X11_X11_LIB) + endif() set(X11_INCLUDE_DIR) # start with empty list if(X11_X11_INCLUDE_PATH) set(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_X11_INCLUDE_PATH}) - endif(X11_X11_INCLUDE_PATH) + endif() if(X11_Xlib_INCLUDE_PATH) set(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_Xlib_INCLUDE_PATH}) - endif(X11_Xlib_INCLUDE_PATH) + endif() if(X11_Xutil_INCLUDE_PATH) set(X11_Xutil_FOUND TRUE) set(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_Xutil_INCLUDE_PATH}) - endif(X11_Xutil_INCLUDE_PATH) + endif() if(X11_Xshape_INCLUDE_PATH) set(X11_Xshape_FOUND TRUE) set(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_Xshape_INCLUDE_PATH}) - endif(X11_Xshape_INCLUDE_PATH) + endif() set(X11_LIBRARIES) # start with empty list if(X11_X11_LIB) set(X11_LIBRARIES ${X11_LIBRARIES} ${X11_X11_LIB}) - endif(X11_X11_LIB) + endif() if(X11_Xext_LIB) set(X11_Xext_FOUND TRUE) set(X11_LIBRARIES ${X11_LIBRARIES} ${X11_Xext_LIB}) - endif(X11_Xext_LIB) + endif() if(X11_Xt_LIB AND X11_Xt_INCLUDE_PATH) set(X11_Xt_FOUND TRUE) - endif(X11_Xt_LIB AND X11_Xt_INCLUDE_PATH) + endif() if(X11_Xft_LIB AND X11_Xft_INCLUDE_PATH) set(X11_Xft_FOUND TRUE) set(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_Xft_INCLUDE_PATH}) - endif(X11_Xft_LIB AND X11_Xft_INCLUDE_PATH) + endif() if(X11_Xv_LIB AND X11_Xv_INCLUDE_PATH) set(X11_Xv_FOUND TRUE) set(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_Xv_INCLUDE_PATH}) - endif(X11_Xv_LIB AND X11_Xv_INCLUDE_PATH) + endif() if (X11_Xau_LIB AND X11_Xau_INCLUDE_PATH) set(X11_Xau_FOUND TRUE) - endif (X11_Xau_LIB AND X11_Xau_INCLUDE_PATH) + endif () if (X11_Xdmcp_INCLUDE_PATH AND X11_Xdmcp_LIB) set(X11_Xdmcp_FOUND TRUE) set(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_Xdmcp_INCLUDE_PATH}) - endif (X11_Xdmcp_INCLUDE_PATH AND X11_Xdmcp_LIB) + endif () if (X11_Xaccessrules_INCLUDE_PATH AND X11_Xaccessstr_INCLUDE_PATH) set(X11_Xaccess_FOUND TRUE) set(X11_Xaccess_INCLUDE_PATH ${X11_Xaccessstr_INCLUDE_PATH}) set(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_Xaccess_INCLUDE_PATH}) - endif (X11_Xaccessrules_INCLUDE_PATH AND X11_Xaccessstr_INCLUDE_PATH) + endif () if (X11_Xpm_INCLUDE_PATH AND X11_Xpm_LIB) set(X11_Xpm_FOUND TRUE) set(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_Xpm_INCLUDE_PATH}) - endif (X11_Xpm_INCLUDE_PATH AND X11_Xpm_LIB) + endif () if (X11_Xcomposite_INCLUDE_PATH AND X11_Xcomposite_LIB) set(X11_Xcomposite_FOUND TRUE) set(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_Xcomposite_INCLUDE_PATH}) - endif (X11_Xcomposite_INCLUDE_PATH AND X11_Xcomposite_LIB) + endif () if (X11_Xdamage_INCLUDE_PATH AND X11_Xdamage_LIB) set(X11_Xdamage_FOUND TRUE) set(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_Xdamage_INCLUDE_PATH}) - endif (X11_Xdamage_INCLUDE_PATH AND X11_Xdamage_LIB) + endif () if (X11_XShm_INCLUDE_PATH) set(X11_XShm_FOUND TRUE) set(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_XShm_INCLUDE_PATH}) - endif (X11_XShm_INCLUDE_PATH) + endif () if (X11_XTest_INCLUDE_PATH AND X11_XTest_LIB) set(X11_XTest_FOUND TRUE) set(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_XTest_INCLUDE_PATH}) - endif (X11_XTest_INCLUDE_PATH AND X11_XTest_LIB) + endif () if (X11_Xi_INCLUDE_PATH AND X11_Xi_LIB) set(X11_Xi_FOUND TRUE) set(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_Xi_INCLUDE_PATH}) - endif (X11_Xi_INCLUDE_PATH AND X11_Xi_LIB) + endif () if (X11_Xinerama_INCLUDE_PATH AND X11_Xinerama_LIB) set(X11_Xinerama_FOUND TRUE) set(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_Xinerama_INCLUDE_PATH}) - endif (X11_Xinerama_INCLUDE_PATH AND X11_Xinerama_LIB) + endif () if (X11_Xfixes_INCLUDE_PATH AND X11_Xfixes_LIB) set(X11_Xfixes_FOUND TRUE) set(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_Xfixes_INCLUDE_PATH}) - endif (X11_Xfixes_INCLUDE_PATH AND X11_Xfixes_LIB) + endif () if (X11_Xrender_INCLUDE_PATH AND X11_Xrender_LIB) set(X11_Xrender_FOUND TRUE) set(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_Xrender_INCLUDE_PATH}) - endif (X11_Xrender_INCLUDE_PATH AND X11_Xrender_LIB) + endif () if (X11_XRes_INCLUDE_PATH AND X11_XRes_LIB) set(X11_XRes_FOUND TRUE) set(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_XRes_INCLUDE_PATH}) - endif (X11_XRes_INCLUDE_PATH AND X11_XRes_LIB) + endif () if (X11_Xrandr_INCLUDE_PATH AND X11_Xrandr_LIB) set(X11_Xrandr_FOUND TRUE) set(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_Xrandr_INCLUDE_PATH}) - endif (X11_Xrandr_INCLUDE_PATH AND X11_Xrandr_LIB) + endif () if (X11_xf86misc_INCLUDE_PATH AND X11_Xxf86misc_LIB) set(X11_xf86misc_FOUND TRUE) set(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_xf86misc_INCLUDE_PATH}) - endif (X11_xf86misc_INCLUDE_PATH AND X11_Xxf86misc_LIB) + endif () if (X11_xf86vmode_INCLUDE_PATH AND X11_Xxf86vm_LIB) set(X11_xf86vmode_FOUND TRUE) set(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_xf86vmode_INCLUDE_PATH}) - endif (X11_xf86vmode_INCLUDE_PATH AND X11_Xxf86vm_LIB) + endif () if (X11_Xcursor_INCLUDE_PATH AND X11_Xcursor_LIB) set(X11_Xcursor_FOUND TRUE) set(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_Xcursor_INCLUDE_PATH}) - endif (X11_Xcursor_INCLUDE_PATH AND X11_Xcursor_LIB) + endif () if (X11_Xscreensaver_INCLUDE_PATH AND X11_Xscreensaver_LIB) set(X11_Xscreensaver_FOUND TRUE) set(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_Xscreensaver_INCLUDE_PATH}) - endif (X11_Xscreensaver_INCLUDE_PATH AND X11_Xscreensaver_LIB) + endif () if (X11_dpms_INCLUDE_PATH) set(X11_dpms_FOUND TRUE) set(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_dpms_INCLUDE_PATH}) - endif (X11_dpms_INCLUDE_PATH) + endif () if (X11_Xkb_INCLUDE_PATH AND X11_Xkblib_INCLUDE_PATH AND X11_Xlib_INCLUDE_PATH) set(X11_Xkb_FOUND TRUE) set(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_Xkb_INCLUDE_PATH} ) - endif (X11_Xkb_INCLUDE_PATH AND X11_Xkblib_INCLUDE_PATH AND X11_Xlib_INCLUDE_PATH) + endif () if (X11_Xkbfile_INCLUDE_PATH AND X11_Xkbfile_LIB AND X11_Xlib_INCLUDE_PATH) set(X11_Xkbfile_FOUND TRUE) set(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_Xkbfile_INCLUDE_PATH} ) - endif (X11_Xkbfile_INCLUDE_PATH AND X11_Xkbfile_LIB AND X11_Xlib_INCLUDE_PATH) + endif () if (X11_Xmu_INCLUDE_PATH AND X11_Xmu_LIB) set(X11_Xmu_FOUND TRUE) set(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_Xmu_INCLUDE_PATH}) - endif (X11_Xmu_INCLUDE_PATH AND X11_Xmu_LIB) + endif () if (X11_Xinput_INCLUDE_PATH AND X11_Xinput_LIB) set(X11_Xinput_FOUND TRUE) set(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_Xinput_INCLUDE_PATH}) - endif (X11_Xinput_INCLUDE_PATH AND X11_Xinput_LIB) + endif () if (X11_XSync_INCLUDE_PATH) set(X11_XSync_FOUND TRUE) set(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_XSync_INCLUDE_PATH}) - endif (X11_XSync_INCLUDE_PATH) + endif () if(X11_ICE_LIB AND X11_ICE_INCLUDE_PATH) set(X11_ICE_FOUND TRUE) - endif(X11_ICE_LIB AND X11_ICE_INCLUDE_PATH) + endif() if(X11_SM_LIB AND X11_SM_INCLUDE_PATH) set(X11_SM_FOUND TRUE) - endif(X11_SM_LIB AND X11_SM_INCLUDE_PATH) + endif() # Deprecated variable for backwards compatibility with CMake 1.4 if (X11_X11_INCLUDE_PATH AND X11_LIBRARIES) set(X11_FOUND 1) - endif (X11_X11_INCLUDE_PATH AND X11_LIBRARIES) + endif () if(X11_FOUND) include(CheckFunctionExists) @@ -338,7 +338,7 @@ if (UNIX) # See libs.m4 in autoconf's m4 directory. if($ENV{ISC} MATCHES "^yes$") set(X11_X_EXTRA_LIBS -lnsl_s -linet) - else($ENV{ISC} MATCHES "^yes$") + else() set(X11_X_EXTRA_LIBS "") # See if XOpenDisplay in X11 works by itself. @@ -348,13 +348,13 @@ if (UNIX) CHECK_LIBRARY_EXISTS("dnet" "dnet_ntoa" "" X11_LIB_DNET_HAS_DNET_NTOA) if (X11_LIB_DNET_HAS_DNET_NTOA) set (X11_X_EXTRA_LIBS ${X11_X_EXTRA_LIBS} -ldnet) - else (X11_LIB_DNET_HAS_DNET_NTOA) + else () CHECK_LIBRARY_EXISTS("dnet_stub" "dnet_ntoa" "" X11_LIB_DNET_STUB_HAS_DNET_NTOA) if (X11_LIB_DNET_STUB_HAS_DNET_NTOA) set (X11_X_EXTRA_LIBS ${X11_X_EXTRA_LIBS} -ldnet_stub) - endif (X11_LIB_DNET_STUB_HAS_DNET_NTOA) - endif (X11_LIB_DNET_HAS_DNET_NTOA) - endif(NOT X11_LIB_X11_SOLO) + endif () + endif () + endif() # Find library needed for gethostbyname. CHECK_FUNCTION_EXISTS("gethostbyname" CMAKE_HAVE_GETHOSTBYNAME) @@ -362,13 +362,13 @@ if (UNIX) CHECK_LIBRARY_EXISTS("nsl" "gethostbyname" "" CMAKE_LIB_NSL_HAS_GETHOSTBYNAME) if (CMAKE_LIB_NSL_HAS_GETHOSTBYNAME) set (X11_X_EXTRA_LIBS ${X11_X_EXTRA_LIBS} -lnsl) - else (CMAKE_LIB_NSL_HAS_GETHOSTBYNAME) + else () CHECK_LIBRARY_EXISTS("bsd" "gethostbyname" "" CMAKE_LIB_BSD_HAS_GETHOSTBYNAME) if (CMAKE_LIB_BSD_HAS_GETHOSTBYNAME) set (X11_X_EXTRA_LIBS ${X11_X_EXTRA_LIBS} -lbsd) - endif (CMAKE_LIB_BSD_HAS_GETHOSTBYNAME) - endif (CMAKE_LIB_NSL_HAS_GETHOSTBYNAME) - endif(NOT CMAKE_HAVE_GETHOSTBYNAME) + endif () + endif () + endif() # Find library needed for connect. CHECK_FUNCTION_EXISTS("connect" CMAKE_HAVE_CONNECT) @@ -376,8 +376,8 @@ if (UNIX) CHECK_LIBRARY_EXISTS("socket" "connect" "" CMAKE_LIB_SOCKET_HAS_CONNECT) if (CMAKE_LIB_SOCKET_HAS_CONNECT) set (X11_X_EXTRA_LIBS -lsocket ${X11_X_EXTRA_LIBS}) - endif (CMAKE_LIB_SOCKET_HAS_CONNECT) - endif(NOT CMAKE_HAVE_CONNECT) + endif () + endif() # Find library needed for remove. CHECK_FUNCTION_EXISTS("remove" CMAKE_HAVE_REMOVE) @@ -385,8 +385,8 @@ if (UNIX) CHECK_LIBRARY_EXISTS("posix" "remove" "" CMAKE_LIB_POSIX_HAS_REMOVE) if (CMAKE_LIB_POSIX_HAS_REMOVE) set (X11_X_EXTRA_LIBS ${X11_X_EXTRA_LIBS} -lposix) - endif (CMAKE_LIB_POSIX_HAS_REMOVE) - endif(NOT CMAKE_HAVE_REMOVE) + endif () + endif() # Find library needed for shmat. CHECK_FUNCTION_EXISTS("shmat" CMAKE_HAVE_SHMAT) @@ -394,9 +394,9 @@ if (UNIX) CHECK_LIBRARY_EXISTS("ipc" "shmat" "" CMAKE_LIB_IPS_HAS_SHMAT) if (CMAKE_LIB_IPS_HAS_SHMAT) set (X11_X_EXTRA_LIBS ${X11_X_EXTRA_LIBS} -lipc) - endif (CMAKE_LIB_IPS_HAS_SHMAT) - endif(NOT CMAKE_HAVE_SHMAT) - endif($ENV{ISC} MATCHES "^yes$") + endif () + endif() + endif() if (X11_ICE_FOUND) CHECK_LIBRARY_EXISTS("ICE" "IceConnectionNumber" "${X11_LIBRARY_DIR}" @@ -405,9 +405,9 @@ if (UNIX) set (X11_X_PRE_LIBS ${X11_ICE_LIB}) if(X11_SM_LIB) set (X11_X_PRE_LIBS ${X11_SM_LIB} ${X11_X_PRE_LIBS}) - endif(X11_SM_LIB) - endif(CMAKE_LIB_ICE_HAS_ICECONNECTIONNUMBER) - endif (X11_ICE_FOUND) + endif() + endif() + endif () # Build the final list of libraries. set(X11_LIBRARIES ${X11_X_PRE_LIBS} ${X11_LIBRARIES} ${X11_X_EXTRA_LIBS}) @@ -415,11 +415,11 @@ if (UNIX) include(FindPackageMessage) FIND_PACKAGE_MESSAGE(X11 "Found X11: ${X11_X11_LIB}" "[${X11_X11_LIB}][${X11_INCLUDE_DIR}]") - else (X11_FOUND) + else () if (X11_FIND_REQUIRED) message(FATAL_ERROR "Could not find X11") - endif (X11_FIND_REQUIRED) - endif (X11_FOUND) + endif () + endif () mark_as_advanced( X11_X11_INCLUDE_PATH @@ -487,6 +487,6 @@ if (UNIX) X11_XSync_INCLUDE_PATH ) set(CMAKE_FIND_FRAMEWORK ${CMAKE_FIND_FRAMEWORK_SAVE}) -endif (UNIX) +endif () # X11_FIND_REQUIRED_<component> could be checked too diff --git a/Modules/FindXMLRPC.cmake b/Modules/FindXMLRPC.cmake index 0fae1d71..6bb578b 100644 --- a/Modules/FindXMLRPC.cmake +++ b/Modules/FindXMLRPC.cmake @@ -31,9 +31,9 @@ find_program(XMLRPC_C_CONFIG NAMES xmlrpc-c-config) # Check whether we found anything. if(XMLRPC_C_CONFIG) set(XMLRPC_FOUND 1) -else(XMLRPC_C_CONFIG) +else() set(XMLRPC_FOUND 0) -endif(XMLRPC_C_CONFIG) +endif() # Lookup the include directories needed for the components requested. if(XMLRPC_FOUND) @@ -45,12 +45,12 @@ if(XMLRPC_FOUND) OUTPUT_STRIP_TRAILING_WHITESPACE RESULT_VARIABLE XMLRPC_C_CONFIG_RESULT ) - else(COMMAND EXECUTE_PROCESS) + else() exec_program(${XMLRPC_C_CONFIG} ARGS "${XMLRPC_FIND_COMPONENTS} --cflags" OUTPUT_VARIABLE XMLRPC_C_CONFIG_CFLAGS RETURN_VALUE XMLRPC_C_CONFIG_RESULT ) - endif(COMMAND EXECUTE_PROCESS) + endif() # Parse the include flags. if("${XMLRPC_C_CONFIG_RESULT}" MATCHES "^0$") @@ -65,13 +65,13 @@ if(XMLRPC_FOUND) string(REGEX REPLACE "^-I" "" DIR "${flag}") file(TO_CMAKE_PATH "${DIR}" DIR) set(XMLRPC_INCLUDE_DIRS ${XMLRPC_INCLUDE_DIRS} "${DIR}") - endif("${flag}" MATCHES "^-I") - endforeach(flag) - else("${XMLRPC_C_CONFIG_RESULT}" MATCHES "^0$") + endif() + endforeach() + else() message("Error running ${XMLRPC_C_CONFIG}: [${XMLRPC_C_CONFIG_RESULT}]") set(XMLRPC_FOUND 0) - endif("${XMLRPC_C_CONFIG_RESULT}" MATCHES "^0$") -endif(XMLRPC_FOUND) + endif() +endif() # Lookup the libraries needed for the components requested. if(XMLRPC_FOUND) @@ -83,12 +83,12 @@ if(XMLRPC_FOUND) OUTPUT_STRIP_TRAILING_WHITESPACE RESULT_VARIABLE XMLRPC_C_CONFIG_RESULT ) - else(COMMAND EXECUTE_PROCESS) + else() exec_program(${XMLRPC_C_CONFIG} ARGS "${XMLRPC_FIND_COMPONENTS} --libs" OUTPUT_VARIABLE XMLRPC_C_CONFIG_LIBS RETURN_VALUE XMLRPC_C_CONFIG_RESULT ) - endif(COMMAND EXECUTE_PROCESS) + endif() # Parse the library names and directories. if("${XMLRPC_C_CONFIG_RESULT}" MATCHES "^0$") @@ -106,8 +106,8 @@ if(XMLRPC_FOUND) elseif("${flag}" MATCHES "^-l") string(REGEX REPLACE "^-l" "" NAME "${flag}") set(XMLRPC_LIBRARY_NAMES ${XMLRPC_LIBRARY_NAMES} "${NAME}") - endif("${flag}" MATCHES "^-L") - endforeach(flag) + endif() + endforeach() # Search for each library needed using the directories given. foreach(name ${XMLRPC_LIBRARY_NAMES}) @@ -121,16 +121,16 @@ if(XMLRPC_FOUND) # If any library is not found then the whole package is not found. if(NOT XMLRPC_${name}_LIBRARY) set(XMLRPC_FOUND 0) - endif(NOT XMLRPC_${name}_LIBRARY) + endif() # Build an ordered list of all the libraries needed. set(XMLRPC_LIBRARIES ${XMLRPC_LIBRARIES} "${XMLRPC_${name}_LIBRARY}") - endforeach(name) - else("${XMLRPC_C_CONFIG_RESULT}" MATCHES "^0$") + endforeach() + else() message("Error running ${XMLRPC_C_CONFIG}: [${XMLRPC_C_CONFIG_RESULT}]") set(XMLRPC_FOUND 0) - endif("${XMLRPC_C_CONFIG_RESULT}" MATCHES "^0$") -endif(XMLRPC_FOUND) + endif() +endif() # Report the results. if(NOT XMLRPC_FOUND) @@ -138,9 +138,9 @@ if(NOT XMLRPC_FOUND) "XMLRPC was not found. Make sure the entries XMLRPC_* are set.") if(NOT XMLRPC_FIND_QUIETLY) message(STATUS "${XMLRPC_DIR_MESSAGE}") - else(NOT XMLRPC_FIND_QUIETLY) + else() if(XMLRPC_FIND_REQUIRED) message(FATAL_ERROR "${XMLRPC_DIR_MESSAGE}") - endif(XMLRPC_FIND_REQUIRED) - endif(NOT XMLRPC_FIND_QUIETLY) -endif(NOT XMLRPC_FOUND) + endif() + endif() +endif() diff --git a/Modules/FindZLIB.cmake b/Modules/FindZLIB.cmake index 6b3c4cf..00b9c64 100644 --- a/Modules/FindZLIB.cmake +++ b/Modules/FindZLIB.cmake @@ -72,7 +72,7 @@ if(ZLIB_INCLUDE_DIR AND EXISTS "${ZLIB_INCLUDE_DIR}/zlib.h") if( "${ZLIB_H}" MATCHES "^.*ZLIB_VERSION \"[0-9]+\\.[0-9]+\\.[0-9]+\\.([0-9]+).*$") set(ZLIB_VERSION_TWEAK "${CMAKE_MATCH_1}") set(ZLIB_VERSION_STRING "${ZLIB_VERSION_STRING}.${ZLIB_VERSION_TWEAK}") - endif( "${ZLIB_H}" MATCHES "^.*ZLIB_VERSION \"[0-9]+\\.[0-9]+\\.[0-9]+\\.([0-9]+).*$") + endif() set(ZLIB_MAJOR_VERSION "${ZLIB_VERSION_MAJOR}") set(ZLIB_MINOR_VERSION "${ZLIB_VERSION_MINOR}") diff --git a/Modules/Findosg_functions.cmake b/Modules/Findosg_functions.cmake index 3a40a09..30c0876 100644 --- a/Modules/Findosg_functions.cmake +++ b/Modules/Findosg_functions.cmake @@ -38,7 +38,7 @@ function(OSG_FIND_PATH module header) /opt /usr/freeware ) -endfunction(OSG_FIND_PATH module header) +endfunction() # @@ -91,7 +91,7 @@ function(OSG_FIND_LIBRARY module library) PARENT_SCOPE ) endif() -endfunction(OSG_FIND_LIBRARY module library) +endfunction() # # OSG_MARK_AS_ADVANCED diff --git a/Modules/FindwxWidgets.cmake b/Modules/FindwxWidgets.cmake index b1a17a8..c186eb5 100644 --- a/Modules/FindwxWidgets.cmake +++ b/Modules/FindwxWidgets.cmake @@ -67,7 +67,7 @@ # include(${wxWidgets_USE_FILE}) # # and for each of your dependent executable/library targets: # target_link_libraries(<YourTarget> ${wxWidgets_LIBRARIES}) -# endif(wxWidgets_FOUND) +# endif() # # If wxWidgets is required (i.e., not an optional part): # find_package(wxWidgets REQUIRED net gl core base) @@ -146,11 +146,11 @@ macro(DBG_MSG _MSG) # message(STATUS # "${CMAKE_CURRENT_LIST_FILE}(${CMAKE_CURRENT_LIST_LINE}): ${_MSG}") -endmacro(DBG_MSG) +endmacro() macro(DBG_MSG_V _MSG) # message(STATUS # "${CMAKE_CURRENT_LIST_FILE}(${CMAKE_CURRENT_LIST_LINE}): ${_MSG}") -endmacro(DBG_MSG_V) +endmacro() # Clear return values in case the module is loaded more than once. set(wxWidgets_FOUND FALSE) @@ -179,7 +179,7 @@ endif() # - else set wxWidgets_FIND_COMPONENTS to wxWidgets_USE_LIBS if(wxWidgets_USE_LIBS AND NOT wxWidgets_FIND_COMPONENTS) set(wxWidgets_FIND_COMPONENTS ${wxWidgets_USE_LIBS}) -endif(wxWidgets_USE_LIBS AND NOT wxWidgets_FIND_COMPONENTS) +endif() DBG_MSG("wxWidgets_FIND_COMPONENTS : ${wxWidgets_FIND_COMPONENTS}") # Add the convenience use file if available. @@ -195,19 +195,19 @@ get_filename_component( if(EXISTS "${wxWidgets_CURRENT_LIST_DIR}/UsewxWidgets.cmake") set(wxWidgets_USE_FILE "${wxWidgets_CURRENT_LIST_DIR}/UsewxWidgets.cmake") -else(EXISTS "${wxWidgets_CURRENT_LIST_DIR}/UsewxWidgets.cmake") +else() set(wxWidgets_USE_FILE UsewxWidgets) -endif(EXISTS "${wxWidgets_CURRENT_LIST_DIR}/UsewxWidgets.cmake") +endif() #===================================================================== #===================================================================== if(WIN32 AND NOT CYGWIN AND NOT MSYS) set(wxWidgets_FIND_STYLE "win32") -else(WIN32 AND NOT CYGWIN AND NOT MSYS) +else() if(UNIX OR MSYS) set(wxWidgets_FIND_STYLE "unix") - endif(UNIX OR MSYS) -endif(WIN32 AND NOT CYGWIN AND NOT MSYS) + endif() +endif() #===================================================================== # WIN32_FIND_STYLE @@ -220,17 +220,17 @@ if(wxWidgets_FIND_STYLE STREQUAL "win32") if(NOT wxWidgets_FIND_COMPONENTS) if(wxWidgets_USE_MONOLITHIC) set(wxWidgets_FIND_COMPONENTS mono) - else(wxWidgets_USE_MONOLITHIC) + else() set(wxWidgets_FIND_COMPONENTS core base) # this is default - endif(wxWidgets_USE_MONOLITHIC) - endif(NOT wxWidgets_FIND_COMPONENTS) + endif() + endif() # Add the common (usually required libs) unless # wxWidgets_EXCLUDE_COMMON_LIBRARIES has been set. if(NOT wxWidgets_EXCLUDE_COMMON_LIBRARIES) list(APPEND wxWidgets_FIND_COMPONENTS ${wxWidgets_COMMON_LIBRARIES}) - endif(NOT wxWidgets_EXCLUDE_COMMON_LIBRARIES) + endif() #------------------------------------------------------------------- # WIN32: Helper MACROS @@ -245,9 +245,9 @@ if(wxWidgets_FIND_STYLE STREQUAL "win32") string(REGEX REPLACE "msw.*(u)[d]*$" "u" ${_UCD} "${_CONFIGURATION}") if(${_UCD} STREQUAL ${_CONFIGURATION}) set(${_UCD} "") - endif(${_UCD} STREQUAL ${_CONFIGURATION}) + endif() string(REGEX MATCH "d$" ${_DBG} "${_CONFIGURATION}") - endmacro(WX_GET_NAME_COMPONENTS) + endmacro() # # Find libraries associated to a configuration. @@ -269,7 +269,7 @@ if(wxWidgets_FIND_STYLE STREQUAL "win32") NO_DEFAULT_PATH ) mark_as_advanced(WX_${LIB}${_DBG}) - endforeach(LIB) + endforeach() # Find wxWidgets multilib base libraries. find_library(WX_base${_DBG} @@ -295,7 +295,7 @@ if(wxWidgets_FIND_STYLE STREQUAL "win32") NO_DEFAULT_PATH ) mark_as_advanced(WX_${LIB}${_DBG}) - endforeach(LIB) + endforeach() # Find wxWidgets monolithic library. find_library(WX_mono${_DBG} @@ -324,8 +324,8 @@ if(wxWidgets_FIND_STYLE STREQUAL "win32") NO_DEFAULT_PATH ) mark_as_advanced(WX_${LIB}${_DBG}) - endforeach(LIB) - endmacro(WX_FIND_LIBS) + endforeach() + endmacro() # # Clear all library paths, so that FIND_LIBRARY refinds them. @@ -335,19 +335,19 @@ if(wxWidgets_FIND_STYLE STREQUAL "win32") set(${_LIB} "${_LIB}-NOTFOUND" CACHE FILEPATH "Cleared." FORCE) set(${_LIB}_FOUND FALSE) mark_as_advanced(${_LIB}) - endmacro(WX_CLEAR_LIB) + endmacro() # Clear all debug or release library paths (arguments are "d" or ""). macro(WX_CLEAR_ALL_LIBS _DBG) # Clear wxWidgets common libraries. foreach(LIB ${wxWidgets_COMMON_LIBRARIES} scintilla) WX_CLEAR_LIB(WX_${LIB}${_DBG}) - endforeach(LIB) + endforeach() # Clear wxWidgets multilib base libraries. WX_CLEAR_LIB(WX_base${_DBG}) foreach(LIB net odbc xml) WX_CLEAR_LIB(WX_${LIB}${_DBG}) - endforeach(LIB) + endforeach() # Clear wxWidgets monolithic library. WX_CLEAR_LIB(WX_mono${_DBG}) @@ -356,16 +356,16 @@ if(wxWidgets_FIND_STYLE STREQUAL "win32") foreach(LIB core adv aui html media xrc dbgrid gl qa richtext stc ribbon propgrid) WX_CLEAR_LIB(WX_${LIB}${_DBG}) - endforeach(LIB) - endmacro(WX_CLEAR_ALL_LIBS) + endforeach() + endmacro() # Clear all wxWidgets debug libraries. macro(WX_CLEAR_ALL_DBG_LIBS) WX_CLEAR_ALL_LIBS("d") - endmacro(WX_CLEAR_ALL_DBG_LIBS) + endmacro() # Clear all wxWidgets release libraries. macro(WX_CLEAR_ALL_REL_LIBS) WX_CLEAR_ALL_LIBS("") - endmacro(WX_CLEAR_ALL_REL_LIBS) + endmacro() # # Set the wxWidgets_LIBRARIES variable. @@ -383,35 +383,35 @@ if(wxWidgets_FIND_STYLE STREQUAL "win32") list(APPEND wxWidgets_LIBRARIES debug ${WX_${LIB}d} optimized ${WX_${LIB}} ) - else(WX_${LIB} AND WX_${LIB}d) + else() DBG_MSG_V("- not found due to missing WX_${LIB}=${WX_${LIB}} or WX_${LIB}d=${WX_${LIB}d}") set(wxWidgets_FOUND FALSE) - endif(WX_${LIB} AND WX_${LIB}d) - endforeach(LIB) - else(WX_USE_REL_AND_DBG) + endif() + endforeach() + else() foreach(LIB ${${_LIBS}}) DBG_MSG_V("Searching for ${LIB}${_DBG}") DBG_MSG_V("WX_${LIB}${_DBG} : ${WX_${LIB}${_DBG}}") if(WX_${LIB}${_DBG}) DBG_MSG_V("Found ${LIB}${_DBG}") list(APPEND wxWidgets_LIBRARIES ${WX_${LIB}${_DBG}}) - else(WX_${LIB}${_DBG}) + else() DBG_MSG_V( "- not found due to missing WX_${LIB}${_DBG}=${WX_${LIB}${_DBG}}") set(wxWidgets_FOUND FALSE) - endif(WX_${LIB}${_DBG}) - endforeach(LIB) - endif(WX_USE_REL_AND_DBG) + endif() + endforeach() + endif() DBG_MSG_V("OpenGL") list(FIND ${_LIBS} gl WX_USE_GL) if(NOT WX_USE_GL EQUAL -1) DBG_MSG_V("- is required.") list(APPEND wxWidgets_LIBRARIES opengl32 glu32) - endif(NOT WX_USE_GL EQUAL -1) + endif() list(APPEND wxWidgets_LIBRARIES winmm comctl32 rpcrt4 wsock32) - endmacro(WX_SET_LIBRARIES) + endmacro() #------------------------------------------------------------------- # WIN32: Start actual work. @@ -467,7 +467,7 @@ if(wxWidgets_FIND_STYLE STREQUAL "win32") CACHE INTERNAL "wxWidgets_ROOT_DIR") set(wxWidgets_LIB_DIR "wxWidgets_LIB_DIR-NOTFOUND" CACHE PATH "Cleared." FORCE) - endif(NOT WX_ROOT_DIR STREQUAL wxWidgets_ROOT_DIR) + endif() if(WX_ROOT_DIR) # Select one default tree inside the already determined wx tree. @@ -475,9 +475,9 @@ if(wxWidgets_FIND_STYLE STREQUAL "win32") # settings. if(MINGW) set(WX_LIB_DIR_PREFIX gcc) - else(MINGW) + else() set(WX_LIB_DIR_PREFIX vc) - endif(MINGW) + endif() if(BUILD_SHARED_LIBS) find_path(wxWidgets_LIB_DIR NAMES @@ -495,7 +495,7 @@ if(wxWidgets_FIND_STYLE STREQUAL "win32") DOC "Path to wxWidgets libraries?" NO_DEFAULT_PATH ) - else(BUILD_SHARED_LIBS) + else() find_path(wxWidgets_LIB_DIR NAMES msw/wx/setup.h @@ -512,21 +512,21 @@ if(wxWidgets_FIND_STYLE STREQUAL "win32") DOC "Path to wxWidgets libraries?" NO_DEFAULT_PATH ) - endif(BUILD_SHARED_LIBS) + endif() # If wxWidgets_LIB_DIR changed, clear all libraries. if(NOT WX_LIB_DIR STREQUAL wxWidgets_LIB_DIR) set(WX_LIB_DIR ${wxWidgets_LIB_DIR} CACHE INTERNAL "wxWidgets_LIB_DIR") WX_CLEAR_ALL_DBG_LIBS() WX_CLEAR_ALL_REL_LIBS() - endif(NOT WX_LIB_DIR STREQUAL wxWidgets_LIB_DIR) + endif() if(WX_LIB_DIR) # If building shared libs, define WXUSINGDLL to use dllimport. if(WX_LIB_DIR MATCHES ".*[dD][lL][lL].*") set(wxWidgets_DEFINITIONS WXUSINGDLL) DBG_MSG_V("detected SHARED/DLL tree WX_LIB_DIR=${WX_LIB_DIR}") - endif(WX_LIB_DIR MATCHES ".*[dD][lL][lL].*") + endif() # Search for available configuration types. foreach(CFG mswunivud mswunivd mswud mswd mswunivu mswuniv mswu msw) @@ -535,8 +535,8 @@ if(wxWidgets_FIND_STYLE STREQUAL "win32") list(APPEND WX_CONFIGURATION_LIST ${CFG}) set(WX_${CFG}_FOUND TRUE) set(WX_CONFIGURATION ${CFG}) - endif(EXISTS ${WX_LIB_DIR}/${CFG}) - endforeach(CFG) + endif() + endforeach() DBG_MSG_V("WX_CONFIGURATION_LIST=${WX_CONFIGURATION_LIST}") if(WX_CONFIGURATION) @@ -549,24 +549,24 @@ if(wxWidgets_FIND_STYLE STREQUAL "win32") if(NOT WX_${wxWidgets_CONFIGURATION}_FOUND) set(wxWidgets_CONFIGURATION ${WX_CONFIGURATION} CACHE STRING "Set wxWidgets configuration (${WX_CONFIGURATION_LIST})" FORCE) - else(NOT WX_${wxWidgets_CONFIGURATION}_FOUND) + else() set(wxWidgets_CONFIGURATION ${wxWidgets_CONFIGURATION} CACHE STRING "Set wxWidgets configuration (${WX_CONFIGURATION_LIST})" FORCE) - endif(NOT WX_${wxWidgets_CONFIGURATION}_FOUND) + endif() # If release config selected, and both release/debug exist. if(WX_${wxWidgets_CONFIGURATION}d_FOUND) option(wxWidgets_USE_REL_AND_DBG "Use release and debug configurations?" TRUE) set(WX_USE_REL_AND_DBG ${wxWidgets_USE_REL_AND_DBG}) - else(WX_${wxWidgets_CONFIGURATION}d_FOUND) + else() # If the option exists (already in cache), force it false. if(wxWidgets_USE_REL_AND_DBG) set(wxWidgets_USE_REL_AND_DBG FALSE CACHE BOOL "No ${wxWidgets_CONFIGURATION}d found." FORCE) - endif(wxWidgets_USE_REL_AND_DBG) + endif() set(WX_USE_REL_AND_DBG FALSE) - endif(WX_${wxWidgets_CONFIGURATION}d_FOUND) + endif() # Get configuration parameters from the name. WX_GET_NAME_COMPONENTS(${wxWidgets_CONFIGURATION} UNV UCD DBG) @@ -575,24 +575,24 @@ if(wxWidgets_FIND_STYLE STREQUAL "win32") if(EXISTS ${WX_LIB_DIR}/${wxWidgets_CONFIGURATION}/wx/setup.h) set(wxWidgets_INCLUDE_DIRS ${WX_LIB_DIR}/${wxWidgets_CONFIGURATION}) - else(EXISTS ${WX_LIB_DIR}/${wxWidgets_CONFIGURATION}/wx/setup.h) + else() DBG_MSG("wxWidgets_FOUND FALSE because ${WX_LIB_DIR}/${wxWidgets_CONFIGURATION}/wx/setup.h does not exists.") set(wxWidgets_FOUND FALSE) - endif(EXISTS ${WX_LIB_DIR}/${wxWidgets_CONFIGURATION}/wx/setup.h) + endif() # Set wxWidgets main include directory. if(EXISTS ${WX_ROOT_DIR}/include/wx/wx.h) list(APPEND wxWidgets_INCLUDE_DIRS ${WX_ROOT_DIR}/include) - else(EXISTS ${WX_ROOT_DIR}/include/wx/wx.h) + else() DBG_MSG("wxWidgets_FOUND FALSE because WX_ROOT_DIR=${WX_ROOT_DIR} has no ${WX_ROOT_DIR}/include/wx/wx.h") set(wxWidgets_FOUND FALSE) - endif(EXISTS ${WX_ROOT_DIR}/include/wx/wx.h) + endif() # Find wxWidgets libraries. WX_FIND_LIBS("${UNV}" "${UCD}" "${DBG}") if(WX_USE_REL_AND_DBG) WX_FIND_LIBS("${UNV}" "${UCD}" "d") - endif(WX_USE_REL_AND_DBG) + endif() # Settings for requested libs (i.e., include dir, libraries, etc.). WX_SET_LIBRARIES(wxWidgets_FIND_COMPONENTS "${DBG}") @@ -600,19 +600,19 @@ if(wxWidgets_FIND_STYLE STREQUAL "win32") # Add necessary definitions for unicode builds if("${UCD}" STREQUAL "u") list(APPEND wxWidgets_DEFINITIONS UNICODE _UNICODE) - endif("${UCD}" STREQUAL "u") + endif() # Add necessary definitions for debug builds set(wxWidgets_DEFINITIONS_DEBUG _DEBUG __WXDEBUG__) - endif(WX_CONFIGURATION) - endif(WX_LIB_DIR) - endif(WX_ROOT_DIR) + endif() + endif() + endif() #===================================================================== # UNIX_FIND_STYLE #===================================================================== -else(wxWidgets_FIND_STYLE STREQUAL "win32") +else() if(wxWidgets_FIND_STYLE STREQUAL "unix") #----------------------------------------------------------------- # UNIX: Helper MACROS @@ -633,16 +633,16 @@ else(wxWidgets_FIND_STYLE STREQUAL "win32") string(TOUPPER ${_opt_name} _upper_opt_name) if(_wx_selected_config MATCHES ".*${_opt_name}.*") set(wxWidgets_DEFAULT_${_upper_opt_name} ON) - else(_wx_selected_config MATCHES ".*${_opt_name}.*") + else() set(wxWidgets_DEFAULT_${_upper_opt_name} OFF) - endif(_wx_selected_config MATCHES ".*${_opt_name}.*") - endforeach(_opt_name) - else(_wx_result EQUAL 0) + endif() + endforeach() + else() foreach(_upper_opt_name DEBUG STATIC UNICODE UNIVERSAL) set(wxWidgets_DEFAULT_${_upper_opt_name} OFF) - endforeach(_upper_opt_name) - endif(_wx_result EQUAL 0) - endmacro(WX_CONFIG_SELECT_GET_DEFAULT) + endforeach() + endif() + endmacro() # # Query a boolean configuration option to determine if the system @@ -668,17 +668,17 @@ else(wxWidgets_FIND_STYLE STREQUAL "win32") if(_wx_result_yes EQUAL 0 AND _wx_result_no EQUAL 0) option(wxWidgets_USE_${_UPPER_OPT_NAME} ${_OPT_HELP} ${wxWidgets_DEFAULT_${_UPPER_OPT_NAME}}) - else(_wx_result_yes EQUAL 0 AND _wx_result_no EQUAL 0) + else() # If option exists (already in cache), force to available one. if(DEFINED wxWidgets_USE_${_UPPER_OPT_NAME}) if(_wx_result_yes EQUAL 0) set(wxWidgets_USE_${_UPPER_OPT_NAME} ON CACHE BOOL ${_OPT_HELP} FORCE) - else(_wx_result_yes EQUAL 0) + else() set(wxWidgets_USE_${_UPPER_OPT_NAME} OFF CACHE BOOL ${_OPT_HELP} FORCE) - endif(_wx_result_yes EQUAL 0) - endif(DEFINED wxWidgets_USE_${_UPPER_OPT_NAME}) - endif(_wx_result_yes EQUAL 0 AND _wx_result_no EQUAL 0) - endmacro(WX_CONFIG_SELECT_QUERY_BOOL) + endif() + endif() + endif() + endmacro() # # Set wxWidgets_SELECT_OPTIONS to wx-config options for selecting @@ -691,12 +691,12 @@ else(wxWidgets_FIND_STYLE STREQUAL "win32") if(DEFINED wxWidgets_USE_${_upper_opt_name}) if(wxWidgets_USE_${_upper_opt_name}) list(APPEND wxWidgets_SELECT_OPTIONS --${_opt_name}=yes) - else(wxWidgets_USE_${_upper_opt_name}) + else() list(APPEND wxWidgets_SELECT_OPTIONS --${_opt_name}=no) - endif(wxWidgets_USE_${_upper_opt_name}) - endif(DEFINED wxWidgets_USE_${_upper_opt_name}) - endforeach(_opt_name) - endmacro(WX_CONFIG_SELECT_SET_OPTIONS) + endif() + endif() + endforeach() + endmacro() #----------------------------------------------------------------- # UNIX: Start actual work. @@ -759,11 +759,11 @@ else(wxWidgets_FIND_STYLE STREQUAL "win32") DBG_MSG_V("wxWidgets_INCLUDE_DIRS=${wxWidgets_INCLUDE_DIRS}") DBG_MSG_V("wxWidgets_CXX_FLAGS=${wxWidgets_CXX_FLAGS}") - else(RET EQUAL 0) + else() set(wxWidgets_FOUND FALSE) DBG_MSG_V( "${wxWidgets_CONFIG_EXECUTABLE} --cxxflags FAILED with RET=${RET}") - endif(RET EQUAL 0) + endif() # run the wx-config program to get the libs # - NOTE: wx-config doesn't verify that the libs requested exist @@ -797,25 +797,25 @@ else(wxWidgets_FIND_STYLE STREQUAL "win32") DBG_MSG_V("wxWidgets_LIBRARIES=${wxWidgets_LIBRARIES}") DBG_MSG_V("wxWidgets_LIBRARY_DIRS=${wxWidgets_LIBRARY_DIRS}") - else(RET EQUAL 0) + else() set(wxWidgets_FOUND FALSE) DBG_MSG("${wxWidgets_CONFIG_EXECUTABLE} --libs ${wxWidgets_FIND_COMPONENTS} FAILED with RET=${RET}") - endif(RET EQUAL 0) - endif(wxWidgets_CONFIG_EXECUTABLE) + endif() + endif() #===================================================================== # Neither UNIX_FIND_STYLE, nor WIN32_FIND_STYLE #===================================================================== - else(wxWidgets_FIND_STYLE STREQUAL "unix") + else() if(NOT wxWidgets_FIND_QUIETLY) message(STATUS "${CMAKE_CURRENT_LIST_FILE}(${CMAKE_CURRENT_LIST_LINE}): \n" " Platform unknown/unsupported. It's neither WIN32 nor UNIX " "find style." ) - endif(NOT wxWidgets_FIND_QUIETLY) - endif(wxWidgets_FIND_STYLE STREQUAL "unix") -endif(wxWidgets_FIND_STYLE STREQUAL "win32") + endif() + endif() +endif() # Debug output: DBG_MSG("wxWidgets_FOUND : ${wxWidgets_FOUND}") @@ -855,7 +855,7 @@ find_program(wxWidgets_wxrc_EXECUTABLE wxrc # function(WXWIDGETS_ADD_RESOURCES outfiles) # WX_SPLIT_ARGUMENTS_ON(OPTIONS wxrc_files wxrc_options ${ARGN}) # ... -# endfunction(WXWIDGETS_ADD_RESOURCES) +# endfunction() # # WXWIDGETS_ADD_RESOURCES(sources ${xrc_files} OPTIONS -e -o file.C) # @@ -877,18 +877,18 @@ function(WX_SPLIT_ARGUMENTS_ON _keyword _leftvar _rightvar) foreach(element ${ARGN}) if("${element}" STREQUAL "${_keyword}") set(_doing_right TRUE) - else("${element}" STREQUAL "${_keyword}") + else() if(_doing_right) list(APPEND ${_rightvar} "${element}") - else(_doing_right) + else() list(APPEND ${_leftvar} "${element}") - endif(_doing_right) - endif("${element}" STREQUAL "${_keyword}") - endforeach(element) + endif() + endif() + endforeach() set(${_leftvar} ${${_leftvar}} PARENT_SCOPE) set(${_rightvar} ${${_rightvar}} PARENT_SCOPE) -endfunction(WX_SPLIT_ARGUMENTS_ON) +endfunction() # # WX_GET_DEPENDENCIES_FROM_XML( @@ -920,14 +920,14 @@ function(WX_GET_DEPENDENCIES_FROM_XML # make the file have an absolute path if(NOT IS_ABSOLUTE "${dep_file}") set(dep_file "${${_depends_path}}/${dep_file}") - endif(NOT IS_ABSOLUTE "${dep_file}") + endif() # append file to dependency list list(APPEND ${_depends} "${dep_file}") - endforeach(dep_file) + endforeach() set(${_depends} ${${_depends}} PARENT_SCOPE) -endfunction(WX_GET_DEPENDENCIES_FROM_XML) +endfunction() # # WXWIDGETS_ADD_RESOURCES(<sources> <xrc_files> @@ -982,7 +982,7 @@ function(WXWIDGETS_ADD_RESOURCES _outfiles) rc_file_contents depends_path ) - endforeach(rc_file) + endforeach() # # Parse options. @@ -994,11 +994,11 @@ function(WXWIDGETS_ADD_RESOURCES _outfiles) list(APPEND rc_options --cpp-code) # wxrc's default output filename for cpp code. set(outfile resource.cpp) - else(index EQUAL -1) + else() list(REMOVE_AT rc_options ${index}) # wxrc's default output filename for xrs file. set(outfile resource.xrs) - endif(index EQUAL -1) + endif() # Get output name for use in ADD_CUSTOM_COMMAND. # - short option scanning @@ -1007,18 +1007,18 @@ function(WXWIDGETS_ADD_RESOURCES _outfiles) math(EXPR filename_index "${index} + 1") list(GET rc_options ${filename_index} outfile) #list(REMOVE_AT rc_options ${index} ${filename_index}) - endif(NOT index EQUAL -1) + endif() # - long option scanning string(REGEX MATCH "--output=[^;]*" outfile_opt "${rc_options}") if(outfile_opt) string(REPLACE "--output=" "" outfile "${outfile_opt}") - endif(outfile_opt) + endif() #string(REGEX REPLACE "--output=[^;]*;?" "" rc_options "${rc_options}") #string(REGEX REPLACE ";$" "" rc_options "${rc_options}") if(NOT IS_ABSOLUTE "${outfile}") set(outfile "${CMAKE_CURRENT_BINARY_DIR}/${outfile}") - endif(NOT IS_ABSOLUTE "${outfile}") + endif() add_custom_command( OUTPUT "${outfile}" COMMAND ${wxWidgets_wxrc_EXECUTABLE} ${rc_options} ${rc_file_list_abs} @@ -1035,10 +1035,10 @@ function(WXWIDGETS_ADD_RESOURCES _outfiles) set_source_files_properties( "${outfile_header}" PROPERTIES GENERATED TRUE ) - endif(NOT short_index EQUAL -1 OR NOT long_index EQUAL -1) + endif() # Add generated file to output file list. list(APPEND ${_outfiles} "${outfile}") set(${_outfiles} ${${_outfiles}} PARENT_SCOPE) -endfunction(WXWIDGETS_ADD_RESOURCES) +endfunction() diff --git a/Modules/FindwxWindows.cmake b/Modules/FindwxWindows.cmake index 66373cd..06db751 100644 --- a/Modules/FindwxWindows.cmake +++ b/Modules/FindwxWindows.cmake @@ -85,14 +85,14 @@ if(WIN32) set(WIN32_STYLE_FIND 1) -endif(WIN32) +endif() if(MINGW) set(WIN32_STYLE_FIND 0) set(UNIX_STYLE_FIND 1) -endif(MINGW) +endif() if(UNIX) set(UNIX_STYLE_FIND 1) -endif(UNIX) +endif() if(WIN32_STYLE_FIND) @@ -283,7 +283,7 @@ if(WIN32_STYLE_FIND) DOC "wxWindows shared debug build GL library" ) - else (WXWINDOWS_USE_MONOLITHIC) + else () ## WX is built as multiple small pieces libraries instead of monolithic ## DEPECATED (jw) replaced by more general WXWINDOWS_USE_MONOLITHIC ON/OFF @@ -346,7 +346,7 @@ if(WIN32_STYLE_FIND) rpcrt4 wsock32 ) - endif (WXWINDOWS_USE_MONOLITHIC) + endif () ## @@ -361,7 +361,7 @@ if(WIN32_STYLE_FIND) option(WXWINDOWS_USE_SHARED_LIBS "Use shared versions (dll) of wxWindows libraries?" OFF) mark_as_advanced(WXWINDOWS_USE_SHARED_LIBS) - endif(WXWINDOWS_SHARED_LIBRARY OR WXWINDOWS_SHARED_DEBUG_LIBRARY) + endif() ## add system libraries wxwindows always seems to depend on set(WXWINDOWS_LIBRARIES ${WXWINDOWS_LIBRARIES} @@ -380,7 +380,7 @@ if(WIN32_STYLE_FIND) debug ${WXWINDOWS_STATIC_DEBUG_LIBRARY_JPEG} optimized ${WXWINDOWS_STATIC_LIBRARY_JPEG} debug ${WXWINDOWS_STATIC_DEBUG_LIBRARY_TIFF} optimized ${WXWINDOWS_STATIC_LIBRARY_TIFF} ) - endif (NOT WXWINDOWS_USE_SHARED_LIBS) + endif () ## opengl/glu: TODO/FIXME: better use FindOpenGL.cmake here ## assume release versions of glu an dopengl, here. @@ -388,7 +388,7 @@ if(WIN32_STYLE_FIND) set(WXWINDOWS_LIBRARIES ${WXWINDOWS_LIBRARIES} opengl32 glu32 ) - endif (WXWINDOWS_USE_GL) + endif () ## ## select between use of shared or static wxWindows lib then set libs to use @@ -419,8 +419,8 @@ if(WIN32_STYLE_FIND) set(WXWINDOWS_LIBRARIES ${WXWINDOWS_LIBRARIES} debug ${WXWINDOWS_SHARED_DEBUG_LIBRARY_GL} optimized ${WXWINDOWS_SHARED_LIBRARY_GL} ) - endif (WXWINDOWS_USE_GL) - endif(WXWINDOWS_SHARED_DEBUG_LIBRARY AND WXWINDOWS_SHARED_LIBRARY) + endif () + endif() ## shared: only debug wx lib found? if(WXWINDOWS_SHARED_DEBUG_LIBRARY) @@ -434,9 +434,9 @@ if(WIN32_STYLE_FIND) if (WXWINDOWS_USE_GL) set(WXWINDOWS_LIBRARIES ${WXWINDOWS_LIBRARIES} ${WXWINDOWS_SHARED_DEBUG_LIBRARY_GL} ) - endif (WXWINDOWS_USE_GL) - endif(NOT WXWINDOWS_SHARED_LIBRARY) - endif(WXWINDOWS_SHARED_DEBUG_LIBRARY) + endif () + endif() + endif() ## shared: only release wx lib found? if(NOT WXWINDOWS_SHARED_DEBUG_LIBRARY) @@ -450,20 +450,20 @@ if(WIN32_STYLE_FIND) if (WXWINDOWS_USE_GL) set(WXWINDOWS_LIBRARIES ${WXWINDOWS_LIBRARIES} ${WXWINDOWS_SHARED_DEBUG_LIBRARY_GL} ) - endif (WXWINDOWS_USE_GL) - endif(WXWINDOWS_SHARED_LIBRARY) - endif(NOT WXWINDOWS_SHARED_DEBUG_LIBRARY) + endif () + endif() + endif() ## shared: none found? if(NOT WXWINDOWS_SHARED_DEBUG_LIBRARY) if(NOT WXWINDOWS_SHARED_LIBRARY) message(STATUS "No shared wxWindows lib found, but WXWINDOWS_USE_SHARED_LIBS=${WXWINDOWS_USE_SHARED_LIBS}.") - endif(NOT WXWINDOWS_SHARED_LIBRARY) - endif(NOT WXWINDOWS_SHARED_DEBUG_LIBRARY) + endif() + endif() ######################################################################################### - else(WXWINDOWS_USE_SHARED_LIBS) + else() ##jw: DEPRECATED if(NOT WXWINDOWS_SEPARATE_LIBS_BUILD) @@ -483,8 +483,8 @@ if(WIN32_STYLE_FIND) set(WXWINDOWS_LIBRARIES ${WXWINDOWS_LIBRARIES} debug ${WXWINDOWS_STATIC_DEBUG_LIBRARY_GL} optimized ${WXWINDOWS_STATIC_LIBRARY_GL} ) - endif (WXWINDOWS_USE_GL) - endif(WXWINDOWS_STATIC_DEBUG_LIBRARY AND WXWINDOWS_STATIC_LIBRARY) + endif () + endif() ## static: only debug wx lib found? if(WXWINDOWS_STATIC_DEBUG_LIBRARY) @@ -498,9 +498,9 @@ if(WIN32_STYLE_FIND) if (WXWINDOWS_USE_GL) set(WXWINDOWS_LIBRARIES ${WXWINDOWS_LIBRARIES} ${WXWINDOWS_STATIC_DEBUG_LIBRARY_GL} ) - endif (WXWINDOWS_USE_GL) - endif(NOT WXWINDOWS_STATIC_LIBRARY) - endif(WXWINDOWS_STATIC_DEBUG_LIBRARY) + endif () + endif() + endif() ## static: only release wx lib found? if(NOT WXWINDOWS_STATIC_DEBUG_LIBRARY) @@ -514,18 +514,18 @@ if(WIN32_STYLE_FIND) if (WXWINDOWS_USE_GL) set(WXWINDOWS_LIBRARIES ${WXWINDOWS_LIBRARIES} ${WXWINDOWS_STATIC_LIBRARY_GL} ) - endif (WXWINDOWS_USE_GL) - endif(WXWINDOWS_STATIC_LIBRARY) - endif(NOT WXWINDOWS_STATIC_DEBUG_LIBRARY) + endif () + endif() + endif() ## static: none found? if(NOT WXWINDOWS_STATIC_DEBUG_LIBRARY AND NOT WXWINDOWS_SEPARATE_LIBS_BUILD) if(NOT WXWINDOWS_STATIC_LIBRARY) message(STATUS "No static wxWindows lib found, but WXWINDOWS_USE_SHARED_LIBS=${WXWINDOWS_USE_SHARED_LIBS}.") - endif(NOT WXWINDOWS_STATIC_LIBRARY) - endif(NOT WXWINDOWS_STATIC_DEBUG_LIBRARY AND NOT WXWINDOWS_SEPARATE_LIBS_BUILD) - endif(WXWINDOWS_USE_SHARED_LIBS) + endif() + endif() + endif() ## not neccessary in wxWindows 2.4.1 and 2.6.2 @@ -535,10 +535,10 @@ if(WIN32_STYLE_FIND) mark_as_advanced(WXWINDOWS_SET_DEFINITIONS) if (WXWINDOWS_SET_DEFINITIONS) set(WXWINDOWS_DEFINITIONS "-DWINVER=0x400") - else (WXWINDOWS_SET_DEFINITIONS) + else () # clear: set(WXWINDOWS_DEFINITIONS "") - endif (WXWINDOWS_SET_DEFINITIONS) + endif () @@ -550,7 +550,7 @@ if(WIN32_STYLE_FIND) ## append the build specific include dir for wx/setup.h: if (WXWINDOWS_INCLUDE_DIR_SETUPH) set(WXWINDOWS_INCLUDE_DIR ${WXWINDOWS_INCLUDE_DIR} ${WXWINDOWS_INCLUDE_DIR_SETUPH} ) - endif (WXWINDOWS_INCLUDE_DIR_SETUPH) + endif () @@ -579,7 +579,7 @@ if(WIN32_STYLE_FIND) ) -else(WIN32_STYLE_FIND) +else() if (UNIX_STYLE_FIND) ## ###################################################################### @@ -613,14 +613,14 @@ else(WIN32_STYLE_FIND) # linking, just link *against* static .a libs) if(WXWINDOWS_USE_SHARED_LIBS) set(WX_CONFIG_ARGS_LIBS "--libs") - else(WXWINDOWS_USE_SHARED_LIBS) + else() set(WX_CONFIG_ARGS_LIBS "--static --libs") - endif(WXWINDOWS_USE_SHARED_LIBS) + endif() # do we need additionial wx GL stuff like GLCanvas ? if(WXWINDOWS_USE_GL) set(WX_CONFIG_ARGS_LIBS "${WX_CONFIG_ARGS_LIBS} --gl-libs" ) - endif(WXWINDOWS_USE_GL) + endif() ##message("DBG: WX_CONFIG_ARGS_LIBS=${WX_CONFIG_ARGS_LIBS}===") # set CXXFLAGS to be fed into CMAKE_CXX_FLAGS by the user: @@ -629,12 +629,12 @@ else(WIN32_STYLE_FIND) if(CMAKE_COMPILER_IS_GNUCC AND CMAKE_COMPILER_IS_GNUCXX ) if (CMAKE_CXX_COMPILER MATCHES g\\+\\+) set(CMAKE_WXWINDOWS_CXX_FLAGS "`${CMAKE_WXWINDOWS_WXCONFIG_EXECUTABLE} --cxxflags|sed -e s/-I/-isystem/g`") - else(CMAKE_CXX_COMPILER MATCHES g\\+\\+) + else() set(CMAKE_WXWINDOWS_CXX_FLAGS "`${CMAKE_WXWINDOWS_WXCONFIG_EXECUTABLE} --cxxflags`") - endif(CMAKE_CXX_COMPILER MATCHES g\\+\\+) - endif(CMAKE_COMPILER_IS_GNUCC AND CMAKE_COMPILER_IS_GNUCXX ) - endif (NOT APPLE) - endif (HAVE_ISYSTEM) + endif() + endif() + endif () + endif () ##message("DBG: for compilation: ##CMAKE_WXWINDOWS_CXX_FLAGS=${CMAKE_WXWINDOWS_CXX_FLAGS}===") @@ -661,7 +661,7 @@ else(WIN32_STYLE_FIND) if(WXWINDOWS_LINK_DIRECTORIES_WITH_PREFIX) string(REGEX REPLACE "[-][L]" ";" WXWINDOWS_LINK_DIRECTORIES ${WXWINDOWS_LINK_DIRECTORIES_WITH_PREFIX} ) # message("DBG WXWINDOWS_LINK_DIRECTORIES=${WXWINDOWS_LINK_DIRECTORIES}") - endif(WXWINDOWS_LINK_DIRECTORIES_WITH_PREFIX) + endif() ## replace space separated string by semicolon separated vector to make it @@ -677,17 +677,17 @@ else(WIN32_STYLE_FIND) ## we really need wx-config... - else(CMAKE_WXWINDOWS_WXCONFIG_EXECUTABLE) + else() message(STATUS "Cannot find wx-config anywhere on the system. Please put the file into your path or specify it in CMAKE_WXWINDOWS_WXCONFIG_EXECUTABLE.") mark_as_advanced(CMAKE_WXWINDOWS_WXCONFIG_EXECUTABLE) - endif(CMAKE_WXWINDOWS_WXCONFIG_EXECUTABLE) + endif() - else(UNIX_STYLE_FIND) + else() message(STATUS "FindwxWindows.cmake: Platform unknown/unsupported by FindwxWindows.cmake. It's neither WIN32 nor UNIX") - endif(UNIX_STYLE_FIND) -endif(WIN32_STYLE_FIND) + endif() +endif() if(WXWINDOWS_LIBRARIES) @@ -702,5 +702,5 @@ if(WXWINDOWS_LIBRARIES) set(WXWINDOWS_LINK_DIRECTORIES ${WXWINDOWS_LINK_DIRECTORIES}) set(CMAKE_WX_CXX_FLAGS ${CMAKE_WXWINDOWS_CXX_FLAGS}) - endif(WXWINDOWS_INCLUDE_DIR OR CMAKE_WXWINDOWS_CXX_FLAGS) -endif(WXWINDOWS_LIBRARIES) + endif() +endif() diff --git a/Modules/FortranCInterface.cmake b/Modules/FortranCInterface.cmake index 2455c5f..aafecb4 100644 --- a/Modules/FortranCInterface.cmake +++ b/Modules/FortranCInterface.cmake @@ -215,7 +215,7 @@ ${_desc_${macro}} message(AUTHOR_WARNING "No FortranCInterface mangling known for ${f}") endif() endif() - endforeach(f) + endforeach() # Store the content. configure_file(${FortranCInterface_SOURCE_DIR}/Macro.h.in ${FILE} @ONLY) diff --git a/Modules/FortranCInterface/Detect.cmake b/Modules/FortranCInterface/Detect.cmake index 2ea43d1..798c44c 100644 --- a/Modules/FortranCInterface/Detect.cmake +++ b/Modules/FortranCInterface/Detect.cmake @@ -174,7 +174,7 @@ file(APPEND ${FortranCInterface_BINARY_DIR}/Output.cmake "\n") if(FortranCInterface_GLOBAL_FOUND) if(FortranCInterface_MODULE_FOUND) set(_result "Found GLOBAL and MODULE mangling") - else(FortranCInterface_MODULE_FOUND) + else() set(_result "Found GLOBAL but not MODULE mangling") endif() elseif(NOT _result) diff --git a/Modules/GetPrerequisites.cmake b/Modules/GetPrerequisites.cmake index d215685..e51055f 100644 --- a/Modules/GetPrerequisites.cmake +++ b/Modules/GetPrerequisites.cmake @@ -126,13 +126,13 @@ function(gp_append_unique list_var value) if("${item}" STREQUAL "${value}") set(contains 1) break() - endif("${item}" STREQUAL "${value}") - endforeach(item) + endif() + endforeach() if(NOT contains) set(${list_var} ${${list_var}} "${value}" PARENT_SCOPE) - endif(NOT contains) -endfunction(gp_append_unique) + endif() +endfunction() function(is_file_executable file result_var) @@ -150,13 +150,13 @@ function(is_file_executable file result_var) if("${file_full_lower}" MATCHES "\\.exe$") set(${result_var} 1 PARENT_SCOPE) return() - endif("${file_full_lower}" MATCHES "\\.exe$") + endif() # A clause could be added here that uses output or return value of dumpbin # to determine ${result_var}. In 99%+? practical cases, the exe name # match will be sufficient... # - endif(WIN32 AND NOT UNIX) + endif() # Use the information returned from the Unix shell command "file" to # determine if ${file_full} should be considered an executable file... @@ -168,7 +168,7 @@ function(is_file_executable file result_var) if(UNIX) if(NOT file_cmd) find_program(file_cmd "file") - endif(NOT file_cmd) + endif() if(file_cmd) execute_process(COMMAND "${file_cmd}" "${file_full}" @@ -190,11 +190,11 @@ function(is_file_executable file result_var) #message(STATUS "executable!") if("${file_ov}" MATCHES "text") #message(STATUS "but text, so *not* a binary executable!") - else("${file_ov}" MATCHES "text") + else() set(${result_var} 1 PARENT_SCOPE) return() - endif("${file_ov}" MATCHES "text") - endif("${file_ov}" MATCHES "executable") + endif() + endif() # Also detect position independent executables on Linux, # where "file" gives "shared object ... (uses shared libraries)" @@ -203,11 +203,11 @@ function(is_file_executable file result_var) return() endif() - else(file_cmd) + else() message(STATUS "warning: No 'file' command, skipping execute_process...") - endif(file_cmd) - endif(UNIX) -endfunction(is_file_executable) + endif() + endif() +endfunction() function(gp_item_default_embedded_path item default_embedded_path_var) @@ -240,7 +240,7 @@ function(gp_item_default_embedded_path item default_embedded_path_var) if(item MATCHES "\\.dylib$") set(path "@executable_path/../MacOS") set(overridden 1) - endif(item MATCHES "\\.dylib$") + endif() # Embed frameworks in the embedded "Frameworks" directory (sibling of MacOS): # @@ -248,8 +248,8 @@ function(gp_item_default_embedded_path item default_embedded_path_var) if(item MATCHES "[^/]+\\.framework/") set(path "@executable_path/../Frameworks") set(overridden 1) - endif(item MATCHES "[^/]+\\.framework/") - endif(NOT overridden) + endif() + endif() endif() # Provide a hook so that projects can override the default embedded location @@ -257,10 +257,10 @@ function(gp_item_default_embedded_path item default_embedded_path_var) # if(COMMAND gp_item_default_embedded_path_override) gp_item_default_embedded_path_override("${item}" path) - endif(COMMAND gp_item_default_embedded_path_override) + endif() set(${default_embedded_path_var} "${path}" PARENT_SCOPE) -endfunction(gp_item_default_embedded_path) +endfunction() function(gp_resolve_item context item exepath dirs resolved_item_var) @@ -271,7 +271,7 @@ function(gp_resolve_item context item exepath dirs resolved_item_var) # if(IS_ABSOLUTE "${resolved_item}" AND EXISTS "${resolved_item}") set(resolved 1) - endif(IS_ABSOLUTE "${resolved_item}" AND EXISTS "${resolved_item}") + endif() if(NOT resolved) if(item MATCHES "@executable_path") @@ -285,11 +285,11 @@ function(gp_resolve_item context item exepath dirs resolved_item_var) #message(STATUS "info: embedded item exists (${ri})") set(resolved 1) set(resolved_item "${ri}") - else(EXISTS "${ri}") + else() message(STATUS "warning: embedded item does not exist '${ri}'") - endif(EXISTS "${ri}") - endif(item MATCHES "@executable_path") - endif(NOT resolved) + endif() + endif() + endif() if(NOT resolved) if(item MATCHES "@loader_path") @@ -305,11 +305,11 @@ function(gp_resolve_item context item exepath dirs resolved_item_var) #message(STATUS "info: embedded item exists (${ri})") set(resolved 1) set(resolved_item "${ri}") - else(EXISTS "${ri}") + else() message(STATUS "warning: embedded item does not exist '${ri}'") - endif(EXISTS "${ri}") - endif(item MATCHES "@loader_path") - endif(NOT resolved) + endif() + endif() + endif() if(NOT resolved) if(item MATCHES "@rpath") @@ -326,10 +326,10 @@ function(gp_resolve_item context item exepath dirs resolved_item_var) set(resolved 1) set(resolved_item "${ri}") set(ri "ri-NOTFOUND") - endif(ri) + endif() - endif(item MATCHES "@rpath") - endif(NOT resolved) + endif() + endif() if(NOT resolved) set(ri "ri-NOTFOUND") @@ -340,8 +340,8 @@ function(gp_resolve_item context item exepath dirs resolved_item_var) set(resolved 1) set(resolved_item "${ri}") set(ri "ri-NOTFOUND") - endif(ri) - endif(NOT resolved) + endif() + endif() if(NOT resolved) if(item MATCHES "[^/]+\\.framework/") @@ -356,9 +356,9 @@ function(gp_resolve_item context item exepath dirs resolved_item_var) set(resolved 1) set(resolved_item "${fw}") set(fw "fw-NOTFOUND") - endif(fw) - endif(item MATCHES "[^/]+\\.framework/") - endif(NOT resolved) + endif() + endif() + endif() # Using find_program on Windows will find dll files that are in the PATH. # (Converting simple file names into full path names if found.) @@ -373,16 +373,16 @@ function(gp_resolve_item context item exepath dirs resolved_item_var) set(resolved 1) set(resolved_item "${ri}") set(ri "ri-NOTFOUND") - endif(ri) - endif(NOT resolved) - endif(WIN32 AND NOT UNIX) + endif() + endif() + endif() # Provide a hook so that projects can override item resolution # by whatever logic they choose: # if(COMMAND gp_resolve_item_override) gp_resolve_item_override("${context}" "${item}" "${exepath}" "${dirs}" resolved_item resolved) - endif(COMMAND gp_resolve_item_override) + endif() if(NOT resolved) message(STATUS " @@ -409,10 +409,10 @@ warning: cannot resolve item '${item}' # resolved_item_var='${resolved_item_var}' #****************************************************************************** #") - endif(NOT resolved) + endif() set(${resolved_item_var} "${resolved_item}" PARENT_SCOPE) -endfunction(gp_resolve_item) +endfunction() function(gp_resolved_file_type original_file file exepath dirs type_var) @@ -480,9 +480,9 @@ function(gp_resolved_file_type original_file file exepath dirs type_var) if(lower MATCHES "^(${sysroot}/sys(tem|wow)|${windir}/sys(tem|wow)|(.*/)*msvc[^/]+dll)") set(is_system 1) endif() - endif(CYGPATH_EXECUTABLE) - endif(UNIX) - endif(WIN32) + endif() + endif() + endif() if(NOT is_system) get_filename_component(original_path "${original_lower}" PATH) @@ -551,7 +551,7 @@ function(gp_file_type original_file file type_var) gp_resolved_file_type("${original_file}" "${file}" "${exepath}" "" type) set(${type_var} "${type}" PARENT_SCOPE) -endfunction(gp_file_type) +endfunction() function(get_prerequisites target prerequisites_var exclude_system recurse exepath dirs) @@ -560,11 +560,11 @@ function(get_prerequisites target prerequisites_var exclude_system recurse exepa if(NOT IS_ABSOLUTE "${target}") message("warning: target '${target}' is not absolute...") - endif(NOT IS_ABSOLUTE "${target}") + endif() if(NOT EXISTS "${target}") message("warning: target '${target}' does not exist...") - endif(NOT EXISTS "${target}") + endif() # <setup-gp_tool-vars> # @@ -575,11 +575,11 @@ function(get_prerequisites target prerequisites_var exclude_system recurse exepa set(gp_tool "ldd") if(APPLE) set(gp_tool "otool") - endif(APPLE) + endif() if(WIN32 AND NOT UNIX) # This is how to check for cygwin, har! set(gp_tool "dumpbin") - endif(WIN32 AND NOT UNIX) - endif("${gp_tool}" STREQUAL "") + endif() + endif() set(gp_tool_known 0) @@ -590,7 +590,7 @@ function(get_prerequisites target prerequisites_var exclude_system recurse exepa set(gp_regex_fallback "^[\t ]*([^\t ]+) => ([^\t ]+).*${eol_char}$") set(gp_regex_cmp_count 1) set(gp_tool_known 1) - endif("${gp_tool}" STREQUAL "ldd") + endif() if("${gp_tool}" STREQUAL "otool") set(gp_cmd_args "-L") @@ -599,7 +599,7 @@ function(get_prerequisites target prerequisites_var exclude_system recurse exepa set(gp_regex_fallback "") set(gp_regex_cmp_count 3) set(gp_tool_known 1) - endif("${gp_tool}" STREQUAL "otool") + endif() if("${gp_tool}" STREQUAL "dumpbin") set(gp_cmd_args "/dependents") @@ -609,14 +609,14 @@ function(get_prerequisites target prerequisites_var exclude_system recurse exepa set(gp_regex_cmp_count 1) set(gp_tool_known 1) set(ENV{VS_UNICODE_OUTPUT} "") # Block extra output from inside VS IDE. - endif("${gp_tool}" STREQUAL "dumpbin") + endif() if(NOT gp_tool_known) message(STATUS "warning: gp_tool='${gp_tool}' is an unknown tool...") message(STATUS "CMake function get_prerequisites needs more code to handle '${gp_tool}'") message(STATUS "Valid gp_tool values are dumpbin, ldd and otool.") return() - endif(NOT gp_tool_known) + endif() set(gp_cmd_paths ${gp_cmd_paths} "C:/Program Files/Microsoft Visual Studio 9.0/VC/bin" @@ -634,7 +634,7 @@ function(get_prerequisites target prerequisites_var exclude_system recurse exepa if(NOT gp_cmd) message(STATUS "warning: could not find '${gp_tool}' - cannot analyze prerequisites...") return() - endif(NOT gp_cmd) + endif() if("${gp_tool}" STREQUAL "dumpbin") # When running dumpbin, it also needs the "Common7/IDE" directory in the @@ -654,14 +654,14 @@ function(get_prerequisites target prerequisites_var exclude_system recurse exepa if("${gp_env_path_element}" STREQUAL "${gp_cmd_dlls_dir}") set(gp_found_cmd_dlls_dir 1) endif() - endforeach(gp_env_path_element) + endforeach() if(NOT gp_found_cmd_dlls_dir) file(TO_NATIVE_PATH "${gp_cmd_dlls_dir}" gp_cmd_dlls_dir) set(ENV{PATH} "$ENV{PATH};${gp_cmd_dlls_dir}") endif() - endif(EXISTS "${gp_cmd_dlls_dir}") - endif("${gp_tool}" STREQUAL "dumpbin") + endif() + endif() # # </setup-gp_tool-vars> @@ -669,8 +669,8 @@ function(get_prerequisites target prerequisites_var exclude_system recurse exepa set(old_ld_env "$ENV{LD_LIBRARY_PATH}") foreach(dir ${exepath} ${dirs}) set(ENV{LD_LIBRARY_PATH} "${dir}:$ENV{LD_LIBRARY_PATH}") - endforeach(dir) - endif("${gp_tool}" STREQUAL "ldd") + endforeach() + endif() # Track new prerequisites at each new level of recursion. Start with an @@ -687,13 +687,13 @@ function(get_prerequisites target prerequisites_var exclude_system recurse exepa if("${gp_tool}" STREQUAL "ldd") set(ENV{LD_LIBRARY_PATH} "${old_ld_env}") - endif("${gp_tool}" STREQUAL "ldd") + endif() if(verbose) message(STATUS "<RawOutput cmd='${gp_cmd} ${gp_cmd_args} ${target}'>") message(STATUS "gp_cmd_ov='${gp_cmd_ov}'") message(STATUS "</RawOutput>") - endif(verbose) + endif() get_filename_component(target_dir "${target}" PATH) @@ -716,8 +716,8 @@ function(get_prerequisites target prerequisites_var exclude_system recurse exepa # trim string(REGEX MATCH "[^\n ].*[^\n ]" gp_install_id "${gp_install_id}") #message("INSTALL ID is \"${gp_install_id}\"") - endif(gp_install_id) - endif("${gp_tool}" STREQUAL "otool") + endif() + endif() # Analyze each line for file names that match the regular expression: # @@ -727,23 +727,23 @@ function(get_prerequisites target prerequisites_var exclude_system recurse exepa # Extract information from each candidate: if(gp_regex_error AND "${candidate}" MATCHES "${gp_regex_error}") string(REGEX REPLACE "${gp_regex_fallback}" "\\1" raw_item "${candidate}") - else(gp_regex_error AND "${candidate}" MATCHES "${gp_regex_error}") + else() string(REGEX REPLACE "${gp_regex}" "\\1" raw_item "${candidate}") - endif(gp_regex_error AND "${candidate}" MATCHES "${gp_regex_error}") + endif() if(gp_regex_cmp_count GREATER 1) string(REGEX REPLACE "${gp_regex}" "\\2" raw_compat_version "${candidate}") string(REGEX REPLACE "^([0-9]+)\\.([0-9]+)\\.([0-9]+)$" "\\1" compat_major_version "${raw_compat_version}") string(REGEX REPLACE "^([0-9]+)\\.([0-9]+)\\.([0-9]+)$" "\\2" compat_minor_version "${raw_compat_version}") string(REGEX REPLACE "^([0-9]+)\\.([0-9]+)\\.([0-9]+)$" "\\3" compat_patch_version "${raw_compat_version}") - endif(gp_regex_cmp_count GREATER 1) + endif() if(gp_regex_cmp_count GREATER 2) string(REGEX REPLACE "${gp_regex}" "\\3" raw_current_version "${candidate}") string(REGEX REPLACE "^([0-9]+)\\.([0-9]+)\\.([0-9]+)$" "\\1" current_major_version "${raw_current_version}") string(REGEX REPLACE "^([0-9]+)\\.([0-9]+)\\.([0-9]+)$" "\\2" current_minor_version "${raw_current_version}") string(REGEX REPLACE "^([0-9]+)\\.([0-9]+)\\.([0-9]+)$" "\\3" current_patch_version "${raw_current_version}") - endif(gp_regex_cmp_count GREATER 2) + endif() # Use the raw_item as the list entries returned by this function. Use the # gp_resolve_item function to resolve it to an actual full path file if @@ -757,7 +757,7 @@ function(get_prerequisites target prerequisites_var exclude_system recurse exepa if("${item}" STREQUAL "${gp_install_id}") set(add_item 0) - endif("${item}" STREQUAL "${gp_install_id}") + endif() if(add_item AND ${exclude_system}) set(type "") @@ -765,8 +765,8 @@ function(get_prerequisites target prerequisites_var exclude_system recurse exepa if("${type}" STREQUAL "system") set(add_item 0) - endif("${type}" STREQUAL "system") - endif(add_item AND ${exclude_system}) + endif() + endif() if(add_item) list(LENGTH ${prerequisites_var} list_length_before_append) @@ -784,49 +784,49 @@ function(get_prerequisites target prerequisites_var exclude_system recurse exepa if(NOT list_length_before_append EQUAL list_length_after_append) gp_resolve_item("${target}" "${item}" "${exepath}" "${dirs}" resolved_item) set(unseen_prereqs ${unseen_prereqs} "${resolved_item}") - endif(NOT list_length_before_append EQUAL list_length_after_append) - endif(${recurse}) - endif(add_item) - else("${candidate}" MATCHES "${gp_regex}") + endif() + endif() + endif() + else() if(verbose) message(STATUS "ignoring non-matching line: '${candidate}'") - endif(verbose) - endif("${candidate}" MATCHES "${gp_regex}") - endforeach(candidate) + endif() + endif() + endforeach() list(LENGTH ${prerequisites_var} prerequisites_var_length) if(prerequisites_var_length GREATER 0) list(SORT ${prerequisites_var}) - endif(prerequisites_var_length GREATER 0) + endif() if(${recurse}) set(more_inputs ${unseen_prereqs}) foreach(input ${more_inputs}) get_prerequisites("${input}" ${prerequisites_var} ${exclude_system} ${recurse} "${exepath}" "${dirs}") - endforeach(input) - endif(${recurse}) + endforeach() + endif() set(${prerequisites_var} ${${prerequisites_var}} PARENT_SCOPE) -endfunction(get_prerequisites) +endfunction() function(list_prerequisites target) if("${ARGV1}" STREQUAL "") set(all 1) - else("${ARGV1}" STREQUAL "") + else() set(all "${ARGV1}") - endif("${ARGV1}" STREQUAL "") + endif() if("${ARGV2}" STREQUAL "") set(exclude_system 0) - else("${ARGV2}" STREQUAL "") + else() set(exclude_system "${ARGV2}") - endif("${ARGV2}" STREQUAL "") + endif() if("${ARGV3}" STREQUAL "") set(verbose 0) - else("${ARGV3}" STREQUAL "") + else() set(verbose "${ARGV3}") - endif("${ARGV3}" STREQUAL "") + endif() set(count 0) set(count_str "") @@ -842,23 +842,23 @@ function(list_prerequisites target) if(print_target) message(STATUS "File '${target}' depends on:") - endif(print_target) + endif() foreach(d ${prereqs}) math(EXPR count "${count} + 1") if(print_count) set(count_str "${count}. ") - endif(print_count) + endif() if(print_prerequisite_type) gp_file_type("${target}" "${d}" type) set(type_str " (${type})") - endif(print_prerequisite_type) + endif() message(STATUS "${count_str}${d}${type_str}") - endforeach(d) -endfunction(list_prerequisites) + endforeach() +endfunction() function(list_prerequisites_by_glob glob_arg glob_exp) @@ -872,6 +872,6 @@ function(list_prerequisites_by_glob glob_arg glob_exp) message(STATUS "=============================================================================") list_prerequisites("${f}" ${ARGN}) message(STATUS "") - endif(is_f_executable) - endforeach(f) -endfunction(list_prerequisites_by_glob) + endif() + endforeach() +endfunction() diff --git a/Modules/InstallRequiredSystemLibraries.cmake b/Modules/InstallRequiredSystemLibraries.cmake index f6b185f..19b06d5 100644 --- a/Modules/InstallRequiredSystemLibraries.cmake +++ b/Modules/InstallRequiredSystemLibraries.cmake @@ -47,9 +47,9 @@ if(MSVC) # VS 9 and earlier: set(CMAKE_MSVC_ARCH amd64) endif() - else(CMAKE_CL_64) + else() set(CMAKE_MSVC_ARCH x86) - endif(CMAKE_CL_64) + endif() get_filename_component(devenv_dir "${CMAKE_MAKE_PROGRAM}" PATH) get_filename_component(base_dir "${devenv_dir}/../.." ABSOLUTE) @@ -59,14 +59,14 @@ if(MSVC) "${SYSTEMROOT}/system32/msvcp70.dll" "${SYSTEMROOT}/system32/msvcr70.dll" ) - endif(MSVC70) + endif() if(MSVC71) set(__install__libs "${SYSTEMROOT}/system32/msvcp71.dll" "${SYSTEMROOT}/system32/msvcr71.dll" ) - endif(MSVC71) + endif() if(MSVC80) # Find the runtime library redistribution directory. @@ -89,7 +89,7 @@ if(MSVC) "${MSVC80_CRT_DIR}/msvcp80.dll" "${MSVC80_CRT_DIR}/msvcr80.dll" ) - endif(NOT CMAKE_INSTALL_DEBUG_LIBRARIES_ONLY) + endif() if(CMAKE_INSTALL_DEBUG_LIBRARIES) set(MSVC80_CRT_DIR @@ -100,8 +100,8 @@ if(MSVC) "${MSVC80_CRT_DIR}/msvcp80d.dll" "${MSVC80_CRT_DIR}/msvcr80d.dll" ) - endif(CMAKE_INSTALL_DEBUG_LIBRARIES) - endif(MSVC80) + endif() + endif() if(MSVC90) # Find the runtime library redistribution directory. @@ -127,7 +127,7 @@ if(MSVC) "${MSVC90_CRT_DIR}/msvcp90.dll" "${MSVC90_CRT_DIR}/msvcr90.dll" ) - endif(NOT CMAKE_INSTALL_DEBUG_LIBRARIES_ONLY) + endif() if(CMAKE_INSTALL_DEBUG_LIBRARIES) set(MSVC90_CRT_DIR @@ -138,8 +138,8 @@ if(MSVC) "${MSVC90_CRT_DIR}/msvcp90d.dll" "${MSVC90_CRT_DIR}/msvcr90d.dll" ) - endif(CMAKE_INSTALL_DEBUG_LIBRARIES) - endif(MSVC90) + endif() + endif() macro(MSVCRT_FILES_FOR_VERSION version) set(v "${version}") @@ -162,7 +162,7 @@ if(MSVC) "${MSVC${v}_CRT_DIR}/msvcp${v}0.dll" "${MSVC${v}_CRT_DIR}/msvcr${v}0.dll" ) - endif(NOT CMAKE_INSTALL_DEBUG_LIBRARIES_ONLY) + endif() if(CMAKE_INSTALL_DEBUG_LIBRARIES) set(MSVC${v}_CRT_DIR @@ -171,7 +171,7 @@ if(MSVC) "${MSVC${v}_CRT_DIR}/msvcp${v}0d.dll" "${MSVC${v}_CRT_DIR}/msvcr${v}0d.dll" ) - endif(CMAKE_INSTALL_DEBUG_LIBRARIES) + endif() endmacro() if(MSVC10) @@ -187,13 +187,13 @@ if(MSVC) set(__install__libs ${__install__libs} "${SYSTEMROOT}/system32/mfc70.dll" ) - endif(MSVC70) + endif() if(MSVC71) set(__install__libs ${__install__libs} "${SYSTEMROOT}/system32/mfc71.dll" ) - endif(MSVC71) + endif() if(MSVC80) if(CMAKE_INSTALL_DEBUG_LIBRARIES) @@ -206,7 +206,7 @@ if(MSVC) "${MSVC80_MFC_DIR}/mfcm80d.dll" "${MSVC80_MFC_DIR}/mfcm80ud.dll" ) - endif(CMAKE_INSTALL_DEBUG_LIBRARIES) + endif() set(MSVC80_MFC_DIR "${MSVC80_REDIST_DIR}/${CMAKE_MSVC_ARCH}/Microsoft.VC80.MFC") # Install the manifest that allows DLLs to be loaded from the @@ -219,7 +219,7 @@ if(MSVC) "${MSVC80_MFC_DIR}/mfcm80.dll" "${MSVC80_MFC_DIR}/mfcm80u.dll" ) - endif(NOT CMAKE_INSTALL_DEBUG_LIBRARIES_ONLY) + endif() # include the language dll's for vs8 as well as the actuall dll's set(MSVC80_MFCLOC_DIR "${MSVC80_REDIST_DIR}/${CMAKE_MSVC_ARCH}/Microsoft.VC80.MFCLOC") @@ -237,7 +237,7 @@ if(MSVC) "${MSVC80_MFCLOC_DIR}/mfc80jpn.dll" "${MSVC80_MFCLOC_DIR}/mfc80kor.dll" ) - endif(MSVC80) + endif() if(MSVC90) if(CMAKE_INSTALL_DEBUG_LIBRARIES) @@ -250,7 +250,7 @@ if(MSVC) "${MSVC90_MFC_DIR}/mfcm90d.dll" "${MSVC90_MFC_DIR}/mfcm90ud.dll" ) - endif(CMAKE_INSTALL_DEBUG_LIBRARIES) + endif() set(MSVC90_MFC_DIR "${MSVC90_REDIST_DIR}/${CMAKE_MSVC_ARCH}/Microsoft.VC90.MFC") # Install the manifest that allows DLLs to be loaded from the @@ -263,7 +263,7 @@ if(MSVC) "${MSVC90_MFC_DIR}/mfcm90.dll" "${MSVC90_MFC_DIR}/mfcm90u.dll" ) - endif(NOT CMAKE_INSTALL_DEBUG_LIBRARIES_ONLY) + endif() # include the language dll's for vs9 as well as the actuall dll's set(MSVC90_MFCLOC_DIR "${MSVC90_REDIST_DIR}/${CMAKE_MSVC_ARCH}/Microsoft.VC90.MFCLOC") @@ -281,7 +281,7 @@ if(MSVC) "${MSVC90_MFCLOC_DIR}/mfc90jpn.dll" "${MSVC90_MFCLOC_DIR}/mfc90kor.dll" ) - endif(MSVC90) + endif() macro(MFC_FILES_FOR_VERSION version) set(v "${version}") @@ -295,7 +295,7 @@ if(MSVC) "${MSVC${v}_MFC_DIR}/mfcm${v}0d.dll" "${MSVC${v}_MFC_DIR}/mfcm${v}0ud.dll" ) - endif(CMAKE_INSTALL_DEBUG_LIBRARIES) + endif() set(MSVC${v}_MFC_DIR "${MSVC${v}_REDIST_DIR}/${CMAKE_MSVC_ARCH}/Microsoft.VC${v}0.MFC") if(NOT CMAKE_INSTALL_DEBUG_LIBRARIES_ONLY) @@ -305,7 +305,7 @@ if(MSVC) "${MSVC${v}_MFC_DIR}/mfcm${v}0.dll" "${MSVC${v}_MFC_DIR}/mfcm${v}0u.dll" ) - endif(NOT CMAKE_INSTALL_DEBUG_LIBRARIES_ONLY) + endif() # include the language dll's as well as the actuall dll's set(MSVC${v}_MFCLOC_DIR "${MSVC${v}_REDIST_DIR}/${CMAKE_MSVC_ARCH}/Microsoft.VC${v}0.MFCLOC") @@ -329,7 +329,7 @@ if(MSVC) if(MSVC11) MFC_FILES_FOR_VERSION(11) endif() - endif(CMAKE_INSTALL_MFC_LIBRARIES) + endif() foreach(lib ${__install__libs} @@ -337,7 +337,7 @@ if(MSVC) if(EXISTS ${lib}) set(CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS ${CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS} ${lib}) - else(EXISTS ${lib}) + else() if(NOT CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_NO_WARNINGS) message(WARNING "system runtime library file does not exist: '${lib}'") # This warning indicates an incomplete Visual Studio installation @@ -346,9 +346,9 @@ if(MSVC) # set CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_NO_WARNINGS before including # this file. endif() - endif(EXISTS ${lib}) - endforeach(lib) -endif(MSVC) + endif() + endforeach() +endif() if(WATCOM) get_filename_component( CompilerPath ${CMAKE_C_COMPILER} PATH ) @@ -391,11 +391,11 @@ if(CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS) if(NOT CMAKE_INSTALL_SYSTEM_RUNTIME_DESTINATION) if(WIN32) set(CMAKE_INSTALL_SYSTEM_RUNTIME_DESTINATION bin) - else(WIN32) + else() set(CMAKE_INSTALL_SYSTEM_RUNTIME_DESTINATION lib) - endif(WIN32) - endif(NOT CMAKE_INSTALL_SYSTEM_RUNTIME_DESTINATION) + endif() + endif() install(PROGRAMS ${CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS} DESTINATION ${CMAKE_INSTALL_SYSTEM_RUNTIME_DESTINATION}) - endif(NOT CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_SKIP) -endif(CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS) + endif() +endif() diff --git a/Modules/KDE3Macros.cmake b/Modules/KDE3Macros.cmake index 858b7d6..6d6cdb0 100644 --- a/Modules/KDE3Macros.cmake +++ b/Modules/KDE3Macros.cmake @@ -54,7 +54,7 @@ macro(KDE3_ADD_DCOP_SKELS _sources) DEPENDS ${_tmp_FILE} ) - endif (NOT HAVE_${_basename}_KIDL_RULE) + endif () if (NOT HAVE_${_basename}_SKEL_RULE) set(HAVE_${_basename}_SKEL_RULE ON) @@ -65,13 +65,13 @@ macro(KDE3_ADD_DCOP_SKELS _sources) DEPENDS ${_kidl} ) - endif (NOT HAVE_${_basename}_SKEL_RULE) + endif () set(${_sources} ${${_sources}} ${_skel}) - endforeach (_current_FILE) + endforeach () -endmacro(KDE3_ADD_DCOP_SKELS) +endmacro() macro(KDE3_ADD_DCOP_STUBS _sources) @@ -94,7 +94,7 @@ macro(KDE3_ADD_DCOP_STUBS _sources) DEPENDS ${_tmp_FILE} ) - endif (NOT HAVE_${_basename}_KIDL_RULE) + endif () if (NOT HAVE_${_basename}_STUB_RULE) @@ -106,13 +106,13 @@ macro(KDE3_ADD_DCOP_STUBS _sources) DEPENDS ${_kidl} ) - endif (NOT HAVE_${_basename}_STUB_RULE) + endif () set(${_sources} ${${_sources}} ${_stub_CPP}) - endforeach (_current_FILE) + endforeach () -endmacro(KDE3_ADD_DCOP_STUBS) +endmacro() macro(KDE3_ADD_KCFG_FILES _sources) @@ -135,9 +135,9 @@ macro(KDE3_ADD_KCFG_FILES _sources) set(${_sources} ${${_sources}} ${_src_FILE}) - endforeach (_current_FILE) + endforeach () -endmacro(KDE3_ADD_KCFG_FILES) +endmacro() #create the moc files and add them to the list of sources @@ -158,8 +158,8 @@ macro(KDE3_ADD_MOC_FILES _sources) set(${_sources} ${${_sources}} ${_moc}) - endforeach (_current_FILE) -endmacro(KDE3_ADD_MOC_FILES) + endforeach () +endmacro() get_filename_component( KDE3_MODULE_DIR ${CMAKE_CURRENT_LIST_FILE} PATH) @@ -202,8 +202,8 @@ macro(KDE3_ADD_UI_FILES _sources ) set(${_sources} ${${_sources}} ${_src} ${_moc} ) - endforeach (_current_FILE) -endmacro(KDE3_ADD_UI_FILES) + endforeach () +endmacro() macro(KDE3_AUTOMOC) @@ -245,12 +245,12 @@ macro(KDE3_AUTOMOC) ADD_FILE_DEPENDENCIES(${_abs_FILE} ${_moc}) - endforeach (_current_MOC_INC) - endif(_match) + endforeach () + endif() - endif (EXISTS ${_abs_FILE} AND NOT _skip) - endforeach (_current_FILE) -endmacro(KDE3_AUTOMOC) + endif () + endforeach () +endmacro() # only used internally by KDE3_INSTALL_ICONS macro (_KDE3_ADD_ICON_INSTALL_RULE _install_SCRIPT _install_PATH _group _orig_NAME _install_NAME) @@ -261,29 +261,29 @@ macro (_KDE3_ADD_ICON_INSTALL_RULE _install_SCRIPT _install_PATH _group _orig_NA if (${_group} STREQUAL "mime") set(_icon_GROUP "mimetypes") - endif (${_group} STREQUAL "mime") + endif () if (${_group} STREQUAL "filesys") set(_icon_GROUP "filesystems") - endif (${_group} STREQUAL "filesys") + endif () if (${_group} STREQUAL "device") set(_icon_GROUP "devices") - endif (${_group} STREQUAL "device") + endif () if (${_group} STREQUAL "app") set(_icon_GROUP "apps") - endif (${_group} STREQUAL "app") + endif () if (${_group} STREQUAL "action") set(_icon_GROUP "actions") - endif (${_group} STREQUAL "action") + endif () # message(STATUS "icon: ${_current_ICON} size: ${_size} group: ${_group} name: ${_name}" ) install(FILES ${_orig_NAME} DESTINATION ${_install_PATH}/${_icon_GROUP}/ RENAME ${_install_NAME} ) - endif (NOT ${_group} STREQUAL ${_install_NAME} ) + endif () -endmacro (_KDE3_ADD_ICON_INSTALL_RULE) +endmacro () macro (KDE3_INSTALL_ICONS _theme ) @@ -297,7 +297,7 @@ macro (KDE3_INSTALL_ICONS _theme ) _KDE3_ADD_ICON_INSTALL_RULE(${CMAKE_CURRENT_BINARY_DIR}/install_icons.cmake ${_defaultpath}/${_theme}/${_size}x${_size} ${_group} ${_current_ICON} ${_name}) - endforeach (_current_ICON) + endforeach () # and now the svg icons file(GLOB _icons *.svgz) @@ -307,9 +307,9 @@ macro (KDE3_INSTALL_ICONS _theme ) _KDE3_ADD_ICON_INSTALL_RULE(${CMAKE_CURRENT_BINARY_DIR}/install_icons.cmake ${_defaultpath}/${_theme}/scalable ${_group} ${_current_ICON} ${_name}) - endforeach (_current_ICON) + endforeach () -endmacro (KDE3_INSTALL_ICONS) +endmacro () macro(KDE3_INSTALL_LIBTOOL_FILE _target) get_target_property(_target_location ${_target} LOCATION) @@ -324,9 +324,9 @@ macro(KDE3_INSTALL_LIBTOOL_FILE _target) file(APPEND ${_laname} "# Names of this library\n") if(CYGWIN) file(APPEND ${_laname} "library_names='${_soname}'\n") - else(CYGWIN) + else() file(APPEND ${_laname} "library_names='${_soname} ${_soname} ${_soname}'\n") - endif(CYGWIN) + endif() file(APPEND ${_laname} "# The name of the static archive\n") file(APPEND ${_laname} "old_library=''\n") file(APPEND ${_laname} "# Libraries that this one depends upon.\n") @@ -340,16 +340,16 @@ macro(KDE3_INSTALL_LIBTOOL_FILE _target) file(APPEND ${_laname} "libdir='${CMAKE_INSTALL_PREFIX}/lib/kde3'\n") install_files(${KDE3_LIBTOOL_DIR} FILES ${_laname}) -endmacro(KDE3_INSTALL_LIBTOOL_FILE) +endmacro() macro(KDE3_CREATE_FINAL_FILE _filename) file(WRITE ${_filename} "//autogenerated file\n") foreach (_current_FILE ${ARGN}) file(APPEND ${_filename} "#include \"${_current_FILE}\"\n") - endforeach (_current_FILE) + endforeach () -endmacro(KDE3_CREATE_FINAL_FILE) +endmacro() # option(KDE3_ENABLE_FINAL "Enable final all-in-one compilation") @@ -360,24 +360,24 @@ macro(KDE3_ADD_KPART _target_NAME _with_PREFIX) #is the first argument is "WITH_PREFIX" then keep the standard "lib" prefix, otherwise SET the prefix empty if (${_with_PREFIX} STREQUAL "WITH_PREFIX") set(_first_SRC) - else (${_with_PREFIX} STREQUAL "WITH_PREFIX") + else () set(_first_SRC ${_with_PREFIX}) - endif (${_with_PREFIX} STREQUAL "WITH_PREFIX") + endif () # if (KDE3_ENABLE_FINAL) # KDE3_CREATE_FINAL_FILE(${_target_NAME}_final.cpp ${_first_SRC} ${ARGN}) # add_library(${_target_NAME} MODULE ${_target_NAME}_final.cpp) -# else (KDE3_ENABLE_FINAL) +# else () add_library(${_target_NAME} MODULE ${_first_SRC} ${ARGN}) -# endif (KDE3_ENABLE_FINAL) +# endif () if(_first_SRC) set_target_properties(${_target_NAME} PROPERTIES PREFIX "") - endif(_first_SRC) + endif() KDE3_INSTALL_LIBTOOL_FILE(${_target_NAME}) -endmacro(KDE3_ADD_KPART) +endmacro() macro(KDE3_ADD_KDEINIT_EXECUTABLE _target_NAME ) @@ -385,16 +385,16 @@ macro(KDE3_ADD_KDEINIT_EXECUTABLE _target_NAME ) # if (KDE3_ENABLE_FINAL) # KDE3_CREATE_FINAL_FILE(${_target_NAME}_final.cpp ${ARGN}) # add_library(kdeinit_${_target_NAME} SHARED ${_target_NAME}_final.cpp) -# else (KDE3_ENABLE_FINAL) +# else () add_library(kdeinit_${_target_NAME} SHARED ${ARGN} ) -# endif (KDE3_ENABLE_FINAL) +# endif () configure_file(${KDE3_MODULE_DIR}/kde3init_dummy.cpp.in ${CMAKE_CURRENT_BINARY_DIR}/${_target_NAME}_dummy.cpp) add_executable( ${_target_NAME} ${CMAKE_CURRENT_BINARY_DIR}/${_target_NAME}_dummy.cpp ) target_link_libraries( ${_target_NAME} kdeinit_${_target_NAME} ) -endmacro(KDE3_ADD_KDEINIT_EXECUTABLE) +endmacro() macro(KDE3_ADD_EXECUTABLE _target_NAME ) @@ -402,10 +402,10 @@ macro(KDE3_ADD_EXECUTABLE _target_NAME ) # if (KDE3_ENABLE_FINAL) # KDE3_CREATE_FINAL_FILE(${_target_NAME}_final.cpp ${ARGN}) # add_executable(${_target_NAME} ${_target_NAME}_final.cpp) -# else (KDE3_ENABLE_FINAL) +# else () add_executable(${_target_NAME} ${ARGN} ) -# endif (KDE3_ENABLE_FINAL) +# endif () -endmacro(KDE3_ADD_EXECUTABLE) +endmacro() diff --git a/Modules/MacroAddFileDependencies.cmake b/Modules/MacroAddFileDependencies.cmake index 5ed5b8d..d0605a1 100644 --- a/Modules/MacroAddFileDependencies.cmake +++ b/Modules/MacroAddFileDependencies.cmake @@ -24,10 +24,10 @@ macro (MACRO_ADD_FILE_DEPENDENCIES _file) get_source_file_property(_deps ${_file} OBJECT_DEPENDS) if (_deps) set(_deps ${_deps} ${ARGN}) - else (_deps) + else () set(_deps ${ARGN}) - endif (_deps) + endif () set_source_files_properties(${_file} PROPERTIES OBJECT_DEPENDS "${_deps}") -endmacro (MACRO_ADD_FILE_DEPENDENCIES) +endmacro () diff --git a/Modules/Platform/AIX.cmake b/Modules/Platform/AIX.cmake index 78221b0..58c6483 100644 --- a/Modules/Platform/AIX.cmake +++ b/Modules/Platform/AIX.cmake @@ -24,6 +24,6 @@ set_property(GLOBAL PROPERTY TARGET_ARCHIVES_MAY_BE_SHARED_LIBS 1) #foreach(type SHARED_LIBRARY SHARED_MODULE EXE) # set(CMAKE_${type}_LINK_STATIC_C_FLAGS "-bstatic") # set(CMAKE_${type}_LINK_DYNAMIC_C_FLAGS "-bdynamic") -#endforeach(type) +#endforeach() include(Platform/UnixPaths) diff --git a/Modules/Platform/BlueGeneL.cmake b/Modules/Platform/BlueGeneL.cmake index b2158f5..082e46c 100644 --- a/Modules/Platform/BlueGeneL.cmake +++ b/Modules/Platform/BlueGeneL.cmake @@ -24,17 +24,17 @@ include(Platform/UnixPaths) if(CMAKE_COMPILER_IS_GNUCC) set(CMAKE_C_LINK_EXECUTABLE "<CMAKE_C_COMPILER> -Wl,-relax <FLAGS> <CMAKE_C_LINK_FLAGS> <LINK_FLAGS> <OBJECTS> -o <TARGET> <LINK_LIBRARIES> -Wl,-lgcc,-lc -lnss_files -lnss_dns -lresolv") -else(CMAKE_COMPILER_IS_GNUCC) +else() # when using IBM xlc we probably don't want to link to -lgcc set(CMAKE_C_LINK_EXECUTABLE "<CMAKE_C_COMPILER> -Wl,-relax <FLAGS> <CMAKE_C_LINK_FLAGS> <LINK_FLAGS> <OBJECTS> -o <TARGET> <LINK_LIBRARIES> -Wl,-lc -lnss_files -lnss_dns -lresolv") -endif(CMAKE_COMPILER_IS_GNUCC) +endif() if(CMAKE_COMPILER_IS_GNUCXX) set(CMAKE_CXX_LINK_EXECUTABLE "<CMAKE_CXX_COMPILER> -Wl,-relax <FLAGS> <CMAKE_CXX_LINK_FLAGS> <LINK_FLAGS> <OBJECTS> -o <TARGET> <LINK_LIBRARIES> -Wl,-lstdc++,-lgcc,-lc -lnss_files -lnss_dns -lresolv") -else(CMAKE_COMPILER_IS_GNUCXX) +else() # when using the IBM xlC we probably don't want to link to -lgcc set(CMAKE_CXX_LINK_EXECUTABLE "<CMAKE_CXX_COMPILER> -Wl,-relax <FLAGS> <CMAKE_CXX_LINK_FLAGS> <LINK_FLAGS> <OBJECTS> -o <TARGET> <LINK_LIBRARIES> -Wl,-lstdc++,-lc -lnss_files -lnss_dns -lresolv") -endif(CMAKE_COMPILER_IS_GNUCXX) +endif() diff --git a/Modules/Platform/CYGWIN-GNU.cmake b/Modules/Platform/CYGWIN-GNU.cmake index 2ec2219..fe25ab2 100644 --- a/Modules/Platform/CYGWIN-GNU.cmake +++ b/Modules/Platform/CYGWIN-GNU.cmake @@ -47,7 +47,7 @@ macro(__cygwin_compiler_gnu lang) foreach(type SHARED_LIBRARY SHARED_MODULE EXE) set(CMAKE_${type}_LINK_STATIC_${lang}_FLAGS "-Wl,-Bstatic") set(CMAKE_${type}_LINK_DYNAMIC_${lang}_FLAGS "-Wl,-Bdynamic") - endforeach(type) + endforeach() set(CMAKE_EXE_EXPORTS_${lang}_FLAG "-Wl,--export-all-symbols") # TODO: Is -Wl,--enable-auto-import now always default? diff --git a/Modules/Platform/Darwin-icc.cmake b/Modules/Platform/Darwin-icc.cmake index b8e1bdf..6a46f8e 100644 --- a/Modules/Platform/Darwin-icc.cmake +++ b/Modules/Platform/Darwin-icc.cmake @@ -13,7 +13,7 @@ if ( _OSX_VERSION MATCHES "^10.4" ) set (CMAKE_C_FLAGS_RELWITHDEBINFO_INIT "-O2 -gdwarf-2") set (CMAKE_C_CREATE_PREPROCESSED_SOURCE "<CMAKE_C_COMPILER> <FLAGS> -E <SOURCE> > <PREPROCESSED_SOURCE>") set (CMAKE_C_CREATE_ASSEMBLY_SOURCE "<CMAKE_C_COMPILER> <FLAGS> -S <SOURCE> -o <ASSEMBLY_SOURCE>") - # endif(CMAKE_COMPILER_IS_GNUCC) + # endif() # if(CMAKE_COMPILER_IS_GNUCXX) set (CMAKE_CXX_FLAGS_INIT "") @@ -23,8 +23,8 @@ if ( _OSX_VERSION MATCHES "^10.4" ) set (CMAKE_CXX_FLAGS_RELWITHDEBINFO_INIT "-O2 -gdwarf-2") set (CMAKE_CXX_CREATE_PREPROCESSED_SOURCE "<CMAKE_CXX_COMPILER> <FLAGS> -E <SOURCE> > <PREPROCESSED_SOURCE>") set (CMAKE_CXX_CREATE_ASSEMBLY_SOURCE "<CMAKE_CXX_COMPILER> <FLAGS> -S <SOURCE> -o <ASSEMBLY_SOURCE>") -# endif(CMAKE_COMPILER_IS_GNUCXX) -endif ( _OSX_VERSION MATCHES "^10.4" ) +# endif() +endif () set(CMAKE_SHARED_LIBRARY_PREFIX "lib") @@ -54,17 +54,17 @@ if(EXISTS /Developer/SDKs/MacOSX10.4u.sdk) # if it is set. if(NOT "$ENV{CMAKE_OSX_ARCHITECTURES}" STREQUAL "") set(_CMAKE_OSX_MACHINE "$ENV{CMAKE_OSX_ARCHITECTURES}") - endif(NOT "$ENV{CMAKE_OSX_ARCHITECTURES}" STREQUAL "") + endif() # now put _CMAKE_OSX_MACHINE into the cache set(CMAKE_OSX_ARCHITECTURES ${_CMAKE_OSX_MACHINE} CACHE STRING "Build architectures for OSX") -endif(EXISTS /Developer/SDKs/MacOSX10.4u.sdk) +endif() if("${CMAKE_BACKWARDS_COMPATIBILITY}" MATCHES "^1\\.[0-6]$") set(CMAKE_SHARED_MODULE_CREATE_C_FLAGS "${CMAKE_SHARED_MODULE_CREATE_C_FLAGS} -flat_namespace -undefined suppress") -endif("${CMAKE_BACKWARDS_COMPATIBILITY}" MATCHES "^1\\.[0-6]$") +endif() if(NOT XCODE) # Enable shared library versioning. This flag is not actually referenced @@ -73,13 +73,13 @@ if(NOT XCODE) set(CMAKE_SHARED_LIBRARY_SONAME_C_FLAG "-install_name") set(CMAKE_SHARED_LIBRARY_SONAME_CXX_FLAG "-install_name") set(CMAKE_SHARED_LIBRARY_SONAME_Fortran_FLAG "-install_name") -endif(NOT XCODE) +endif() # Xcode does not support -isystem yet. if(XCODE) set(CMAKE_INCLUDE_SYSTEM_FLAG_C) set(CMAKE_INCLUDE_SYSTEM_FLAG_CXX) -endif(XCODE) +endif() set(CMAKE_MacOSX_Content_COMPILE_OBJECT "\"${CMAKE_COMMAND}\" -E copy_if_different <SOURCE> <OBJECT>") diff --git a/Modules/Platform/Darwin.cmake b/Modules/Platform/Darwin.cmake index 8e665d1..2a5f3cf 100644 --- a/Modules/Platform/Darwin.cmake +++ b/Modules/Platform/Darwin.cmake @@ -17,8 +17,8 @@ if(NOT DEFINED HAVE_FLAG_SEARCH_PATHS_FIRST) set(HAVE_FLAG_SEARCH_PATHS_FIRST 0) if("${DARWIN_MAJOR_VERSION}" GREATER 6) set(HAVE_FLAG_SEARCH_PATHS_FIRST 1) - endif("${DARWIN_MAJOR_VERSION}" GREATER 6) -endif(NOT DEFINED HAVE_FLAG_SEARCH_PATHS_FIRST) + endif() +endif() # More desirable, but does not work: #include(CheckCXXCompilerFlag) #CHECK_CXX_COMPILER_FLAG("-Wl,-search_paths_first" HAVE_FLAG_SEARCH_PATHS_FIRST) @@ -41,7 +41,7 @@ set(CMAKE_CXX_LINK_FLAGS "-Wl,-headerpad_max_install_names") if(HAVE_FLAG_SEARCH_PATHS_FIRST) set(CMAKE_C_LINK_FLAGS "-Wl,-search_paths_first ${CMAKE_C_LINK_FLAGS}") set(CMAKE_CXX_LINK_FLAGS "-Wl,-search_paths_first ${CMAKE_CXX_LINK_FLAGS}") -endif(HAVE_FLAG_SEARCH_PATHS_FIRST) +endif() set(CMAKE_PLATFORM_HAS_INSTALLNAME 1) set(CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS "-dynamiclib -Wl,-headerpad_max_install_names") @@ -57,7 +57,7 @@ set(CMAKE_FIND_LIBRARY_SUFFIXES ".dylib" ".so" ".a") if(NOT DEFINED CMAKE_INSTALL_NAME_TOOL) find_program(CMAKE_INSTALL_NAME_TOOL install_name_tool) mark_as_advanced(CMAKE_INSTALL_NAME_TOOL) -endif(NOT DEFINED CMAKE_INSTALL_NAME_TOOL) +endif() # Set the assumed (Pre 10.5 or Default) location of the developer tools set(OSX_DEVELOPER_ROOT "/Developer") @@ -69,7 +69,7 @@ if(CMAKE_XCODE_SELECT) execute_process(COMMAND ${CMAKE_XCODE_SELECT} "-print-path" OUTPUT_VARIABLE OSX_DEVELOPER_ROOT OUTPUT_STRIP_TRAILING_WHITESPACE) -endif(CMAKE_XCODE_SELECT) +endif() # Find installed SDKs # Start with Xcode-4.3+ default SDKs directory @@ -81,7 +81,7 @@ file(GLOB _CMAKE_OSX_SDKS "${_CMAKE_OSX_SDKS_DIR}/*") if(NOT _CMAKE_OSX_SDKS) set(_CMAKE_OSX_SDKS_DIR "${OSX_DEVELOPER_ROOT}/SDKs") file(GLOB _CMAKE_OSX_SDKS "${_CMAKE_OSX_SDKS_DIR}/*") -endif(NOT _CMAKE_OSX_SDKS) +endif() execute_process(COMMAND sw_vers -productVersion OUTPUT_VARIABLE CURRENT_OSX_VERSION @@ -100,7 +100,7 @@ string(REGEX REPLACE "^([0-9]+\\.[0-9]+).*$" "\\1" if(_CURRENT_OSX_VERSION VERSION_GREATER 10.3) set(CMAKE_OSX_DEPLOYMENT_TARGET "$ENV{MACOSX_DEPLOYMENT_TARGET}" CACHE STRING "Minimum OS X version to target for deployment (at runtime); newer APIs weak linked. Set to empty string for default value.") -endif(_CURRENT_OSX_VERSION VERSION_GREATER 10.3) +endif() #---------------------------------------------------------------------------- # CMAKE_OSX_SYSROOT @@ -117,19 +117,19 @@ set(CMAKE_OSX_SYSROOT_DEFAULT if(_CURRENT_OSX_VERSION STREQUAL "10.4") set(CMAKE_OSX_SYSROOT_DEFAULT "${_CMAKE_OSX_SDKS_DIR}/MacOSX10.4u.sdk") -endif(_CURRENT_OSX_VERSION STREQUAL "10.4") +endif() if(_CURRENT_OSX_VERSION STREQUAL "10.3") set(CMAKE_OSX_SYSROOT_DEFAULT "${_CMAKE_OSX_SDKS_DIR}/MacOSX10.3.9.sdk") -endif(_CURRENT_OSX_VERSION STREQUAL "10.3") +endif() # Use environment or default as initial cache value: if(NOT ENV_SDKROOT STREQUAL "") set(CMAKE_OSX_SYSROOT_VALUE ${ENV_SDKROOT}) -else(NOT ENV_SDKROOT STREQUAL "") +else() set(CMAKE_OSX_SYSROOT_VALUE ${CMAKE_OSX_SYSROOT_DEFAULT}) -endif(NOT ENV_SDKROOT STREQUAL "") +endif() # Set cache variable - end user may change this during ccmake or cmake-gui configure. set(CMAKE_OSX_SYSROOT ${CMAKE_OSX_SYSROOT_VALUE} CACHE PATH @@ -149,7 +149,7 @@ function(SanityCheckSDKAndDeployTarget _sdk_path _deploy) if(_deploy GREATER "${SDK}") message(FATAL_ERROR "CMAKE_OSX_DEPLOYMENT_TARGET (${_deploy}) is greater than CMAKE_OSX_SYSROOT SDK (${_sdk_path}). Please set CMAKE_OSX_DEPLOYMENT_TARGET to ${SDK} or lower") endif() -endfunction(SanityCheckSDKAndDeployTarget) +endfunction() #---------------------------------------------------------------------------- # Make sure the combination of SDK and Deployment Target are allowed @@ -163,15 +163,15 @@ execute_process(COMMAND uname -m # check for Power PC and change to ppc if(_CMAKE_OSX_MACHINE MATCHES "Power") set(_CMAKE_OSX_MACHINE ppc) -endif(_CMAKE_OSX_MACHINE MATCHES "Power") +endif() # check for environment variable CMAKE_OSX_ARCHITECTURES # if it is set. if(NOT "$ENV{CMAKE_OSX_ARCHITECTURES}" STREQUAL "") set(CMAKE_OSX_ARCHITECTURES_VALUE "$ENV{CMAKE_OSX_ARCHITECTURES}") -else(NOT "$ENV{CMAKE_OSX_ARCHITECTURES}" STREQUAL "") +else() set(CMAKE_OSX_ARCHITECTURES_VALUE "") -endif(NOT "$ENV{CMAKE_OSX_ARCHITECTURES}" STREQUAL "") +endif() # now put _CMAKE_OSX_MACHINE into the cache set(CMAKE_OSX_ARCHITECTURES ${CMAKE_OSX_ARCHITECTURES_VALUE} CACHE STRING @@ -181,20 +181,20 @@ set(CMAKE_OSX_ARCHITECTURES ${CMAKE_OSX_ARCHITECTURES_VALUE} CACHE STRING if("${CMAKE_BACKWARDS_COMPATIBILITY}" MATCHES "^1\\.[0-6]$") set(CMAKE_SHARED_MODULE_CREATE_C_FLAGS "${CMAKE_SHARED_MODULE_CREATE_C_FLAGS} -flat_namespace -undefined suppress") -endif("${CMAKE_BACKWARDS_COMPATIBILITY}" MATCHES "^1\\.[0-6]$") +endif() if(NOT XCODE) # Enable shared library versioning. This flag is not actually referenced # but the fact that the setting exists will cause the generators to support # soname computation. set(CMAKE_SHARED_LIBRARY_SONAME_C_FLAG "-install_name") -endif(NOT XCODE) +endif() # Xcode does not support -isystem yet. if(XCODE) set(CMAKE_INCLUDE_SYSTEM_FLAG_C) set(CMAKE_INCLUDE_SYSTEM_FLAG_CXX) -endif(XCODE) +endif() if("${_CURRENT_OSX_VERSION}" VERSION_LESS "10.5") # Need to list dependent shared libraries on link line. When building diff --git a/Modules/Platform/FreeBSD.cmake b/Modules/Platform/FreeBSD.cmake index b577902..cf18501 100644 --- a/Modules/Platform/FreeBSD.cmake +++ b/Modules/Platform/FreeBSD.cmake @@ -10,7 +10,7 @@ if(EXISTS /usr/include/dlfcn.h) set(CMAKE_SHARED_LIBRARY_RPATH_LINK_C_FLAG "-Wl,-rpath-link,") set(CMAKE_SHARED_LIBRARY_SONAME_C_FLAG "-Wl,-soname,") set(CMAKE_EXE_EXPORTS_C_FLAG "-Wl,--export-dynamic") -endif(EXISTS /usr/include/dlfcn.h) +endif() # Shared libraries with no builtin soname may not be linked safely by # specifying the file path. @@ -23,6 +23,6 @@ set(CMAKE_PLATFORM_USES_PATH_WHEN_NO_SONAME 1) foreach(type SHARED_LIBRARY SHARED_MODULE EXE) set(CMAKE_${type}_LINK_STATIC_C_FLAGS "-Wl,-Bstatic") set(CMAKE_${type}_LINK_DYNAMIC_C_FLAGS "-Wl,-Bdynamic") -endforeach(type) +endforeach() include(Platform/UnixPaths) diff --git a/Modules/Platform/Generic-ADSP-Common.cmake b/Modules/Platform/Generic-ADSP-Common.cmake index 9120eed..026f83c 100644 --- a/Modules/Platform/Generic-ADSP-Common.cmake +++ b/Modules/Platform/Generic-ADSP-Common.cmake @@ -18,66 +18,66 @@ if(NOT ADSP) # assume that this is the processor name to use for the compiler if(CMAKE_SYSTEM_PROCESSOR AND NOT ADSP_PROCESSOR) set(ADSP_PROCESSOR ${CMAKE_SYSTEM_PROCESSOR}) - endif(CMAKE_SYSTEM_PROCESSOR AND NOT ADSP_PROCESSOR) + endif() # if ADSP_PROCESSOR_SILICIUM_REVISION has not been set, use "none" if(NOT ADSP_PROCESSOR_SILICIUM_REVISION) set(ADSP_PROCESSOR_SILICIUM_REVISION "none") - endif(NOT ADSP_PROCESSOR_SILICIUM_REVISION) + endif() # this file is included from the C and CXX files, so handle both here get_filename_component(_ADSP_DIR "${CMAKE_C_COMPILER}" PATH) if(NOT _ADSP_DIR) get_filename_component(_ADSP_DIR "${CMAKE_CXX_COMPILER}" PATH) - endif(NOT _ADSP_DIR) + endif() if(NOT _ADSP_DIR) get_filename_component(_ADSP_DIR "${CMAKE_ASM_COMPILER}" PATH) - endif(NOT _ADSP_DIR) + endif() # detect architecture if(CMAKE_C_COMPILER MATCHES ccblkfn OR CMAKE_CXX_COMPILER MATCHES ccblkfn OR CMAKE_ASM_COMPILER MATCHES easmBLKFN) if(NOT ADSP_PROCESSOR) set(ADSP_PROCESSOR "ADSP-BF561") - endif(NOT ADSP_PROCESSOR) + endif() set(ADSP_BLACKFIN TRUE) set(_ADSP_FAMILY_DIR "${_ADSP_DIR}/Blackfin") - endif(CMAKE_C_COMPILER MATCHES ccblkfn OR CMAKE_CXX_COMPILER MATCHES ccblkfn OR CMAKE_ASM_COMPILER MATCHES easmBLKFN) + endif() if(CMAKE_C_COMPILER MATCHES ccts OR CMAKE_CXX_COMPILER MATCHES ccts OR CMAKE_ASM_COMPILER MATCHES easmTS) if(NOT ADSP_PROCESSOR) set(ADSP_PROCESSOR "ADSP-TS101") - endif(NOT ADSP_PROCESSOR) + endif() set(ADSP_TS TRUE) set(_ADSP_FAMILY_DIR "${_ADSP_DIR}/TS") - endif(CMAKE_C_COMPILER MATCHES ccts OR CMAKE_CXX_COMPILER MATCHES ccts OR CMAKE_ASM_COMPILER MATCHES easmTS) + endif() if(CMAKE_C_COMPILER MATCHES cc21k OR CMAKE_CXX_COMPILER MATCHES cc21k OR CMAKE_ASM_COMPILER MATCHES easm21k) if(NOT ADSP_PROCESSOR) set(ADSP_PROCESSOR "ADSP-21060") - endif(NOT ADSP_PROCESSOR) + endif() set(ADSP_21K TRUE) set(_ADSP_FAMILY_DIR "${_ADSP_DIR}/21k") # default if nothing matches if (ADSP_PROCESSOR MATCHES "210..$") set(_ADSP_FAMILY_DIR "${_ADSP_DIR}/21k") - endif(ADSP_PROCESSOR MATCHES "210..$") + endif() if (ADSP_PROCESSOR MATCHES "211..$") set(_ADSP_FAMILY_DIR "${_ADSP_DIR}/211k") - endif(ADSP_PROCESSOR MATCHES "211..$") + endif() if (ADSP_PROCESSOR MATCHES "212..$") set(_ADSP_FAMILY_DIR "${_ADSP_DIR}/212k") - endif(ADSP_PROCESSOR MATCHES "212..$") + endif() if (ADSP_PROCESSOR MATCHES "213..$") set(_ADSP_FAMILY_DIR "${_ADSP_DIR}/213k") - endif(ADSP_PROCESSOR MATCHES "213..$") + endif() set(_ADSP_FAMILY_DIR "${_ADSP_DIR}/21k") - endif(CMAKE_C_COMPILER MATCHES cc21k OR CMAKE_CXX_COMPILER MATCHES cc21k OR CMAKE_ASM_COMPILER MATCHES easm21k) + endif() link_directories("${_ADSP_FAMILY_DIR}/lib") @@ -91,7 +91,7 @@ if(NOT ADSP) COMMAND ${ADSP_VDKGEN_EXECUTABLE} ${VDK_KERNEL_SUPPORT_FILE} -proc ${ADSP_PROCESSOR} -si-revision ${ADSP_PROCESSOR_SILICIUM_REVISION} -MM DEPENDS ${VDK_KERNEL_SUPPORT_FILE} ) - endmacro(ADSP_GENERATE_VDK VDK_GENERATED_HEADER VDK_GENERATED_SOURCE VDK_KERNEL_SUPPORT_FILE) + endmacro() # loader support find_program( ADSP_ELFLOADER_EXECUTABLE elfloader "${_ADSP_FAMILY_DIR}" ) @@ -106,7 +106,7 @@ if(NOT ADSP) COMMAND ${ADSP_ELFLOADER_EXECUTABLE} ${EXECUTABLE_OUTPUT_PATH}/${TARGET_NAME}.dxe -proc ${ADSP_PROCESSOR} -si-revision ${ADSP_PROCESSOR_SILICIUM_REVISION} -b ${BOOT_MODE} -f ${FORMAT} -width ${WIDTH} -o ${EXECUTABLE_OUTPUT_PATH}/${TARGET_NAME}.ldr COMMENT "Building the loader file" ) - endmacro(ADSP_CREATE_LOADER_FILE TARGET_NAME BOOT_MODE FORMAT WIDTH) + endmacro() macro(ADSP_CREATE_LOADER_FILE_INIT TARGET_NAME BOOT_MODE FORMAT WIDTH INITIALIZATION_FILE) add_custom_command( @@ -115,6 +115,6 @@ if(NOT ADSP) COMMAND ${ADSP_ELFLOADER_EXECUTABLE} ${EXECUTABLE_OUTPUT_PATH}/${TARGET_NAME}.dxe -proc ${ADSP_PROCESSOR} -si-revision ${ADSP_PROCESSOR_SILICIUM_REVISION} -b ${BOOT_MODE} -f ${FORMAT} -width ${WIDTH} -o ${EXECUTABLE_OUTPUT_PATH}/${TARGET_NAME}.ldr -init ${INITIALIZATION_FILE} COMMENT "Building the loader file" ) - endmacro(ADSP_CREATE_LOADER_FILE_INIT TARGET_NAME BOOT_MODE FORMAT WIDTH INITIALIZATION_FILE) + endmacro() -endif(NOT ADSP) +endif() diff --git a/Modules/Platform/Generic-SDCC-C.cmake b/Modules/Platform/Generic-SDCC-C.cmake index fc7eb42..588bf32 100644 --- a/Modules/Platform/Generic-SDCC-C.cmake +++ b/Modules/Platform/Generic-SDCC-C.cmake @@ -31,11 +31,11 @@ set(CMAKE_AR "${SDCCLIB_EXECUTABLE}" CACHE FILEPATH "The sdcc librarian" FORCE) # CMAKE_C_FLAGS_INIT and CMAKE_EXE_LINKER_FLAGS_INIT should be set in a CMAKE_SYSTEM_PROCESSOR file if(NOT DEFINED CMAKE_C_FLAGS_INIT) set(CMAKE_C_FLAGS_INIT "-mmcs51 --model-small") -endif(NOT DEFINED CMAKE_C_FLAGS_INIT) +endif() if(NOT DEFINED CMAKE_EXE_LINKER_FLAGS_INIT) set (CMAKE_EXE_LINKER_FLAGS_INIT --model-small) -endif(NOT DEFINED CMAKE_EXE_LINKER_FLAGS_INIT) +endif() # compile a C file into an object file set(CMAKE_C_COMPILE_OBJECT "<CMAKE_C_COMPILER> <DEFINES> <FLAGS> -o <OBJECT> -c <SOURCE>") diff --git a/Modules/Platform/HP-UX.cmake b/Modules/Platform/HP-UX.cmake index 33257f9..65cc731 100644 --- a/Modules/Platform/HP-UX.cmake +++ b/Modules/Platform/HP-UX.cmake @@ -38,13 +38,13 @@ list(APPEND CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES foreach(type SHARED_LIBRARY SHARED_MODULE) set(CMAKE_${type}_LINK_STATIC_C_FLAGS "-a archive") set(CMAKE_${type}_LINK_DYNAMIC_C_FLAGS "-a default") -endforeach(type) +endforeach() foreach(type EXE) set(CMAKE_${type}_LINK_STATIC_C_FLAGS "-Wl,-a,archive") set(CMAKE_${type}_LINK_DYNAMIC_C_FLAGS "-Wl,-a,default") -endforeach(type) +endforeach() foreach(type SHARED_LIBRARY SHARED_MODULE EXE) set(CMAKE_${type}_LINK_STATIC_CXX_FLAGS "-Wl,-a,archive") set(CMAKE_${type}_LINK_DYNAMIC_CXX_FLAGS "-Wl,-a,default") -endforeach(type) +endforeach() diff --git a/Modules/Platform/Haiku.cmake b/Modules/Platform/Haiku.cmake index ec0b8fa..8987783 100644 --- a/Modules/Platform/Haiku.cmake +++ b/Modules/Platform/Haiku.cmake @@ -21,4 +21,4 @@ list(APPEND CMAKE_SYSTEM_LIBRARY_PATH /boot/develop/lib/x86) if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT) set(CMAKE_INSTALL_PREFIX "/boot/common" CACHE PATH "Install path prefix, prepended onto install directories." FORCE) -endif(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT) +endif() diff --git a/Modules/Platform/IRIX.cmake b/Modules/Platform/IRIX.cmake index 221a61d..03e98cc 100644 --- a/Modules/Platform/IRIX.cmake +++ b/Modules/Platform/IRIX.cmake @@ -11,7 +11,7 @@ if(NOT CMAKE_COMPILER_IS_GNUCXX) set (CMAKE_CXX_FLAGS_RELEASE_INIT "-O2 -DNDEBUG") set (CMAKE_CXX_FLAGS_RELWITHDEBINFO_INIT "-O2") set (CMAKE_C_FLAGS_INIT "") -endif(NOT CMAKE_COMPILER_IS_GNUCXX) +endif() # set flags for gcc support include(Platform/UnixPaths) @@ -21,7 +21,7 @@ if(NOT CMAKE_COMPILER_IS_GNUCC) "<CMAKE_C_COMPILER> <FLAGS> -S <SOURCE>" "mv `basename \"<SOURCE>\" | sed 's/\\.[^./]*$$//'`.s <ASSEMBLY_SOURCE>" ) -endif(NOT CMAKE_COMPILER_IS_GNUCC) +endif() if(NOT CMAKE_COMPILER_IS_GNUCXX) set (CMAKE_CXX_CREATE_PREPROCESSED_SOURCE "<CMAKE_CXX_COMPILER> <FLAGS> -E <SOURCE> > <PREPROCESSED_SOURCE>") @@ -29,7 +29,7 @@ if(NOT CMAKE_COMPILER_IS_GNUCXX) "<CMAKE_CXX_COMPILER> <FLAGS> -S <SOURCE>" "mv `basename \"<SOURCE>\" | sed 's/\\.[^./]*$$//'`.s <ASSEMBLY_SOURCE>" ) -endif(NOT CMAKE_COMPILER_IS_GNUCXX) +endif() # Initialize C link type selection flags. These flags are used when # building a shared library, shared module, or executable that links @@ -38,7 +38,7 @@ endif(NOT CMAKE_COMPILER_IS_GNUCXX) foreach(type SHARED_LIBRARY SHARED_MODULE EXE) set(CMAKE_${type}_LINK_STATIC_C_FLAGS "-Wl,-Bstatic") set(CMAKE_${type}_LINK_DYNAMIC_C_FLAGS "-Wl,-Bdynamic") -endforeach(type) +endforeach() # The IRIX linker needs to find transitive shared library dependencies # in the -L path. diff --git a/Modules/Platform/IRIX64.cmake b/Modules/Platform/IRIX64.cmake index 191dfcc..5acbd81 100644 --- a/Modules/Platform/IRIX64.cmake +++ b/Modules/Platform/IRIX64.cmake @@ -14,13 +14,13 @@ if(NOT CMAKE_COMPILER_IS_GNUCC) # If no -o32, -n32, or -64 flag is given, set a reasonable default. if("$ENV{CFLAGS} $ENV{CXXFLAGS} $ENV{LDFLAGS}" MATCHES "-([no]32|64)") - else("$ENV{CFLAGS} $ENV{CXXFLAGS} $ENV{LDFLAGS}" MATCHES "-([no]32|64)") + else() # Check if this is a 64-bit CMake. if(CMAKE_FILE_SELF MATCHES "^CMAKE_FILE_SELF$") exec_program(file ARGS ${CMAKE_COMMAND} OUTPUT_VARIABLE CMAKE_FILE_SELF) set(CMAKE_FILE_SELF "${CMAKE_FILE_SELF}" CACHE INTERNAL "Output of file command on ${CMAKE_COMMAND}.") - endif(CMAKE_FILE_SELF MATCHES "^CMAKE_FILE_SELF$") + endif() # Set initial flags to match cmake executable. if(CMAKE_FILE_SELF MATCHES " 64-bit ") @@ -30,8 +30,8 @@ if(NOT CMAKE_COMPILER_IS_GNUCC) set(CMAKE_EXE_LINKER_FLAGS_INIT "-64") set(CMAKE_SHARED_LINKER_FLAGS_INIT "-64") set(CMAKE_MODULE_LINKER_FLAGS_INIT "-64") - endif(CMAKE_FILE_SELF MATCHES " 64-bit ") - endif("$ENV{CFLAGS} $ENV{CXXFLAGS} $ENV{LDFLAGS}" MATCHES "-([no]32|64)") + endif() + endif() # Set remaining defaults. set(CMAKE_CXX_CREATE_STATIC_LIBRARY @@ -40,7 +40,7 @@ if(NOT CMAKE_COMPILER_IS_GNUCC) set (CMAKE_CXX_FLAGS_MINSIZEREL_INIT "-O3 -DNDEBUG") set (CMAKE_CXX_FLAGS_RELEASE_INIT "-O2 -DNDEBUG") set (CMAKE_CXX_FLAGS_RELWITHDEBINFO_INIT "-O2") -endif(NOT CMAKE_COMPILER_IS_GNUCC) +endif() include(Platform/UnixPaths) if(NOT CMAKE_COMPILER_IS_GNUCC) @@ -49,7 +49,7 @@ if(NOT CMAKE_COMPILER_IS_GNUCC) "<CMAKE_C_COMPILER> <DEFINES> <FLAGS> -S <SOURCE>" "mv `basename \"<SOURCE>\" | sed 's/\\.[^./]*$$//'`.s <ASSEMBLY_SOURCE>" ) -endif(NOT CMAKE_COMPILER_IS_GNUCC) +endif() if(NOT CMAKE_COMPILER_IS_GNUCXX) set (CMAKE_CXX_CREATE_PREPROCESSED_SOURCE "<CMAKE_CXX_COMPILER> <DEFINES> <FLAGS> -E <SOURCE> > <PREPROCESSED_SOURCE>") @@ -57,7 +57,7 @@ if(NOT CMAKE_COMPILER_IS_GNUCXX) "<CMAKE_CXX_COMPILER> <DEFINES> <FLAGS> -S <SOURCE>" "mv `basename \"<SOURCE>\" | sed 's/\\.[^./]*$$//'`.s <ASSEMBLY_SOURCE>" ) -endif(NOT CMAKE_COMPILER_IS_GNUCXX) +endif() # Initialize C link type selection flags. These flags are used when # building a shared library, shared module, or executable that links @@ -66,7 +66,7 @@ endif(NOT CMAKE_COMPILER_IS_GNUCXX) foreach(type SHARED_LIBRARY SHARED_MODULE EXE) set(CMAKE_${type}_LINK_STATIC_C_FLAGS "-Wl,-Bstatic") set(CMAKE_${type}_LINK_DYNAMIC_C_FLAGS "-Wl,-Bdynamic") -endforeach(type) +endforeach() # The IRIX linker needs to find transitive shared library dependencies # in the -L path. diff --git a/Modules/Platform/Linux-Intel.cmake b/Modules/Platform/Linux-Intel.cmake index 47bf246..2394f10 100644 --- a/Modules/Platform/Linux-Intel.cmake +++ b/Modules/Platform/Linux-Intel.cmake @@ -28,7 +28,7 @@ if(NOT XIAR) endforeach() find_program(XIAR NAMES xiar HINTS ${_intel_xiar_hints}) mark_as_advanced(XIAR) -endif(NOT XIAR) +endif() macro(__linux_compiler_intel lang) set(CMAKE_${lang}_COMPILE_OPTIONS_PIC "-fPIC") diff --git a/Modules/Platform/Linux.cmake b/Modules/Platform/Linux.cmake index c1dc642..fe8e003 100644 --- a/Modules/Platform/Linux.cmake +++ b/Modules/Platform/Linux.cmake @@ -16,7 +16,7 @@ set(CMAKE_PLATFORM_USES_PATH_WHEN_NO_SONAME 1) foreach(type SHARED_LIBRARY SHARED_MODULE EXE) set(CMAKE_${type}_LINK_STATIC_C_FLAGS "-Wl,-Bstatic") set(CMAKE_${type}_LINK_DYNAMIC_C_FLAGS "-Wl,-Bdynamic") -endforeach(type) +endforeach() # Debian policy requires that shared libraries be installed without # executable permission. Fedora policy requires that shared libraries @@ -31,7 +31,7 @@ if(DEFINED CMAKE_INSTALL_SO_NO_EXE) # setting the user provides on the command line. set(CMAKE_INSTALL_SO_NO_EXE "${CMAKE_INSTALL_SO_NO_EXE}" CACHE INTERNAL "Install .so files without execute permission.") -else(DEFINED CMAKE_INSTALL_SO_NO_EXE) +else() # Store the decision variable as an internal cache entry to avoid # checking the platform every time. This option is advanced enough # that only package maintainers should need to adjust it. They are @@ -39,11 +39,11 @@ else(DEFINED CMAKE_INSTALL_SO_NO_EXE) if(EXISTS "/etc/debian_version") set(CMAKE_INSTALL_SO_NO_EXE 1 CACHE INTERNAL "Install .so files without execute permission.") - else(EXISTS "/etc/debian_version") + else() set(CMAKE_INSTALL_SO_NO_EXE 0 CACHE INTERNAL "Install .so files without execute permission.") - endif(EXISTS "/etc/debian_version") -endif(DEFINED CMAKE_INSTALL_SO_NO_EXE) + endif() +endif() # Match multiarch library directory names. set(CMAKE_LIBRARY_ARCHITECTURE_REGEX "[a-z0-9_]+(-[a-z0-9_]+)?-linux-gnu[a-z0-9_]*") @@ -54,4 +54,4 @@ include(Platform/UnixPaths) # searched. if(EXISTS "/etc/debian_version") set_property(GLOBAL PROPERTY FIND_LIBRARY_USE_LIB64_PATHS FALSE) -endif(EXISTS "/etc/debian_version") +endif() diff --git a/Modules/Platform/MP-RAS.cmake b/Modules/Platform/MP-RAS.cmake index ae5fa61..fe8d81a 100644 --- a/Modules/Platform/MP-RAS.cmake +++ b/Modules/Platform/MP-RAS.cmake @@ -2,12 +2,12 @@ if(CMAKE_SYSTEM MATCHES "MP-RAS-02*.") set(CMAKE_C_COMPILE_OPTIONS_PIC -K PIC) set(CMAKE_C_COMPILE_OPTIONS_PIE -K PIE) set(CMAKE_SHARED_LIBRARY_C_FLAGS "-K PIC") -else(CMAKE_SYSTEM MATCHES "MP-RAS-02*.") +else() set(CMAKE_C_COMPILE_OPTIONS_PIC -K PIC) set(CMAKE_C_COMPILE_OPTIONS_PIE -K PIE) set(CMAKE_SHARED_LIBRARY_C_FLAGS "-K PIC") set(CMAKE_SHARED_LIBRARY_LINK_C_FLAGS "-Wl,-Bexport") -endif(CMAKE_SYSTEM MATCHES "MP-RAS-02*.") +endif() include(Platform/UnixPaths) diff --git a/Modules/Platform/NetBSD.cmake b/Modules/Platform/NetBSD.cmake index 24dd15c..7318275 100644 --- a/Modules/Platform/NetBSD.cmake +++ b/Modules/Platform/NetBSD.cmake @@ -10,6 +10,6 @@ if(EXISTS /usr/include/dlfcn.h) set(CMAKE_SHARED_LIBRARY_RPATH_LINK_C_FLAG "-Wl,-rpath-link,") set(CMAKE_SHARED_LIBRARY_SONAME_C_FLAG "-Wl,-soname,") set(CMAKE_EXE_EXPORTS_C_FLAG "-Wl,--export-dynamic") -endif(EXISTS /usr/include/dlfcn.h) +endif() include(Platform/UnixPaths) diff --git a/Modules/Platform/OSF1.cmake b/Modules/Platform/OSF1.cmake index e720e40..9c3255e 100644 --- a/Modules/Platform/OSF1.cmake +++ b/Modules/Platform/OSF1.cmake @@ -1,14 +1,14 @@ set(CMAKE_DL_LIBS "") if(CMAKE_SYSTEM MATCHES "OSF1-1.[012]") -endif(CMAKE_SYSTEM MATCHES "OSF1-1.[012]") +endif() if(CMAKE_SYSTEM MATCHES "OSF1-1.*") # OSF/1 1.3 from OSF using ELF, and derivatives, including AD2 set(CMAKE_C_COMPILE_OPTIONS_PIC "-fpic") set(CMAKE_C_COMPILE_OPTIONS_PIE "-fpie") set(CMAKE_SHARED_LIBRARY_C_FLAGS "-fpic") # -pic set(CMAKE_SHARED_LIBRARY_CXX_FLAGS "-fpic") # -pic -endif(CMAKE_SYSTEM MATCHES "OSF1-1.*") +endif() @@ -16,22 +16,22 @@ if(CMAKE_SYSTEM MATCHES "OSF1-V.*") set(CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS "-shared -Wl,-expect_unresolved,\\*") # -shared if(CMAKE_COMPILER_IS_GNUCXX) set(CMAKE_SHARED_LIBRARY_RUNTIME_CXX_FLAG "-Wl,-rpath,") - else(CMAKE_COMPILER_IS_GNUCXX) + else() set(CMAKE_SHARED_LIBRARY_RUNTIME_CXX_FLAG "-rpath ") - endif(CMAKE_COMPILER_IS_GNUCXX) + endif() if(CMAKE_COMPILER_IS_GNUCC) set(CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG "-Wl,-rpath,") - else(CMAKE_COMPILER_IS_GNUCC) + else() set(CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG "-rpath ") - endif(CMAKE_COMPILER_IS_GNUCC) + endif() set(CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG_SEP ":") -endif(CMAKE_SYSTEM MATCHES "OSF1-V.*") +endif() set(CMAKE_MAKE_INCLUDE_FROM_ROOT 1) # include $(CMAKE_BINARY_DIR)/... if(CMAKE_COMPILER_IS_GNUCXX) # include the gcc flags -else (CMAKE_COMPILER_IS_GNUCXX) +else () # use default OSF compiler flags set (CMAKE_C_FLAGS_INIT "") set (CMAKE_C_FLAGS_DEBUG_INIT "-g") @@ -43,5 +43,5 @@ else (CMAKE_COMPILER_IS_GNUCXX) set (CMAKE_CXX_FLAGS_MINSIZEREL_INIT "-O2 -DNDEBUG") set (CMAKE_CXX_FLAGS_RELEASE_INIT "-O2 -DNDEBUG") set (CMAKE_CXX_FLAGS_RELWITHDEBINFO_INIT "-O2") -endif(CMAKE_COMPILER_IS_GNUCXX) +endif() include(Platform/UnixPaths) diff --git a/Modules/Platform/QNX.cmake b/Modules/Platform/QNX.cmake index fedc0b4..2598411 100644 --- a/Modules/Platform/QNX.cmake +++ b/Modules/Platform/QNX.cmake @@ -25,7 +25,7 @@ set(CMAKE_PLATFORM_USES_PATH_WHEN_NO_SONAME 1) foreach(type SHARED_LIBRARY SHARED_MODULE EXE) set(CMAKE_${type}_LINK_STATIC_C_FLAGS "-Wl,-Bstatic") set(CMAKE_${type}_LINK_DYNAMIC_C_FLAGS "-Wl,-Bdynamic") -endforeach(type) +endforeach() # force the language to be c++ since qnx only has gcc and not g++ and c++? set(CMAKE_CXX_COMPILE_OBJECT "<CMAKE_CXX_COMPILER> -x c++ <DEFINES> <FLAGS> -o <OBJECT> -c <SOURCE>") diff --git a/Modules/Platform/SunOS.cmake b/Modules/Platform/SunOS.cmake index a1fc72f..da20f97 100644 --- a/Modules/Platform/SunOS.cmake +++ b/Modules/Platform/SunOS.cmake @@ -5,23 +5,23 @@ if(CMAKE_SYSTEM MATCHES "SunOS-4.*") set(CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS "-shared -Wl,-r") set(CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG "-Wl,-R") set(CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG_SEP ":") -endif(CMAKE_SYSTEM MATCHES "SunOS-4.*") +endif() if(CMAKE_COMPILER_IS_GNUCXX) if(CMAKE_COMPILER_IS_GNUCC) set(CMAKE_CXX_CREATE_SHARED_LIBRARY "<CMAKE_C_COMPILER> <CMAKE_SHARED_LIBRARY_CXX_FLAGS> <LINK_FLAGS> <CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS> <SONAME_FLAG><TARGET_SONAME> -o <TARGET> <OBJECTS> <LINK_LIBRARIES>") - else(CMAKE_COMPILER_IS_GNUCC) + else() # Take default rule from CMakeDefaultMakeRuleVariables.cmake. - endif(CMAKE_COMPILER_IS_GNUCC) -endif(CMAKE_COMPILER_IS_GNUCXX) + endif() +endif() include(Platform/UnixPaths) # Add the compiler's implicit link directories. if("${CMAKE_C_COMPILER_ID} ${CMAKE_CXX_COMPILER_ID}" MATCHES SunPro) list(APPEND CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES /opt/SUNWspro/lib /opt/SUNWspro/prod/lib /usr/ccs/lib) -endif("${CMAKE_C_COMPILER_ID} ${CMAKE_CXX_COMPILER_ID}" MATCHES SunPro) +endif() # The Sun linker needs to find transitive shared library dependencies # in the -L path. diff --git a/Modules/Platform/Windows-GNU.cmake b/Modules/Platform/Windows-GNU.cmake index 4a37eca..50ba80b 100644 --- a/Modules/Platform/Windows-GNU.cmake +++ b/Modules/Platform/Windows-GNU.cmake @@ -74,7 +74,7 @@ macro(__windows_compiler_gnu lang) foreach(type SHARED_LIBRARY SHARED_MODULE EXE) set(CMAKE_${type}_LINK_STATIC_${lang}_FLAGS "-Wl,-Bstatic") set(CMAKE_${type}_LINK_DYNAMIC_${lang}_FLAGS "-Wl,-Bdynamic") - endforeach(type) + endforeach() endif() # No -fPIC on Windows diff --git a/Modules/Platform/Windows-Intel.cmake b/Modules/Platform/Windows-Intel.cmake index ec78886..3370557 100644 --- a/Modules/Platform/Windows-Intel.cmake +++ b/Modules/Platform/Windows-Intel.cmake @@ -27,9 +27,9 @@ set(CMAKE_LINK_LIBRARY_FLAG "") set(WIN32 1) if(CMAKE_VERBOSE_MAKEFILE) set(CMAKE_CL_NOLOGO) -else(CMAKE_VERBOSE_MAKEFILE) +else() set(CMAKE_CL_NOLOGO "/nologo") -endif(CMAKE_VERBOSE_MAKEFILE) +endif() set(CMAKE_COMPILE_RESOURCE "rc <FLAGS> /fo<OBJECT> <SOURCE>") set(CMAKE_CREATE_WIN32_EXE /subsystem:windows) set(CMAKE_CREATE_CONSOLE_EXE /subsystem:console) @@ -69,15 +69,15 @@ if(NOT _INTEL_XILINK_TEST_RUN) OUTPUT_VARIABLE _XILINK_HELP) if(_XILINK_HELP MATCHES MANIFEST) set(_INTEL_COMPILER_SUPPORTS_MANIFEST 1) - endif(_XILINK_HELP MATCHES MANIFEST) + endif() if(NOT EXISTS "${CMAKE_PLATFORM_ROOT_BIN}/CMakeIntelInformation.cmake") file(WRITE ${CMAKE_PLATFORM_ROOT_BIN}/CMakeIntelInformation.cmake " set(_INTEL_XILINK_TEST_RUN 1) set(_INTEL_COMPILER_SUPPORTS_MANIFEST ${_INTEL_COMPILER_SUPPORTS_MANIFEST}) ") - endif(NOT EXISTS "${CMAKE_PLATFORM_ROOT_BIN}/CMakeIntelInformation.cmake") -endif(NOT _INTEL_XILINK_TEST_RUN) + endif() +endif() macro(__windows_compiler_intel lang) set(CMAKE_${lang}_COMPILE_OBJECT diff --git a/Modules/Platform/Windows-cl.cmake b/Modules/Platform/Windows-cl.cmake index 216419f..05df946 100644 --- a/Modules/Platform/Windows-cl.cmake +++ b/Modules/Platform/Windows-cl.cmake @@ -12,17 +12,17 @@ set(CMAKE_CREATE_CONSOLE_EXE /subsystem:console) if(CMAKE_GENERATOR MATCHES "Visual Studio 6") set (CMAKE_NO_BUILD_TYPE 1) -endif(CMAKE_GENERATOR MATCHES "Visual Studio 6") +endif() if(NOT CMAKE_NO_BUILD_TYPE AND CMAKE_GENERATOR MATCHES "Visual Studio") set (CMAKE_NO_BUILD_TYPE 1) set (CMAKE_CONFIGURATION_TYPES "Debug;Release;MinSizeRel;RelWithDebInfo" CACHE STRING "Semicolon separated list of supported configuration types, only supports Debug, Release, MinSizeRel, and RelWithDebInfo, anything else will be ignored.") mark_as_advanced(CMAKE_CONFIGURATION_TYPES) -endif(NOT CMAKE_NO_BUILD_TYPE AND CMAKE_GENERATOR MATCHES "Visual Studio") +endif() # does the compiler support pdbtype and is it the newer compiler if(CMAKE_GENERATOR MATCHES "Visual Studio 8") set(CMAKE_COMPILER_2005 1) -endif(CMAKE_GENERATOR MATCHES "Visual Studio 8") +endif() # make sure to enable languages after setting configuration types enable_language(RC) @@ -48,7 +48,7 @@ if(CMAKE_GENERATOR MATCHES "Makefiles" OR CMAKE_GENERATOR MATCHES "Ninja") set(CMAKE_TEST_COMPILER ${CMAKE_C_COMPILER}) if (NOT CMAKE_C_COMPILER) set(CMAKE_TEST_COMPILER ${CMAKE_CXX_COMPILER}) - endif(NOT CMAKE_C_COMPILER) + endif() exec_program(${CMAKE_TEST_COMPILER} ARGS /nologo -EP \"${testNmakeCLVersionFile}\" OUTPUT_VARIABLE CMAKE_COMPILER_OUTPUT @@ -70,32 +70,32 @@ if(CMAKE_GENERATOR MATCHES "Makefiles" OR CMAKE_GENERATOR MATCHES "Ninja") if("${compilerVersion}" LESS 1300) set(MSVC60 1) set(CMAKE_COMPILER_SUPPORTS_PDBTYPE 1) - endif("${compilerVersion}" LESS 1300) + endif() if("${compilerVersion}" EQUAL 1300) set(MSVC70 1) set(CMAKE_COMPILER_SUPPORTS_PDBTYPE 0) - endif("${compilerVersion}" EQUAL 1300) + endif() if("${compilerVersion}" EQUAL 1310) set(MSVC71 1) set(CMAKE_COMPILER_SUPPORTS_PDBTYPE 0) - endif("${compilerVersion}" EQUAL 1310) + endif() if("${compilerVersion}" EQUAL 1400) set(MSVC80 1) set(CMAKE_COMPILER_2005 1) - endif("${compilerVersion}" EQUAL 1400) + endif() if("${compilerVersion}" EQUAL 1500) set(MSVC90 1) - endif("${compilerVersion}" EQUAL 1500) + endif() if("${compilerVersion}" EQUAL 1600) set(MSVC10 1) - endif("${compilerVersion}" EQUAL 1600) + endif() set(MSVC_VERSION "${compilerVersion}") - else(NOT CMAKE_COMPILER_RETURN) + else() message(STATUS "Check for CL compiler version - failed") file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log "Determining the version of compiler failed with the following output:\n" "${CMAKE_COMPILER_OUTPUT}\n\n") - endif(NOT CMAKE_COMPILER_RETURN) + endif() # try to figure out if we are running the free command line # tools from Microsoft. These tools do not provide debug libraries, # so the link flags used have to be different. @@ -116,25 +116,25 @@ if(CMAKE_GENERATOR MATCHES "Makefiles" OR CMAKE_GENERATOR MATCHES "Ninja") "${CMAKE_COMPILER_OUTPUT}\n\n") message(STATUS "Check if this is a free VC compiler - yes") set(CMAKE_USING_VC_FREE_TOOLS 1) - else(CMAKE_COMPILER_RETURN) + else() file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log "Determining if this is a free VC compiler passed with the following output:\n" "${CMAKE_COMPILER_OUTPUT}\n\n") message(STATUS "Check if this is a free VC compiler - no") set(CMAKE_USING_VC_FREE_TOOLS 0) - endif(CMAKE_COMPILER_RETURN) + endif() make_directory("${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp3") - endif(NOT CMAKE_VC_COMPILER_TESTS_RUN) -endif(CMAKE_GENERATOR MATCHES "Makefiles" OR CMAKE_GENERATOR MATCHES "Ninja") + endif() +endif() if(MSVC_C_ARCHITECTURE_ID MATCHES 64) set(CMAKE_CL_64 1) -else(MSVC_C_ARCHITECTURE_ID MATCHES 64) +else() set(CMAKE_CL_64 0) -endif(MSVC_C_ARCHITECTURE_ID MATCHES 64) +endif() if(CMAKE_FORCE_WIN64 OR CMAKE_FORCE_IA64) set(CMAKE_CL_64 1) -endif(CMAKE_FORCE_WIN64 OR CMAKE_FORCE_IA64) +endif() if("${MSVC_VERSION}" GREATER 1599) set(MSVC_INCREMENTAL_DEFAULT ON) @@ -165,7 +165,7 @@ if(MSVC_VERSION GREATER 1310) set (CMAKE_C_FLAGS_RELWITHDEBINFO_INIT "/MD /Zi /O2 /Ob1 /D NDEBUG") set (CMAKE_C_STANDARD_LIBRARIES_INIT "kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib ") set (CMAKE_EXE_LINKER_FLAGS_INIT "${CMAKE_EXE_LINKER_FLAGS_INIT}") -else(MSVC_VERSION GREATER 1310) +else() if(CMAKE_USING_VC_FREE_TOOLS) message(STATUS "Using FREE VC TOOLS, NO DEBUG available") set(CMAKE_BUILD_TYPE_INIT Release) @@ -179,7 +179,7 @@ else(MSVC_VERSION GREATER 1310) set (CMAKE_C_FLAGS_MINSIZEREL_INIT "/MT /O1 /Ob1 /D NDEBUG") set (CMAKE_C_FLAGS_RELEASE_INIT "/MT /O2 /Ob2 /D NDEBUG") set (CMAKE_C_FLAGS_RELWITHDEBINFO_INIT "/MT /Zi /O2 /Ob1 /D NDEBUG") - else(CMAKE_USING_VC_FREE_TOOLS) + else() set(CMAKE_BUILD_TYPE_INIT Debug) set (CMAKE_CXX_FLAGS_INIT "/DWIN32 /D_WINDOWS /W3 /Zm1000 /GX /GR") set (CMAKE_CXX_FLAGS_DEBUG_INIT "/D_DEBUG /MDd /Zi /Ob0 /Od /GZ") @@ -191,9 +191,9 @@ else(MSVC_VERSION GREATER 1310) set (CMAKE_C_FLAGS_MINSIZEREL_INIT "/MD /O1 /Ob1 /D NDEBUG") set (CMAKE_C_FLAGS_RELEASE_INIT "/MD /O2 /Ob2 /D NDEBUG") set (CMAKE_C_FLAGS_RELWITHDEBINFO_INIT "/MD /Zi /O2 /Ob1 /D NDEBUG") - endif(CMAKE_USING_VC_FREE_TOOLS) + endif() set (CMAKE_C_STANDARD_LIBRARIES_INIT "kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib") -endif(MSVC_VERSION GREATER 1310) +endif() set(CMAKE_CXX_STANDARD_LIBRARIES_INIT "${CMAKE_C_STANDARD_LIBRARIES_INIT}") @@ -203,7 +203,7 @@ set (CMAKE_LINK_DEF_FILE_FLAG "/DEF:") set(_MACHINE_ARCH_FLAG ${MSVC_C_ARCHITECTURE_ID}) if(NOT _MACHINE_ARCH_FLAG) set(_MACHINE_ARCH_FLAG ${MSVC_CXX_ARCHITECTURE_ID}) -endif(NOT _MACHINE_ARCH_FLAG) +endif() set (CMAKE_EXE_LINKER_FLAGS_INIT "${CMAKE_EXE_LINKER_FLAGS_INIT} /STACK:10000000 /machine:${_MACHINE_ARCH_FLAG}") @@ -219,10 +219,10 @@ endif() if (CMAKE_COMPILER_SUPPORTS_PDBTYPE) set (CMAKE_EXE_LINKER_FLAGS_DEBUG_INIT "/debug /pdbtype:sept ${MSVC_INCREMENTAL_YES_FLAG}") set (CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO_INIT "/debug /pdbtype:sept ${MSVC_INCREMENTAL_YES_FLAG}") -else (CMAKE_COMPILER_SUPPORTS_PDBTYPE) +else () set (CMAKE_EXE_LINKER_FLAGS_DEBUG_INIT "/debug ${MSVC_INCREMENTAL_YES_FLAG}") set (CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO_INIT "/debug ${MSVC_INCREMENTAL_YES_FLAG}") -endif (CMAKE_COMPILER_SUPPORTS_PDBTYPE) +endif () # for release and minsize release default to no incremental linking set(CMAKE_EXE_LINKER_FLAGS_MINSIZEREL_INIT "/INCREMENTAL:NO") set(CMAKE_EXE_LINKER_FLAGS_RELEASE_INIT "/INCREMENTAL:NO") @@ -245,9 +245,9 @@ set (CMAKE_MODULE_LINKER_FLAGS_MINSIZEREL_INIT ${CMAKE_EXE_LINKER_FLAGS_MINSIZER if(NOT EXISTS "${CMAKE_PLATFORM_ROOT_BIN}/CMakeCPlatform.cmake") configure_file(${CMAKE_ROOT}/Modules/Platform/Windows-cl.cmake.in ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeCPlatform.cmake IMMEDIATE) -endif(NOT EXISTS "${CMAKE_PLATFORM_ROOT_BIN}/CMakeCPlatform.cmake") +endif() if(NOT EXISTS "${CMAKE_PLATFORM_ROOT_BIN}/CMakeCXXPlatform.cmake") configure_file(${CMAKE_ROOT}/Modules/Platform/Windows-cl.cmake.in ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeCXXPlatform.cmake IMMEDIATE) -endif(NOT EXISTS "${CMAKE_PLATFORM_ROOT_BIN}/CMakeCXXPlatform.cmake") +endif() diff --git a/Modules/Platform/Windows-df.cmake b/Modules/Platform/Windows-df.cmake index dff58c5..9a87be1 100644 --- a/Modules/Platform/Windows-df.cmake +++ b/Modules/Platform/Windows-df.cmake @@ -6,9 +6,9 @@ set(CMAKE_LINK_LIBRARY_FLAG "") set(WIN32 1) if(CMAKE_VERBOSE_MAKEFILE) set(CMAKE_CL_NOLOGO) -else(CMAKE_VERBOSE_MAKEFILE) +else() set(CMAKE_CL_NOLOGO "/nologo") -endif(CMAKE_VERBOSE_MAKEFILE) +endif() set(CMAKE_Fortran_MODDIR_FLAG "-module:") @@ -34,12 +34,12 @@ set(CMAKE_CREATE_CONSOLE_EXE ) if(CMAKE_GENERATOR MATCHES "Visual Studio 6") set (CMAKE_NO_BUILD_TYPE 1) -endif(CMAKE_GENERATOR MATCHES "Visual Studio 6") +endif() if(CMAKE_GENERATOR MATCHES "Visual Studio 7" OR CMAKE_GENERATOR MATCHES "Visual Studio 8") set (CMAKE_NO_BUILD_TYPE 1) set (CMAKE_CONFIGURATION_TYPES "Debug;Release;MinSizeRel;RelWithDebInfo" CACHE STRING "Semicolon separated list of supported configuration types, only supports Debug, Release, MinSizeRel, and RelWithDebInfo, anything else will be ignored.") -endif(CMAKE_GENERATOR MATCHES "Visual Studio 7" OR CMAKE_GENERATOR MATCHES "Visual Studio 8") +endif() # does the compiler support pdbtype and is it the newer compiler set(CMAKE_BUILD_TYPE_INIT Debug) @@ -57,10 +57,10 @@ set (CMAKE_EXE_LINKER_FLAGS_INIT " /INCREMENTAL:YES") if (CMAKE_COMPILER_SUPPORTS_PDBTYPE) set (CMAKE_EXE_LINKER_FLAGS_DEBUG_INIT "/debug /pdbtype:sept") set (CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO_INIT "/debug /pdbtype:sept") -else (CMAKE_COMPILER_SUPPORTS_PDBTYPE) +else () set (CMAKE_EXE_LINKER_FLAGS_DEBUG_INIT "/debug") set (CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO_INIT "/debug") -endif (CMAKE_COMPILER_SUPPORTS_PDBTYPE) +endif () set (CMAKE_SHARED_LINKER_FLAGS_INIT ${CMAKE_EXE_LINKER_FLAGS_INIT}) set (CMAKE_SHARED_LINKER_FLAGS_DEBUG_INIT ${CMAKE_EXE_LINKER_FLAGS_DEBUG_INIT}) diff --git a/Modules/Platform/Windows-wcl386.cmake b/Modules/Platform/Windows-wcl386.cmake index 977531d..8a03b29 100644 --- a/Modules/Platform/Windows-wcl386.cmake +++ b/Modules/Platform/Windows-wcl386.cmake @@ -6,11 +6,11 @@ if(CMAKE_VERBOSE_MAKEFILE) set(CMAKE_WCL_QUIET) set(CMAKE_WLINK_QUIET) set(CMAKE_LIB_QUIET) -else(CMAKE_VERBOSE_MAKEFILE) +else() set(CMAKE_WCL_QUIET "-zq") set(CMAKE_WLINK_QUIET "option quiet") set(CMAKE_LIB_QUIET "-q") -endif(CMAKE_VERBOSE_MAKEFILE) +endif() set(CMAKE_CREATE_WIN32_EXE "system nt_win" ) set(CMAKE_CREATE_CONSOLE_EXE "system nt" ) diff --git a/Modules/Platform/Windows.cmake b/Modules/Platform/Windows.cmake index 9481baa..b158a9d 100644 --- a/Modules/Platform/Windows.cmake +++ b/Modules/Platform/Windows.cmake @@ -18,14 +18,14 @@ set(CMAKE_FIND_LIBRARY_SUFFIXES ".lib") if(CMAKE_GENERATOR MATCHES "Borland") set(CMAKE_START_TEMP_FILE "@&&|\n") set(CMAKE_END_TEMP_FILE "\n|") -endif(CMAKE_GENERATOR MATCHES "Borland") +endif() # for nmake make long command lines are redirected to a file # with the following syntax, see Windows-bcc32.cmake for use if(CMAKE_GENERATOR MATCHES "NMake") set(CMAKE_START_TEMP_FILE "@<<\n") set(CMAKE_END_TEMP_FILE "\n<<") -endif(CMAKE_GENERATOR MATCHES "NMake") +endif() include(Platform/WindowsPaths) diff --git a/Modules/Platform/cl.cmake b/Modules/Platform/cl.cmake index c8dc025..9e4d607 100644 --- a/Modules/Platform/cl.cmake +++ b/Modules/Platform/cl.cmake @@ -8,13 +8,13 @@ set(MSVC 1) # hardcode CMAKE_LINKER here to link, so it behaves as it did before, Alex if(NOT DEFINED CMAKE_LINKER) set(CMAKE_LINKER link) -endif(NOT DEFINED CMAKE_LINKER) +endif() if(CMAKE_VERBOSE_MAKEFILE) set(CMAKE_CL_NOLOGO) -else(CMAKE_VERBOSE_MAKEFILE) +else() set(CMAKE_CL_NOLOGO "/nologo") -endif(CMAKE_VERBOSE_MAKEFILE) +endif() # create a shared C++ library set(CMAKE_CXX_CREATE_SHARED_LIBRARY "<CMAKE_LINKER> ${CMAKE_CL_NOLOGO} <OBJECTS> ${CMAKE_START_TEMP_FILE} /out:<TARGET> /implib:<TARGET_IMPLIB> /pdb:<TARGET_PDB> /dll /version:<TARGET_VERSION_MAJOR>.<TARGET_VERSION_MINOR> <LINK_FLAGS> <LINK_LIBRARIES> ${CMAKE_END_TEMP_FILE}") diff --git a/Modules/Platform/eCos.cmake b/Modules/Platform/eCos.cmake index c839b0e..a203826 100644 --- a/Modules/Platform/eCos.cmake +++ b/Modules/Platform/eCos.cmake @@ -30,10 +30,10 @@ include(Platform/UnixPaths) get_property(_IN_TC GLOBAL PROPERTY IN_TRY_COMPILE) if(CMAKE_C_COMPILER AND NOT "${CMAKE_C_COMPILER_ID}" MATCHES "GNU" AND NOT _IN_TC) message(FATAL_ERROR "GNU gcc is required for eCos") -endif(CMAKE_C_COMPILER AND NOT "${CMAKE_C_COMPILER_ID}" MATCHES "GNU" AND NOT _IN_TC) +endif() if(CMAKE_CXX_COMPILER AND NOT "${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU" AND NOT _IN_TC) message(FATAL_ERROR "GNU g++ is required for eCos") -endif(CMAKE_CXX_COMPILER AND NOT "${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU" AND NOT _IN_TC) +endif() # find eCos system files find_path(ECOS_SYSTEM_CONFIG_HEADER_PATH NAMES pkgconf/system.h) @@ -41,11 +41,11 @@ find_library(ECOS_SYSTEM_TARGET_LIBRARY NAMES libtarget.a) if(NOT ECOS_SYSTEM_CONFIG_HEADER_PATH) message(FATAL_ERROR "Could not find eCos pkgconf/system.h. Build eCos first and set up CMAKE_FIND_ROOT_PATH correctly.") -endif(NOT ECOS_SYSTEM_CONFIG_HEADER_PATH) +endif() if(NOT ECOS_SYSTEM_TARGET_LIBRARY) message(FATAL_ERROR "Could not find eCos \"libtarget.a\". Build eCos first and set up CMAKE_FIND_ROOT_PATH correctly.") -endif(NOT ECOS_SYSTEM_TARGET_LIBRARY) +endif() get_filename_component(ECOS_LIBTARGET_DIRECTORY "${ECOS_SYSTEM_TARGET_LIBRARY}" PATH) include_directories(${ECOS_SYSTEM_CONFIG_HEADER_PATH}) diff --git a/Modules/Platform/gas.cmake b/Modules/Platform/gas.cmake index 6ac3b55..7d2bc84 100644 --- a/Modules/Platform/gas.cmake +++ b/Modules/Platform/gas.cmake @@ -1,8 +1,8 @@ if(UNIX) set(CMAKE_ASM${ASM_DIALECT}_OUTPUT_EXTENSION .o) -else(UNIX) +else() set(CMAKE_ASM${ASM_DIALECT}_OUTPUT_EXTENSION .obj) -endif(UNIX) +endif() set(CMAKE_ASM${ASM_DIALECT}_COMPILE_OBJECT "<CMAKE_ASM${ASM_DIALECT}_COMPILER> <FLAGS> -o <OBJECT> <SOURCE>") diff --git a/Modules/Platform/syllable.cmake b/Modules/Platform/syllable.cmake index 50c695f..69c108d 100644 --- a/Modules/Platform/syllable.cmake +++ b/Modules/Platform/syllable.cmake @@ -25,7 +25,7 @@ set(CMAKE_SHARED_LIBRARY_SONAME_C_FLAG "-Wl,-soname,") foreach(type SHARED_LIBRARY SHARED_MODULE EXE) set(CMAKE_${type}_LINK_STATIC_C_FLAGS "-Wl,-Bstatic") set(CMAKE_${type}_LINK_DYNAMIC_C_FLAGS "-Wl,-Bdynamic") -endforeach(type) +endforeach() include(Platform/UnixPaths) diff --git a/Modules/Qt4ConfigDependentSettings.cmake b/Modules/Qt4ConfigDependentSettings.cmake index 2a7a1ce..6db5da1 100644 --- a/Modules/Qt4ConfigDependentSettings.cmake +++ b/Modules/Qt4ConfigDependentSettings.cmake @@ -38,31 +38,31 @@ if(Q_WS_WIN) # On Windows, qconfig.pri has "shared" for shared library builds if(NOT QT_CONFIG MATCHES "shared") set(QT_IS_STATIC 1) - endif(NOT QT_CONFIG MATCHES "shared") -else(Q_WS_WIN) + endif() +else() # On other platforms, check file extension to know if its static if(QT_QTCORE_LIBRARY_RELEASE) get_filename_component(qtcore_lib_ext "${QT_QTCORE_LIBRARY_RELEASE}" EXT) if("${qtcore_lib_ext}" STREQUAL "${CMAKE_STATIC_LIBRARY_SUFFIX}") set(QT_IS_STATIC 1) - endif("${qtcore_lib_ext}" STREQUAL "${CMAKE_STATIC_LIBRARY_SUFFIX}") - endif(QT_QTCORE_LIBRARY_RELEASE) + endif() + endif() if(QT_QTCORE_LIBRARY_DEBUG) get_filename_component(qtcore_lib_ext "${QT_QTCORE_LIBRARY_DEBUG}" EXT) if(${qtcore_lib_ext} STREQUAL ${CMAKE_STATIC_LIBRARY_SUFFIX}) set(QT_IS_STATIC 1) - endif(${qtcore_lib_ext} STREQUAL ${CMAKE_STATIC_LIBRARY_SUFFIX}) - endif(QT_QTCORE_LIBRARY_DEBUG) -endif(Q_WS_WIN) + endif() + endif() +endif() # build using shared Qt needs -DQT_DLL on Windows if(Q_WS_WIN AND NOT QT_IS_STATIC) set(QT_DEFINITIONS ${QT_DEFINITIONS} -DQT_DLL) -endif(Q_WS_WIN AND NOT QT_IS_STATIC) +endif() if(NOT QT_IS_STATIC) return() -endif(NOT QT_IS_STATIC) +endif() # QtOpenGL dependencies find_package(OpenGL) @@ -73,86 +73,86 @@ set (QT_QTOPENGL_LIB_DEPENDENCIES ${OPENGL_glu_LIBRARY} ${OPENGL_gl_LIBRARY}) if(QT_QCONFIG MATCHES "system-png") find_package(PNG) set(QT_QTGUI_LIB_DEPENDENCIES ${QT_QTGUI_LIB_DEPENDENCIES} ${PNG_LIBRARY}) -endif(QT_QCONFIG MATCHES "system-png") +endif() ## system jpeg if(QT_QCONFIG MATCHES "system-jpeg") find_package(JPEG) set(QT_QTGUI_LIB_DEPENDENCIES ${QT_QTGUI_LIB_DEPENDENCIES} ${JPEG_LIBRARIES}) -endif(QT_QCONFIG MATCHES "system-jpeg") +endif() ## system tiff if(QT_QCONFIG MATCHES "system-tiff") find_package(TIFF) set(QT_QTGUI_LIB_DEPENDENCIES ${QT_QTGUI_LIB_DEPENDENCIES} ${TIFF_LIBRARIES}) -endif(QT_QCONFIG MATCHES "system-tiff") +endif() ## system mng if(QT_QCONFIG MATCHES "system-mng") find_library(MNG_LIBRARY NAMES mng) set(QT_QTGUI_LIB_DEPENDENCIES ${QT_QTGUI_LIB_DEPENDENCIES} ${MNG_LIBRARY}) -endif(QT_QCONFIG MATCHES "system-mng") +endif() # for X11, get X11 library directory if(Q_WS_X11) find_package(X11) -endif(Q_WS_X11) +endif() ## X11 SM if(QT_QCONFIG MATCHES "x11sm") if(X11_SM_LIB AND X11_ICE_LIB) set(QT_QTGUI_LIB_DEPENDENCIES ${QT_QTGUI_LIB_DEPENDENCIES} ${X11_SM_LIB} ${X11_ICE_LIB}) - endif(X11_SM_LIB AND X11_ICE_LIB) -endif(QT_QCONFIG MATCHES "x11sm") + endif() +endif() ## Xi if(QT_QCONFIG MATCHES "tablet") if(X11_Xi_LIB) set(QT_QTGUI_LIB_DEPENDENCIES ${QT_QTGUI_LIB_DEPENDENCIES} ${X11_Xi_LIB}) - endif(X11_Xi_LIB) -endif(QT_QCONFIG MATCHES "tablet") + endif() +endif() ## Xrender if(QT_QCONFIG MATCHES "xrender") if(X11_Xrender_LIB) set(QT_QTGUI_LIB_DEPENDENCIES ${QT_QTGUI_LIB_DEPENDENCIES} ${X11_Xrender_LIB}) - endif(X11_Xrender_LIB) -endif(QT_QCONFIG MATCHES "xrender") + endif() +endif() ## Xrandr if(QT_QCONFIG MATCHES "xrandr") if(X11_Xrandr_LIB) set(QT_QTGUI_LIB_DEPENDENCIES ${QT_QTGUI_LIB_DEPENDENCIES} ${X11_Xrandr_LIB}) - endif(X11_Xrandr_LIB) -endif(QT_QCONFIG MATCHES "xrandr") + endif() +endif() ## Xcursor if(QT_QCONFIG MATCHES "xcursor") if(X11_Xcursor_LIB) set(QT_QTGUI_LIB_DEPENDENCIES ${QT_QTGUI_LIB_DEPENDENCIES} ${X11_Xcursor_LIB}) - endif(X11_Xcursor_LIB) -endif(QT_QCONFIG MATCHES "xcursor") + endif() +endif() ## Xinerama if(QT_QCONFIG MATCHES "xinerama") if(X11_Xinerama_LIB) set(QT_QTGUI_LIB_DEPENDENCIES ${QT_QTGUI_LIB_DEPENDENCIES} ${X11_Xinerama_LIB}) - endif(X11_Xinerama_LIB) -endif(QT_QCONFIG MATCHES "xinerama") + endif() +endif() ## Xfixes if(QT_QCONFIG MATCHES "xfixes") if(X11_Xfixes_LIB) set(QT_QTGUI_LIB_DEPENDENCIES ${QT_QTGUI_LIB_DEPENDENCIES} ${X11_Xfixes_LIB}) - endif(X11_Xfixes_LIB) -endif(QT_QCONFIG MATCHES "xfixes") + endif() +endif() ## fontconfig @@ -161,8 +161,8 @@ if(QT_QCONFIG MATCHES "fontconfig") mark_as_advanced(QT_FONTCONFIG_LIBRARY) if(QT_FONTCONFIG_LIBRARY) set(QT_QTGUI_LIB_DEPENDENCIES ${QT_QTGUI_LIB_DEPENDENCIES} ${QT_FONTCONFIG_LIBRARY}) - endif(QT_FONTCONFIG_LIBRARY) -endif(QT_QCONFIG MATCHES "fontconfig") + endif() +endif() ## system-freetype @@ -170,15 +170,15 @@ if(QT_QCONFIG MATCHES "system-freetype") find_package(Freetype) if(FREETYPE_LIBRARIES) set(QT_QTGUI_LIB_DEPENDENCIES ${QT_QTGUI_LIB_DEPENDENCIES} ${FREETYPE_LIBRARIES}) - endif(FREETYPE_LIBRARIES) -endif(QT_QCONFIG MATCHES "system-freetype") + endif() +endif() ## system-zlib if(QT_QCONFIG MATCHES "system-zlib") find_package(ZLIB) set(QT_QTCORE_LIB_DEPENDENCIES ${QT_QTCORE_LIB_DEPENDENCIES} ${ZLIB_LIBRARIES}) -endif(QT_QCONFIG MATCHES "system-zlib") +endif() ## openssl @@ -186,17 +186,17 @@ if(NOT Q_WS_WIN) set(_QT_NEED_OPENSSL 0) if(QT_VERSION_MINOR LESS 4 AND QT_QCONFIG MATCHES "openssl") set(_QT_NEED_OPENSSL 1) - endif(QT_VERSION_MINOR LESS 4 AND QT_QCONFIG MATCHES "openssl") + endif() if(QT_VERSION_MINOR GREATER 3 AND QT_QCONFIG MATCHES "openssl-linked") set(_QT_NEED_OPENSSL 1) - endif(QT_VERSION_MINOR GREATER 3 AND QT_QCONFIG MATCHES "openssl-linked") + endif() if(_QT_NEED_OPENSSL) find_package(OpenSSL) if(OPENSSL_LIBRARIES) set(QT_QTNETWORK_LIB_DEPENDENCIES ${QT_QTNETWORK_LIB_DEPENDENCIES} ${OPENSSL_LIBRARIES}) - endif(OPENSSL_LIBRARIES) - endif(_QT_NEED_OPENSSL) -endif(NOT Q_WS_WIN) + endif() + endif() +endif() ## dbus @@ -205,10 +205,10 @@ if(QT_QCONFIG MATCHES "dbus") find_library(QT_DBUS_LIBRARY NAMES dbus-1 ) if(QT_DBUS_LIBRARY) set(QT_QTDBUS_LIB_DEPENDENCIES ${QT_QTDBUS_LIB_DEPENDENCIES} ${QT_DBUS_LIBRARY}) - endif(QT_DBUS_LIBRARY) + endif() mark_as_advanced(QT_DBUS_LIBRARY) -endif(QT_QCONFIG MATCHES "dbus") +endif() ## glib @@ -223,7 +223,7 @@ if(QT_QCONFIG MATCHES "glib") if(QT_GLIB_LIBRARY AND QT_GTHREAD_LIBRARY) set(QT_QTCORE_LIB_DEPENDENCIES ${QT_QTCORE_LIB_DEPENDENCIES} ${QT_GTHREAD_LIBRARY} ${QT_GLIB_LIBRARY}) - endif(QT_GLIB_LIBRARY AND QT_GTHREAD_LIBRARY) + endif() # Qt 4.5+ also links to gobject-2.0 @@ -234,10 +234,10 @@ if(QT_QCONFIG MATCHES "glib") if(QT_GOBJECT_LIBRARY) set(QT_QTCORE_LIB_DEPENDENCIES ${QT_QTCORE_LIB_DEPENDENCIES} ${QT_GOBJECT_LIBRARY}) - endif(QT_GOBJECT_LIBRARY) - endif(QT_VERSION_MINOR GREATER 4) + endif() + endif() -endif(QT_QCONFIG MATCHES "glib") +endif() ## clock-monotonic, just see if we need to link with rt @@ -251,9 +251,9 @@ if(QT_QCONFIG MATCHES "clock-monotonic") mark_as_advanced(QT_RT_LIBRARY) if(QT_RT_LIBRARY) set(QT_QTCORE_LIB_DEPENDENCIES ${QT_QTCORE_LIB_DEPENDENCIES} ${QT_RT_LIBRARY}) - endif(QT_RT_LIBRARY) - endif(QT_POSIX_TIMERS) -endif(QT_QCONFIG MATCHES "clock-monotonic") + endif() + endif() +endif() if(Q_WS_X11) @@ -264,17 +264,17 @@ if(Q_WS_X11) find_package(Threads) if(CMAKE_USE_PTHREADS_INIT) set(QT_QTCORE_LIB_DEPENDENCIES ${QT_QTCORE_LIB_DEPENDENCIES} ${CMAKE_THREAD_LIBS_INIT}) - endif(CMAKE_USE_PTHREADS_INIT) + endif() set (QT_QTCORE_LIB_DEPENDENCIES ${QT_QTCORE_LIB_DEPENDENCIES} ${CMAKE_DL_LIBS}) -endif(Q_WS_X11) +endif() if(Q_WS_WIN) set(QT_QTGUI_LIB_DEPENDENCIES ${QT_QTGUI_LIB_DEPENDENCIES} imm32 winmm) set(QT_QTCORE_LIB_DEPENDENCIES ${QT_QTCORE_LIB_DEPENDENCIES} ws2_32) -endif(Q_WS_WIN) +endif() if(Q_WS_MAC) @@ -283,13 +283,13 @@ if(Q_WS_MAC) # Qt 4.0, 4.1, 4.2 use QuickTime if(QT_VERSION_MINOR LESS 3) set(QT_QTGUI_LIB_DEPENDENCIES ${QT_QTGUI_LIB_DEPENDENCIES} "-framework QuickTime") - endif(QT_VERSION_MINOR LESS 3) + endif() # Qt 4.2+ use AppKit if(QT_VERSION_MINOR GREATER 1) set(QT_QTGUI_LIB_DEPENDENCIES ${QT_QTGUI_LIB_DEPENDENCIES} "-framework AppKit") - endif(QT_VERSION_MINOR GREATER 1) + endif() set(QT_QTCORE_LIB_DEPENDENCIES ${QT_QTCORE_LIB_DEPENDENCIES} "-framework ApplicationServices") -endif(Q_WS_MAC) +endif() diff --git a/Modules/Qt4Macros.cmake b/Modules/Qt4Macros.cmake index 1e19ff2..4324347 100644 --- a/Modules/Qt4Macros.cmake +++ b/Modules/Qt4Macros.cmake @@ -28,15 +28,15 @@ macro (QT4_EXTRACT_OPTIONS _qt4_files _qt4_options) foreach(_currentArg ${ARGN}) if ("${_currentArg}" STREQUAL "OPTIONS") set(_QT4_DOING_OPTIONS TRUE) - else ("${_currentArg}" STREQUAL "OPTIONS") + else () if(_QT4_DOING_OPTIONS) list(APPEND ${_qt4_options} "${_currentArg}") - else(_QT4_DOING_OPTIONS) + else() list(APPEND ${_qt4_files} "${_currentArg}") - endif(_QT4_DOING_OPTIONS) - endif ("${_currentArg}" STREQUAL "OPTIONS") - endforeach(_currentArg) -endmacro (QT4_EXTRACT_OPTIONS) + endif() + endif () + endforeach() +endmacro () # macro used to create the names of output files preserving relative dirs @@ -48,22 +48,22 @@ macro (QT4_MAKE_OUTPUT_FILE infile prefix ext outfile ) string(SUBSTRING "${infile}" 0 ${_binlength} _checkinfile) if(_checkinfile STREQUAL "${CMAKE_CURRENT_BINARY_DIR}") file(RELATIVE_PATH rel ${CMAKE_CURRENT_BINARY_DIR} ${infile}) - else(_checkinfile STREQUAL "${CMAKE_CURRENT_BINARY_DIR}") + else() file(RELATIVE_PATH rel ${CMAKE_CURRENT_SOURCE_DIR} ${infile}) - endif(_checkinfile STREQUAL "${CMAKE_CURRENT_BINARY_DIR}") - else(_infileLength GREATER _binlength) + endif() + else() file(RELATIVE_PATH rel ${CMAKE_CURRENT_SOURCE_DIR} ${infile}) - endif(_infileLength GREATER _binlength) + endif() if(WIN32 AND rel MATCHES "^[a-zA-Z]:") # absolute path string(REGEX REPLACE "^([a-zA-Z]):(.*)$" "\\1_\\2" rel "${rel}") - endif(WIN32 AND rel MATCHES "^[a-zA-Z]:") + endif() set(_outfile "${CMAKE_CURRENT_BINARY_DIR}/${rel}") string(REPLACE ".." "__" _outfile ${_outfile}) get_filename_component(outpath ${_outfile} PATH) get_filename_component(_outfile ${_outfile} NAME_WE) file(MAKE_DIRECTORY ${outpath}) set(${outfile} ${outpath}/${prefix}${_outfile}.${ext}) -endmacro (QT4_MAKE_OUTPUT_FILE ) +endmacro () macro (QT4_GET_MOC_FLAGS _moc_flags) @@ -74,21 +74,21 @@ macro (QT4_GET_MOC_FLAGS _moc_flags) if("${_current}" MATCHES "\\.framework/?$") string(REGEX REPLACE "/[^/]+\\.framework" "" framework_path "${_current}") set(${_moc_flags} ${${_moc_flags}} "-F${framework_path}") - else("${_current}" MATCHES "\\.framework/?$") + else() set(${_moc_flags} ${${_moc_flags}} "-I${_current}") - endif("${_current}" MATCHES "\\.framework/?$") - endforeach(_current ${_inc_DIRS}) + endif() + endforeach() get_directory_property(_defines COMPILE_DEFINITIONS) foreach(_current ${_defines}) set(${_moc_flags} ${${_moc_flags}} "-D${_current}") - endforeach(_current ${_defines}) + endforeach() if(Q_WS_WIN) set(${_moc_flags} ${${_moc_flags}} -DWIN32) - endif(Q_WS_WIN) + endif() -endmacro(QT4_GET_MOC_FLAGS) +endmacro() # helper macro to set up a moc rule @@ -104,7 +104,7 @@ macro (QT4_CREATE_MOC_COMMAND infile outfile moc_flags moc_options) get_filename_component(_moc_outfile_dir "${outfile}" PATH) if(_moc_outfile_dir) set(_moc_working_dir WORKING_DIRECTORY ${_moc_outfile_dir}) - endif(_moc_outfile_dir) + endif() set (_moc_parameters_file ${outfile}_parameters) set (_moc_parameters ${moc_flags} ${moc_options} -o "${outfile}" "${infile}") string (REPLACE ";" "\n" _moc_parameters "${_moc_parameters}") @@ -114,13 +114,13 @@ macro (QT4_CREATE_MOC_COMMAND infile outfile moc_flags moc_options) DEPENDS ${infile} ${_moc_working_dir} VERBATIM) - else (WIN32) + else () add_custom_command(OUTPUT ${outfile} COMMAND ${QT_MOC_EXECUTABLE} ARGS ${moc_flags} ${moc_options} -o ${outfile} ${infile} DEPENDS ${infile} VERBATIM) - endif (WIN32) -endmacro (QT4_CREATE_MOC_COMMAND) + endif () +endmacro () macro (QT4_GENERATE_MOC infile outfile ) @@ -130,10 +130,10 @@ macro (QT4_GENERATE_MOC infile outfile ) set(_outfile "${outfile}") if(NOT IS_ABSOLUTE "${outfile}") set(_outfile "${CMAKE_CURRENT_BINARY_DIR}/${outfile}") - endif(NOT IS_ABSOLUTE "${outfile}") + endif() QT4_CREATE_MOC_COMMAND(${abs_infile} ${_outfile} "${moc_flags}" "") set_source_files_properties(${outfile} PROPERTIES SKIP_AUTOMOC TRUE) # dont run automoc on this file -endmacro (QT4_GENERATE_MOC) +endmacro () # QT4_WRAP_CPP(outfiles inputfile ... ) @@ -148,9 +148,9 @@ macro (QT4_WRAP_CPP outfiles ) QT4_MAKE_OUTPUT_FILE(${it} moc_ cxx outfile) QT4_CREATE_MOC_COMMAND(${it} ${outfile} "${moc_flags}" "${moc_options}") set(${outfiles} ${${outfiles}} ${outfile}) - endforeach(it) + endforeach() -endmacro (QT4_WRAP_CPP) +endmacro () # QT4_WRAP_UI(outfiles inputfile ... ) @@ -167,9 +167,9 @@ macro (QT4_WRAP_UI outfiles ) ARGS ${ui_options} -o ${outfile} ${infile} MAIN_DEPENDENCY ${infile} VERBATIM) set(${outfiles} ${${outfiles}} ${outfile}) - endforeach (it) + endforeach () -endmacro (QT4_WRAP_UI) +endmacro () # QT4_ADD_RESOURCES(outfiles inputfile ... ) @@ -193,19 +193,19 @@ macro (QT4_ADD_RESOURCES outfiles ) string(REGEX REPLACE "^<file[^>]*>" "" _RC_FILE "${_RC_FILE}") if(NOT IS_ABSOLUTE "${_RC_FILE}") set(_RC_FILE "${rc_path}/${_RC_FILE}") - endif(NOT IS_ABSOLUTE "${_RC_FILE}") + endif() set(_RC_DEPENDS ${_RC_DEPENDS} "${_RC_FILE}") - endforeach(_RC_FILE) + endforeach() # Since this cmake macro is doing the dependency scanning for these files, # let's make a configured file and add it as a dependency so cmake is run # again when dependencies need to be recomputed. QT4_MAKE_OUTPUT_FILE("${infile}" "" "qrc.depends" out_depends) configure_file("${infile}" "${out_depends}" COPY_ONLY) - else(EXISTS "${infile}") + else() # The .qrc file does not exist (yet). Let's add a dependency and hope # that it will be generated later set(out_depends) - endif(EXISTS "${infile}") + endif() add_custom_command(OUTPUT ${outfile} COMMAND ${QT_RCC_EXECUTABLE} @@ -213,9 +213,9 @@ macro (QT4_ADD_RESOURCES outfiles ) MAIN_DEPENDENCY ${infile} DEPENDS ${_RC_DEPENDS} "${out_depends}" VERBATIM) set(${outfiles} ${${outfiles}} ${outfile}) - endforeach (it) + endforeach () -endmacro (QT4_ADD_RESOURCES) +endmacro () macro(QT4_ADD_DBUS_INTERFACE _sources _interface _basename) @@ -227,19 +227,19 @@ macro(QT4_ADD_DBUS_INTERFACE _sources _interface _basename) get_source_file_property(_nonamespace ${_interface} NO_NAMESPACE) if(_nonamespace) set(_params -N -m) - else(_nonamespace) + else() set(_params -m) - endif(_nonamespace) + endif() get_source_file_property(_classname ${_interface} CLASSNAME) if(_classname) set(_params ${_params} -c ${_classname}) - endif(_classname) + endif() get_source_file_property(_include ${_interface} INCLUDE) if(_include) set(_params ${_params} -i ${_include}) - endif(_include) + endif() add_custom_command(OUTPUT "${_impl}" "${_header}" COMMAND ${QT_DBUSXML2CPP_EXECUTABLE} ${_params} -p ${_basename} ${_infile} @@ -252,7 +252,7 @@ macro(QT4_ADD_DBUS_INTERFACE _sources _interface _basename) list(APPEND ${_sources} "${_impl}" "${_header}" "${_moc}") MACRO_ADD_FILE_DEPENDENCIES("${_impl}" "${_moc}") -endmacro(QT4_ADD_DBUS_INTERFACE) +endmacro() macro(QT4_ADD_DBUS_INTERFACES _sources) @@ -263,8 +263,8 @@ macro(QT4_ADD_DBUS_INTERFACES _sources) string(TOLOWER ${_basename} _basename) string(REGEX REPLACE "(.*\\.)?([^\\.]+)\\.xml" "\\2" _basename ${_basename}) QT4_ADD_DBUS_INTERFACE(${_sources} ${_infile} ${_basename}interface) - endforeach (_current_FILE) -endmacro(QT4_ADD_DBUS_INTERFACES) + endforeach () +endmacro() macro(QT4_GENERATE_DBUS_INTERFACE _header) # _customName OPTIONS -some -options ) @@ -283,15 +283,15 @@ macro(QT4_GENERATE_DBUS_INTERFACE _header) # _customName OPTIONS -some -options else() set(_target ${CMAKE_CURRENT_BINARY_DIR}/${_customName}) endif() - else (_customName) + else () set(_target ${CMAKE_CURRENT_BINARY_DIR}/${_basename}.xml) - endif (_customName) + endif () add_custom_command(OUTPUT ${_target} COMMAND ${QT_DBUSCPP2XML_EXECUTABLE} ${_qt4_dbus_options} ${_in_file} -o ${_target} DEPENDS ${_in_file} VERBATIM ) -endmacro(QT4_GENERATE_DBUS_INTERFACE) +endmacro() macro(QT4_ADD_DBUS_ADAPTOR _sources _xml_file _include _parentClass) # _optionalBasename _optionalClassName) @@ -300,10 +300,10 @@ macro(QT4_ADD_DBUS_ADAPTOR _sources _xml_file _include _parentClass) # _optional set(_optionalBasename "${ARGV4}") if (_optionalBasename) set(_basename ${_optionalBasename} ) - else (_optionalBasename) + else () string(REGEX REPLACE "(.*[/\\.])?([^\\.]+)\\.xml" "\\2adaptor" _basename ${_infile}) string(TOLOWER ${_basename} _basename) - endif (_optionalBasename) + endif () set(_optionalClassName "${ARGV5}") set(_header "${CMAKE_CURRENT_BINARY_DIR}/${_basename}.h") @@ -315,19 +315,19 @@ macro(QT4_ADD_DBUS_ADAPTOR _sources _xml_file _include _parentClass) # _optional COMMAND ${QT_DBUSXML2CPP_EXECUTABLE} -m -a ${_basename} -c ${_optionalClassName} -i ${_include} -l ${_parentClass} ${_infile} DEPENDS ${_infile} VERBATIM ) - else(_optionalClassName) + else() add_custom_command(OUTPUT "${_impl}" "${_header}" COMMAND ${QT_DBUSXML2CPP_EXECUTABLE} -m -a ${_basename} -i ${_include} -l ${_parentClass} ${_infile} DEPENDS ${_infile} VERBATIM ) - endif(_optionalClassName) + endif() QT4_GENERATE_MOC("${_header}" "${_moc}") set_source_files_properties("${_impl}" PROPERTIES SKIP_AUTOMOC TRUE) MACRO_ADD_FILE_DEPENDENCIES("${_impl}" "${_moc}") list(APPEND ${_sources} "${_impl}" "${_header}" "${_moc}") -endmacro(QT4_ADD_DBUS_ADAPTOR) +endmacro() macro(QT4_AUTOMOC) @@ -360,17 +360,17 @@ macro(QT4_AUTOMOC) get_filename_component(_basename ${_current_MOC} NAME_WE) if(EXISTS ${_abs_PATH}/${_basename}.hpp) set(_header ${_abs_PATH}/${_basename}.hpp) - else(EXISTS ${_abs_PATH}/${_basename}.hpp) + else() set(_header ${_abs_PATH}/${_basename}.h) - endif(EXISTS ${_abs_PATH}/${_basename}.hpp) + endif() set(_moc ${CMAKE_CURRENT_BINARY_DIR}/${_current_MOC}) QT4_CREATE_MOC_COMMAND(${_header} ${_moc} "${_moc_INCS}" "") MACRO_ADD_FILE_DEPENDENCIES(${_abs_FILE} ${_moc}) - endforeach (_current_MOC_INC) - endif(_match) - endif ( NOT _skip AND EXISTS ${_abs_FILE} ) - endforeach (_current_FILE) -endmacro(QT4_AUTOMOC) + endforeach () + endif() + endif () + endforeach () +endmacro() macro(QT4_CREATE_TRANSLATION _qm_files) @@ -384,14 +384,14 @@ macro(QT4_CREATE_TRANSLATION _qm_files) get_filename_component(_abs_FILE ${_file} ABSOLUTE) if(_ext MATCHES "ts") list(APPEND _my_tsfiles ${_abs_FILE}) - else(_ext MATCHES "ts") + else() if(NOT _ext) list(APPEND _my_dirs ${_abs_FILE}) - else(NOT _ext) + else() list(APPEND _my_sources ${_abs_FILE}) - endif(NOT _ext) - endif(_ext MATCHES "ts") - endforeach(_file) + endif() + endif() + endforeach() foreach(_ts_file ${_my_tsfiles}) if(_my_sources) # make a .pro file to call lupdate on, so we don't make our commands too @@ -401,22 +401,22 @@ macro(QT4_CREATE_TRANSLATION _qm_files) set(_pro_srcs) foreach(_pro_src ${_my_sources}) set(_pro_srcs "${_pro_srcs} \"${_pro_src}\"") - endforeach(_pro_src ${_my_sources}) + endforeach() set(_pro_includes) get_directory_property(_inc_DIRS INCLUDE_DIRECTORIES) foreach(_pro_include ${_inc_DIRS}) get_filename_component(_abs_include "${_pro_include}" ABSOLUTE) set(_pro_includes "${_pro_includes} \"${_abs_include}\"") - endforeach(_pro_include ${CMAKE_CXX_INCLUDE_PATH}) + endforeach() file(WRITE ${_ts_pro} "SOURCES = ${_pro_srcs}\nINCLUDEPATH = ${_pro_includes}\n") - endif(_my_sources) + endif() add_custom_command(OUTPUT ${_ts_file} COMMAND ${QT_LUPDATE_EXECUTABLE} ARGS ${_lupdate_options} ${_ts_pro} ${_my_dirs} -ts ${_ts_file} DEPENDS ${_my_sources} ${_ts_pro} VERBATIM) - endforeach(_ts_file) + endforeach() QT4_ADD_TRANSLATION(${_qm_files} ${_my_tsfiles}) -endmacro(QT4_CREATE_TRANSLATION) +endmacro() macro(QT4_ADD_TRANSLATION _qm_files) @@ -427,9 +427,9 @@ macro(QT4_ADD_TRANSLATION _qm_files) if(output_location) file(MAKE_DIRECTORY "${output_location}") set(qm "${output_location}/${qm}.qm") - else(output_location) + else() set(qm "${CMAKE_CURRENT_BINARY_DIR}/${qm}.qm") - endif(output_location) + endif() add_custom_command(OUTPUT ${qm} COMMAND ${QT_LRELEASE_EXECUTABLE} @@ -437,5 +437,5 @@ macro(QT4_ADD_TRANSLATION _qm_files) DEPENDS ${_abs_FILE} VERBATIM ) set(${_qm_files} ${${_qm_files}} ${qm}) - endforeach (_current_FILE) -endmacro(QT4_ADD_TRANSLATION) + endforeach () +endmacro() diff --git a/Modules/SelectLibraryConfigurations.cmake b/Modules/SelectLibraryConfigurations.cmake index e4df3eb..82bb173 100644 --- a/Modules/SelectLibraryConfigurations.cmake +++ b/Modules/SelectLibraryConfigurations.cmake @@ -38,8 +38,8 @@ macro( _set_library_name basename GOOD BAD ) set( ${basename}_LIBRARY_${BAD} ${${basename}_LIBRARY_${GOOD}} ) set( ${basename}_LIBRARY ${${basename}_LIBRARY_${GOOD}} ) set( ${basename}_LIBRARIES ${${basename}_LIBRARY_${GOOD}} ) - endif( ${basename}_LIBRARY_${GOOD} AND NOT ${basename}_LIBRARY_${BAD} ) -endmacro( _set_library_name ) + endif() +endmacro() macro( select_library_configurations basename ) # if only the release version was found, set the debug to be the release @@ -61,12 +61,12 @@ macro( select_library_configurations basename ) list( APPEND ${basename}_LIBRARY debug "${_libname}" ) endforeach() set( ${basename}_LIBRARIES "${${basename}_LIBRARY}" ) - else( CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE ) + else() # If there are no configuration types or build type, just use # the release version set( ${basename}_LIBRARY ${${basename}_LIBRARY_RELEASE} ) set( ${basename}_LIBRARIES ${${basename}_LIBRARY_RELEASE} ) - endif( CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE ) + endif() endif() set( ${basename}_LIBRARY ${${basename}_LIBRARY} CACHE FILEPATH @@ -74,10 +74,10 @@ macro( select_library_configurations basename ) if( ${basename}_LIBRARY ) set( ${basename}_FOUND TRUE ) - endif( ${basename}_LIBRARY ) + endif() mark_as_advanced( ${basename}_LIBRARY ${basename}_LIBRARY_RELEASE ${basename}_LIBRARY_DEBUG ) -endmacro( select_library_configurations ) +endmacro() diff --git a/Modules/SquishTestScript.cmake b/Modules/SquishTestScript.cmake index 9eac970..5cdd212 100644 --- a/Modules/SquishTestScript.cmake +++ b/Modules/SquishTestScript.cmake @@ -46,7 +46,7 @@ endforeach() if (QT4_INSTALLED) # record qt lib directory set ( ENV{${SQUISH_LIBQTDIR}} ${squish_libqtdir} ) -endif (QT4_INSTALLED) +endif () # run the test if (WIN32) @@ -54,19 +54,19 @@ if (WIN32) COMMAND ${CMAKE_ROOT}/Modules/SquishRunTestCase.bat ${squish_server_executable} ${squish_client_executable} ${squish_test_case} ${squish_wrapper} ${squish_aut} RESULT_VARIABLE test_rv ) -endif (WIN32) +endif () if (UNIX) execute_process( COMMAND ${CMAKE_ROOT}/Modules/SquishRunTestCase.sh ${squish_server_executable} ${squish_client_executable} ${squish_test_case} ${squish_wrapper} ${squish_aut} RESULT_VARIABLE test_rv ) -endif (UNIX) +endif () # check for an error with running the test if(NOT "${test_rv}" STREQUAL "0") message(FATAL_ERROR "Error running Squish test") -endif(NOT "${test_rv}" STREQUAL "0") +endif() diff --git a/Modules/SystemInformation.cmake b/Modules/SystemInformation.cmake index 73674e6..fa85071 100644 --- a/Modules/SystemInformation.cmake +++ b/Modules/SystemInformation.cmake @@ -32,7 +32,7 @@ file(APPEND "${RESULT_FILE}" get_cmake_property(res VARIABLES) foreach(var ${res}) file(APPEND "${RESULT_FILE}" "${var} \"${${var}}\"\n") -endforeach(var ${res}) +endforeach() file(APPEND "${RESULT_FILE}" "\n=================================================================\n") @@ -43,7 +43,7 @@ file(APPEND "${RESULT_FILE}" get_cmake_property(res COMMANDS) foreach(var ${res}) file(APPEND "${RESULT_FILE}" "${var}\n") -endforeach(var ${res}) +endforeach() file(APPEND "${RESULT_FILE}" "\n=================================================================\n") @@ -55,7 +55,7 @@ file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/AllMacros.txt "") get_cmake_property(res MACROS) foreach(var ${res}) file(APPEND "${RESULT_FILE}" "${var}\n") -endforeach(var ${res}) +endforeach() file(APPEND "${RESULT_FILE}" "\n=================================================================\n") @@ -66,12 +66,12 @@ file(APPEND "${RESULT_FILE}" get_directory_property(res INCLUDE_DIRECTORIES) foreach(var ${res}) file(APPEND "${RESULT_FILE}" "INCLUDE_DIRECTORY: ${var}\n") -endforeach(var) +endforeach() get_directory_property(res LINK_DIRECTORIES) foreach(var ${res}) file(APPEND "${RESULT_FILE}" "LINK_DIRECTORIES: ${var}\n") -endforeach(var) +endforeach() get_directory_property(res INCLUDE_REGULAR_EXPRESSION) file(APPEND "${RESULT_FILE}" "INCLUDE_REGULAR_EXPRESSION: ${res}\n") @@ -89,8 +89,8 @@ macro(DUMP_FILE THE_FILE) file(READ "${THE_FILE}" FILE_CONTENTS LIMIT 50000) file(APPEND "${RESULT_FILE}" "${FILE_CONTENTS}") - endif (EXISTS "${THE_FILE}") -endmacro(DUMP_FILE) + endif () +endmacro() DUMP_FILE("../CMakeCache.txt") DUMP_FILE("../CMakeFiles/CMakeOutput.log") @@ -99,5 +99,5 @@ DUMP_FILE("../CMakeFiles/CMakeSystem.cmake") foreach (EXTRA_FILE ${EXTRA_DUMP_FILES}) DUMP_FILE("${EXTRA_FILE}") -endforeach (EXTRA_FILE) +endforeach () diff --git a/Modules/TestBigEndian.cmake b/Modules/TestBigEndian.cmake index d162f13..193df8f 100644 --- a/Modules/TestBigEndian.cmake +++ b/Modules/TestBigEndian.cmake @@ -28,25 +28,25 @@ macro(TEST_BIG_ENDIAN VARIABLE) if(CMAKE_SIZEOF_UNSIGNED_SHORT EQUAL 2) message(STATUS "Using unsigned short") set(CMAKE_16BIT_TYPE "unsigned short") - else(CMAKE_SIZEOF_UNSIGNED_SHORT EQUAL 2) + else() CHECK_TYPE_SIZE("unsigned int" CMAKE_SIZEOF_UNSIGNED_INT) if(CMAKE_SIZEOF_UNSIGNED_INT) message(STATUS "Using unsigned int") set(CMAKE_16BIT_TYPE "unsigned int") - else(CMAKE_SIZEOF_UNSIGNED_INT) + else() CHECK_TYPE_SIZE("unsigned long" CMAKE_SIZEOF_UNSIGNED_LONG) if(CMAKE_SIZEOF_UNSIGNED_LONG) message(STATUS "Using unsigned long") set(CMAKE_16BIT_TYPE "unsigned long") - else(CMAKE_SIZEOF_UNSIGNED_LONG) + else() message(FATAL_ERROR "no suitable type found") - endif(CMAKE_SIZEOF_UNSIGNED_LONG) + endif() - endif(CMAKE_SIZEOF_UNSIGNED_INT) + endif() - endif(CMAKE_SIZEOF_UNSIGNED_SHORT EQUAL 2) + endif() configure_file("${CMAKE_ROOT}/Modules/TestEndianess.c.in" @@ -76,37 +76,37 @@ macro(TEST_BIG_ENDIAN VARIABLE) if(CMAKE_SYSTEM_PROCESSOR MATCHES powerpc) set(CMAKE_TEST_ENDIANESS_STRINGS_BE TRUE) set(CMAKE_TEST_ENDIANESS_STRINGS_LE FALSE) - else(CMAKE_SYSTEM_PROCESSOR MATCHES powerpc) + else() set(CMAKE_TEST_ENDIANESS_STRINGS_BE FALSE) set(CMAKE_TEST_ENDIANESS_STRINGS_LE TRUE) - endif(CMAKE_SYSTEM_PROCESSOR MATCHES powerpc) + endif() message(STATUS "TEST_BIG_ENDIAN found different results, consider setting CMAKE_OSX_ARCHITECTURES or CMAKE_TRY_COMPILE_OSX_ARCHITECTURES to one or no architecture !") - endif(CMAKE_TEST_ENDIANESS_STRINGS_BE AND CMAKE_TEST_ENDIANESS_STRINGS_LE) + endif() if(CMAKE_TEST_ENDIANESS_STRINGS_LE) set(${VARIABLE} 0 CACHE INTERNAL "Result of TEST_BIG_ENDIAN" FORCE) message(STATUS "Check if the system is big endian - little endian") - endif(CMAKE_TEST_ENDIANESS_STRINGS_LE) + endif() if(CMAKE_TEST_ENDIANESS_STRINGS_BE) set(${VARIABLE} 1 CACHE INTERNAL "Result of TEST_BIG_ENDIAN" FORCE) message(STATUS "Check if the system is big endian - big endian") - endif(CMAKE_TEST_ENDIANESS_STRINGS_BE) + endif() if(NOT CMAKE_TEST_ENDIANESS_STRINGS_BE AND NOT CMAKE_TEST_ENDIANESS_STRINGS_LE) message(SEND_ERROR "TEST_BIG_ENDIAN found no result!") - endif(NOT CMAKE_TEST_ENDIANESS_STRINGS_BE AND NOT CMAKE_TEST_ENDIANESS_STRINGS_LE) + endif() file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log "Determining if the system is big endian passed with the following output:\n${OUTPUT}\nTestEndianess.c:\n${TEST_ENDIANESS_FILE_CONTENT}\n\n") - else(HAVE_${VARIABLE}) + else() message(STATUS "Check if the system is big endian - failed") file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log "Determining if the system is big endian failed with the following output:\n${OUTPUT}\nTestEndianess.c:\n${TEST_ENDIANESS_FILE_CONTENT}\n\n") set(${VARIABLE}) - endif(HAVE_${VARIABLE}) - endif("HAVE_${VARIABLE}" MATCHES "^HAVE_${VARIABLE}$") -endmacro(TEST_BIG_ENDIAN) + endif() + endif() +endmacro() diff --git a/Modules/TestCXXAcceptsFlag.cmake b/Modules/TestCXXAcceptsFlag.cmake index 58623f8..2694737 100644 --- a/Modules/TestCXXAcceptsFlag.cmake +++ b/Modules/TestCXXAcceptsFlag.cmake @@ -33,11 +33,11 @@ macro(CHECK_CXX_ACCEPTS_FLAG FLAGS VARIABLE) file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log "Determining if the CXX compiler accepts the flag ${FLAGS} passed with " "the following output:\n${OUTPUT}\n\n") - else(${VARIABLE}) + else() message(STATUS "Checking to see if CXX compiler accepts flag ${FLAGS} - no") file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log "Determining if the CXX compiler accepts the flag ${FLAGS} failed with " "the following output:\n${OUTPUT}\n\n") - endif(${VARIABLE}) - endif(NOT DEFINED ${VARIABLE}) -endmacro(CHECK_CXX_ACCEPTS_FLAG) + endif() + endif() +endmacro() diff --git a/Modules/TestForANSIForScope.cmake b/Modules/TestForANSIForScope.cmake index d7e2c92..9b4d51c 100644 --- a/Modules/TestForANSIForScope.cmake +++ b/Modules/TestForANSIForScope.cmake @@ -28,15 +28,15 @@ if("CMAKE_ANSI_FOR_SCOPE" MATCHES "^CMAKE_ANSI_FOR_SCOPE$") file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log "Determining if the CXX compiler understands ansi for scopes passed with " "the following output:\n${OUTPUT}\n\n") - else (CMAKE_ANSI_FOR_SCOPE) + else () message(STATUS "Check for ANSI scope - not found") set (CMAKE_NO_ANSI_FOR_SCOPE 1 CACHE INTERNAL "Does the compiler support ansi for scope.") file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log "Determining if the CXX compiler understands ansi for scopes failed with " "the following output:\n${OUTPUT}\n\n") - endif (CMAKE_ANSI_FOR_SCOPE) -endif("CMAKE_ANSI_FOR_SCOPE" MATCHES "^CMAKE_ANSI_FOR_SCOPE$") + endif () +endif() diff --git a/Modules/TestForANSIStreamHeaders.cmake b/Modules/TestForANSIStreamHeaders.cmake index 1ed532e..4aa4023 100644 --- a/Modules/TestForANSIStreamHeaders.cmake +++ b/Modules/TestForANSIStreamHeaders.cmake @@ -23,12 +23,12 @@ if(NOT CMAKE_NO_ANSI_STREAM_HEADERS) if (CMAKE_ANSI_STREAM_HEADERS) set (CMAKE_NO_ANSI_STREAM_HEADERS 0 CACHE INTERNAL "Does the compiler support headers like iostream.") - else (CMAKE_ANSI_STREAM_HEADERS) + else () set (CMAKE_NO_ANSI_STREAM_HEADERS 1 CACHE INTERNAL "Does the compiler support headers like iostream.") - endif (CMAKE_ANSI_STREAM_HEADERS) + endif () mark_as_advanced(CMAKE_NO_ANSI_STREAM_HEADERS) -endif(NOT CMAKE_NO_ANSI_STREAM_HEADERS) +endif() diff --git a/Modules/TestForSSTREAM.cmake b/Modules/TestForSSTREAM.cmake index cdd8091..db39c1e 100644 --- a/Modules/TestForSSTREAM.cmake +++ b/Modules/TestForSSTREAM.cmake @@ -28,15 +28,15 @@ if("CMAKE_HAS_ANSI_STRING_STREAM" MATCHES "^CMAKE_HAS_ANSI_STRING_STREAM$") file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log "Determining if the CXX compiler has sstream passed with " "the following output:\n${OUTPUT}\n\n") - else (CMAKE_HAS_ANSI_STRING_STREAM) + else () message(STATUS "Check for sstream - not found") set (CMAKE_NO_ANSI_STRING_STREAM 1 CACHE INTERNAL "Does the compiler support sstream") file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log "Determining if the CXX compiler has sstream failed with " "the following output:\n${OUTPUT}\n\n") - endif (CMAKE_HAS_ANSI_STRING_STREAM) -endif("CMAKE_HAS_ANSI_STRING_STREAM" MATCHES "^CMAKE_HAS_ANSI_STRING_STREAM$") + endif () +endif() diff --git a/Modules/TestForSTDNamespace.cmake b/Modules/TestForSTDNamespace.cmake index 848aa87..6a75644 100644 --- a/Modules/TestForSTDNamespace.cmake +++ b/Modules/TestForSTDNamespace.cmake @@ -28,15 +28,15 @@ if("CMAKE_STD_NAMESPACE" MATCHES "^CMAKE_STD_NAMESPACE$") file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log "Determining if the CXX compiler has std namespace passed with " "the following output:\n${OUTPUT}\n\n") - else (CMAKE_STD_NAMESPACE) + else () message(STATUS "Check for STD namespace - not found") set (CMAKE_NO_STD_NAMESPACE 1 CACHE INTERNAL "Does the compiler support std::.") file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log "Determining if the CXX compiler has std namespace failed with " "the following output:\n${OUTPUT}\n\n") - endif (CMAKE_STD_NAMESPACE) -endif("CMAKE_STD_NAMESPACE" MATCHES "^CMAKE_STD_NAMESPACE$") + endif () +endif() diff --git a/Modules/UseEcos.cmake b/Modules/UseEcos.cmake index e3e7798..028df82 100644 --- a/Modules/UseEcos.cmake +++ b/Modules/UseEcos.cmake @@ -33,24 +33,24 @@ find_program(ECOSCONFIG_EXECUTABLE NAMES ecosconfig) if(NOT ECOSCONFIG_EXECUTABLE) message(SEND_ERROR "ecosconfig was not found. Either include it in the system path or set it manually using ccmake.") -else(NOT ECOSCONFIG_EXECUTABLE) +else() message(STATUS "Found ecosconfig: ${ECOSCONFIG_EXECUTABLE}") -endif(NOT ECOSCONFIG_EXECUTABLE) +endif() # check that ECOS_REPOSITORY is set correctly if (NOT EXISTS $ENV{ECOS_REPOSITORY}/ecos.db) message(SEND_ERROR "The environment variable ECOS_REPOSITORY is not set correctly. Set it to the directory which contains the file ecos.db") -else (NOT EXISTS $ENV{ECOS_REPOSITORY}/ecos.db) +else () message(STATUS "ECOS_REPOSITORY is set to $ENV{ECOS_REPOSITORY}") -endif (NOT EXISTS $ENV{ECOS_REPOSITORY}/ecos.db) +endif () # check that tclsh (coming with TCL) is available, otherwise ecosconfig doesn't work find_package(Tclsh) if (NOT TCL_TCLSH) message(SEND_ERROR "The TCL tclsh was not found. Please install TCL, it is required for building eCos applications.") -else (NOT TCL_TCLSH) +else () message(STATUS "tlcsh found: ${TCL_TCLSH}") -endif (NOT TCL_TCLSH) +endif () #add the globale include-diretories #usage: ECOS_ADD_INCLUDE_DIRECTORIES() @@ -58,14 +58,14 @@ macro(ECOS_ADD_INCLUDE_DIRECTORIES) #check for ProjectSources.txt one level higher if (EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/../ProjectSources.txt) include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../) - else (EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/../ProjectSources.txt) + else () include_directories(${CMAKE_CURRENT_SOURCE_DIR}/) - endif (EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/../ProjectSources.txt) + endif () #the ecos include directory include_directories(${CMAKE_CURRENT_BINARY_DIR}/ecos/install/include/) -endmacro(ECOS_ADD_INCLUDE_DIRECTORIES) +endmacro() #we want to compile for the xscale processor, in this case the following macro has to be called @@ -82,7 +82,7 @@ macro (ECOS_USE_ARM_ELF_TOOLS) add_definitions(-mcpu=xscale -mapcs-frame) #for the obj-tools set(ECOS_ARCH_PREFIX "arm-elf-") -endmacro (ECOS_USE_ARM_ELF_TOOLS) +endmacro () #usage: ECOS_USE_PPC_EABI_TOOLS() macro (ECOS_USE_PPC_EABI_TOOLS) @@ -97,7 +97,7 @@ macro (ECOS_USE_PPC_EABI_TOOLS) add_definitions() #for the obj-tools set(ECOS_ARCH_PREFIX "powerpc-eabi-") -endmacro (ECOS_USE_PPC_EABI_TOOLS) +endmacro () #usage: ECOS_USE_I386_ELF_TOOLS() macro (ECOS_USE_I386_ELF_TOOLS) @@ -112,7 +112,7 @@ macro (ECOS_USE_I386_ELF_TOOLS) add_definitions() #for the obj-tools set(ECOS_ARCH_PREFIX "i386-elf-") -endmacro (ECOS_USE_I386_ELF_TOOLS) +endmacro () #since the actual sources are located one level upwards @@ -126,10 +126,10 @@ macro(ECOS_ADJUST_DIRECTORY _target_FILES ) get_filename_component(_abs_FILE ${_current_FILE} ABSOLUTE) if (NOT ${_abs_FILE} STREQUAL ${_current_FILE}) get_filename_component(_abs_FILE ${CMAKE_CURRENT_SOURCE_DIR}/../${_current_FILE} ABSOLUTE) - endif (NOT ${_abs_FILE} STREQUAL ${_current_FILE}) + endif () list(APPEND ${_target_FILES} ${_abs_FILE}) - endforeach (_current_FILE) -endmacro(ECOS_ADJUST_DIRECTORY) + endforeach () +endmacro() # the default ecos config file name # maybe in the future also out-of-source builds may be possible @@ -141,7 +141,7 @@ macro(ECOS_ADD_TARGET_LIB) # when building out-of-source, create the ecos/ subdir if(NOT EXISTS ${CMAKE_CURRENT_BINARY_DIR}/ecos) file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/ecos) - endif(NOT EXISTS ${CMAKE_CURRENT_BINARY_DIR}/ecos) + endif() #sources depend on target.ld set_source_files_properties( @@ -162,7 +162,7 @@ macro(ECOS_ADD_TARGET_LIB) ) add_custom_target( ecos make -C ${CMAKE_CURRENT_BINARY_DIR}/ecos/ DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/ecos/makefile ) -endmacro(ECOS_ADD_TARGET_LIB) +endmacro() # get the directory of the current file, used later on in the file get_filename_component( ECOS_CMAKE_MODULE_DIR ${CMAKE_CURRENT_LIST_FILE} PATH) @@ -232,5 +232,5 @@ macro(ECOS_ADD_EXECUTABLE _exe_NAME ) COMMAND echo -e \"\\n--- Full assembly listing ---\\n\" >> ${CMAKE_CURRENT_BINARY_DIR}/${_exe_NAME}.lst COMMAND ${ECOS_ARCH_PREFIX}objdump -S -x -d -C ${CMAKE_CURRENT_BINARY_DIR}/${_exe_NAME}.elf >> ${CMAKE_CURRENT_BINARY_DIR}/${_exe_NAME}.lst ) -endmacro(ECOS_ADD_EXECUTABLE) +endmacro() diff --git a/Modules/UseJava.cmake b/Modules/UseJava.cmake index 0b2d1b8..1b823a8 100644 --- a/Modules/UseJava.cmake +++ b/Modules/UseJava.cmake @@ -198,7 +198,7 @@ function (__java_copy_file src dest comment) ${dest} DEPENDS ${src} COMMENT ${comment}) -endfunction (__java_copy_file src dest comment) +endfunction () # define helper scripts set(_JAVA_CLASS_FILELIST_SCRIPT ${CMAKE_CURRENT_LIST_DIR}/UseJavaClassFilelist.cmake) @@ -209,18 +209,18 @@ function(add_jar _TARGET_NAME) if (NOT DEFINED CMAKE_JAVA_TARGET_OUTPUT_DIR) set(CMAKE_JAVA_TARGET_OUTPUT_DIR ${CMAKE_CURRENT_BINARY_DIR}) - endif(NOT DEFINED CMAKE_JAVA_TARGET_OUTPUT_DIR) + endif() if (CMAKE_JAVA_JAR_ENTRY_POINT) set(_ENTRY_POINT_OPTION e) set(_ENTRY_POINT_VALUE ${CMAKE_JAVA_JAR_ENTRY_POINT}) - endif (CMAKE_JAVA_JAR_ENTRY_POINT) + endif () if (LIBRARY_OUTPUT_PATH) set(CMAKE_JAVA_LIBRARY_OUTPUT_PATH ${LIBRARY_OUTPUT_PATH}) - else (LIBRARY_OUTPUT_PATH) + else () set(CMAKE_JAVA_LIBRARY_OUTPUT_PATH ${CMAKE_JAVA_TARGET_OUTPUT_DIR}) - endif (LIBRARY_OUTPUT_PATH) + endif () set(CMAKE_JAVA_INCLUDE_PATH ${CMAKE_JAVA_INCLUDE_PATH} @@ -231,13 +231,13 @@ function(add_jar _TARGET_NAME) if (WIN32 AND NOT CYGWIN) set(CMAKE_JAVA_INCLUDE_FLAG_SEP ";") - else (WIN32 AND NOT CYGWIN) + else () set(CMAKE_JAVA_INCLUDE_FLAG_SEP ":") - endif(WIN32 AND NOT CYGWIN) + endif() foreach (JAVA_INCLUDE_DIR ${CMAKE_JAVA_INCLUDE_PATH}) set(CMAKE_JAVA_INCLUDE_PATH_FINAL "${CMAKE_JAVA_INCLUDE_PATH_FINAL}${CMAKE_JAVA_INCLUDE_FLAG_SEP}${JAVA_INCLUDE_DIR}") - endforeach(JAVA_INCLUDE_DIR) + endforeach() set(CMAKE_JAVA_CLASS_OUTPUT_PATH "${CMAKE_JAVA_TARGET_OUTPUT_DIR}${CMAKE_FILES_DIRECTORY}/${_TARGET_NAME}.dir") @@ -250,7 +250,7 @@ function(add_jar _TARGET_NAME) set(_JAVA_TARGET_OUTPUT_LINK "${_TARGET_NAME}.jar") elseif (CMAKE_JAVA_TARGET_OUTPUT_NAME) set(_JAVA_TARGET_OUTPUT_NAME "${CMAKE_JAVA_TARGET_OUTPUT_NAME}.jar") - endif (CMAKE_JAVA_TARGET_OUTPUT_NAME AND CMAKE_JAVA_TARGET_VERSION) + endif () # reset set(CMAKE_JAVA_TARGET_OUTPUT_NAME) @@ -270,9 +270,9 @@ function(add_jar _TARGET_NAME) string(LENGTH ${_JAVA_REL_SOURCE_PATH} _SRC_LEN) if (${_BIN_LEN} LESS ${_SRC_LEN}) set(_JAVA_REL_PATH ${_JAVA_REL_BINARY_PATH}) - else (${_BIN_LEN} LESS ${_SRC_LEN}) + else () set(_JAVA_REL_PATH ${_JAVA_REL_SOURCE_PATH}) - endif (${_BIN_LEN} LESS ${_SRC_LEN}) + endif () get_filename_component(_JAVA_REL_PATH ${_JAVA_REL_PATH} PATH) if (_JAVA_EXT MATCHES ".java") @@ -290,13 +290,13 @@ function(add_jar _TARGET_NAME) list(APPEND CMAKE_JAVA_INCLUDE_PATH ${JAVA_JAR_TARGET_${_JAVA_SOURCE_FILE}} ${JAVA_JAR_TARGET_${_JAVA_SOURCE_FILE}_CLASSPATH}) list(APPEND _JAVA_DEPENDS ${JAVA_JAR_TARGET_${_JAVA_SOURCE_FILE}}) - else (_JAVA_EXT MATCHES ".java") + else () __java_copy_file(${CMAKE_CURRENT_SOURCE_DIR}/${_JAVA_SOURCE_FILE} ${CMAKE_JAVA_CLASS_OUTPUT_PATH}/${_JAVA_SOURCE_FILE} "Copying ${_JAVA_SOURCE_FILE} to the build directory") list(APPEND _JAVA_RESOURCE_FILES ${_JAVA_SOURCE_FILE}) - endif (_JAVA_EXT MATCHES ".java") - endforeach(_JAVA_SOURCE_FILE) + endif () + endforeach() # create an empty java_class_filelist if (NOT EXISTS ${CMAKE_JAVA_CLASS_OUTPUT_PATH}/java_class_filelist) @@ -327,7 +327,7 @@ function(add_jar _TARGET_NAME) DEPENDS ${CMAKE_JAVA_CLASS_OUTPUT_PATH}/java_compiled_${_TARGET_NAME} WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} ) - endif (_JAVA_COMPILE_FILES) + endif () # create the jar file set(_JAVA_JAR_OUTPUT_PATH @@ -367,7 +367,7 @@ function(add_jar _TARGET_NAME) DEPENDS ${_JAVA_RESOURCE_FILES} ${_JAVA_DEPENDS} ${CMAKE_JAVA_CLASS_OUTPUT_PATH}/java_class_filelist COMMENT "Creating Java archive ${_JAVA_TARGET_OUTPUT_NAME}" ) - endif (CMAKE_JNI_TARGET) + endif () # Add the target and make sure we have the latest resource files. add_custom_target(${_TARGET_NAME} ALL DEPENDS ${_JAVA_JAR_OUTPUT_PATH}) @@ -398,8 +398,8 @@ function(add_jar _TARGET_NAME) JNI_SYMLINK ${CMAKE_JAVA_TARGET_OUTPUT_DIR}/${_JAVA_TARGET_OUTPUT_LINK} ) - endif (CMAKE_JNI_TARGET) - endif (_JAVA_TARGET_OUTPUT_LINK) + endif () + endif () set_property( TARGET @@ -417,7 +417,7 @@ function(add_jar _TARGET_NAME) ${CMAKE_JAVA_CLASS_OUTPUT_PATH} ) -endfunction(add_jar) +endfunction() function(INSTALL_JAR _TARGET_NAME _DESTINATION) get_property(__FILES @@ -434,10 +434,10 @@ function(INSTALL_JAR _TARGET_NAME _DESTINATION) DESTINATION ${_DESTINATION} ) - else (__FILES) + else () message(SEND_ERROR "The target ${_TARGET_NAME} is not known in this scope.") - endif (__FILES) -endfunction(INSTALL_JAR _TARGET_NAME _DESTINATION) + endif () +endfunction() function(INSTALL_JNI_SYMLINK _TARGET_NAME _DESTINATION) get_property(__SYMLINK @@ -454,10 +454,10 @@ function(INSTALL_JNI_SYMLINK _TARGET_NAME _DESTINATION) DESTINATION ${_DESTINATION} ) - else (__SYMLINK) + else () message(SEND_ERROR "The target ${_TARGET_NAME} is not known in this scope.") - endif (__SYMLINK) -endfunction(INSTALL_JNI_SYMLINK _TARGET_NAME _DESTINATION) + endif () +endfunction() function (find_jar VARIABLE) set(_jar_names) @@ -481,12 +481,12 @@ function (find_jar VARIABLE) set(_state "paths") elseif (${arg} STREQUAL "DOC") set(_state "doc") - else (${arg} STREQUAL "NAMES") + else () set(_jar_names ${arg}) if (_jar_doc STREQUAL "NOTSET") set(_jar_doc "Finding ${arg} jar") - endif (_jar_doc STREQUAL "NOTSET") - endif (${arg} STREQUAL "VERSIONS") + endif () + endif () elseif (${_state} STREQUAL "versions") if (${arg} STREQUAL "NAMES") set(_state "names") @@ -494,9 +494,9 @@ function (find_jar VARIABLE) set(_state "paths") elseif (${arg} STREQUAL "DOC") set(_state "doc") - else (${arg} STREQUAL "NAMES") + else () set(_jar_versions ${_jar_versions} ${arg}) - endif (${arg} STREQUAL "NAMES") + endif () elseif (${_state} STREQUAL "names") if (${arg} STREQUAL "VERSIONS") set(_state "versions") @@ -504,12 +504,12 @@ function (find_jar VARIABLE) set(_state "paths") elseif (${arg} STREQUAL "DOC") set(_state "doc") - else (${arg} STREQUAL "VERSIONS") + else () set(_jar_names ${_jar_names} ${arg}) if (_jar_doc STREQUAL "NOTSET") set(_jar_doc "Finding ${arg} jar") - endif (_jar_doc STREQUAL "NOTSET") - endif (${arg} STREQUAL "VERSIONS") + endif () + endif () elseif (${_state} STREQUAL "paths") if (${arg} STREQUAL "VERSIONS") set(_state "versions") @@ -517,9 +517,9 @@ function (find_jar VARIABLE) set(_state "names") elseif (${arg} STREQUAL "DOC") set(_state "doc") - else (${arg} STREQUAL "VERSIONS") + else () set(_jar_paths ${_jar_paths} ${arg}) - endif (${arg} STREQUAL "VERSIONS") + endif () elseif (${_state} STREQUAL "doc") if (${arg} STREQUAL "VERSIONS") set(_state "versions") @@ -527,29 +527,29 @@ function (find_jar VARIABLE) set(_state "names") elseif (${arg} STREQUAL "PATHS") set(_state "paths") - else (${arg} STREQUAL "VERSIONS") + else () set(_jar_doc ${arg}) - endif (${arg} STREQUAL "VERSIONS") - endif (${_state} STREQUAL "name") - endforeach (arg ${ARGN}) + endif () + endif () + endforeach () if (NOT _jar_names) message(FATAL_ERROR "find_jar: No name to search for given") - endif (NOT _jar_names) + endif () foreach (jar_name ${_jar_names}) foreach (version ${_jar_versions}) set(_jar_files ${_jar_files} ${jar_name}-${version}.jar) - endforeach (version ${_jar_versions}) + endforeach () set(_jar_files ${_jar_files} ${jar_name}.jar) - endforeach (jar_name ${_jar_names}) + endforeach () find_file(${VARIABLE} NAMES ${_jar_files} PATHS ${_jar_paths} DOC ${_jar_doc} NO_DEFAULT_PATH) -endfunction (find_jar VARIABLE) +endfunction () function(create_javadoc _target) set(_javadoc_packages) @@ -815,8 +815,8 @@ function(create_javadoc _target) else () set(_javadoc_version ${arg}) endif () - endif (${_state} STREQUAL "package") - endforeach (arg ${ARGN}) + endif () + endforeach () set(_javadoc_builddir ${CMAKE_CURRENT_BINARY_DIR}/javadoc/${_target}) set(_javadoc_options -d ${_javadoc_builddir}) @@ -827,12 +827,12 @@ function(create_javadoc _target) if (_start) set(_sourcepath ${_path}) set(_start FALSE) - else (_start) + else () set(_sourcepath ${_sourcepath}:${_path}) - endif (_start) - endforeach(_path ${_javadoc_sourcepath}) + endif () + endforeach() set(_javadoc_options ${_javadoc_options} -sourcepath ${_sourcepath}) - endif (_javadoc_sourcepath) + endif () if (_javadoc_classpath) set(_start TRUE) @@ -840,32 +840,32 @@ function(create_javadoc _target) if (_start) set(_classpath ${_path}) set(_start FALSE) - else (_start) + else () set(_classpath ${_classpath}:${_path}) - endif (_start) - endforeach(_path ${_javadoc_classpath}) + endif () + endforeach() set(_javadoc_options ${_javadoc_options} -classpath "${_classpath}") - endif (_javadoc_classpath) + endif () if (_javadoc_doctitle) set(_javadoc_options ${_javadoc_options} -doctitle '${_javadoc_doctitle}') - endif (_javadoc_doctitle) + endif () if (_javadoc_windowtitle) set(_javadoc_options ${_javadoc_options} -windowtitle '${_javadoc_windowtitle}') - endif (_javadoc_windowtitle) + endif () if (_javadoc_author) set(_javadoc_options ${_javadoc_options} -author) - endif (_javadoc_author) + endif () if (_javadoc_use) set(_javadoc_options ${_javadoc_options} -use) - endif (_javadoc_use) + endif () if (_javadoc_version) set(_javadoc_options ${_javadoc_options} -version) - endif (_javadoc_version) + endif () add_custom_target(${_target}_javadoc ALL COMMAND ${Java_JAVADOC_EXECUTABLE} ${_javadoc_options} @@ -878,4 +878,4 @@ function(create_javadoc _target) DIRECTORY ${_javadoc_builddir} DESTINATION ${_javadoc_installpath} ) -endfunction(create_javadoc) +endfunction() diff --git a/Modules/UseJavaClassFilelist.cmake b/Modules/UseJavaClassFilelist.cmake index c842bf7..6f3a4e7 100644 --- a/Modules/UseJavaClassFilelist.cmake +++ b/Modules/UseJavaClassFilelist.cmake @@ -28,25 +28,25 @@ if (CMAKE_JAVA_CLASS_OUTPUT_PATH) file(GLOB_RECURSE _JAVA_GLOBBED_TMP_FILES "${CMAKE_JAVA_CLASS_OUTPUT_PATH}/${JAR_CLASS_PREFIX}/*.class") if (_JAVA_GLOBBED_TMP_FILES) list(APPEND _JAVA_GLOBBED_FILES ${_JAVA_GLOBBED_TMP_FILES}) - endif (_JAVA_GLOBBED_TMP_FILES) - endforeach(JAR_CLASS_PREFIX ${CMAKE_JAR_CLASSES_PREFIX}) + endif () + endforeach() else() file(GLOB_RECURSE _JAVA_GLOBBED_FILES "${CMAKE_JAVA_CLASS_OUTPUT_PATH}/*.class") - endif (CMAKE_JAR_CLASSES_PREFIX) + endif () set(_JAVA_CLASS_FILES) # file(GLOB_RECURSE foo RELATIVE) is broken so we need this. foreach(_JAVA_GLOBBED_FILE ${_JAVA_GLOBBED_FILES}) file(RELATIVE_PATH _JAVA_CLASS_FILE ${CMAKE_JAVA_CLASS_OUTPUT_PATH} ${_JAVA_GLOBBED_FILE}) set(_JAVA_CLASS_FILES ${_JAVA_CLASS_FILES}${_JAVA_CLASS_FILE}\n) - endforeach(_JAVA_GLOBBED_FILE ${_JAVA_GLOBBED_FILES}) + endforeach() # write to file file(WRITE ${CMAKE_JAVA_CLASS_OUTPUT_PATH}/java_class_filelist ${_JAVA_CLASS_FILES}) - else (EXISTS "${CMAKE_JAVA_CLASS_OUTPUT_PATH}") + else () message(SEND_ERROR "FATAL: Java class output path doesn't exist") - endif (EXISTS "${CMAKE_JAVA_CLASS_OUTPUT_PATH}") -else (CMAKE_JAVA_CLASS_OUTPUT_PATH) + endif () +else () message(SEND_ERROR "FATAL: Can't find CMAKE_JAVA_CLASS_OUTPUT_PATH") -endif (CMAKE_JAVA_CLASS_OUTPUT_PATH) +endif () diff --git a/Modules/UseJavaSymlinks.cmake b/Modules/UseJavaSymlinks.cmake index c66ee1e..88dd768 100644 --- a/Modules/UseJavaSymlinks.cmake +++ b/Modules/UseJavaSymlinks.cmake @@ -26,7 +26,7 @@ if (UNIX AND _JAVA_TARGET_OUTPUT_LINK) COMMAND ${LN_EXECUTABLE} -sf "${_JAVA_TARGET_OUTPUT_NAME}" "${_JAVA_TARGET_OUTPUT_LINK}" WORKING_DIRECTORY ${_JAVA_TARGET_DIR} ) - else (_JAVA_TARGET_OUTPUT_NAME) + else () message(SEND_ERROR "FATAL: Can't find _JAVA_TARGET_OUTPUT_NAME") - endif (_JAVA_TARGET_OUTPUT_NAME) -endif (UNIX AND _JAVA_TARGET_OUTPUT_LINK) + endif () +endif () diff --git a/Modules/UsePkgConfig.cmake b/Modules/UsePkgConfig.cmake index b4517f7..b1569f9 100644 --- a/Modules/UsePkgConfig.cmake +++ b/Modules/UsePkgConfig.cmake @@ -60,19 +60,19 @@ macro(PKGCONFIG _package _include_DIR _link_DIR _link_FLAGS _cflags) OUTPUT_VARIABLE ${_cflags} ) string(REGEX REPLACE "[\r\n]" " " ${_cflags} "${${_cflags}}") - else( NOT _return_VALUE) + else() message(STATUS "PKGCONFIG() indicates that ${_package} is not installed (install the package which contains ${_package}.pc if you want to support this feature)") - endif(NOT _return_VALUE) + endif() # if pkg-config has NOT been found, INFORM the user - else(PKGCONFIG_EXECUTABLE) + else() message(STATUS "WARNING: PKGCONFIG() indicates that the tool pkg-config has not been found on your system. You should install it.") - endif(PKGCONFIG_EXECUTABLE) + endif() -endmacro(PKGCONFIG _include_DIR _link_DIR _link_FLAGS _cflags) +endmacro() mark_as_advanced(PKGCONFIG_EXECUTABLE) diff --git a/Modules/UseQt4.cmake b/Modules/UseQt4.cmake index 260c3cd..e8166f4 100644 --- a/Modules/UseQt4.cmake +++ b/Modules/UseQt4.cmake @@ -33,24 +33,24 @@ set(QT_LIBRARIES_PLUGINS "") if (QT_USE_QTMAIN) if (Q_WS_WIN) set(QT_LIBRARIES ${QT_LIBRARIES} ${QT_QTMAIN_LIBRARY}) - endif (Q_WS_WIN) -endif (QT_USE_QTMAIN) + endif () +endif () if(QT_DONT_USE_QTGUI) set(QT_USE_QTGUI 0) -else(QT_DONT_USE_QTGUI) +else() set(QT_USE_QTGUI 1) -endif(QT_DONT_USE_QTGUI) +endif() if(QT_DONT_USE_QTCORE) set(QT_USE_QTCORE 0) -else(QT_DONT_USE_QTCORE) +else() set(QT_USE_QTCORE 1) -endif(QT_DONT_USE_QTCORE) +endif() if (QT_USE_QT3SUPPORT) add_definitions(-DQT3_SUPPORT) -endif (QT_USE_QT3SUPPORT) +endif () # list dependent modules, so dependent libraries are added set(QT_QT3SUPPORT_MODULE_DEPENDS QTGUI QTSQL QTXML QTNETWORK QTCORE) @@ -59,9 +59,9 @@ set(QT_QTUITOOLS_MODULE_DEPENDS QTGUI QTXML QTCORE) set(QT_QTHELP_MODULE_DEPENDS QTGUI QTSQL QTXML QTNETWORK QTCORE) if(QT_QTDBUS_FOUND) set(QT_PHONON_MODULE_DEPENDS QTGUI QTDBUS QTCORE) -else(QT_QTDBUS_FOUND) +else() set(QT_PHONON_MODULE_DEPENDS QTGUI QTCORE) -endif(QT_QTDBUS_FOUND) +endif() set(QT_QTDBUS_MODULE_DEPENDS QTXML QTCORE) set(QT_QTXMLPATTERNS_MODULE_DEPENDS QTNETWORK QTCORE) set(QT_QAXCONTAINER_MODULE_DEPENDS QTGUI QTCORE) @@ -90,19 +90,19 @@ foreach(module QT3SUPPORT QTOPENGL QTASSISTANT QTDESIGNER QTMOTIF QTNSPLUGIN string(REPLACE "QT" "" qt_module_def "${module}") add_definitions(-DQT_${qt_module_def}_LIB) include_directories(${QT_${module}_INCLUDE_DIR}) - endif(QT_USE_${module}) + endif() set(QT_LIBRARIES ${QT_LIBRARIES} ${QT_${module}_LIBRARY}) set(QT_LIBRARIES_PLUGINS ${QT_LIBRARIES_PLUGINS} ${QT_${module}_PLUGINS}) if(QT_IS_STATIC) set(QT_LIBRARIES ${QT_LIBRARIES} ${QT_${module}_LIB_DEPENDENCIES}) - endif(QT_IS_STATIC) + endif() foreach(depend_module ${QT_${module}_MODULE_DEPENDS}) set(QT_USE_${depend_module}_DEPENDS 1) - endforeach(depend_module ${QT_${module}_MODULE_DEPENDS}) - else (QT_${module}_FOUND) + endforeach() + else () message("Qt ${module} library not found.") - endif (QT_${module}_FOUND) - endif (QT_USE_${module} OR QT_USE_${module}_DEPENDS) + endif () + endif () -endforeach(module) +endforeach() diff --git a/Modules/UseSWIG.cmake b/Modules/UseSWIG.cmake index e4e72c2..2a09585 100644 --- a/Modules/UseSWIG.cmake +++ b/Modules/UseSWIG.cmake @@ -58,7 +58,7 @@ macro(SWIG_MODULE_INITIALIZE name language) elseif("${SWIG_MODULE_${name}_LANGUAGE}" STREQUAL "PERL") set(SWIG_MODULE_${name}_EXTRA_FLAGS "-shadow") endif() -endmacro(SWIG_MODULE_INITIALIZE) +endmacro() # # For a given language, input file, and output file, determine extra files that @@ -71,12 +71,12 @@ macro(SWIG_GET_EXTRA_OUTPUT_FILES language outfiles generatedpath infile) ${infile} SWIG_MODULE_NAME) if(SWIG_GET_EXTRA_OUTPUT_FILES_module_basename STREQUAL "NOTFOUND") get_filename_component(SWIG_GET_EXTRA_OUTPUT_FILES_module_basename "${infile}" NAME_WE) - endif(SWIG_GET_EXTRA_OUTPUT_FILES_module_basename STREQUAL "NOTFOUND") + endif() foreach(it ${SWIG_${language}_EXTRA_FILE_EXTENSION}) set(${outfiles} ${${outfiles}} "${generatedpath}/${SWIG_GET_EXTRA_OUTPUT_FILES_module_basename}.${it}") - endforeach(it) -endmacro(SWIG_GET_EXTRA_OUTPUT_FILES) + endforeach() +endmacro() # # Take swig (*.i) file and add proper custom commands for it @@ -90,42 +90,42 @@ macro(SWIG_ADD_SOURCE_TO_MODULE name outfiles infile) get_source_file_property(swig_source_file_flags ${infile} SWIG_FLAGS) if("${swig_source_file_flags}" STREQUAL "NOTFOUND") set(swig_source_file_flags "") - endif("${swig_source_file_flags}" STREQUAL "NOTFOUND") + endif() set(swig_source_file_fullname "${infile}") if(${swig_source_file_path} MATCHES "^${CMAKE_CURRENT_SOURCE_DIR}") string(REGEX REPLACE "^${CMAKE_CURRENT_SOURCE_DIR}" "" swig_source_file_relative_path "${swig_source_file_path}") - else(${swig_source_file_path} MATCHES "^${CMAKE_CURRENT_SOURCE_DIR}") + else() if(${swig_source_file_path} MATCHES "^${CMAKE_CURRENT_BINARY_DIR}") string(REGEX REPLACE "^${CMAKE_CURRENT_BINARY_DIR}" "" swig_source_file_relative_path "${swig_source_file_path}") set(swig_source_file_generated 1) - else(${swig_source_file_path} MATCHES "^${CMAKE_CURRENT_BINARY_DIR}") + else() set(swig_source_file_relative_path "${swig_source_file_path}") if(swig_source_file_generated) set(swig_source_file_fullname "${CMAKE_CURRENT_BINARY_DIR}/${infile}") - else(swig_source_file_generated) + else() set(swig_source_file_fullname "${CMAKE_CURRENT_SOURCE_DIR}/${infile}") - endif(swig_source_file_generated) - endif(${swig_source_file_path} MATCHES "^${CMAKE_CURRENT_BINARY_DIR}") - endif(${swig_source_file_path} MATCHES "^${CMAKE_CURRENT_SOURCE_DIR}") + endif() + endif() + endif() set(swig_generated_file_fullname "${CMAKE_CURRENT_BINARY_DIR}") if(swig_source_file_relative_path) set(swig_generated_file_fullname "${swig_generated_file_fullname}/${swig_source_file_relative_path}") - endif(swig_source_file_relative_path) + endif() # If CMAKE_SWIG_OUTDIR was specified then pass it to -outdir if(CMAKE_SWIG_OUTDIR) set(swig_outdir ${CMAKE_SWIG_OUTDIR}) - else(CMAKE_SWIG_OUTDIR) + else() set(swig_outdir ${CMAKE_CURRENT_BINARY_DIR}) - endif(CMAKE_SWIG_OUTDIR) + endif() SWIG_GET_EXTRA_OUTPUT_FILES(${SWIG_MODULE_${name}_LANGUAGE} swig_extra_generated_files "${swig_outdir}" @@ -140,10 +140,10 @@ macro(SWIG_ADD_SOURCE_TO_MODULE name outfiles infile) if(swig_source_file_cplusplus) set(swig_generated_file_fullname "${swig_generated_file_fullname}.${SWIG_CXX_EXTENSION}") - else(swig_source_file_cplusplus) + else() set(swig_generated_file_fullname "${swig_generated_file_fullname}.c") - endif(swig_source_file_cplusplus) + endif() #message("Full path to source file: ${swig_source_file_fullname}") #message("Full path to the output file: ${swig_generated_file_fullname}") @@ -151,17 +151,17 @@ macro(SWIG_ADD_SOURCE_TO_MODULE name outfiles infile) set(swig_include_dirs) foreach(it ${cmake_include_directories}) set(swig_include_dirs ${swig_include_dirs} "-I${it}") - endforeach(it) + endforeach() set(swig_special_flags) # default is c, so add c++ flag if it is c++ if(swig_source_file_cplusplus) set(swig_special_flags ${swig_special_flags} "-c++") - endif(swig_source_file_cplusplus) + endif() set(swig_extra_flags) if(SWIG_MODULE_${name}_EXTRA_FLAGS) set(swig_extra_flags ${swig_extra_flags} ${SWIG_MODULE_${name}_EXTRA_FLAGS}) - endif(SWIG_MODULE_${name}_EXTRA_FLAGS) + endif() add_custom_command( OUTPUT "${swig_generated_file_fullname}" ${swig_extra_generated_files} # Let's create the ${swig_outdir} at execution time, in case dir contains $(OutDir) @@ -182,7 +182,7 @@ macro(SWIG_ADD_SOURCE_TO_MODULE name outfiles infile) set_source_files_properties("${swig_generated_file_fullname}" ${swig_extra_generated_files} PROPERTIES GENERATED 1) set(${outfiles} "${swig_generated_file_fullname}" ${swig_extra_generated_files}) -endmacro(SWIG_ADD_SOURCE_TO_MODULE) +endmacro() # # Create Swig module @@ -194,16 +194,16 @@ macro(SWIG_ADD_MODULE name language) foreach(it ${ARGN}) if(${it} MATCHES ".*\\.i$") set(swig_dot_i_sources ${swig_dot_i_sources} "${it}") - else(${it} MATCHES ".*\\.i$") + else() set(swig_other_sources ${swig_other_sources} "${it}") - endif(${it} MATCHES ".*\\.i$") - endforeach(it) + endif() + endforeach() set(swig_generated_sources) foreach(it ${swig_dot_i_sources}) SWIG_ADD_SOURCE_TO_MODULE(${name} swig_generated_source ${it}) set(swig_generated_sources ${swig_generated_sources} "${swig_generated_source}") - endforeach(it) + endforeach() get_directory_property(swig_extra_clean_files ADDITIONAL_MAKE_CLEAN_FILES) set_directory_properties(PROPERTIES ADDITIONAL_MAKE_CLEAN_FILES "${swig_extra_clean_files};${swig_generated_sources}") @@ -221,8 +221,8 @@ macro(SWIG_ADD_MODULE name language) # Windows: LIBRARY.dll # Linux : libLIBRARY.so set_target_properties (${SWIG_MODULE_${name}_REAL_NAME} PROPERTIES SUFFIX ".jnilib") - endif (APPLE) - endif ("${swig_lowercase_language}" STREQUAL "java") + endif () + endif () if ("${swig_lowercase_language}" STREQUAL "python") # this is only needed for the python case where a _modulename.so is generated set_target_properties(${SWIG_MODULE_${name}_REAL_NAME} PROPERTIES PREFIX "") @@ -236,9 +236,9 @@ macro(SWIG_ADD_MODULE name language) # </quote> if(WIN32 AND NOT CYGWIN) set_target_properties(${SWIG_MODULE_${name}_REAL_NAME} PROPERTIES SUFFIX ".pyd") - endif(WIN32 AND NOT CYGWIN) - endif ("${swig_lowercase_language}" STREQUAL "python") -endmacro(SWIG_ADD_MODULE) + endif() + endif () +endmacro() # # Like TARGET_LINK_LIBRARIES but for swig modules @@ -246,8 +246,8 @@ endmacro(SWIG_ADD_MODULE) macro(SWIG_LINK_LIBRARIES name) if(SWIG_MODULE_${name}_REAL_NAME) target_link_libraries(${SWIG_MODULE_${name}_REAL_NAME} ${ARGN}) - else(SWIG_MODULE_${name}_REAL_NAME) + else() message(SEND_ERROR "Cannot find Swig library \"${name}\".") - endif(SWIG_MODULE_${name}_REAL_NAME) -endmacro(SWIG_LINK_LIBRARIES name) + endif() +endmacro() diff --git a/Modules/UseVTKConfig40.cmake b/Modules/UseVTKConfig40.cmake index 549a792..554b8c4 100644 --- a/Modules/UseVTKConfig40.cmake +++ b/Modules/UseVTKConfig40.cmake @@ -160,28 +160,28 @@ set(VTK_WRAP_TCL ${VTK40_VTK_WRAP_TCL}) set(VTK_KITS COMMON FILTERING GRAPHICS IMAGING IO) if(VTK_USE_RENDERING) set(VTK_KITS ${VTK_KITS} RENDERING) -endif(VTK_USE_RENDERING) +endif() if(VTK_USE_HYBRID) set(VTK_KITS ${VTK_KITS} HYBRID) -endif(VTK_USE_HYBRID) +endif() if(VTK_USE_PARALLEL) set(VTK_KITS ${VTK_KITS} PARALLEL) -endif(VTK_USE_PARALLEL) +endif() if(VTK_USE_PATENTED) set(VTK_KITS ${VTK_KITS} PATENTED) -endif(VTK_USE_PATENTED) +endif() # Create the list of available languages. set(VTK_LANGUAGES "") if(VTK_WRAP_TCL) set(VTK_LANGUAGES ${VTK_LANGUAGES} TCL) -endif(VTK_WRAP_TCL) +endif() if(VTK_WRAP_PYTHON) set(VTK_LANGUAGES ${VTK_LANGUAGES} PYTHON) -endif(VTK_WRAP_PYTHON) +endif() if(VTK_WRAP_JAVA) set(VTK_LANGUAGES ${VTK_LANGUAGES} JAVA) -endif(VTK_WRAP_JAVA) +endif() # Include directories for other projects installed on the system and # used by VTK. @@ -192,40 +192,40 @@ if(VTK_USE_RENDERING) if(VTK_USE_X) set(VTK_INCLUDE_DIRS_SYS ${VTK_INCLUDE_DIRS_SYS} ${VTK40_CMAKE_Xlib_INCLUDE_PATH} ${VTK40_CMAKE_Xutil_INCLUDE_PATH}) - endif(VTK_USE_X) -endif(VTK_USE_RENDERING) + endif() +endif() if(VTK_OPENGL_HAS_OSMESA) set(VTK_INCLUDE_DIRS_SYS ${VTK_INCLUDE_DIRS_SYS} ${VTK40_OSMESA_INCLUDE_PATH}) -endif(VTK_OPENGL_HAS_OSMESA) +endif() if(VTK_USE_MPI) set(VTK_INCLUDE_DIRS_SYS ${VTK_INCLUDE_DIRS_SYS} ${VTK40_MPI_INCLUDE_PATH}) -endif(VTK_USE_MPI) +endif() if(VTK_WRAP_TCL) set(VTK_INCLUDE_DIRS_SYS ${VTK_INCLUDE_DIRS_SYS} ${VTK40_TCL_INCLUDE_PATH}) -endif(VTK_WRAP_TCL) +endif() if(VTK_WRAP_PYTHON) set(VTK_INCLUDE_DIRS_SYS ${VTK_INCLUDE_DIRS_SYS} ${VTK40_PYTHON_INCLUDE_PATH}) -endif(VTK_WRAP_PYTHON) +endif() if(VTK_WRAP_JAVA) set(VTK_INCLUDE_DIRS_SYS ${VTK_INCLUDE_DIRS_SYS} ${VTK40_JAVA_INCLUDE_PATH} ${VTK40_JAVA_INCLUDE_PATH2}) -endif(VTK_WRAP_JAVA) +endif() if(VTK_HAVE_VG500) set(VTK_INCLUDE_DIRS_SYS ${VTK_INCLUDE_DIRS_SYS} ${VTK40_VLI_INCLUDE_PATH_FOR_VG500}) -endif(VTK_HAVE_VG500) +endif() if(VTK_HAVE_VP1000) set(VTK_INCLUDE_DIRS_SYS ${VTK_INCLUDE_DIRS_SYS} ${VTK40_VLI_INCLUDE_PATH_FOR_VP1000}) -endif(VTK_HAVE_VP1000) +endif() # See if this is a build tree or install tree. if(EXISTS ${VTK_DIR}/Common) @@ -237,16 +237,16 @@ if(EXISTS ${VTK_DIR}/Common) set(VTK_INCLUDE_DIRS ${VTK40_VTK_BINARY_DIR}) if(VTK_USE_PARALLEL) set(VTK_INCLUDE_DIRS ${VTK_INCLUDE_DIRS} ${VTK40_VTK_SOURCE_DIR}/Parallel) - endif(VTK_USE_PARALLEL) + endif() if(VTK_USE_HYBRID) set(VTK_INCLUDE_DIRS ${VTK_INCLUDE_DIRS} ${VTK40_VTK_SOURCE_DIR}/Hybrid) - endif(VTK_USE_HYBRID) + endif() if(VTK_USE_PATENTED) set(VTK_INCLUDE_DIRS ${VTK_INCLUDE_DIRS} ${VTK40_VTK_SOURCE_DIR}/Patented) - endif(VTK_USE_PATENTED) + endif() if(VTK_USE_RENDERING) set(VTK_INCLUDE_DIRS ${VTK_INCLUDE_DIRS} ${VTK40_VTK_SOURCE_DIR}/Rendering) - endif(VTK_USE_RENDERING) + endif() # These directories are always needed. set(VTK_INCLUDE_DIRS ${VTK_INCLUDE_DIRS} @@ -268,16 +268,16 @@ if(EXISTS ${VTK_DIR}/Common) set(VTK_TCL_EXE ${VTK40_EXECUTABLE_OUTPUT_PATH}/vtk) set(VTK_WRAP_TCL_EXE ${VTK40_VTK_WRAP_TCL_EXE}) set(VTK_TCL_HOME ${VTK40_VTK_SOURCE_DIR}/Wrapping/Tcl) - endif(VTK_WRAP_TCL) + endif() if(VTK_WRAP_PYTHON) set(VTK_WRAP_PYTHON_EXE ${VTK40_VTK_WRAP_PYTHON_EXE}) - endif(VTK_WRAP_PYTHON) + endif() if(VTK_WRAP_JAVA) set(VTK_PARSE_JAVA_EXE ${VTK40_VTK_PARSE_JAVA_EXE}) set(VTK_WRAP_JAVA_EXE ${VTK40_VTK_WRAP_JAVA_EXE}) - endif(VTK_WRAP_JAVA) + endif() -else(EXISTS ${VTK_DIR}/Common) +else() # This is a VTK 4.0 install tree. set(VTK_INCLUDE_DIRS ${VTK_DIR}) @@ -288,15 +288,15 @@ else(EXISTS ${VTK_DIR}/Common) set(VTK_TCL_EXE ${VTK40_CMAKE_INSTALL_PREFIX}/bin/vtk) set(VTK_WRAP_TCL_EXE ${VTK40_CMAKE_INSTALL_PREFIX}/bin/vtkWrapTcl) set(VTK_TCL_HOME ${VTK40_CMAKE_INSTALL_PREFIX}/lib/vtk/tcl) - endif(VTK_WRAP_TCL) + endif() if(VTK_WRAP_PYTHON) set(VTK_WRAP_PYTHON_EXE ${VTK40_CMAKE_INSTALL_PREFIX}/bin/vtkWrapPython) - endif(VTK_WRAP_PYTHON) + endif() if(VTK_WRAP_JAVA) set(VTK_PARSE_JAVA_EXE ${VTK40_CMAKE_INSTALL_PREFIX}/bin/vtkParseJava) set(VTK_WRAP_JAVA_EXE ${VTK40_CMAKE_INSTALL_PREFIX}/bin/vtkWrapJava) - endif(VTK_WRAP_JAVA) -endif(EXISTS ${VTK_DIR}/Common) + endif() +endif() # Add the system include directories last. set(VTK_INCLUDE_DIRS ${VTK_INCLUDE_DIRS} ${VTK_INCLUDE_DIRS_SYS}) @@ -307,23 +307,23 @@ if(CMAKE_COMPILER_IS_GNUCXX) # The platform is gcc on cygwin. set(VTK_REQUIRED_CXX_FLAGS "${VTK_REQUIRED_CXX_FLAGS} -mwin32") set(VTK_REQUIRED_C_FLAGS "${VTK_REQUIRED_C_FLAGS} -mwin32") - endif(WIN32) -else(CMAKE_COMPILER_IS_GNUCXX) + endif() +else() if(CMAKE_ANSI_CFLAGS) set(VTK_REQUIRED_C_FLAGS "${VTK_REQUIRED_C_FLAGS} ${CMAKE_ANSI_CFLAGS}") - endif(CMAKE_ANSI_CFLAGS) + endif() if(CMAKE_SYSTEM MATCHES "OSF1-V.*") set(VTK_REQUIRED_CXX_FLAGS "${VTK_REQUIRED_CXX_FLAGS} -timplicit_local -no_implicit_include") - endif(CMAKE_SYSTEM MATCHES "OSF1-V.*") -endif(CMAKE_COMPILER_IS_GNUCXX) + endif() +endif() if(VTK_USE_X) if(CMAKE_X_CFLAGS) set(VTK_REQUIRED_C_FLAGS "${VTK_REQUIRED_C_FLAGS} ${CMAKE_X_CFLAGS}") set(VTK_REQUIRED_CXX_FLAGS "${VTK_REQUIRED_CXX_FLAGS} ${CMAKE_X_CFLAGS}") - endif(CMAKE_X_CFLAGS) -endif(VTK_USE_X) + endif() +endif() # Copy library dependencies. set(vtkCommonJava_LIB_DEPENDS "${VTK40_vtkCommonJava_LIB_DEPENDS}") diff --git a/Modules/Use_wxWindows.cmake b/Modules/Use_wxWindows.cmake index 681fe28..6c95681 100644 --- a/Modules/Use_wxWindows.cmake +++ b/Modules/Use_wxWindows.cmake @@ -45,20 +45,20 @@ if(WXWINDOWS_FOUND) if(WXWINDOWS_INCLUDE_DIR) include_directories(${WXWINDOWS_INCLUDE_DIR}) - endif(WXWINDOWS_INCLUDE_DIR) + endif() if(WXWINDOWS_LINK_DIRECTORIES) link_directories(${WXWINDOWS_LINK_DIRECTORIES}) - endif(WXWINDOWS_LINK_DIRECTORIES) + endif() if(WXWINDOWS_LIBRARIES) link_libraries(${WXWINDOWS_LIBRARIES}) - endif(WXWINDOWS_LIBRARIES) + endif() if (CMAKE_WXWINDOWS_CXX_FLAGS) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CMAKE_WXWINDOWS_CXX_FLAGS}") - endif(CMAKE_WXWINDOWS_CXX_FLAGS) + endif() if(WXWINDOWS_DEFINITIONS) add_definitions(${WXWINDOWS_DEFINITIONS}) - endif(WXWINDOWS_DEFINITIONS) -else(WXWINDOWS_FOUND) + endif() +else() message(SEND_ERROR "wxWindows not found by Use_wxWindows.cmake") -endif(WXWINDOWS_FOUND) +endif() diff --git a/Modules/UsewxWidgets.cmake b/Modules/UsewxWidgets.cmake index 82a0085..bb8c29b 100644 --- a/Modules/UsewxWidgets.cmake +++ b/Modules/UsewxWidgets.cmake @@ -33,11 +33,11 @@ # comment these out for distribution if (NOT LOGFILE ) # set(LOGFILE "${PROJECT_BINARY_DIR}/CMakeOutput.log") -endif (NOT LOGFILE ) +endif () macro(MSG _MSG) # file(APPEND ${LOGFILE} "${CMAKE_CURRENT_LIST_FILE}(${CMAKE_CURRENT_LIST_LINE}): ${_MSG}\n") # message(STATUS "${CMAKE_CURRENT_LIST_FILE}(${CMAKE_CURRENT_LIST_LINE}): ${_MSG}") -endmacro(MSG) +endmacro() MSG("wxWidgets_FOUND=${wxWidgets_FOUND}") @@ -45,33 +45,33 @@ if (wxWidgets_FOUND) if (wxWidgets_INCLUDE_DIRS) if(wxWidgets_INCLUDE_DIRS_NO_SYSTEM) include_directories(${wxWidgets_INCLUDE_DIRS}) - else(wxWidgets_INCLUDE_DIRS_NO_SYSTEM) + else() include_directories(SYSTEM ${wxWidgets_INCLUDE_DIRS}) - endif(wxWidgets_INCLUDE_DIRS_NO_SYSTEM) + endif() MSG("wxWidgets_INCLUDE_DIRS=${wxWidgets_INCLUDE_DIRS}") - endif(wxWidgets_INCLUDE_DIRS) + endif() if (wxWidgets_LIBRARY_DIRS) link_directories(${wxWidgets_LIBRARY_DIRS}) MSG("wxWidgets_LIBRARY_DIRS=${wxWidgets_LIBRARY_DIRS}") - endif(wxWidgets_LIBRARY_DIRS) + endif() if (wxWidgets_DEFINITIONS) set_property(DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS ${wxWidgets_DEFINITIONS}) MSG("wxWidgets_DEFINITIONS=${wxWidgets_DEFINITIONS}") - endif(wxWidgets_DEFINITIONS) + endif() if (wxWidgets_DEFINITIONS_DEBUG) set_property(DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS_DEBUG ${wxWidgets_DEFINITIONS_DEBUG}) MSG("wxWidgets_DEFINITIONS_DEBUG=${wxWidgets_DEFINITIONS_DEBUG}") - endif(wxWidgets_DEFINITIONS_DEBUG) + endif() if (wxWidgets_CXX_FLAGS) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${wxWidgets_CXX_FLAGS}") MSG("wxWidgets_CXX_FLAGS=${wxWidgets_CXX_FLAGS}") - endif(wxWidgets_CXX_FLAGS) + endif() # DEPRECATED JW # just for backward compatibility: add deps to all targets @@ -81,9 +81,9 @@ if (wxWidgets_FOUND) # # BUG: str too long: MSG("wxWidgets_LIBRARIES=${wxWidgets_LIBRARIES}") # if(LOGFILE) # file(APPEND ${LOGFILE} "${CMAKE_CURRENT_LIST_FILE}(${CMAKE_CURRENT_LIST_LINE}): ${wxWidgets_LIBRARIES}\n") - # endif(LOGFILE) - #endif(wxWidgets_LIBRARIES) + # endif() + #endif() -else (wxWidgets_FOUND) +else () message("wxWidgets requested but not found.") -endif(wxWidgets_FOUND) +endif() diff --git a/Modules/VTKCompatibility.cmake b/Modules/VTKCompatibility.cmake index e1abfbb..b33bf2e 100644 --- a/Modules/VTKCompatibility.cmake +++ b/Modules/VTKCompatibility.cmake @@ -21,7 +21,7 @@ if(APPLE) string( REGEX REPLACE "CMAKE_C_COMPILER" CMAKE_CXX_COMPILER CMAKE_CXX_CREATE_SHARED_LIBRARY "${CMAKE_CXX_CREATE_SHARED_LIBRARY}") -endif(APPLE) +endif() set(VTKFTGL_BINARY_DIR "${VTK_BINARY_DIR}/Utilities/ftgl" CACHE INTERNAL "") @@ -48,5 +48,5 @@ set(TIFF_RIGHT_VERSION 1) # for very old VTK (versions prior to 4.2) macro(SOURCE_FILES) message (FATAL_ERROR "You are trying to build a very old version of VTK (prior to VTK 4.2). To do this you need to use CMake 2.0 as it was the last version of CMake to support VTK 4.0.") -endmacro(SOURCE_FILES) +endmacro() diff --git a/Modules/WriteBasicConfigVersionFile.cmake b/Modules/WriteBasicConfigVersionFile.cmake index 038cb57..4466cd7 100644 --- a/Modules/WriteBasicConfigVersionFile.cmake +++ b/Modules/WriteBasicConfigVersionFile.cmake @@ -28,7 +28,7 @@ function(WRITE_BASIC_CONFIG_VERSION_FILE _filename) if(CVF_UNPARSED_ARGUMENTS) message(FATAL_ERROR "Unknown keywords given to WRITE_BASIC_CONFIG_VERSION_FILE(): \"${CVF_UNPARSED_ARGUMENTS}\"") - endif(CVF_UNPARSED_ARGUMENTS) + endif() set(versionTemplateFile "${CMAKE_ROOT}/Modules/BasicConfigVersion-${CVF_COMPATIBILITY}.cmake.in") if(NOT EXISTS "${versionTemplateFile}") @@ -41,4 +41,4 @@ function(WRITE_BASIC_CONFIG_VERSION_FILE _filename) configure_file("${versionTemplateFile}" "${_filename}" @ONLY) -endfunction(WRITE_BASIC_CONFIG_VERSION_FILE) +endfunction() diff --git a/Modules/ecos_clean.cmake b/Modules/ecos_clean.cmake index 7a563ae..37a1f93 100644 --- a/Modules/ecos_clean.cmake +++ b/Modules/ecos_clean.cmake @@ -21,6 +21,6 @@ foreach(_entry ${_files}) get_filename_component(dir ${_entry} NAME) if(${dir} MATCHES "^[a-z]+$") file(REMOVE_RECURSE ${_entry}) - endif(${dir} MATCHES "^[a-z]+$") - endif(IS_DIRECTORY ${_entry}) -endforeach(_entry) + endif() + endif() +endforeach() diff --git a/Source/CMakeLists.txt b/Source/CMakeLists.txt index 106e78f..e79689b 100644 --- a/Source/CMakeLists.txt +++ b/Source/CMakeLists.txt @@ -14,9 +14,9 @@ include(CheckIncludeFile) CHECK_INCLUDE_FILE("elf.h" HAVE_ELF_H) if(HAVE_ELF_H) set(CMAKE_USE_ELF_PARSER 1) -else(HAVE_ELF_H) +else() set(CMAKE_USE_ELF_PARSER) -endif(HAVE_ELF_H) +endif() set(EXECUTABLE_OUTPUT_PATH ${CMake_BIN_DIR}) @@ -65,7 +65,7 @@ if(CMAKE_REGENERATE_YACCLEX) set(BISON_FLAGS) if(YACC_EXECUTABLE MATCHES "bison") set(BISON_FLAGS "--yacc") - endif(YACC_EXECUTABLE MATCHES "bison") + endif() set(yacc_files) foreach(name ${parsersLexers}) set(src "${CMAKE_CURRENT_SOURCE_DIR}/${name}Parser.y") @@ -79,9 +79,9 @@ if(CMAKE_REGENERATE_YACCLEX) --name-prefix=${name}_yy --defines=${hdr} -o${dst} ${src} ) set(yacc_files ${yacc_files} "${dst}") - endforeach(name) + endforeach() add_custom_target(RerunYacc DEPENDS ${yacc_files}) - endif(YACC_EXECUTABLE) + endif() if(FLEX_EXECUTABLE) set(lex_files) foreach(name ${parsersLexers}) @@ -96,16 +96,16 @@ if(CMAKE_REGENERATE_YACCLEX) --prefix=${name}_yy --header-file=${hdr} -o${dst} ${src} ) set(lex_files ${lex_files} "${dst}") - endforeach(name) + endforeach() add_custom_target(RerunLex DEPENDS ${lex_files}) - endif(FLEX_EXECUTABLE) + endif() -endif(CMAKE_REGENERATE_YACCLEX) +endif() # Check if we can build the ELF parser. if(CMAKE_USE_ELF_PARSER) set(ELF_SRCS cmELF.h cmELF.cxx) -endif(CMAKE_USE_ELF_PARSER) +endif() # # Sources for CMakeLib @@ -277,7 +277,7 @@ set(SRCS # Kdevelop only works on UNIX and not windows if(UNIX) set(SRCS ${SRCS} cmGlobalKdevelopGenerator.cxx) -endif(UNIX) +endif() # Xcode only works on Apple if(APPLE) @@ -288,7 +288,7 @@ if(APPLE) cmGlobalXCodeGenerator.h cmLocalXCodeGenerator.cxx cmLocalXCodeGenerator.h) -endif(APPLE) +endif() if (WIN32) @@ -356,8 +356,8 @@ if (WIN32) cmWin32ProcessExecution.cxx cmWin32ProcessExecution.h ) - endif(NOT UNIX) -endif (WIN32) + endif() +endif () # Ninja support set(SRCS ${SRCS} @@ -390,12 +390,12 @@ target_link_libraries(CMakeLib cmsys # On Apple we need CoreFoundation if(APPLE) target_link_libraries(CMakeLib "-framework CoreFoundation") -endif(APPLE) +endif() # On some platforms we need the rpcrt4 library for the VS 7 generators. if(CMAKE_BUILD_ON_VISUAL_STUDIO OR MINGW) target_link_libraries(CMakeLib rpcrt4) -endif(CMAKE_BUILD_ON_VISUAL_STUDIO OR MINGW) +endif() # # CTestLib @@ -488,14 +488,14 @@ if(CYGWIN) CPack/cmCPackCygwinBinaryGenerator.cxx CPack/cmCPackCygwinSourceGenerator.cxx ) -endif(CYGWIN) +endif() if(UNIX) set(CPACK_SRCS ${CPACK_SRCS} CPack/cmCPackDebGenerator.cxx CPack/cmCPackRPMGenerator.cxx ) -endif(UNIX) +endif() if(APPLE) set(CPACK_SRCS ${CPACK_SRCS} @@ -504,7 +504,7 @@ if(APPLE) CPack/cmCPackOSXX11Generator.cxx CPack/cmCPackPackageMakerGenerator.cxx ) -endif(APPLE) +endif() # Build CPackLib add_library(CPackLib ${CPACK_SRCS}) @@ -517,7 +517,7 @@ if(APPLE) CPack/OSXScriptLauncher.cxx) target_link_libraries(OSXScriptLauncher cmsys) target_link_libraries(OSXScriptLauncher "-framework CoreFoundation") -endif(APPLE) +endif() # Build CMake executable add_executable(cmake cmakemain.cxx) @@ -529,8 +529,8 @@ if(WIN32) add_executable(cmw9xcom cmw9xcom.cxx) target_link_libraries(cmw9xcom CMakeLib) install_targets(/bin cmw9xcom) - endif(NOT UNIX) -endif(WIN32) + endif() +endif() # Build CTest executable add_executable(ctest ctest.cxx) @@ -543,13 +543,13 @@ target_link_libraries(cpack CPackLib) # Curses GUI if(BUILD_CursesDialog) include(${CMake_SOURCE_DIR}/Source/CursesDialog/CMakeLists.txt) -endif(BUILD_CursesDialog) +endif() # Qt GUI option(BUILD_QtDialog "Build Qt dialog for CMake" FALSE) if(BUILD_QtDialog) subdirs(QtDialog) -endif(BUILD_QtDialog) +endif() include (${CMake_BINARY_DIR}/Source/LocalUserOptions.cmake OPTIONAL) include (${CMake_SOURCE_DIR}/Source/LocalUserOptions.cmake OPTIONAL) @@ -559,6 +559,6 @@ install_targets(/bin ctest) install_targets(/bin cpack) if(APPLE) install_targets(/bin cmakexbuild) -endif(APPLE) +endif() install_files(${CMAKE_DATA_DIR}/include cmCPluginAPI.h) diff --git a/Source/CursesDialog/form/CMakeLists.txt b/Source/CursesDialog/form/CMakeLists.txt index d5cc1bd..4e07fa0 100644 --- a/Source/CursesDialog/form/CMakeLists.txt +++ b/Source/CursesDialog/form/CMakeLists.txt @@ -63,4 +63,4 @@ add_library(cmForm ${FORM_SRCS} ) target_link_libraries(cmForm ${CURSES_LIBRARY}) if(CURSES_EXTRA_LIBRARY) target_link_libraries(cmForm ${CURSES_EXTRA_LIBRARY}) -endif(CURSES_EXTRA_LIBRARY) +endif() diff --git a/Source/QtDialog/CMakeLists.txt b/Source/QtDialog/CMakeLists.txt index d962d8d..0969aea 100644 --- a/Source/QtDialog/CMakeLists.txt +++ b/Source/QtDialog/CMakeLists.txt @@ -15,7 +15,7 @@ find_package(Qt4 REQUIRED) if(NOT QT4_FOUND) message(SEND_ERROR "Failed to find Qt 4.4 or greater.") -else(NOT QT4_FOUND) +else() include(${QT_USE_FILE}) set(CMAKE_PACKAGE_QTGUI TRUE) @@ -58,13 +58,13 @@ else(NOT QT4_FOUND) set(SRCS ${SRCS} ${UI_SRCS} ${MOC_SRCS} ${RC_SRCS}) if(Q_WS_WIN) set(SRCS ${SRCS} CMakeSetup.rc) - endif(Q_WS_WIN) + endif() if(Q_WS_MAC) set(SRCS ${SRCS} CMakeSetup.icns) set(MACOSX_BUNDLE_ICON_FILE CMakeSetup.icns) set_source_files_properties(CMakeSetup.icns PROPERTIES MACOSX_PACKAGE_LOCATION Resources) - endif(Q_WS_MAC) + endif() include_directories(${CMAKE_CURRENT_BINARY_DIR}) include_directories(${CMAKE_CURRENT_SOURCE_DIR}) @@ -75,10 +75,10 @@ else(NOT QT4_FOUND) if(APPLE) set_target_properties(cmake-gui PROPERTIES OUTPUT_NAME ${CMAKE_BUNDLE_NAME}) - endif(APPLE) + endif() set(CMAKE_INSTALL_DESTINATION_ARGS BUNDLE DESTINATION "${CMAKE_BUNDLE_LOCATION}") - endif(${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION} GREATER 2.4) + endif() install(TARGETS cmake-gui RUNTIME DESTINATION bin ${CMAKE_INSTALL_DESTINATION_ARGS}) @@ -88,7 +88,7 @@ else(NOT QT4_FOUND) install(FILES CMake.desktop DESTINATION share/applications ) install(FILES CMakeSetup32.png DESTINATION share/pixmaps ) install(FILES cmakecache.xml DESTINATION share/mime/packages ) - endif(UNIX) + endif() if(APPLE) set(CMAKE_POSTFLIGHT_SCRIPT @@ -101,7 +101,7 @@ else(NOT QT4_FOUND) "${CMake_BINARY_DIR}/Source/QtDialog/postupgrade.sh") install(CODE "execute_process(COMMAND ln -s \"../MacOS/${CMAKE_BUNDLE_NAME}\" cmake-gui WORKING_DIRECTORY \$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX}/bin)") - endif(APPLE) + endif() if(APPLE OR WIN32) # install rules for including 3rd party libs such as Qt @@ -109,15 +109,15 @@ else(NOT QT4_FOUND) set(fixup_exe "\$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX}/bin/cmake-gui${CMAKE_EXECUTABLE_SUFFIX}") if(APPLE) set(fixup_exe "\$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX}/MacOS/${CMAKE_BUNDLE_NAME}") - endif(APPLE) + endif() install(CODE " include(\"${CMake_SOURCE_DIR}/Modules/BundleUtilities.cmake\") set(BU_CHMOD_BUNDLE_ITEMS ON) fixup_bundle(\"${fixup_exe}\" \"\" \"${QT_LIBRARY_DIR};${QT_BINARY_DIR}\") ") - endif(APPLE OR WIN32) + endif() configure_file("${QtDialog_SOURCE_DIR}/QtDialogCPack.cmake.in" "${QtDialog_BINARY_DIR}/QtDialogCPack.cmake" @ONLY) -endif(NOT QT4_FOUND) +endif() diff --git a/Source/QtDialog/QtDialogCPack.cmake.in b/Source/QtDialog/QtDialogCPack.cmake.in index f43e1c3..3196471 100644 --- a/Source/QtDialog/QtDialogCPack.cmake.in +++ b/Source/QtDialog/QtDialogCPack.cmake.in @@ -12,7 +12,7 @@ if(CMAKE_PACKAGE_QTGUI) # we also want to run post install stuff to setup command line set(CPACK_POSTFLIGHT_SCRIPT "@CMAKE_POSTFLIGHT_SCRIPT@") set(CPACK_POSTUPGRADE_SCRIPT "@CMAKE_POSTUPGRADE_SCRIPT@") - endif(IS_APPLE) -endif(CMAKE_PACKAGE_QTGUI) + endif() +endif() diff --git a/Tests/ArgumentExpansion/CMakeLists.txt b/Tests/ArgumentExpansion/CMakeLists.txt index a24636f..1735400 100644 --- a/Tests/ArgumentExpansion/CMakeLists.txt +++ b/Tests/ArgumentExpansion/CMakeLists.txt @@ -8,7 +8,7 @@ function (argument_tester expected expected_len) if (NOT ${expected_received_len} EQUAL ${expected_len}) message(STATUS "Unexpected: Expanding expected values isn't working") - endif (NOT ${expected_received_len} EQUAL ${expected_len}) + endif () if (${argn_len} EQUAL ${expected_len}) set(i 0) @@ -23,13 +23,13 @@ function (argument_tester expected expected_len) endif () math(EXPR i "${i} + 1") - endwhile (i LESS ${argn_len}) - else (${argn_len} EQUAL ${expected_len}) + endwhile () + else () message(STATUS "Unexpected: Lengths of arguments don't match") message(STATUS " Expected: ${expected_len}") message(STATUS " Received: ${argn_len}") - endif (${argn_len} EQUAL ${expected_len}) -endfunction (argument_tester expected) + endif () +endfunction () set(empty_test) message(STATUS "Test: Empty arguments") diff --git a/Tests/Assembler/CMakeLists.txt b/Tests/Assembler/CMakeLists.txt index 456e496..5f71036 100644 --- a/Tests/Assembler/CMakeLists.txt +++ b/Tests/Assembler/CMakeLists.txt @@ -18,16 +18,16 @@ if("${CMAKE_GENERATOR}" MATCHES "Makefile") DEPENDS main.c VERBATIM ) - endif(("${CMAKE_C_COMPILER_ID}" MATCHES "^(GNU|HP|SunPro|XL)$") OR ("${CMAKE_C_COMPILER_ID}" STREQUAL "Intel" AND UNIX)) -endif("${CMAKE_GENERATOR}" MATCHES "Makefile") + endif() +endif() if(SRCS) set(CMAKE_ASM_FLAGS "${CMAKE_C_FLAGS}") enable_language(ASM OPTIONAL) -else(SRCS) +else() message(STATUS "No assembler enabled, using C") set(SRCS main.c) -endif(SRCS) +endif() add_executable(HelloAsm ${SRCS}) diff --git a/Tests/BuildDepends/CMakeLists.txt b/Tests/BuildDepends/CMakeLists.txt index 045acb8..d3b1f3c 100644 --- a/Tests/BuildDepends/CMakeLists.txt +++ b/Tests/BuildDepends/CMakeLists.txt @@ -15,7 +15,7 @@ set(CMAKE_SUPPRESS_REGENERATION 1) # Xcode needs some help with the fancy dependencies in this test. if("${CMAKE_GENERATOR}" MATCHES "Xcode") set(HELP_XCODE 1) -endif("${CMAKE_GENERATOR}" MATCHES "Xcode") +endif() function(help_xcode_depends) if(HELP_XCODE) file(GLOB_RECURSE MACRO_OBJS @@ -24,9 +24,9 @@ function(help_xcode_depends) if(MACRO_OBJS) message("Helping Xcode by removing objects [${MACRO_OBJS}]") file(REMOVE ${MACRO_OBJS}) - endif(MACRO_OBJS) - endif(HELP_XCODE) -endfunction(help_xcode_depends) + endif() + endif() +endfunction() if("${CMAKE_GENERATOR}" MATCHES "Ninja") set(HELP_NINJA 1) # TODO Why is this needed? @@ -80,12 +80,12 @@ if(HELP_XCODE) ${BuildDepends_SOURCE_DIR}/Project testRebuild OUTPUT_VARIABLE OUTPUT) -endif(HELP_XCODE) +endif() message("Output from first build:\n${OUTPUT}") if(NOT RESULT) message(SEND_ERROR "Could not build test project (1)!") -endif(NOT RESULT) +endif() set(bar ${BuildDepends_BINARY_DIR}/Project/bar${CMAKE_EXECUTABLE_SUFFIX}) if(EXISTS @@ -111,9 +111,9 @@ message("Run result: ${runResult} Output: \"${out}\"") if("${out}" STREQUAL "foo ") message("Worked!") -else("${out}" STREQUAL "foo ") +else() message(SEND_ERROR "Project did not initially build properly: ${out}") -endif("${out}" STREQUAL "foo ") +endif() message("Running ${zot} ") execute_process(COMMAND ${zot} OUTPUT_VARIABLE out RESULT_VARIABLE runResult) @@ -123,9 +123,9 @@ message("Run result: ${runResult} Output: \"${out}\"") set(VALUE_UNCHANGED "[zot] [zot_custom] [zot_macro_dir] [zot_macro_tgt] ") if("${out}" STREQUAL "${VALUE_UNCHANGED}") message("Worked!") -else("${out}" STREQUAL "${VALUE_UNCHANGED}") +else() message(SEND_ERROR "Project did not initially build properly: ${out}") -endif("${out}" STREQUAL "${VALUE_UNCHANGED}") +endif() message("Waiting 3 seconds...") # any additional argument will cause ${bar} to wait forever @@ -174,7 +174,7 @@ endif() message("Output from second build:\n${OUTPUT}") if(NOT RESULT) message(SEND_ERROR "Could not build test project (2)!") -endif(NOT RESULT) +endif() if(EXISTS "${BuildDepends_BINARY_DIR}/Project/Debug/bar${CMAKE_EXECUTABLE_SUFFIX}" ) message("found debug") @@ -193,9 +193,9 @@ message("Run result: ${runResult} Output: \"${out}\"") if("${out}" STREQUAL "foo changed ") message("Worked!") -else("${out}" STREQUAL "foo changed ") +else() message(SEND_ERROR "Project did not rebuild properly!") -endif("${out}" STREQUAL "foo changed ") +endif() message("Running ${zot} ") execute_process(COMMAND ${zot} OUTPUT_VARIABLE out RESULT_VARIABLE runResult) @@ -207,9 +207,9 @@ set(VALUE_CHANGED ) if("${out}" STREQUAL "${VALUE_CHANGED}") message("Worked!") -else("${out}" STREQUAL "${VALUE_CHANGED}") +else() message(SEND_ERROR "Project did not rebuild properly!") -endif("${out}" STREQUAL "${VALUE_CHANGED}") +endif() if(TEST_LINK_DEPENDS) set(linkdep ${BuildDepends_BINARY_DIR}/Project/linkdep${CMAKE_EXECUTABLE_SUFFIX}) diff --git a/Tests/BuildDepends/Project/CMakeLists.txt b/Tests/BuildDepends/Project/CMakeLists.txt index a258de2..01f5f62 100644 --- a/Tests/BuildDepends/Project/CMakeLists.txt +++ b/Tests/BuildDepends/Project/CMakeLists.txt @@ -27,7 +27,7 @@ if(APPLE) set(CMAKE_OSX_ARCHITECTURES i386 x86_64) endif() endif() -endif(APPLE) +endif() add_library(foo STATIC ${testRebuild_BINARY_DIR}/foo.cxx) set_target_properties(foo PROPERTIES OUTPUT_NAME "foolib") @@ -65,11 +65,11 @@ if("${CMAKE_GENERATOR}" MATCHES "Make") set(ZOT_DEPENDS IMPLICIT_DEPENDS CXX ${CMAKE_CURRENT_SOURCE_DIR}/dep.cxx) set(ZOT_CUSTOM_DEP IMPLICIT_DEPENDS CXX ${CMAKE_CURRENT_SOURCE_DIR}/dep_custom.cxx) -else("${CMAKE_GENERATOR}" MATCHES "Make") +else() # No IMPLICIT_DEPENDS...just depend directly. set(ZOT_DEPENDS DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/zot.hxx.in) set(ZOT_CUSTOM_DEP DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/zot_custom.hxx.in) -endif("${CMAKE_GENERATOR}" MATCHES "Make") +endif() add_custom_command( OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/zot.hxx COMMAND ${CMAKE_COMMAND} -E copy diff --git a/Tests/BundleTest/CMakeLists.txt b/Tests/BundleTest/CMakeLists.txt index 4fb65bf..de69d75 100644 --- a/Tests/BundleTest/CMakeLists.txt +++ b/Tests/BundleTest/CMakeLists.txt @@ -61,7 +61,7 @@ set_target_properties(BundleTest PROPERTIES OUTPUT_NAME BundleTestExe) # Test executable versioning if it is supported. if(NOT XCODE) set_target_properties(BundleTest PROPERTIES VERSION 1) -endif(NOT XCODE) +endif() # Make sure the executable can find its installed library. set_target_properties(BundleTestLib PROPERTIES @@ -77,26 +77,26 @@ if(EXISTS /usr/lib/libtcl.dylib message("frame: ${TCL}") if(NOT "${TCL}" MATCHES .framework) message(FATAL_ERROR "Could not find tcl framework, found ${TCL}") - endif(NOT "${TCL}" MATCHES .framework) + endif() set(TCL NOTFOUND) set(CMAKE_FIND_FRAMEWORK LAST) find_library(TCL tcl) if("${TCL}" MATCHES .framework) message(FATAL_ERROR "Found framework and should have found dylib ${TCL}") - endif("${TCL}" MATCHES .framework) + endif() set(TCL NOTFOUND) set(CMAKE_FIND_FRAMEWORK NEVER) find_library(TCL tcl) if("${TCL}" MATCHES .framework) message(FATAL_ERROR "Found framework and should have found dylib ${TCL}") - endif("${TCL}" MATCHES .framework) + endif() message("not frame: ${TCL}") set(TCL NOTFOUND) set(CMAKE_FIND_FRAMEWORK FIRST) find_library(TCL tcl) if(NOT "${TCL}" MATCHES .framework) message(FATAL_ERROR "Could not find tcl framework, found ${TCL}") - endif(NOT "${TCL}" MATCHES .framework) + endif() message("frame: ${TCL}") endif(EXISTS /usr/lib/libtcl.dylib AND EXISTS /System/Library/Frameworks/Tcl.framework) diff --git a/Tests/BundleUtilities/bundleutils.cmake b/Tests/BundleUtilities/bundleutils.cmake index 46765e7..cc89347 100644 --- a/Tests/BundleUtilities/bundleutils.cmake +++ b/Tests/BundleUtilities/bundleutils.cmake @@ -31,7 +31,7 @@ configure_file("${MODULE}" "${OUTPUT_MODULE}" COPYONLY) # this shouldn't be necessary except for the non-bundle case on Mac function(gp_item_default_embedded_path_override item path) set(path "@executable_path" PARENT_SCOPE) -endfunction(gp_item_default_embedded_path_override) +endfunction() include(BundleUtilities) fixup_bundle("${OUTPUT}" "${OUTPUT_MODULE}" "${INPUTDIR}") @@ -42,4 +42,4 @@ execute_process(COMMAND "${OUTPUT}" RESULT_VARIABLE result OUTPUT_VARIABLE out E if(NOT result STREQUAL "0") message(FATAL_ERROR " failed to execute test program\n${out}") -endif(NOT result STREQUAL "0") +endif() diff --git a/Tests/CMakeBuildTest.cmake.in b/Tests/CMakeBuildTest.cmake.in index 02206de..195f107 100644 --- a/Tests/CMakeBuildTest.cmake.in +++ b/Tests/CMakeBuildTest.cmake.in @@ -16,7 +16,7 @@ execute_process(COMMAND "${CMAKE_COMMAND}" RESULT_VARIABLE RESULT) if(RESULT) message(FATAL_ERROR "Error running cmake command") -endif(RESULT) +endif() # Now use the --build option to build the project message("running: ${CMAKE_COMMAND} --build") @@ -25,7 +25,7 @@ execute_process(COMMAND "${CMAKE_COMMAND}" RESULT_VARIABLE RESULT) if(RESULT) message(FATAL_ERROR "Error running cmake --build") -endif(RESULT) +endif() # check for configuration types set(CMAKE_CONFIGURATION_TYPES @CMAKE_CONFIGURATION_TYPES@) @@ -33,15 +33,15 @@ set(CMAKE_CONFIGURATION_TYPES @CMAKE_CONFIGURATION_TYPES@) # are configuration types if(CMAKE_CONFIGURATION_TYPES) set(RUN_TEST "@CMAKE_BUILD_TEST_BINARY_DIR@/Debug/@CMAKE_BUILD_TEST_EXE@") -else(CMAKE_CONFIGURATION_TYPES) +else() set(RUN_TEST "@CMAKE_BUILD_TEST_BINARY_DIR@/@CMAKE_BUILD_TEST_EXE@") -endif(CMAKE_CONFIGURATION_TYPES) +endif() # run the test results message("running [${RUN_TEST}]") execute_process(COMMAND "${RUN_TEST}" RESULT_VARIABLE RESULT) if(RESULT) message(FATAL_ERROR "Error running test @CMAKE_BUILD_TEST_EXE@") -endif(RESULT) +endif() # build it again with clean and only @CMAKE_BUILD_TEST_EXE@ target execute_process(COMMAND "${CMAKE_COMMAND}" @@ -50,10 +50,10 @@ execute_process(COMMAND "${CMAKE_COMMAND}" RESULT_VARIABLE RESULT) if(RESULT) message(FATAL_ERROR "Error running cmake --build") -endif(RESULT) +endif() # run it again after clean execute_process(COMMAND "${RUN_TEST}" RESULT_VARIABLE RESULT) if(RESULT) message(FATAL_ERROR "Error running test @CMAKE_BUILD_TEST_EXE@ after clean ") -endif(RESULT) +endif() diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt index 70d4171..651e1b9 100644 --- a/Tests/CMakeLists.txt +++ b/Tests/CMakeLists.txt @@ -14,12 +14,12 @@ macro(ADD_TEST_MACRO NAME COMMAND) ${${NAME}_EXTRA_OPTIONS} --test-command ${COMMAND} ${ARGN}) list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/${dir}") -endmacro(ADD_TEST_MACRO) +endmacro() macro(REGEX_ESCAPE_STRING _OUT _IN) # Escape special regex metacharacters with a backslash string(REGEX REPLACE "([$^.[|*+?()]|])" "\\\\\\1" ${_OUT} "${_IN}") -endmacro(REGEX_ESCAPE_STRING _OUT _IN) +endmacro() include(${CMAKE_CURRENT_SOURCE_DIR}/CheckFortran.cmake) @@ -75,7 +75,7 @@ if(BUILD_TESTING) "Should the KDE4 stable branch test be run?" OFF) mark_as_advanced(TEST_KDE4_STABLE_BRANCH) - endif (CMAKE_RUN_LONG_TESTS) + endif () # Should tests that use CVS be run? # @@ -83,19 +83,19 @@ if(BUILD_TESTING) if(EXISTS ${CMAKE_ROOT}/Modules/FindCVS.cmake) find_package(CVS QUIET) - else(EXISTS ${CMAKE_ROOT}/Modules/FindCVS.cmake) + else() find_program(CVS_EXECUTABLE NAMES cvs) - endif(EXISTS ${CMAKE_ROOT}/Modules/FindCVS.cmake) + endif() if(CVS_EXECUTABLE) set(do_cvs_tests 1) - endif(CVS_EXECUTABLE) + endif() if(do_cvs_tests AND NOT UNIX) if("${CVS_EXECUTABLE}" MATCHES "cygwin") set(do_cvs_tests 0) - endif("${CVS_EXECUTABLE}" MATCHES "cygwin") - endif(do_cvs_tests AND NOT UNIX) + endif() + endif() # Should CPack tests be run? By default, yes, but... # @@ -123,20 +123,20 @@ if(BUILD_TESTING) message(STATUS "Forcing CTEST_TEST_CPACK=OFF on OSX < 10.4") message(STATUS "OSX_VERSION='${OSX_VERSION}'") set(CTEST_TEST_CPACK OFF) - else(OSX_VERSION MATCHES "^10\\.[0123]" OR OSX_VERSION MATCHES "ProductVersion:\t10\\.[0123]") + else() set(CTEST_TEST_OSX_ARCH 1) - endif(OSX_VERSION MATCHES "^10\\.[0123]" OR OSX_VERSION MATCHES "ProductVersion:\t10\\.[0123]") - endif(APPLE) + endif() + endif() # Use 1500 or CTEST_TEST_TIMEOUT for long test timeout value, # whichever is greater. set(CMAKE_LONG_TEST_TIMEOUT 1500) if(CTEST_TEST_TIMEOUT) set(CMAKE_LONG_TEST_TIMEOUT ${CTEST_TEST_TIMEOUT}) - endif(CTEST_TEST_TIMEOUT) + endif() if(CMAKE_LONG_TEST_TIMEOUT LESS 1500) set(CMAKE_LONG_TEST_TIMEOUT 1500) - endif(CMAKE_LONG_TEST_TIMEOUT LESS 1500) + endif() # add a bunch of standard build-and-test style tests ADD_TEST_MACRO(CommandLineTest CommandLineTest) @@ -225,18 +225,18 @@ if(BUILD_TESTING) PASS_REGULAR_EXPRESSION "TRY_RUN.. invoked in cross-compiling mode") if("${CMAKE_TEST_GENERATOR}" MATCHES "Make") ADD_TEST_MACRO(Policy0002 Policy0002) - endif("${CMAKE_TEST_GENERATOR}" MATCHES "Make") + endif() if(CTEST_TEST_OSX_ARCH) ADD_TEST_MACRO(Architecture Architecture) set_tests_properties(Architecture PROPERTIES PASS_REGULAR_EXPRESSION "(file is not of required architecture|does not match cputype|not the architecture being linked)") - endif(CTEST_TEST_OSX_ARCH) + endif() list(APPEND TEST_BUILD_DIRS ${CMake_TEST_INSTALL_PREFIX}) if(NOT QT4_FOUND) find_package(Qt4) - endif(NOT QT4_FOUND) + endif() if(QT4_FOUND) # test whether the Qt4 which has been found works, on some machines @@ -380,7 +380,7 @@ if(BUILD_TESTING) --build-project Simple --test-command Simple) list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/Simple_EclipseGenerator") - endif ("${cmakeOutput}" MATCHES Eclipse) + endif () # check for the CodeBlocks generator if ("${cmakeOutput}" MATCHES CodeBlocks) @@ -394,7 +394,7 @@ if(BUILD_TESTING) --build-project Simple --test-command Simple) list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/Simple_CodeBlocksGenerator") - endif ("${cmakeOutput}" MATCHES CodeBlocks) + endif () # check for the KDevelop3 generator if ("${cmakeOutput}" MATCHES KDevelop3) add_test(Simple_KDevelop3Generator ${CMAKE_CTEST_COMMAND} @@ -407,9 +407,9 @@ if(BUILD_TESTING) --build-project Simple --test-command Simple) list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/Simple_KDevelop3Generator") - endif ("${cmakeOutput}" MATCHES KDevelop3) + endif () - endif(${CMAKE_TEST_GENERATOR} MATCHES "Unix Makefiles" OR ${CMAKE_TEST_GENERATOR} MATCHES "KDevelop") + endif() # test for correct sub-project generation # not implemented in VS6 or Xcode @@ -454,11 +454,11 @@ if(BUILD_TESTING) ) set_tests_properties ( SubProject-Stage2 PROPERTIES DEPENDS SubProject) list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/SubProject") - endif(NOT MSVC60 AND NOT XCODE AND NOT MSVC70) + endif() if (CMAKE_STRICT) ADD_TEST_MACRO(DocTest DocTest) - endif (CMAKE_STRICT) + endif () # macro to add a test that will build a nightly release # of CMake for given platform using the release scripts macro(ADD_NIGHTLY_BUILD_TEST name script) @@ -472,8 +472,8 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ add_test(${name} /bin/sh ${_TEST_DIR}/nightly-cmake.sh) if(COMMAND SET_TESTS_PROPERTIES AND COMMAND GET_TEST_PROPERTY) set_tests_properties (${name} PROPERTIES TIMEOUT ${CMAKE_LONG_TEST_TIMEOUT}) - endif(COMMAND SET_TESTS_PROPERTIES AND COMMAND GET_TEST_PROPERTY) - endmacro(ADD_NIGHTLY_BUILD_TEST) + endif() + endmacro() if(CMAKE_BUILD_NIGHTLY_RELEASES) ADD_NIGHTLY_BUILD_TEST(CMakeNightlyWindows dash2win64_release.cmake) @@ -483,7 +483,7 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ dashmacmini5_release.cmake) ADD_NIGHTLY_BUILD_TEST(CMakeNightlyLinux magrathea_release.cmake) - endif(CMAKE_BUILD_NIGHTLY_RELEASES) + endif() # add tests with more complex invocations add_test(Framework ${CMAKE_CTEST_COMMAND} @@ -663,11 +663,11 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ if (CMAKE_SYSTEM_NAME MATCHES "Linux" AND NOT CMAKE_CURRENT_BINARY_DIR MATCHES ".* .*") find_program(RPMBUILD NAMES rpmbuild) - endif(CMAKE_SYSTEM_NAME MATCHES "Linux" AND NOT CMAKE_CURRENT_BINARY_DIR MATCHES ".* .*") + endif() # Do not try to build RPM if (NOT RPMBUILD) set(CPACK_BINARY_RPM OFF) - endif(NOT RPMBUILD) + endif() find_program(NSIS_MAKENSIS_EXECUTABLE NAMES makensis PATHS [HKEY_LOCAL_MACHINE\\SOFTWARE\\NSIS] @@ -680,21 +680,21 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ if(WIN32) if(NSIS_MAKENSIS_EXECUTABLE) set(CTEST_RUN_CPackComponents ON) - else(NSIS_MAKENSIS_EXECUTABLE) + else() set(CTEST_RUN_CPackComponents OFF) set(CTEST_package_X11_TEST OFF) - endif(NSIS_MAKENSIS_EXECUTABLE) - endif(WIN32) + endif() + endif() if(CTEST_RUN_CPackComponents) set(CPackComponents_EXTRA_OPTIONS) if(APPLE) set(CPackComponents_EXTRA_OPTIONS -DCPACK_BINARY_DRAGNDROP:BOOL=ON) - endif(APPLE) + endif() if(NSIS_MAKENSIS_EXECUTABLE) set(CPackComponents_EXTRA_OPTIONS ${CPackComponents_EXTRA_OPTIONS} -DCPACK_BINARY_NSIS:BOOL=ON) - endif(NSIS_MAKENSIS_EXECUTABLE) + endif() add_test(CPackComponents ${CMAKE_CTEST_COMMAND} --build-and-test @@ -714,7 +714,7 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ "-DCPackComponents_BINARY_DIR:PATH=${CMake_BINARY_DIR}/Tests/CPackComponents" -P "${CMake_SOURCE_DIR}/Tests/CPackComponents/VerifyResult.cmake") list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/CPackComponents") - endif(CTEST_RUN_CPackComponents) + endif() if(CTEST_RUN_CPackComponentsForAll) # Check whether if rpmbuild command is found @@ -722,13 +722,13 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ find_program(RPMBUILD_EXECUTABLE NAMES rpmbuild) if(RPMBUILD_EXECUTABLE) list(APPEND ACTIVE_CPACK_GENERATORS RPM) - endif(RPMBUILD_EXECUTABLE) + endif() # Check whether if dpkg command is found # before adding DEB tests find_program(DPKG_EXECUTABLE NAMES dpkg) if(DPKG_EXECUTABLE) list(APPEND ACTIVE_CPACK_GENERATORS DEB) - endif(DPKG_EXECUTABLE) + endif() # ACTIVE_CPACK_GENERATORS variable # now contains the list of 'active generators' @@ -738,17 +738,17 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ list(APPEND GENLST "ZIP") if(APPLE) list(APPEND GENLST "DragNDrop") - endif(APPLE) + endif() if (NOT CMAKE_CURRENT_BINARY_DIR MATCHES ".* .*") list(FIND ACTIVE_CPACK_GENERATORS "RPM" RPM_ACTIVE) if (NOT ${RPM_ACTIVE} EQUAL -1) list(APPEND GENLST "RPM") - endif(NOT ${RPM_ACTIVE} EQUAL -1) - endif(NOT CMAKE_CURRENT_BINARY_DIR MATCHES ".* .*") + endif() + endif() list(FIND ACTIVE_CPACK_GENERATORS "DEB" DEB_ACTIVE) if (NOT ${DEB_ACTIVE} EQUAL -1) list(APPEND GENLST "DEB") - endif(NOT ${DEB_ACTIVE} EQUAL -1) + endif() # set up list of component packaging ways list(APPEND CWAYLST "default") @@ -778,9 +778,9 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ "${CPackRun_CPackComponentWay}" -P "${CMake_SOURCE_DIR}/Tests/CPackComponentsForAll/RunCPackVerifyResult.cmake") list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/CPackComponentsForAll/build${CPackGen}-${CPackComponentWay}") - endforeach(CPackComponentWay) - endforeach(CPackGen) - endif(CTEST_RUN_CPackComponentsForAll) + endforeach() + endforeach() + endif() # By default, turn this test off (because it takes a long time...) # @@ -797,7 +797,7 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ endif(CMAKE_CXX_FLAGS MATCHES "-ftest-coverage" OR NOT "$ENV{COVFILE}" STREQUAL "" OR CMAKE_RUN_LONG_TESTS) - endif(NOT DEFINED CTEST_RUN_CPackTestAllGenerators) + endif() if(CTEST_RUN_CPackTestAllGenerators) add_test(CPackTestAllGenerators ${CMAKE_CTEST_COMMAND} @@ -814,13 +814,13 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ -P ${CMake_SOURCE_DIR}/Tests/CPackTestAllGenerators/RunCPack.cmake ) list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/CPackTestAllGenerators") - endif(CTEST_RUN_CPackTestAllGenerators) + endif() if(CTEST_package_X11_TEST) set(X11_build_target_arg --build-target package) - else(CTEST_package_X11_TEST) + else() set(X11_build_target_arg) - endif(CTEST_package_X11_TEST) + endif() add_test(X11 ${CMAKE_CTEST_COMMAND} --build-and-test @@ -836,7 +836,7 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ if(NOT DEFINED CTEST_RUN_CMakeTestAllGenerators) set(CTEST_RUN_CMakeTestAllGenerators ON) - endif(NOT DEFINED CTEST_RUN_CMakeTestAllGenerators) + endif() if(CTEST_RUN_CMakeTestAllGenerators) add_test(CMakeTestAllGenerators ${CMAKE_CMAKE_COMMAND} @@ -846,11 +846,11 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ ) list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/CMakeTestAllGenerators") - endif(CTEST_RUN_CMakeTestAllGenerators) + endif() if(NOT DEFINED CTEST_RUN_CMakeTestBadCommandLines) set(CTEST_RUN_CMakeTestBadCommandLines ON) - endif(NOT DEFINED CTEST_RUN_CMakeTestBadCommandLines) + endif() if(CTEST_RUN_CMakeTestBadCommandLines) add_test(CMakeTestBadCommandLines ${CMAKE_CMAKE_COMMAND} @@ -861,11 +861,11 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ ) list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/CMakeTestBadCommandLines") - endif(CTEST_RUN_CMakeTestBadCommandLines) + endif() if(NOT DEFINED CTEST_RUN_CMakeTestMultipleConfigures) set(CTEST_RUN_CMakeTestMultipleConfigures ON) - endif(NOT DEFINED CTEST_RUN_CMakeTestMultipleConfigures) + endif() if(CTEST_RUN_CMakeTestMultipleConfigures) add_test(CMakeTestMultipleConfigures ${CMAKE_CMAKE_COMMAND} @@ -876,7 +876,7 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ ) list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/CMakeTestMultipleConfigures") - endif(CTEST_RUN_CMakeTestMultipleConfigures) + endif() add_test(LoadedCommandOneConfig ${CMAKE_CTEST_COMMAND} --build-and-test @@ -987,7 +987,7 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM} --build-project Tutorial --test-command Tutorial 25.0) - endforeach(STP) + endforeach() list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/Tutorial") add_test(testing ${CMAKE_CTEST_COMMAND} -C \${CTEST_CONFIGURATION_TYPE} @@ -1081,12 +1081,12 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ set(_DLL_PATH "$ENV{DLL_PATH}") if(NOT "${_DLL_PATH}" MATCHES "^(.*:)?\\@bindir\\@/\\.(:.*)?$") message(FATAL_ERROR "In order to successfully run the CMake test suite on Syllable you need to add \"\\@bindir\\@/.\" to the DLL_PATH environment variable") - endif(NOT "${_DLL_PATH}" MATCHES "^(.*:)?\\@bindir\\@/\\.(:.*)?$") + endif() if(NOT "${_DLL_PATH}" MATCHES "^(.*:)?\\@bindir\\@/\\.\\./lib(:.*)?$") message(FATAL_ERROR "In order to successfully run the CMake test suite on Syllable you need to add \"\\@bindir\\@/../lib\" to the DLL_PATH environment variable") - endif(NOT "${_DLL_PATH}" MATCHES "^(.*:)?\\@bindir\\@/\\.\\./lib(:.*)?$") + endif() - else("${CMAKE_SYSTEM_NAME}" MATCHES syllable) + else() add_test(JumpWithLibOut ${CMAKE_CTEST_COMMAND} --build-and-test @@ -1127,8 +1127,8 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ if(CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG) ADD_TEST_MACRO(RuntimePath RuntimePath) - endif(CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG) - endif("${CMAKE_SYSTEM_NAME}" MATCHES syllable) + endif() + endif() add_test(linkorder1 ${CMAKE_CTEST_COMMAND} --build-and-test @@ -1184,7 +1184,7 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ --test-command kwsysTestsCxx testIOS ) list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/kwsys") - endif(NOT CMAKE_TEST_DIFFERENT_GENERATOR) + endif() set(MAKE_IS_GNU ) if(${CMAKE_TEST_MAKEPROGRAM} MATCHES make) exec_program( @@ -1194,9 +1194,9 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ if("${res}" EQUAL 0) if("${out}" MATCHES "GNU") set(MAKE_IS_GNU 1) - endif("${out}" MATCHES "GNU") - endif("${res}" EQUAL 0) - endif(${CMAKE_TEST_MAKEPROGRAM} MATCHES make) + endif() + endif() + endif() # only add this test on platforms that support it # some old versions of make simply cannot handle spaces in paths @@ -1234,7 +1234,7 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ "${CMake_BINARY_DIR}/Tests/SubDir/ShouldBeHere" "${CMake_BINARY_DIR}/Tests/SubDir/testfromsubdir.obj" ) - else (WIN32) + else () add_test(SubDir ${CMAKE_CTEST_COMMAND} --build-and-test "${CMake_SOURCE_DIR}/Tests/SubDir" @@ -1247,7 +1247,7 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ "${CMake_BINARY_DIR}/Tests/SubDir/ShouldBeHere" "${CMake_BINARY_DIR}/Tests/SubDir/testfromsubdir.o" ) - endif (WIN32) + endif () list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/SubDir") if(CMAKE_TEST_MSVC) @@ -1273,7 +1273,7 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ --test-command check_clean ) list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/MakeClean") - endif("${CMAKE_TEST_GENERATOR}" MATCHES "Makefile") + endif() if(NOT DEFINED CTEST_RUN_MFC) set(CTEST_RUN_MFC OFF) @@ -1383,7 +1383,7 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ if(${CMAKE_TEST_GENERATOR} MATCHES "Visual Studio") if(NOT MSVC60) ADD_TEST_MACRO(SBCS SBCS) - endif(NOT MSVC60) + endif() add_test(VSExternalInclude ${CMAKE_CTEST_COMMAND} --build-and-test @@ -1406,7 +1406,7 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM} --test-command VSMidl) list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/VSMidl") - endif(${CMAKE_TEST_GENERATOR} MATCHES "Visual Studio") + endif() if (APPLE) if (CMAKE_COMPILER_IS_GNUCXX OR "${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang") @@ -1444,8 +1444,8 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/CFBundleTest") ADD_TEST_MACRO(ObjC++ ObjC++) - endif (CMAKE_COMPILER_IS_GNUCXX OR "${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang") - endif (APPLE) + endif () + endif () if(APPLE AND CTEST_TEST_CPACK) add_test(BundleGeneratorTest ${CMAKE_CTEST_COMMAND} @@ -1460,7 +1460,7 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ --build-options "-DCMAKE_INSTALL_PREFIX:PATH=${CMake_BINARY_DIR}/Tests/BundleGeneratorTest/InstallDirectory" ) list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/BundleGeneratorTest") - endif(APPLE AND CTEST_TEST_CPACK) + endif() add_test(WarnUnusedUnusedViaSet ${CMAKE_CTEST_COMMAND} --build-and-test @@ -1570,8 +1570,8 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ mark_as_advanced(Subversion_SVNADMIN_EXECUTABLE) if(NOT Subversion_SVNADMIN_EXECUTABLE) set(Subversion_FOUND FALSE) - endif(NOT Subversion_SVNADMIN_EXECUTABLE) - endif(Subversion_FOUND) + endif() + endif() if(Subversion_FOUND) set(CTestUpdateSVN_DIR "CTest UpdateSVN") configure_file("${CMake_SOURCE_DIR}/Tests/CTestUpdateSVN.cmake.in" @@ -1580,22 +1580,22 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ -P "${CMake_BINARY_DIR}/Tests/CTestUpdateSVN.cmake" ) list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/${CTestUpdateSVN_DIR}") - endif(Subversion_FOUND) + endif() # Test CTest Update with CVS if(EXISTS ${CMAKE_ROOT}/Modules/FindCVS.cmake) find_package(CVS QUIET) - else(EXISTS ${CMAKE_ROOT}/Modules/FindCVS.cmake) + else() find_program(CVS_EXECUTABLE NAMES cvs) set(CVS_FOUND ${CVS_EXECUTABLE}) - endif(EXISTS ${CMAKE_ROOT}/Modules/FindCVS.cmake) + endif() set(CTEST_TEST_UPDATE_CVS ${CVS_FOUND}) if(CTEST_TEST_UPDATE_CVS AND NOT UNIX) if("${CVS_EXECUTABLE}" MATCHES "cygwin") message(STATUS "No CTest.UpdateCVS test with cygwin cvs.exe outside cygwin!") set(CTEST_TEST_UPDATE_CVS 0) - endif("${CVS_EXECUTABLE}" MATCHES "cygwin") - endif(CTEST_TEST_UPDATE_CVS AND NOT UNIX) + endif() + endif() if(CTEST_TEST_UPDATE_CVS) set(CTestUpdateCVS_DIR "CTest UpdateCVS") configure_file("${CMake_SOURCE_DIR}/Tests/CTestUpdateCVS.cmake.in" @@ -1604,7 +1604,7 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ -P "${CMake_BINARY_DIR}/Tests/CTestUpdateCVS.cmake" ) list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/${CTestUpdateCVS_DIR}") - endif(CTEST_TEST_UPDATE_CVS) + endif() # Test CTest Update with BZR find_program(BZR_EXECUTABLE NAMES bzr) @@ -1613,8 +1613,8 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ if(BZR_EXECUTABLE) if(NOT "${BZR_EXECUTABLE}" MATCHES "cygwin" OR UNIX) set(CTEST_TEST_UPDATE_BZR 1) - endif(NOT "${BZR_EXECUTABLE}" MATCHES "cygwin" OR UNIX) - endif(BZR_EXECUTABLE) + endif() + endif() if(CTEST_TEST_UPDATE_BZR) # Check if xmloutput plugin is there execute_process(COMMAND ${BZR_EXECUTABLE} xmlplugins RESULT_VARIABLE xmlplugres @@ -1635,8 +1635,8 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ ) set_tests_properties(CTest.UpdateBZR.CLocale PROPERTIES ENVIRONMENT LC_ALL=C) list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/${CTestUpdateBZR_DIR}") - endif( NOT ${xmlplugres} ) - endif(CTEST_TEST_UPDATE_BZR) + endif() + endif() # Test CTest Update with GIT find_program(GIT_EXECUTABLE NAMES git) @@ -1645,8 +1645,8 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ if(GIT_EXECUTABLE) if(NOT "${GIT_EXECUTABLE}" MATCHES "cygwin" OR UNIX) set(CTEST_TEST_UPDATE_GIT 1) - endif(NOT "${GIT_EXECUTABLE}" MATCHES "cygwin" OR UNIX) - endif(GIT_EXECUTABLE) + endif() + endif() if(CTEST_TEST_UPDATE_GIT) set(CTestUpdateGIT_DIR "CTest UpdateGIT") configure_file("${CMake_SOURCE_DIR}/Tests/CTestUpdateGIT.cmake.in" @@ -1655,7 +1655,7 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ -P "${CMake_BINARY_DIR}/Tests/CTestUpdateGIT.cmake" ) list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/${CTestUpdateGIT_DIR}") - endif(CTEST_TEST_UPDATE_GIT) + endif() # Test CTest Update with HG find_program(HG_EXECUTABLE NAMES hg) @@ -1664,8 +1664,8 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ if(HG_EXECUTABLE) if(NOT "${HG_EXECUTABLE}" MATCHES "cygwin" OR UNIX) set(CTEST_TEST_UPDATE_HG 1) - endif(NOT "${HG_EXECUTABLE}" MATCHES "cygwin" OR UNIX) - endif(HG_EXECUTABLE) + endif() + endif() if(CTEST_TEST_UPDATE_HG) set(CTestUpdateHG_DIR "CTest UpdateHG") configure_file("${CMake_SOURCE_DIR}/Tests/CTestUpdateHG.cmake.in" @@ -1674,8 +1674,8 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ -P "${CMake_BINARY_DIR}/Tests/CTestUpdateHG.cmake" ) list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/${CTestUpdateHG_DIR}") - endif(CTEST_TEST_UPDATE_HG) - endif(CTEST_TEST_UPDATE) + endif() + endif() configure_file( "${CMake_SOURCE_DIR}/Tests/CTestTestFailure/testNoBuild.cmake.in" @@ -1841,10 +1841,10 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ if(CMAKE_TEST_GENERATOR MATCHES "Watcom WMake") set_tests_properties(CTestTestCrash PROPERTIES PASS_REGULAR_EXPRESSION "Failed") - else(CMAKE_TEST_GENERATOR MATCHES "Watcom WMake") + else() set_tests_properties(CTestTestCrash PROPERTIES PASS_REGULAR_EXPRESSION "(Illegal|SegFault)") - endif(CMAKE_TEST_GENERATOR MATCHES "Watcom WMake") + endif() configure_file( "${CMake_SOURCE_DIR}/Tests/CTestTestBadExe/test.cmake.in" @@ -2055,14 +2055,14 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ set(protocol "${CMAKE_MATCH_1}") set(server "${CMAKE_MATCH_2}") set(path "${CMAKE_MATCH_3}") - else ("${CMAKE_TESTS_CDASH_SERVER}" MATCHES "${regex}") + else () set(protocol "http") set(server "www.cdash.org") set(path "/CDash") message("warning: CMAKE_TESTS_CDASH_SERVER does not match expected regex...") message(" ...using default url='${protocol}://${server}${path}' for CTestTest[23]") - endif ("${CMAKE_TESTS_CDASH_SERVER}" MATCHES "${regex}") - endif (CMAKE_TESTS_CDASH_SERVER) + endif () + endif () if (CTEST_TEST_CTEST AND CMAKE_RUN_LONG_TESTS AND CMAKE_TESTS_CDASH_SERVER) @@ -2097,40 +2097,40 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ if ("${PREVIOUS_TIMEOUT}" MATCHES NOTFOUND) set_tests_properties ( CTestTest PROPERTIES TIMEOUT ${CMAKE_LONG_TEST_TIMEOUT}) - endif ("${PREVIOUS_TIMEOUT}" MATCHES NOTFOUND) + endif () get_test_property(CTestTest2 TIMEOUT PREVIOUS_TIMEOUT) if ("${PREVIOUS_TIMEOUT}" MATCHES NOTFOUND) set_tests_properties ( CTestTest2 PROPERTIES TIMEOUT ${CMAKE_LONG_TEST_TIMEOUT}) - endif ("${PREVIOUS_TIMEOUT}" MATCHES NOTFOUND) - endif (CTEST_TEST_CTEST AND CMAKE_RUN_LONG_TESTS AND CMAKE_TESTS_CDASH_SERVER) + endif () + endif () if (CMAKE_RUN_LONG_TESTS AND TEST_KDE4_STABLE_BRANCH) if(UNIX) if(NOT QT4_FOUND) find_package(Qt4) - endif(NOT QT4_FOUND) + endif() set(TRY_BUILD_KDE4 TRUE) if(QT4_FOUND) # check whether it's Qt 4.5 in a cmake 2.4. compatible way: if(NOT EXISTS "${QT_QTNETWORK_INCLUDE_DIR}/QAbstractNetworkCache") set(TRY_BUILD_KDE4 FALSE) - endif(NOT EXISTS "${QT_QTNETWORK_INCLUDE_DIR}/QAbstractNetworkCache") - else(QT4_FOUND) + endif() + else() set(TRY_BUILD_KDE4 FALSE) - endif(QT4_FOUND) + endif() find_package(Perl) if(NOT PERL_FOUND) set(TRY_BUILD_KDE4 FALSE) - endif(NOT PERL_FOUND) + endif() find_package(ZLIB) if(NOT ZLIB_FOUND) set(TRY_BUILD_KDE4 FALSE) - endif(NOT ZLIB_FOUND) + endif() if(TRY_BUILD_KDE4) file(MAKE_DIRECTORY ${CMake_BINARY_DIR}/Tests/KDE4StableBranchTest) @@ -2138,18 +2138,18 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ configure_file(${CMake_SOURCE_DIR}/Tests/KDE4StableBranchTest/test_kde4.sh.in ${CMake_BINARY_DIR}/Tests/KDE4StableBranchTest/test_kde4.sh @ONLY) execute_process(COMMAND chmod 755 ${CMake_BINARY_DIR}/Tests/KDE4StableBranchTest/test_kde4.sh ) add_test(KDE4StableBranchTest ${CMake_BINARY_DIR}/Tests/KDE4StableBranchTest/test_kde4.sh) - endif(TRY_BUILD_KDE4) + endif() - endif(UNIX) - endif (CMAKE_RUN_LONG_TESTS AND TEST_KDE4_STABLE_BRANCH) + endif() + endif () if("${CMAKE_TEST_GENERATOR}" MATCHES Xcode) set(CMAKE_SKIP_BOOTSTRAP_TEST 1) - endif("${CMAKE_TEST_GENERATOR}" MATCHES Xcode) + endif() if(EXISTS "${CMake_BINARY_DIR}/CMakeLists.txt") # If there is CMakeLists.txt in the binary tree, assume in-source build set(CMAKE_SKIP_BOOTSTRAP_TEST 1) - endif(EXISTS "${CMake_BINARY_DIR}/CMakeLists.txt") + endif() set(bootstrap "") if(CMAKE_RUN_LONG_TESTS AND NOT CMAKE_SKIP_BOOTSTRAP_TEST) if(UNIX) @@ -2180,7 +2180,7 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ if ("${PREVIOUS_TIMEOUT}" MATCHES NOTFOUND) set_tests_properties ( BootstrapTest PROPERTIES TIMEOUT 5400) - endif ("${PREVIOUS_TIMEOUT}" MATCHES NOTFOUND) + endif () endif() if(CMAKE_Fortran_COMPILER) @@ -2237,7 +2237,7 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ --build-run-dir "${CMake_BINARY_DIR}/Tests/Java/" --test-command ${JAVA_RUNTIME} -classpath hello.jar HelloWorld) list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/Java") - endif("${JNI_FILE}" MATCHES "JDK1_2") + endif() endif() endif() @@ -2259,7 +2259,7 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ "-DCMAKE_SYSTEM_NAME=Generic" "-DCMAKE_C_COMPILER=${SDCC_EXECUTABLE}") list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/SimpleCOnly_sdcc") - endif(SDCC_EXECUTABLE) + endif() # If a Linux -> MinGW cross compiler is found then try it find_program(MINGW_CC_LINUX2WIN_EXECUTABLE i586-mingw32msvc-gcc) @@ -2282,7 +2282,7 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ ) list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/Simple_Mingw_Linux2Win") endif() - endif(CMAKE_TEST_GENERATOR MATCHES "Makefiles" OR CMAKE_TEST_GENERATOR MATCHES "KDevelop") + endif() if(UNIX) string(COMPARE EQUAL "${CMAKE_INSTALL_PREFIX}" "${CMake_BINARY_DIR}/Tests/TestShellInstall/Prefix" @@ -2294,36 +2294,36 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ @ONLY IMMEDIATE ) add_test(ShellInstall /bin/sh ${CMake_BINARY_DIR}/Tests/TestShellInstall/TestShellInstall.sh) - endif(PREFIX_IS_FOR_TEST) - endif(UNIX) + endif() + endif() if(CMAKE_TEST_PROJECT_CSE_DIR) set(script "${CMAKE_TEST_PROJECT_CSE_DIR}/BuildProjectCSE.cmake") if(NOT EXISTS "${script}") set(script "${CMAKE_TEST_PROJECT_CSE_DIR}/cse_build.cmake") - endif(NOT EXISTS "${script}") + endif() if(NOT EXISTS "${script}") message("warning: CMAKE_TEST_PROJECT_CSE_DIR set, but no build script found...") - endif(NOT EXISTS "${script}") + endif() add_test(BuildCSE ${CMAKE_CTEST_COMMAND} -V -S "${script}") set_tests_properties(BuildCSE PROPERTIES TIMEOUT 5400) - endif(CMAKE_TEST_PROJECT_CSE_DIR) + endif() if(CMAKE_TEST_PLPLOT_DIR) add_test(plplot ${CMAKE_CTEST_COMMAND} -V -S ${CMAKE_TEST_PLPLOT_DIR}/../../EasyDashboardScripts/plplot.cmake ) set_tests_properties ( plplot PROPERTIES TIMEOUT 5400) - endif(CMAKE_TEST_PLPLOT_DIR) + endif() if(CMAKE_TEST_CHICKEN_DIR) add_test(Chicken ${CMAKE_CTEST_COMMAND} -V -S ${CMAKE_TEST_CHICKEN_DIR}/../../EasyDashboardScripts/Chicken.cmake ) set_tests_properties ( Chicken PROPERTIES TIMEOUT 5400) - endif(CMAKE_TEST_CHICKEN_DIR) + endif() if(CMAKE_TEST_KDELIBS_ALPHA_1_DIR) add_test(KDELibsAlpha1 ${CMAKE_CTEST_COMMAND} -V -S ${CMAKE_TEST_KDELIBS_ALPHA_1_DIR}/../../EasyDashboardScripts/kdelibs.cmake ) set_tests_properties ( KDELibsAlpha1 PROPERTIES TIMEOUT 5400) - endif(CMAKE_TEST_KDELIBS_ALPHA_1_DIR) + endif() # If this is not an in-source build, provide a target to wipe out # all the test build directories. @@ -2334,7 +2334,7 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ COMMAND ${CMAKE_COMMAND} -P ${CMake_BINARY_DIR}/Tests/test_clean.cmake COMMENT "Removing test build directories." ) - endif(NOT EXISTS "${CMake_BINARY_DIR}/CMakeLists.txt") + endif() add_test(CMakeWizardTest ${CMAKE_CMAKE_COMMAND} -D build_dir:STRING=${CMAKE_CURRENT_BINARY_DIR}/CMakeWizardTest @@ -2399,6 +2399,6 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ set_tests_properties(KWStyle PROPERTIES WORKING_DIRECTORY ${CMake_BINARY_DIR}/Utilities/KWStyle) endif() -endif(BUILD_TESTING) +endif() subdirs(CMakeTests) diff --git a/Tests/CMakeOnly/AllFindModules/CMakeLists.txt b/Tests/CMakeOnly/AllFindModules/CMakeLists.txt index 551cee3..fb0bd15 100644 --- a/Tests/CMakeOnly/AllFindModules/CMakeLists.txt +++ b/Tests/CMakeOnly/AllFindModules/CMakeLists.txt @@ -13,7 +13,7 @@ file(GLOB FIND_MODULES "${CMAKE_CURRENT_SOURCE_DIR}/../../../Modules/Find*.cmake macro(do_find MODULE_NAME) message(STATUS " Checking Find${MODULE_NAME}") find_package(${MODULE_NAME}) -endmacro(do_find) +endmacro() # It is only possible to use either Qt3 or Qt4 in one project. # Since FindQt will complain if both are found we explicitly request Qt4 here @@ -35,15 +35,15 @@ foreach(FIND_MODULE ${FIND_MODULES}) do_find(${MODULE_NAME}) endif () -endforeach(FIND_MODULE) +endforeach() # Qt4 is not present, so we can check Qt3 if (NOT QT4_FOUND) set(DESIRED_QT_VERSION 3) foreach(FIND_MODULE ${NO_QT4_MODULES} "Qt") do_find(${FIND_MODULE}) - endforeach(FIND_MODULE) -endif (NOT QT4_FOUND) + endforeach() +endif () macro(check_version_string MODULE_NAME VERSION_VAR) if (${MODULE_NAME}_FOUND) @@ -65,7 +65,7 @@ macro(check_version_string MODULE_NAME VERSION_VAR) message(SEND_ERROR "${MODULE_NAME}_FOUND is set but version number variable ${VERSION_VAR} is NOT DEFINED") endif() endif () -endmacro(check_version_string) +endmacro() # If any of these modules reported that it was found a version number should have been # reported. @@ -73,12 +73,12 @@ endmacro(check_version_string) foreach(VTEST ALSA ARMADILLO BZIP2 CUPS CURL EXPAT FREETYPE GETTEXT GIT HSPELL JASPER LIBLZMA LIBXML2 LIBXSLT PERL PKG_CONFIG PostgreSQL TIFF ZLIB) check_version_string(${VTEST} ${VTEST}_VERSION_STRING) -endforeach(VTEST) +endforeach() foreach(VTEST BISON Boost CUDA DOXYGEN FLEX GIF GTK2 LibArchive OPENSCENEGRAPH RUBY SWIG) check_version_string(${VTEST} ${VTEST}_VERSION) -endforeach(VTEST) +endforeach() check_version_string(PYTHONINTERP PYTHON_VERSION_STRING) check_version_string(SUBVERSION Subversion_VERSION_SVN) diff --git a/Tests/CMakeOnly/CheckCXXSymbolExists/CMakeLists.txt b/Tests/CMakeOnly/CheckCXXSymbolExists/CMakeLists.txt index 70c186c..9528aa3 100644 --- a/Tests/CMakeOnly/CheckCXXSymbolExists/CMakeLists.txt +++ b/Tests/CMakeOnly/CheckCXXSymbolExists/CMakeLists.txt @@ -23,7 +23,7 @@ foreach(_config_type Release RelWithDebInfo MinSizeRel Debug) if (CSE_RESULT_${_config_type}) message(SEND_ERROR "CheckCXXSymbolExists reported a nonexistent symbol as existing in configuration ${_config_type}") - endif (CSE_RESULT_${_config_type}) + endif () endforeach() set(CMAKE_TRY_COMPILE_CONFIGURATION ${CMAKE_BUILD_TYPE}) @@ -42,12 +42,12 @@ if (NOT CSE_RESULT_ERRNO_CERRNO) if (NOT CSE_RESULT_ERRNO_ERRNOH) message(SEND_ERROR "CheckCXXSymbolExists did not find errno in <cerrno> and <errno.h>") - else (NOT CSE_RESULT_ERRNO_ERRNOH) + else () message(STATUS "errno found in <errno.h>") - endif (NOT CSE_RESULT_ERRNO_ERRNOH) -else (NOT CSE_RESULT_ERRNO_CERRNO) + endif () +else () message(STATUS "errno found in <cerrno>") -endif (NOT CSE_RESULT_ERRNO_CERRNO) +endif () if (CMAKE_COMPILER_IS_GNUCXX) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O3") @@ -58,5 +58,5 @@ if (CMAKE_COMPILER_IS_GNUCXX) if (CSE_RESULT_O3) message(SEND_ERROR "CheckCXXSymbolExists reported a nonexistent symbol as existing with optimization -O3") - endif (CSE_RESULT_O3) -endif (CMAKE_COMPILER_IS_GNUCXX) + endif () +endif () diff --git a/Tests/CMakeOnly/CheckSymbolExists/CMakeLists.txt b/Tests/CMakeOnly/CheckSymbolExists/CMakeLists.txt index acf0d2d..7656577 100644 --- a/Tests/CMakeOnly/CheckSymbolExists/CMakeLists.txt +++ b/Tests/CMakeOnly/CheckSymbolExists/CMakeLists.txt @@ -24,7 +24,7 @@ foreach(_config_type Release RelWithDebInfo MinSizeRel Debug) if (CSE_RESULT_${_config_type}) message(SEND_ERROR "CheckSymbolExists reported a nonexistent symbol as existing in configuration ${_config_type}") - endif (CSE_RESULT_${_config_type}) + endif () endforeach() set(CMAKE_TRY_COMPILE_CONFIGURATION ${CMAKE_BUILD_TYPE}) @@ -34,9 +34,9 @@ check_symbol_exists(errno "errno.h" CSE_RESULT_ERRNO) if (NOT CSE_RESULT_ERRNO) message(SEND_ERROR "CheckSymbolExists did not find errno in <errno.h>") -else (NOT CSE_RESULT_ERRNO) +else () message(STATUS "errno found as expected") -endif (NOT CSE_RESULT_ERRNO) +endif () if (CMAKE_COMPILER_IS_GNUCC) set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -O3") @@ -47,5 +47,5 @@ if (CMAKE_COMPILER_IS_GNUCC) if (CSE_RESULT_O3) message(SEND_ERROR "CheckSymbolExists reported a nonexistent symbol as existing with optimization -O3") - endif (CSE_RESULT_O3) -endif (CMAKE_COMPILER_IS_GNUCC) + endif () +endif () diff --git a/Tests/CMakeTestMultipleConfigures/RunCMake.cmake b/Tests/CMakeTestMultipleConfigures/RunCMake.cmake index 19391d7..9632664 100644 --- a/Tests/CMakeTestMultipleConfigures/RunCMake.cmake +++ b/Tests/CMakeTestMultipleConfigures/RunCMake.cmake @@ -143,7 +143,7 @@ function(analyze_directory_diffs d1 d2 diff_count_var) endif() set(${diff_count_var} ${diffs} PARENT_SCOPE) -endfunction(analyze_directory_diffs) +endfunction() # Analyze diffs between b1:b2, b2:b3, b3:b4, b4:b5 ... bN-1:bN. diff --git a/Tests/CMakeTests/CMakeLists.txt b/Tests/CMakeTests/CMakeLists.txt index fadcc1e..d34d4a6 100644 --- a/Tests/CMakeTests/CMakeLists.txt +++ b/Tests/CMakeTests/CMakeLists.txt @@ -6,7 +6,7 @@ macro(AddCMakeTest TestName PreArgs) "${CMAKE_CURRENT_BINARY_DIR}/${TestName}Test.cmake" @ONLY IMMEDIATE) add_test(CMake.${TestName} ${CMAKE_EXECUTABLE} ${PreArgs} -P "${CMAKE_CURRENT_BINARY_DIR}/${TestName}Test.cmake" ${ARGN}) -endmacro(AddCMakeTest) +endmacro() AddCMakeTest(List "") diff --git a/Tests/CMakeTests/FindBaseTest.cmake.in b/Tests/CMakeTests/FindBaseTest.cmake.in index 47c1692..658b350 100644 --- a/Tests/CMakeTests/FindBaseTest.cmake.in +++ b/Tests/CMakeTests/FindBaseTest.cmake.in @@ -12,7 +12,7 @@ set(_HEADER_FULL_A "${MY_SOURCE_DIR}/A/include/${_HEADER}") find_file(FOO_H_1 ${_HEADER}) if(FOO_H_1) message(FATAL_ERROR "${_HEADER} found: ${FOO_H_1}, it should not exist !") -endif(FOO_H_1) +endif() # The HINTS option should override the system but the PATHS option # should not. @@ -21,10 +21,10 @@ find_file(TEST_H_1 ${_HEADER} HINTS ${MY_SOURCE_DIR}/A/include) find_file(TEST_H_2 ${_HEADER} PATHS ${MY_SOURCE_DIR}/A/include) if(NOT "${TEST_H_1}" STREQUAL "${_HEADER_FULL_A}") message(FATAL_ERROR "Did not find \"${_HEADER_FULL_A}\"\ngot \"${TEST_H_1}\" instead!") -endif(NOT "${TEST_H_1}" STREQUAL "${_HEADER_FULL_A}") +endif() if(NOT "${TEST_H_2}" STREQUAL "${_HEADER_FULL}") message(FATAL_ERROR "Did not find \"${_HEADER_FULL}\"\ngot \"${TEST_H_2}\" instead!") -endif(NOT "${TEST_H_2}" STREQUAL "${_HEADER_FULL}") +endif() set(CMAKE_SYSTEM_PREFIX_PATH) # with this it still should not be found, since the include/ subdir is still missing @@ -32,20 +32,20 @@ set(CMAKE_INCLUDE_PATH "${MY_SOURCE_DIR}") find_file(FOO_H_2 ${_HEADER}) if(FOO_H_2) message(FATAL_ERROR "${_HEADER} found: ${FOO_H_2}, it should not exist !") -endif(FOO_H_2) +endif() # now with the PATH_SUFFIX it should be found find_file(FOO_H_3 NAMES ${_HEADER} PATH_SUFFIXES include ) if(NOT "${FOO_H_3}" STREQUAL "${_HEADER_FULL}") message(FATAL_ERROR "Did not find \"${_HEADER_FULL}\"\ngot ${FOO_H_3} instead !") -endif(NOT "${FOO_H_3}" STREQUAL "${_HEADER_FULL}") +endif() # without PATH_SUFFIX, but with a CMAKE_INCLUDE_PATH it should not be found set(CMAKE_INCLUDE_PATH /include) find_file(FOO_H_4 ${_HEADER}) if(FOO_H_4) message(FATAL_ERROR "${_HEADER} found: ${FOO_H_4}, it should not exist !") -endif(FOO_H_4) +endif() # when setting CMAKE_FIND_ROOT_PATH to the current source dir, # together with the CMAKE_INCLUDE_PATH it should be found @@ -53,10 +53,10 @@ set(CMAKE_FIND_ROOT_PATH blub "${MY_SOURCE_DIR}") find_file(FOO_H_5 ${_HEADER}) if(NOT "${FOO_H_5}" STREQUAL "${_HEADER_FULL}") message(FATAL_ERROR "Did not find \"${_HEADER_FULL}\"\ngot ${FOO_H_5} instead !") -endif(NOT "${FOO_H_5}" STREQUAL "${_HEADER_FULL}") +endif() # by explicitly disabling CMAKE_FIND_ROOT_PATH again it shouldn't be found find_file(FOO_H_6 ${_HEADER} NO_CMAKE_FIND_ROOT_PATH) if(FOO_H_6) message(FATAL_ERROR "${_HEADER} found: ${FOO_H_6}, it should not exist !") -endif(FOO_H_6) +endif() diff --git a/Tests/CMakeTests/GetFilenameComponentRealpathTest.cmake.in b/Tests/CMakeTests/GetFilenameComponentRealpathTest.cmake.in index 7adc240..22f6afd 100644 --- a/Tests/CMakeTests/GetFilenameComponentRealpathTest.cmake.in +++ b/Tests/CMakeTests/GetFilenameComponentRealpathTest.cmake.in @@ -66,7 +66,7 @@ if(UNIX) if(EXISTS file1 OR EXISTS file2) message(FATAL_ERROR "removal of file1 or file2 failed") endif() - endif(LN) + endif() file(REMOVE ${bindir}/file3) endif() diff --git a/Tests/CMakeTests/GetPrerequisitesTest.cmake.in b/Tests/CMakeTests/GetPrerequisitesTest.cmake.in index daf467b..89ca735 100644 --- a/Tests/CMakeTests/GetPrerequisitesTest.cmake.in +++ b/Tests/CMakeTests/GetPrerequisitesTest.cmake.in @@ -58,7 +58,7 @@ function(stresstest_list_prerequisites file) message(STATUS "=============================================================================") message(STATUS "") -endfunction(stresstest_list_prerequisites) +endfunction() function(test_cmake_executables) @@ -68,7 +68,7 @@ function(test_cmake_executables) get_filename_component(cmake_bin_dir "${CMAKE_COMMAND}" PATH) list_prerequisites_by_glob(GLOB "${cmake_bin_dir}/*" 0 0 1) -endfunction(test_cmake_executables) +endfunction() message(STATUS "=============================================================================") @@ -93,7 +93,7 @@ if(do_testdefaults) message(STATUS "") list_prerequisites("${CMAKE_COMMAND}") message(STATUS "") -endif(do_testdefaults) +endif() set(do_stresstest 0) @@ -103,7 +103,7 @@ if(do_stresstest) message(STATUS "") stresstest_list_prerequisites("${CMAKE_COMMAND}") message(STATUS "") -endif(do_stresstest) +endif() test_cmake_executables() @@ -141,7 +141,7 @@ message(STATUS "") get_cmake_property(vs VARIABLES) foreach(v ${vs}) message(STATUS "${v}='${${v}}'") -endforeach(v) +endforeach() message(STATUS "") message(STATUS "=============================================================================") diff --git a/Tests/CMakeTests/IncludeTest.cmake.in b/Tests/CMakeTests/IncludeTest.cmake.in index eca679b..985333c 100644 --- a/Tests/CMakeTests/IncludeTest.cmake.in +++ b/Tests/CMakeTests/IncludeTest.cmake.in @@ -9,18 +9,18 @@ set(fileTwo "${CMAKE_ROOT}/Modules/CMake.cmake") if(WIN32) string(TOLOWER "${fileOne}" fileOne) string(TOLOWER "${fileTwo}" fileTwo) -endif(WIN32) +endif() if(NOT "${fileOne}" STREQUAL "${fileTwo}") message(FATAL_ERROR "Wrong CMake.cmake was included: \"${fileOne}\" expected \"${fileTwo}\"") -endif(NOT "${fileOne}" STREQUAL "${fileTwo}") +endif() # this one must return NOTFOUND in _includedFile include(I_do_not_exist OPTIONAL RESULT_VARIABLE _includedFile) if(_includedFile) message(FATAL_ERROR "File \"I_do_not_exist\" was included, although it shouldn't exist,\nIncluded file is \"${_includedFile}\"") -endif(_includedFile) +endif() # and this one must succeed too include(CMake OPTIONAL RESULT_VARIABLE _includedFile) @@ -29,11 +29,11 @@ set(fileTwo "${CMAKE_ROOT}/Modules/CMake.cmake") if(WIN32) string(TOLOWER "${fileOne}" fileOne) string(TOLOWER "${fileTwo}" fileTwo) -endif(WIN32) +endif() if(NOT "${fileOne}" STREQUAL "${fileTwo}") message(FATAL_ERROR "Wrong CMake.cmake was included: \"${fileOne}\" expected \"${fileTwo}\"") -endif(NOT "${fileOne}" STREQUAL "${fileTwo}") +endif() # Check that CMAKE_CURRENT_LIST_DIR is working: # Needs to be a file in the build tree, which is correct cmake script diff --git a/Tests/CMakeTests/ListTest.cmake.in b/Tests/CMakeTests/ListTest.cmake.in index 5db171c..07fc7c6 100644 --- a/Tests/CMakeTests/ListTest.cmake.in +++ b/Tests/CMakeTests/ListTest.cmake.in @@ -1,10 +1,10 @@ macro(TEST command expected) if("x${result}" STREQUAL "x${expected}") #message("TEST \"${command}\" success: \"${result}\" expected: \"${expected}\"") - else("x${result}" STREQUAL "x${expected}") + else() message(SEND_ERROR "${CMAKE_CURRENT_LIST_LINE}: TEST \"${command}\" failed: \"${result}\" expected: \"${expected}\"") - endif("x${result}" STREQUAL "x${expected}") -endmacro(TEST command expected) + endif() +endmacro() set(mylist andy bill ken brad) diff --git a/Tests/CMakeTests/StringTestScript.cmake b/Tests/CMakeTests/StringTestScript.cmake index 7a264a0..a562e71 100644 --- a/Tests/CMakeTests/StringTestScript.cmake +++ b/Tests/CMakeTests/StringTestScript.cmake @@ -236,42 +236,42 @@ elseif(testname STREQUAL string_find_with_no_possible_result) # pass message(STATUS "v='${v}'") if(NOT(-1 EQUAL ${v})) message(SEND_ERROR "FIND sub-command should return -1 but returned ${v}.") - endif(NOT(-1 EQUAL ${v})) + endif() elseif(testname STREQUAL string_find_reverse_with_no_possible_result) # pass string(FIND "CMake is a great application." "z" v REVERSE) message(STATUS "v='${v}'") if(NOT(-1 EQUAL ${v})) message(SEND_ERROR "FIND REVERSE sub-command should return -1 but returned ${v}.") - endif(NOT(-1 EQUAL ${v})) + endif() elseif(testname STREQUAL string_find_with_required_result) # pass string(FIND "CMake is a great application." "g" v) message(STATUS "v='${v}'") if(NOT(11 EQUAL ${v})) message(SEND_ERROR "FIND sub-command should return 11 but returned ${v}.") - endif(NOT(11 EQUAL ${v})) + endif() elseif(testname STREQUAL string_find_reverse_with_required_result) # pass string(FIND "CMake is a great application." "e" v REVERSE) message(STATUS "v='${v}'") if(NOT(13 EQUAL ${v})) message(SEND_ERROR "FIND REVERSE sub-command should return 13 but returned ${v}.") - endif(NOT(13 EQUAL ${v})) + endif() elseif(testname STREQUAL string_find_word_reverse_with_required_result) # pass string(FIND "The command should find REVERSE in this string. Or maybe this REVERSE?!" "REVERSE" v) message(STATUS "v='${v}'") if(NOT(24 EQUAL ${v})) message(SEND_ERROR "FIND sub-command should return 24 but returned ${v}.") - endif(NOT(24 EQUAL ${v})) + endif() elseif(testname STREQUAL string_find_reverse_word_reverse_with_required_result) # pass string(FIND "The command should find REVERSE in this string. Or maybe this REVERSE?!" "REVERSE" v REVERSE) message(STATUS "v='${v}'") if(NOT(62 EQUAL ${v})) message(SEND_ERROR "FIND sub-command should return 62 but returned ${v}.") - endif(NOT(62 EQUAL ${v})) + endif() else() # fail message(FATAL_ERROR "testname='${testname}' - error: no such test in '${CMAKE_CURRENT_LIST_FILE}'") diff --git a/Tests/CMakeTests/ToolchainTest.cmake.in b/Tests/CMakeTests/ToolchainTest.cmake.in index cd258db..c010fca 100644 --- a/Tests/CMakeTests/ToolchainTest.cmake.in +++ b/Tests/CMakeTests/ToolchainTest.cmake.in @@ -4,7 +4,7 @@ # overwrite mark_as_advanced(), since this is used in CMakeDetermineCCompiler.cmake # which will complain that it can"t be used in script mode macro(MARK_AS_ADVANCED) -endmacro(MARK_AS_ADVANCED) +endmacro() # set this to a place where we are allowed to write set(CMAKE_PLATFORM_ROOT_BIN "${CMAKE_CURRENT_BINARY_DIR}") @@ -21,19 +21,19 @@ include(CMakeDetermineSystem) # check that CMAKE_SYSTEM_XXX and CMAKE_HOST_SYSTEM_xxx are identical if(NOT "${CMAKE_SYSTEM_NAME}" STREQUAL "${CMAKE_HOST_SYSTEM_NAME}") message(FATAL_ERROR "CMAKE_SYSTEM_NAME and CMAKE_HOST_SYSTEM_NAME not identical: \"${CMAKE_SYSTEM_NAME}\" vs. \"${CMAKE_HOST_SYSTEM_NAME}\"") -endif(NOT "${CMAKE_SYSTEM_NAME}" STREQUAL "${CMAKE_HOST_SYSTEM_NAME}") +endif() if(NOT "${CMAKE_SYSTEM}" STREQUAL "${CMAKE_HOST_SYSTEM}") message(FATAL_ERROR "CMAKE_SYSTEM and CMAKE_HOST_SYSTEM not identical: \"${CMAKE_SYSTEM}\" vs. \"${CMAKE_HOST_SYSTEM}\"") -endif(NOT "${CMAKE_SYSTEM}" STREQUAL "${CMAKE_HOST_SYSTEM}") +endif() if(NOT "${CMAKE_SYSTEM_VERSION}" STREQUAL "${CMAKE_HOST_SYSTEM_VERSION}") message(FATAL_ERROR "CMAKE_SYSTEM_VERSION and CMAKE_HOST_SYSTEM_VERSION not identical: \"${CMAKE_SYSTEM_VERSION}\" vs. \"${CMAKE_HOST_SYSTEM_VERSION}\"") -endif(NOT "${CMAKE_SYSTEM_VERSION}" STREQUAL "${CMAKE_HOST_SYSTEM_VERSION}") +endif() if(NOT "${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "${CMAKE_HOST_SYSTEM_PROCESSOR}") message(FATAL_ERROR "CMAKE_SYSTEM_PROCESSOR and CMAKE_HOST_SYSTEM_PROCESSOR not identical: \"${CMAKE_SYSTEM_PROCESSOR}\" vs. \"${CMAKE_HOST_SYSTEM_PROCESSOR}\"") -endif(NOT "${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "${CMAKE_HOST_SYSTEM_PROCESSOR}") +endif() # save the values so we can compare them to CMAKE_HOST_SYSTEM_XXX in the toolchain case @@ -73,35 +73,35 @@ include(CMakeDetermineCXXCompiler) if(NOT "${CMAKE_SYSTEM_NAME}" STREQUAL "Dumdidum") message(FATAL_ERROR "CMAKE_SYSTEM_NAME overwritten: \"${CMAKE_SYSTEM_NAME}\", was: \"Dumdidum\"") -endif(NOT "${CMAKE_SYSTEM_NAME}" STREQUAL "Dumdidum") +endif() if(NOT "${CMAKE_SYSTEM}" STREQUAL "Dumdidum-1.0") message(FATAL_ERROR "CMAKE_SYSTEM wrong: \"${CMAKE_SYSTEM}\", expected: \"Dumdidum-1.0\"") -endif(NOT "${CMAKE_SYSTEM}" STREQUAL "Dumdidum-1.0") +endif() set(fileOne "${_INCLUDED_TOOLCHAIN_FILE}") set(fileTwo "${MY_SOURCE_DIR}/DummyToolchain.cmake") if(WIN32) string(TOLOWER "${fileOne}" fileOne) string(TOLOWER "${fileTwo}" fileTwo) -endif(WIN32) +endif() if(NOT "${fileOne}" STREQUAL "${fileTwo}") message(FATAL_ERROR "Wrong toolchain was loaded: \"${fileOne}\" expected \"${fileTwo}\"") -endif(NOT "${fileOne}" STREQUAL "${fileTwo}") +endif() # check that CMAKE_HOST_SYSTEM_XXX and _SYSTEM_xxx detected above are identical if(NOT "${CMAKE_HOST_SYSTEM_NAME}" STREQUAL "${NATIVE_SYSTEM_NAME}") message(FATAL_ERROR "CMAKE_HOST_SYSTEM_NAME and NATIVE_SYSTEM_NAME not identical: \"${CMAKE_HOST_SYSTEM_NAME}\" vs. \"${NATIVE_SYSTEM_NAME}\"") -endif(NOT "${CMAKE_HOST_SYSTEM_NAME}" STREQUAL "${NATIVE_SYSTEM_NAME}") +endif() if(NOT "${CMAKE_HOST_SYSTEM}" STREQUAL "${NATIVE_SYSTEM}") message(FATAL_ERROR "CMAKE_HOST_SYSTEM and NATIVE_SYSTEM not identical: \"${CMAKE_HOST_SYSTEM}\" vs. \"${NATIVE_SYSTEM}\"") -endif(NOT "${CMAKE_HOST_SYSTEM}" STREQUAL "${NATIVE_SYSTEM}") +endif() if(NOT "${CMAKE_HOST_SYSTEM_VERSION}" STREQUAL "${NATIVE_SYSTEM_VERSION}") message(FATAL_ERROR "CMAKE_HOST_SYSTEM_VERSION and NATIVE_SYSTEM_VERSION not identical: \"${CMAKE_HOST_SYSTEM_VERSION}\" vs. \"${NATIVE_SYSTEM_VERSION}\"") -endif(NOT "${CMAKE_HOST_SYSTEM_VERSION}" STREQUAL "${NATIVE_SYSTEM_VERSION}") +endif() if(NOT "${CMAKE_HOST_SYSTEM_PROCESSOR}" STREQUAL "${NATIVE_SYSTEM_PROCESSOR}") message(FATAL_ERROR "CMAKE_HOST_SYSTEM_PROCESSOR and NATIVE_SYSTEM_PROCESSOR not identical: \"${CMAKE_HOST_SYSTEM_PROCESSOR}\" vs. \"${NATIVE_SYSTEM_PROCESSOR}\"") -endif(NOT "${CMAKE_HOST_SYSTEM_PROCESSOR}" STREQUAL "${NATIVE_SYSTEM_PROCESSOR}") +endif() ############################################################# @@ -109,15 +109,15 @@ endif(NOT "${CMAKE_HOST_SYSTEM_PROCESSOR}" STREQUAL "${NATIVE_SYSTEM_PROCESSOR}" if(NOT "${_CMAKE_TOOLCHAIN_PREFIX}" STREQUAL "arm-elf-") message(FATAL_ERROR "wrong toolchain prefix detected: \"${_CMAKE_TOOLCHAIN_PREFIX}\", expected: \"arm-elf-\"") -endif(NOT "${_CMAKE_TOOLCHAIN_PREFIX}" STREQUAL "arm-elf-") +endif() if(NOT "${_CMAKE_USER_C_COMPILER_PATH}" STREQUAL "/opt/foo/bin") message(FATAL_ERROR "wrong C compiler location detected: \"${_CMAKE_USER_C_COMPILER_PATH}\", expected: \"/opt/foo/bin\"") -endif(NOT "${_CMAKE_USER_C_COMPILER_PATH}" STREQUAL "/opt/foo/bin") +endif() if(NOT "${CMAKE_C_OUTPUT_EXTENSION}" STREQUAL ".foo") message(FATAL_ERROR "C output extension overwritten: \"${CMAKE_C_OUTPUT_EXTENSION}\", was: \".foo\"") -endif(NOT "${CMAKE_C_OUTPUT_EXTENSION}" STREQUAL ".foo") +endif() ############################################################# @@ -125,11 +125,11 @@ endif(NOT "${CMAKE_C_OUTPUT_EXTENSION}" STREQUAL ".foo") if(NOT "${_CMAKE_USER_CXX_COMPILER_PATH}" STREQUAL "/opt/bar/bin") message(FATAL_ERROR "wrong CXX compiler location detected: \"${_CMAKE_USER_CXX_COMPILER_PATH}\", expected: \"/opt/bar/bin\"") -endif(NOT "${_CMAKE_USER_CXX_COMPILER_PATH}" STREQUAL "/opt/bar/bin") +endif() if(NOT "${CMAKE_CXX_OUTPUT_EXTENSION}" STREQUAL ".bar") message(FATAL_ERROR "C output extension overwritten: \"${CMAKE_CXX_OUTPUT_EXTENSION}\", was: \".bar\"") -endif(NOT "${CMAKE_CXX_OUTPUT_EXTENSION}" STREQUAL ".bar") +endif() message(STATUS "CMAKE_SYSTEM: \"${CMAKE_SYSTEM}\"") message(STATUS "_CMAKE_TOOLCHAIN_PREFIX: \"${_CMAKE_TOOLCHAIN_PREFIX}\"") diff --git a/Tests/CMakeTests/VariableWatchTest.cmake.in b/Tests/CMakeTests/VariableWatchTest.cmake.in index 3d290d6..0c084fd 100644 --- a/Tests/CMakeTests/VariableWatchTest.cmake.in +++ b/Tests/CMakeTests/VariableWatchTest.cmake.in @@ -7,7 +7,7 @@ macro(testwatch var access file stack) message("There was a ${access} access done on the variable: ${var} in file ${file}") message("List file stack is: ${stack}") set(${var}_watched 1) -endmacro(testwatch) +endmacro() variable_watch(somevar testwatch) diff --git a/Tests/CMakeTests/WhileTest.cmake.in b/Tests/CMakeTests/WhileTest.cmake.in index 4693f2d..4cec291 100644 --- a/Tests/CMakeTests/WhileTest.cmake.in +++ b/Tests/CMakeTests/WhileTest.cmake.in @@ -10,7 +10,7 @@ while(COUNT LESS 200) set(NUMBERS "${NUMBERS} ${NCOUNT}") set(NCOUNT "${NCOUNT}0") endwhile() -endwhile(COUNT LESS 200) +endwhile() if(NOT NUMBERS STREQUAL " 0 3 30 20 3 30") message(SEND_ERROR "while loop nesting error, result: '${NUMBERS}'") diff --git a/Tests/COnly/CMakeLists.txt b/Tests/COnly/CMakeLists.txt index 5ef0f1e..b3cc438 100644 --- a/Tests/COnly/CMakeLists.txt +++ b/Tests/COnly/CMakeLists.txt @@ -10,14 +10,14 @@ target_link_libraries(COnly testc1 testc2) if(MSVC_VERSION) set_target_properties(COnly PROPERTIES LINK_FLAGS " /NODEFAULTLIB:\"libcdg.lib\" /NODEFAULTLIB:\"libcmtg.lib\" /NODEFAULTLIB:\"foomsvcrt.lib\" /NODEFAULTLIB:\"libbar.lib\" /NODEFAULTLIB:\"libfooba.lib\"") -endif(MSVC_VERSION) +endif() string(ASCII 35 32 67 77 97 107 101 ASCII_STRING) message(STATUS "String: ${ASCII_STRING}") get_source_file_property(LANG conly.c LANGUAGE) if("${LANG}" STREQUAL "C") message("Language is C") -else("${LANG}" STREQUAL "C") +else() message(FATAL_ERROR "Bad language for file conly.c") -endif("${LANG}" STREQUAL "C") +endif() add_library(testCModule MODULE testCModule.c) diff --git a/Tests/CPackComponents/VerifyResult.cmake b/Tests/CPackComponents/VerifyResult.cmake index 850ec00..c7c24fd 100644 --- a/Tests/CPackComponents/VerifyResult.cmake +++ b/Tests/CPackComponents/VerifyResult.cmake @@ -4,7 +4,7 @@ message(STATUS "") if(NOT CPackComponents_BINARY_DIR) message(FATAL_ERROR "CPackComponents_BINARY_DIR not set") -endif(NOT CPackComponents_BINARY_DIR) +endif() set(expected_file_mask "") @@ -18,15 +18,15 @@ if(WIN32) ) if(NSIS_MAKENSIS_EXECUTABLE) set(expected_file_mask "${CPackComponents_BINARY_DIR}/MyLib-*.exe") - endif(NSIS_MAKENSIS_EXECUTABLE) -endif(WIN32) + endif() +endif() if(APPLE) # Always expect the *.dmg installer - PackageMaker should always # be installed on a development Mac: # set(expected_file_mask "${CPackComponents_BINARY_DIR}/MyLib-*.dmg") -endif(APPLE) +endif() if(expected_file_mask) set(expected_count 1) @@ -38,11 +38,11 @@ if(expected_file_mask) if(NOT expected_file) message(FATAL_ERROR "error: expected_file does not exist: CPackComponents test fails.") - endif(NOT expected_file) + endif() list(LENGTH expected_file actual_count) message(STATUS "actual_count='${actual_count}'") if(NOT actual_count EQUAL expected_count) message(FATAL_ERROR "error: expected_count does not match actual_count: CPackComponents test fails.") - endif(NOT actual_count EQUAL expected_count) -endif(expected_file_mask) + endif() +endif() diff --git a/Tests/CPackComponentsForAll/CMakeLists.txt b/Tests/CPackComponentsForAll/CMakeLists.txt index 5449d09..8162f0c 100644 --- a/Tests/CPackComponentsForAll/CMakeLists.txt +++ b/Tests/CPackComponentsForAll/CMakeLists.txt @@ -118,6 +118,6 @@ if (NOT ("${CPackComponentWay}" STREQUAL "default")) ${CPackComponentsForAll_BINARY_DIR}/MyLibCPackConfig-${CPackComponentWay}.cmake @ONLY) set(CPACK_PROJECT_CONFIG_FILE ${CPackComponentsForAll_BINARY_DIR}/MyLibCPackConfig-${CPackComponentWay}.cmake) -endif (NOT ("${CPackComponentWay}" STREQUAL "default")) +endif () # Include CPack to introduce the appropriate targets include(CPack)
\ No newline at end of file diff --git a/Tests/CPackComponentsForAll/MyLibCPackConfig-AllInOne.cmake.in b/Tests/CPackComponentsForAll/MyLibCPackConfig-AllInOne.cmake.in index 1d203c8..0bfbf14 100644 --- a/Tests/CPackComponentsForAll/MyLibCPackConfig-AllInOne.cmake.in +++ b/Tests/CPackComponentsForAll/MyLibCPackConfig-AllInOne.cmake.in @@ -3,15 +3,15 @@ # if(CPACK_GENERATOR MATCHES "ZIP") set(CPACK_ARCHIVE_COMPONENT_INSTALL "ON") -endif(CPACK_GENERATOR MATCHES "ZIP") +endif() if(CPACK_GENERATOR MATCHES "RPM") set(CPACK_RPM_COMPONENT_INSTALL "ON") -endif(CPACK_GENERATOR MATCHES "RPM") +endif() if(CPACK_GENERATOR MATCHES "DEB") set(CPACK_DEB_COMPONENT_INSTALL "ON") -endif(CPACK_GENERATOR MATCHES "DEB") +endif() # # Choose grouping way diff --git a/Tests/CPackComponentsForAll/MyLibCPackConfig-IgnoreGroup.cmake.in b/Tests/CPackComponentsForAll/MyLibCPackConfig-IgnoreGroup.cmake.in index 9444a14..450c204 100644 --- a/Tests/CPackComponentsForAll/MyLibCPackConfig-IgnoreGroup.cmake.in +++ b/Tests/CPackComponentsForAll/MyLibCPackConfig-IgnoreGroup.cmake.in @@ -3,16 +3,16 @@ # if(CPACK_GENERATOR MATCHES "ZIP") set(CPACK_ARCHIVE_COMPONENT_INSTALL "ON") -endif(CPACK_GENERATOR MATCHES "ZIP") +endif() if(CPACK_GENERATOR MATCHES "RPM") set(CPACK_RPM_COMPONENT_INSTALL "ON") set(CPACK_RPM_applications_PACKAGE_REQUIRES "mylib-libraries") -endif(CPACK_GENERATOR MATCHES "RPM") +endif() if(CPACK_GENERATOR MATCHES "DEB") set(CPACK_DEB_COMPONENT_INSTALL "ON") -endif(CPACK_GENERATOR MATCHES "DEB") +endif() # # Choose grouping way diff --git a/Tests/CPackComponentsForAll/MyLibCPackConfig-OnePackPerGroup.cmake.in b/Tests/CPackComponentsForAll/MyLibCPackConfig-OnePackPerGroup.cmake.in index 2d251b3..60bdd06 100644 --- a/Tests/CPackComponentsForAll/MyLibCPackConfig-OnePackPerGroup.cmake.in +++ b/Tests/CPackComponentsForAll/MyLibCPackConfig-OnePackPerGroup.cmake.in @@ -3,20 +3,20 @@ # if(CPACK_GENERATOR MATCHES "ZIP") set(CPACK_ARCHIVE_COMPONENT_INSTALL "ON") -endif(CPACK_GENERATOR MATCHES "ZIP") +endif() if(CPACK_GENERATOR MATCHES "RPM") set(CPACK_RPM_COMPONENT_INSTALL "ON") set(CPACK_RPM_Development_PACKAGE_REQUIRES "mylib-Runtime") -endif(CPACK_GENERATOR MATCHES "RPM") +endif() if(CPACK_GENERATOR MATCHES "DEB") set(CPACK_DEB_COMPONENT_INSTALL "ON") -endif(CPACK_GENERATOR MATCHES "DEB") +endif() if(CPACK_GENERATOR MATCHES "DragNDrop") set(CPACK_COMPONENTS_GROUPING "ONE_PER_GROUP") -endif(CPACK_GENERATOR MATCHES "DragNDrop") +endif() # # Choose grouping way diff --git a/Tests/CPackComponentsForAll/RunCPackVerifyResult.cmake b/Tests/CPackComponentsForAll/RunCPackVerifyResult.cmake index e2d343d..9a022c5 100644 --- a/Tests/CPackComponentsForAll/RunCPackVerifyResult.cmake +++ b/Tests/CPackComponentsForAll/RunCPackVerifyResult.cmake @@ -4,21 +4,21 @@ message(STATUS "") if(NOT CPackComponentsForAll_BINARY_DIR) message(FATAL_ERROR "CPackComponentsForAll_BINARY_DIR not set") -endif(NOT CPackComponentsForAll_BINARY_DIR) +endif() if(NOT CPackGen) message(FATAL_ERROR "CPackGen not set") -endif(NOT CPackGen) +endif() get_filename_component(CPACK_LOCATION ${CMAKE_COMMAND} PATH) set(CPackCommand "${CPACK_LOCATION}/cpack") message("cpack = ${CPackCommand}") if(NOT CPackCommand) message(FATAL_ERROR "CPackCommand not set") -endif(NOT CPackCommand) +endif() if(NOT CPackComponentWay) message(FATAL_ERROR "CPackComponentWay not set") -endif(NOT CPackComponentWay) +endif() set(expected_file_mask "") # The usual default behavior is to expect a single file @@ -30,7 +30,7 @@ set(config_type $ENV{CMAKE_CONFIG_TYPE}) set(config_args ) if(config_type) set(config_args -C ${config_type}) -endif(config_type) +endif() set(config_verbose ) if(CPackGen MATCHES "ZIP") @@ -80,15 +80,15 @@ if(CPackGen MATCHES "DragNDrop") elseif (${CPackComponentWay} STREQUAL "AllInOne") set(expected_count 1) endif () -endif(CPackGen MATCHES "DragNDrop") +endif() # clean-up previously CPack generated files if(expected_file_mask) file(GLOB expected_file "${expected_file_mask}") if (expected_file) file(REMOVE ${expected_file}) - endif(expected_file) -endif(expected_file_mask) + endif() +endif() message("config_args = ${config_args}") message("config_verbose = ${config_verbose}") @@ -100,9 +100,9 @@ execute_process(COMMAND ${CPackCommand} ${config_verbose} -G ${CPackGen} ${confi if (CPack_result) message(FATAL_ERROR "error: CPack execution went wrong!, CPack_output=${CPack_output}, CPack_error=${CPack_error}") -else (CPack_result) +else () message(STATUS "CPack_output=${CPack_output}") -endif(CPack_result) +endif() # Now verify if the number of expected file is OK # - using expected_file_mask and @@ -116,11 +116,11 @@ if(expected_file_mask) if(NOT expected_file) message(FATAL_ERROR "error: expected_file=${expected_file} does not exist: CPackComponentsForAll test fails. (CPack_output=${CPack_output}, CPack_error=${CPack_error}") - endif(NOT expected_file) + endif() list(LENGTH expected_file actual_count) message(STATUS "actual_count='${actual_count}'") if(NOT actual_count EQUAL expected_count) message(FATAL_ERROR "error: expected_count=${expected_count} does not match actual_count=${actual_count}: CPackComponents test fails. (CPack_output=${CPack_output}, CPack_error=${CPack_error})") - endif(NOT actual_count EQUAL expected_count) -endif(expected_file_mask) + endif() +endif() diff --git a/Tests/CTestScriptMode/CTestTestScriptMode.cmake.in b/Tests/CTestScriptMode/CTestTestScriptMode.cmake.in index 7731710..45f0e37 100644 --- a/Tests/CTestScriptMode/CTestTestScriptMode.cmake.in +++ b/Tests/CTestScriptMode/CTestTestScriptMode.cmake.in @@ -5,7 +5,7 @@ set(CMAKE_CMAKE_SYSTEM_NAME "@CMAKE_SYSTEM_NAME@") if (NOT "${CMAKE_SYSTEM_NAME}" STREQUAL "${CMAKE_CMAKE_SYSTEM_NAME}") message(FATAL_ERROR "Error: CMAKE_SYSTEM_NAME is \"${CMAKE_SYSTEM_NAME}\", but should be \"@CMAKE_SYSTEM_NAME@\"") -endif(NOT "${CMAKE_SYSTEM_NAME}" STREQUAL "${CMAKE_CMAKE_SYSTEM_NAME}") +endif() # this seems to be necessary, otherwise ctest complains that these # variables are not set: diff --git a/Tests/CTestTestCostSerial/CMakeLists.txt b/Tests/CTestTestCostSerial/CMakeLists.txt index 29d2983..d3344cf 100644 --- a/Tests/CTestTestCostSerial/CMakeLists.txt +++ b/Tests/CTestTestCostSerial/CMakeLists.txt @@ -6,7 +6,7 @@ add_executable (Sleep sleep.c) foreach (index RANGE 1 3) add_test (TestSleep${index} Sleep) -endforeach (index RANGE 1 3) +endforeach () set_tests_properties(TestSleep1 PROPERTIES COST -500) set_tests_properties(TestSleep2 PROPERTIES COST 12) diff --git a/Tests/CTestTestCostSerial/test.cmake.in b/Tests/CTestTestCostSerial/test.cmake.in index 3f0f6f8..8661767 100644 --- a/Tests/CTestTestCostSerial/test.cmake.in +++ b/Tests/CTestTestCostSerial/test.cmake.in @@ -18,7 +18,7 @@ set(CTEST_NOTES_FILES "${CTEST_SCRIPT_DIRECTORY}/${CTEST_SCRIP # Remove old cost data file if it exists if(EXISTS "${CTEST_BINARY_DIRECTORY}/Testing/Temporary/CTestCostData.txt") file(REMOVE "${CTEST_BINARY_DIRECTORY}/Testing/Temporary/CTestCostData.txt") -endif(EXISTS "${CTEST_BINARY_DIRECTORY}/Testing/Temporary/CTestCostData.txt") +endif() CTEST_START(Experimental) CTEST_CONFIGURE(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res) diff --git a/Tests/CTestTestScheduler/CMakeLists.txt b/Tests/CTestTestScheduler/CMakeLists.txt index d2b3bb4..ccd7b2c 100644 --- a/Tests/CTestTestScheduler/CMakeLists.txt +++ b/Tests/CTestTestScheduler/CMakeLists.txt @@ -6,4 +6,4 @@ add_executable (Sleep sleep.c) foreach (time RANGE 1 4) add_test (TestSleep${time} Sleep ${time}) -endforeach (time RANGE 1 4) +endforeach () diff --git a/Tests/CTestTestScheduler/test.cmake.in b/Tests/CTestTestScheduler/test.cmake.in index 87a390a..9115a61 100644 --- a/Tests/CTestTestScheduler/test.cmake.in +++ b/Tests/CTestTestScheduler/test.cmake.in @@ -18,7 +18,7 @@ set(CTEST_NOTES_FILES "${CTEST_SCRIPT_DIRECTORY}/${CTEST_SCRIP # Remove old cost data file if it exists if(EXISTS "${CTEST_BINARY_DIRECTORY}/Testing/Temporary/CTestCostData.txt") file(REMOVE "${CTEST_BINARY_DIRECTORY}/Testing/Temporary/CTestCostData.txt") -endif(EXISTS "${CTEST_BINARY_DIRECTORY}/Testing/Temporary/CTestCostData.txt") +endif() CTEST_START(Experimental) CTEST_CONFIGURE(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res) diff --git a/Tests/CTestTestStopTime/GetDate.cmake b/Tests/CTestTestStopTime/GetDate.cmake index ac8f65d..60f1e0c 100644 --- a/Tests/CTestTestStopTime/GetDate.cmake +++ b/Tests/CTestTestStopTime/GetDate.cmake @@ -37,17 +37,17 @@ macro(GET_DATE) set(GD_PREFIX "GD_") if(NOT "${ARGV0}" STREQUAL "") set(GD_PREFIX "${ARGV0}") - endif(NOT "${ARGV0}" STREQUAL "") + endif() if(NOT "${GD_PREFIX}" STREQUAL "GD_") set(${GD_PREFIX}PREFIX "${GD_PREFIX}") - endif(NOT "${GD_PREFIX}" STREQUAL "GD_") + endif() # If there's an ARGV1, use it as ${GD_PREFIX}VERBOSE: # set(${GD_PREFIX}VERBOSE "0") if(NOT "${ARGV1}" STREQUAL "") set(${GD_PREFIX}VERBOSE "${ARGV1}") - endif(NOT "${ARGV1}" STREQUAL "") + endif() # Retrieve the current date and time in the format: # @@ -65,13 +65,13 @@ macro(GET_DATE) # set(${GD_PREFIX}CMD "cmd") set(${GD_PREFIX}ARGS "/c echo %DATE% %TIME%") - else(WIN32) + else() # # Match the format returned by default in US English Windows: # set(${GD_PREFIX}CMD "date") set(${GD_PREFIX}ARGS "\"+%a %m/%d/%Y %H:%M:%S.00\"") - endif(WIN32) + endif() exec_program("${${GD_PREFIX}CMD}" "." ARGS "${${GD_PREFIX}ARGS}" OUTPUT_VARIABLE ${GD_PREFIX}OV RETURN_VALUE ${GD_PREFIX}RV @@ -84,7 +84,7 @@ macro(GET_DATE) message(STATUS "GD_PREFIX='${GD_PREFIX}'") if(NOT "${GD_PREFIX}" STREQUAL "GD_") message(STATUS "${GD_PREFIX}PREFIX='${${GD_PREFIX}PREFIX}'") - endif(NOT "${GD_PREFIX}" STREQUAL "GD_") + endif() message(STATUS "${GD_PREFIX}VERBOSE='${${GD_PREFIX}VERBOSE}'") message(STATUS "") message(STATUS "${GD_PREFIX}CMD='${${GD_PREFIX}CMD}'") @@ -92,7 +92,7 @@ macro(GET_DATE) message(STATUS "${GD_PREFIX}OV='${${GD_PREFIX}OV}'") message(STATUS "${GD_PREFIX}RV='${${GD_PREFIX}RV}'") message(STATUS "") - endif(${GD_PREFIX}VERBOSE) + endif() if("${${GD_PREFIX}RV}" STREQUAL "0") # @@ -119,59 +119,59 @@ macro(GET_DATE) # if(NOT "${${GD_PREFIX}YEAR}" MATCHES "^[0-9][0-9][0-9][0-9]$") message(STATUS "WARNING: Extracted ${GD_PREFIX}YEAR='${${GD_PREFIX}YEAR}' is not a four digit number...") - endif(NOT "${${GD_PREFIX}YEAR}" MATCHES "^[0-9][0-9][0-9][0-9]$") + endif() # Expecting month to be <= 12: # if(${${GD_PREFIX}MONTH} GREATER 12) message(STATUS "WARNING: Extracted ${GD_PREFIX}MONTH='${${GD_PREFIX}MONTH}' is greater than 12!") - endif(${${GD_PREFIX}MONTH} GREATER 12) + endif() # Expecting day to be <= 31: # if(${${GD_PREFIX}DAY} GREATER 31) message(STATUS "WARNING: Extracted ${GD_PREFIX}DAY='${${GD_PREFIX}DAY}' is greater than 31!") - endif(${${GD_PREFIX}DAY} GREATER 31) + endif() # Expecting hour to be <= 23: # if(${${GD_PREFIX}HOUR} GREATER 23) message(STATUS "WARNING: Extracted ${GD_PREFIX}HOUR='${${GD_PREFIX}HOUR}' is greater than 23!") - endif(${${GD_PREFIX}HOUR} GREATER 23) + endif() # Expecting minute to be <= 59: # if(${${GD_PREFIX}MINUTE} GREATER 59) message(STATUS "WARNING: Extracted ${GD_PREFIX}MINUTE='${${GD_PREFIX}MINUTE}' is greater than 59!") - endif(${${GD_PREFIX}MINUTE} GREATER 59) + endif() # Expecting second to be <= 59: # if(${${GD_PREFIX}SECOND} GREATER 59) message(STATUS "WARNING: Extracted ${GD_PREFIX}SECOND='${${GD_PREFIX}SECOND}' is greater than 59!") - endif(${${GD_PREFIX}SECOND} GREATER 59) + endif() # If individual components are single digit, # prepend a leading zero: # if("${${GD_PREFIX}YEAR}" MATCHES "^[0-9]$") set(${GD_PREFIX}YEAR "0${${GD_PREFIX}YEAR}") - endif("${${GD_PREFIX}YEAR}" MATCHES "^[0-9]$") + endif() if("${${GD_PREFIX}MONTH}" MATCHES "^[0-9]$") set(${GD_PREFIX}MONTH "0${${GD_PREFIX}MONTH}") - endif("${${GD_PREFIX}MONTH}" MATCHES "^[0-9]$") + endif() if("${${GD_PREFIX}DAY}" MATCHES "^[0-9]$") set(${GD_PREFIX}DAY "0${${GD_PREFIX}DAY}") - endif("${${GD_PREFIX}DAY}" MATCHES "^[0-9]$") + endif() if("${${GD_PREFIX}HOUR}" MATCHES "^[0-9]$") set(${GD_PREFIX}HOUR "0${${GD_PREFIX}HOUR}") - endif("${${GD_PREFIX}HOUR}" MATCHES "^[0-9]$") + endif() if("${${GD_PREFIX}MINUTE}" MATCHES "^[0-9]$") set(${GD_PREFIX}MINUTE "0${${GD_PREFIX}MINUTE}") - endif("${${GD_PREFIX}MINUTE}" MATCHES "^[0-9]$") + endif() if("${${GD_PREFIX}SECOND}" MATCHES "^[0-9]$") set(${GD_PREFIX}SECOND "0${${GD_PREFIX}SECOND}") - endif("${${GD_PREFIX}SECOND}" MATCHES "^[0-9]$") + endif() if(${GD_PREFIX}VERBOSE) message(STATUS "${GD_PREFIX}REGEX='${${GD_PREFIX}REGEX}'") @@ -192,16 +192,16 @@ macro(GET_DATE) message(STATUS " monthly : ${${GD_PREFIX}YEAR}${${GD_PREFIX}MONTH}") message(STATUS " annually : ${${GD_PREFIX}YEAR}") message(STATUS "") - endif(${GD_PREFIX}VERBOSE) - else("${${GD_PREFIX}RV}" STREQUAL "0") + endif() + else() message(SEND_ERROR "ERROR: macro(GET_DATE) failed. ${GD_PREFIX}CMD='${${GD_PREFIX}CMD}' ${GD_PREFIX}ARGS='${${GD_PREFIX}ARGS}' ${GD_PREFIX}OV='${${GD_PREFIX}OV}' ${GD_PREFIX}RV='${${GD_PREFIX}RV}'") - endif("${${GD_PREFIX}RV}" STREQUAL "0") + endif() if(${GD_PREFIX}VERBOSE) message(STATUS "</GET_DATE>") message(STATUS "") - endif(${GD_PREFIX}VERBOSE) -endmacro(GET_DATE) + endif() +endmacro() macro(ADD_SECONDS sec) set(new_min ${${GD_PREFIX}MINUTE}) @@ -230,4 +230,4 @@ macro(ADD_SECONDS sec) if(${hr_len} EQUAL 1) set(new_hr "0${new_hr}") endif() -endmacro(ADD_SECONDS) +endmacro() diff --git a/Tests/CTestUpdateBZR.cmake.in b/Tests/CTestUpdateBZR.cmake.in index c654f47..8fb1d34 100644 --- a/Tests/CTestUpdateBZR.cmake.in +++ b/Tests/CTestUpdateBZR.cmake.in @@ -74,7 +74,7 @@ if(dirs_added) WORKING_DIRECTORY ${TOP}/user-source COMMAND ${BZR} add ${dirs_added} ) -endif(dirs_added) +endif() run_child( WORKING_DIRECTORY ${TOP}/user-source COMMAND ${BZR} add ${files_added} diff --git a/Tests/CTestUpdateCVS.cmake.in b/Tests/CTestUpdateCVS.cmake.in index f7f5db6..1699c3f 100644 --- a/Tests/CTestUpdateCVS.cmake.in +++ b/Tests/CTestUpdateCVS.cmake.in @@ -91,7 +91,7 @@ if(dirs_added) WORKING_DIRECTORY ${TOP}/user-source COMMAND ${CVSCMD} add ${dirs_added} ) -endif(dirs_added) +endif() run_child( WORKING_DIRECTORY ${TOP}/user-source COMMAND ${CVSCMD} add ${files_added} diff --git a/Tests/CTestUpdateCommon.cmake b/Tests/CTestUpdateCommon.cmake index 335d09e..aaf88a8 100644 --- a/Tests/CTestUpdateCommon.cmake +++ b/Tests/CTestUpdateCommon.cmake @@ -12,8 +12,8 @@ function(run_child) string(REGEX REPLACE "\n" "\n " OUTPUT "${OUTPUT}") message(FATAL_ERROR "Child failed (${FAILED}), output is\n ${OUTPUT}\n" "Command = [${ARGN}]\n") - endif(FAILED) -endfunction(run_child) + endif() +endfunction() #----------------------------------------------------------------------------- # Function to find the Update.xml file and check for expected entries. @@ -26,7 +26,7 @@ function(check_updates build) ) if(NOT UPDATE_XML_FILE) message(FATAL_ERROR "Cannot find Update.xml with pattern\n ${PATTERN}") - endif(NOT UPDATE_XML_FILE) + endif() message(" found ${UPDATE_XML_FILE}") set(max_update_xml_size 16384) @@ -73,11 +73,11 @@ function(check_updates build) set(MSG "${MSG}Update.xml is missing expected entries:\n") foreach(f ${MISSING}) set(MSG "${MSG} ${f}\n") - endforeach(f) - else(MISSING) + endforeach() + else() # Success message(" no entries missing from Update.xml") - endif(MISSING) + endif() # Report the result if(EXTRA) @@ -85,11 +85,11 @@ function(check_updates build) set(MSG "${MSG}Update.xml has extra unexpected entries:\n") foreach(f ${EXTRA}) set(MSG "${MSG} ${f}\n") - endforeach(f) - else(EXTRA) + endforeach() + else() # Success message(" no extra entries in Update.xml") - endif(EXTRA) + endif() if(MSG) # Provide the log file @@ -99,14 +99,14 @@ function(check_updates build) file(READ ${UPDATE_LOG_FILE} UPDATE_LOG LIMIT ${max_update_xml_size}) string(REGEX REPLACE "\n" "\n " UPDATE_LOG "${UPDATE_LOG}") set(MSG "${MSG}Update log:\n ${UPDATE_LOG}") - else(UPDATE_LOG_FILE) + else() set(MSG "${MSG}No update log found!") - endif(UPDATE_LOG_FILE) + endif() # Display the error message message(FATAL_ERROR "${MSG}") - endif(MSG) -endfunction(check_updates) + endif() +endfunction() #----------------------------------------------------------------------------- # Function to create initial content. @@ -123,7 +123,7 @@ set(CTEST_NIGHTLY_START_TIME \"21:00:00 EDT\") # Some other files. file(WRITE ${TOP}/${dir}/foo.txt "foo\n") file(WRITE ${TOP}/${dir}/bar.txt "bar\n") -endfunction(create_content) +endfunction() #----------------------------------------------------------------------------- # Function to update content. @@ -137,20 +137,20 @@ function(update_content dir added_var removed_var dirs_var) set(${dirs_var} subdir PARENT_SCOPE) set(${added_var} zot.txt subdir/foo.txt subdir/bar.txt PARENT_SCOPE) set(${removed_var} bar.txt PARENT_SCOPE) -endfunction(update_content) +endfunction() #----------------------------------------------------------------------------- # Function to change existing files function(change_content dir) file(APPEND ${TOP}/${dir}/foo.txt "foo line 3\n") file(APPEND ${TOP}/${dir}/subdir/foo.txt "foo line 2\n") -endfunction(change_content) +endfunction() #----------------------------------------------------------------------------- # Function to create local modifications before update function(modify_content dir) file(APPEND ${TOP}/${dir}/CTestConfig.cmake "# local modification\n") -endfunction(modify_content) +endfunction() #----------------------------------------------------------------------------- # Function to write CTestConfiguration.ini content. @@ -163,7 +163,7 @@ BuildDirectory: ${TOP}/${bin_dir} Site: test.site BuildName: user-test ") -endfunction(create_build_tree) +endfunction() #----------------------------------------------------------------------------- # Function to write the dashboard test script. @@ -181,7 +181,7 @@ ${custom_text} ctest_start(Experimental) ctest_update(SOURCE \${CTEST_SOURCE_DIRECTORY}) ") -endfunction(create_dashboard_script) +endfunction() #----------------------------------------------------------------------------- # Function to run the dashboard through the command line @@ -205,7 +205,7 @@ function(run_dashboard_command_line bin_dir) Updated{subdir/bar.txt} ${_modified} ) -endfunction(run_dashboard_command_line) +endfunction() #----------------------------------------------------------------------------- # Function to run the dashboard through a script @@ -224,11 +224,11 @@ function(run_dashboard_script bin_dir) Updated{subdir/foo.txt} Updated{subdir/bar.txt} ) -endfunction(run_dashboard_script) +endfunction() #----------------------------------------------------------------------------- # Function to initialize the testing directory. function(init_testing) file(REMOVE_RECURSE ${TOP}) file(MAKE_DIRECTORY ${TOP}) -endfunction(init_testing) +endfunction() diff --git a/Tests/CTestUpdateGIT.cmake.in b/Tests/CTestUpdateGIT.cmake.in index eb9f987..0c01291 100644 --- a/Tests/CTestUpdateGIT.cmake.in +++ b/Tests/CTestUpdateGIT.cmake.in @@ -159,7 +159,7 @@ if(dirs_added) WORKING_DIRECTORY ${TOP}/user-source COMMAND ${GIT} add ${dirs_added} ) -endif(dirs_added) +endif() run_child( WORKING_DIRECTORY ${TOP}/user-source COMMAND ${GIT} add ${files_added} @@ -221,7 +221,7 @@ macro(rewind_source src_dir) WORKING_DIRECTORY ${TOP}/${src_dir} COMMAND ${GIT} submodule update ) -endmacro(rewind_source) +endmacro() rewind_source(user-source) # Make sure pull does not try to rebase (which does not work with diff --git a/Tests/CTestUpdateHG.cmake.in b/Tests/CTestUpdateHG.cmake.in index 640d2c6..c5440f9 100644 --- a/Tests/CTestUpdateHG.cmake.in +++ b/Tests/CTestUpdateHG.cmake.in @@ -70,7 +70,7 @@ if(dirs_added) WORKING_DIRECTORY ${TOP}/user-source COMMAND ${HG} add ${dirs_added} ) -endif(dirs_added) +endif() run_child( WORKING_DIRECTORY ${TOP}/user-source COMMAND ${HG} add ${files_added} diff --git a/Tests/CTestUpdateSVN.cmake.in b/Tests/CTestUpdateSVN.cmake.in index 15b833b..b5728fd 100644 --- a/Tests/CTestUpdateSVN.cmake.in +++ b/Tests/CTestUpdateSVN.cmake.in @@ -74,7 +74,7 @@ if(dirs_added) WORKING_DIRECTORY ${TOP}/user-source COMMAND ${SVNCMD} add ${depth_empty} ${dirs_added} ) -endif(dirs_added) +endif() run_child( WORKING_DIRECTORY ${TOP}/user-source COMMAND ${SVNCMD} add ${files_added} diff --git a/Tests/CommandLineTest/CMakeLists.txt b/Tests/CommandLineTest/CMakeLists.txt index 8a4b4f4..96aac10 100644 --- a/Tests/CommandLineTest/CMakeLists.txt +++ b/Tests/CommandLineTest/CMakeLists.txt @@ -6,8 +6,8 @@ macro(EXEC_CMAKE_COMMAND CMAKE_ARGS) exec_program("${CMAKE_COMMAND}" ARGS "${CMAKE_ARGS}" RETURN_VALUE RET) if(${RET}) message(SEND_ERROR "CMake command failed with arguments \"${CMAKE_ARGS}\"") - endif(${RET}) -endmacro(EXEC_CMAKE_COMMAND) + endif() +endmacro() EXEC_CMAKE_COMMAND("-E chdir \"${CMAKE_CURRENT_SOURCE_DIR}\" \"${CMAKE_COMMAND}\" -E echo \"Hello World\"") EXEC_CMAKE_COMMAND("-E time \"${CMAKE_COMMAND} -N -L ${CommandLineTest_SOURCE_DIR}\"") @@ -32,14 +32,14 @@ macro(EXEC_CTEST_COMMAND CMAKE_ARGS) exec_program("${CTEST_COMMAND}" ARGS "${CMAKE_ARGS}" RETURN_VALUE RET) if(${RET}) message(SEND_ERROR "CTest command failed with arguments \"${CMAKE_ARGS}\"") - endif(${RET}) -endmacro(EXEC_CTEST_COMMAND) + endif() +endmacro() macro(EXEC_CTEST_COMMAND_WITH_DIR DIR CMAKE_ARGS) exec_program("${CTEST_COMMAND}" "${DIR}" ARGS "${CMAKE_ARGS}" RETURN_VALUE RET) if(${RET}) message(SEND_ERROR "CTest command failed with arguments \"${CMAKE_ARGS}\"") - endif(${RET}) -endmacro(EXEC_CTEST_COMMAND_WITH_DIR) + endif() +endmacro() EXEC_CTEST_COMMAND_WITH_DIR("${CMAKE_CURRENT_BINARY_DIR}/../.." "-N") EXEC_CTEST_COMMAND_WITH_DIR("${CMAKE_CURRENT_BINARY_DIR}/../.." "-R complex -N") @@ -59,21 +59,21 @@ if(THIS_SHOULD_BE_SET) message(STATUS "***************************") message(STATUS "PreLoad.cmake works fine.") message(STATUS "***************************") -else(THIS_SHOULD_BE_SET) +else() message("***************************") message(FATAL_ERROR "PreLoad.cmake does not work.") -endif(THIS_SHOULD_BE_SET) +endif() if(DEFINED ENV{TEST_ENVIRONMENT_VARIABLE_NOTSET}) message(SEND_ERROR "Environment variable definition test broken!") -endif(DEFINED ENV{TEST_ENVIRONMENT_VARIABLE_NOTSET}) +endif() set(ENV{TEST_ENVIRONMENT_VARIABLE} "Environment variable set") if("$ENV{TEST_ENVIRONMENT_VARIABLE}" STREQUAL "Environment variable set") message(STATUS "Environment variable set to: $ENV{TEST_ENVIRONMENT_VARIABLE}") if(NOT DEFINED ENV{TEST_ENVIRONMENT_VARIABLE}) message(SEND_ERROR "Environment variable definition test failed!") - endif(NOT DEFINED ENV{TEST_ENVIRONMENT_VARIABLE}) -else("$ENV{TEST_ENVIRONMENT_VARIABLE}" STREQUAL "Environment variable set") + endif() +else() message(SEND_ERROR "Environment variable setting is broken") -endif("$ENV{TEST_ENVIRONMENT_VARIABLE}" STREQUAL "Environment variable set") +endif() diff --git a/Tests/Complex/CMakeLists.txt b/Tests/Complex/CMakeLists.txt index 45ea901..048f966 100644 --- a/Tests/Complex/CMakeLists.txt +++ b/Tests/Complex/CMakeLists.txt @@ -11,8 +11,8 @@ if(POLICY CMP0003) cmake_policy(GET CMP0003 P3) if(NOT "${P3}" STREQUAL "NEW") message(FATAL_ERROR "cmake_policy(GET) did not report NEW!") - endif(NOT "${P3}" STREQUAL "NEW") -endif(POLICY CMP0003) + endif() +endif() # Test building without per-rule echo lines in Makefiles. set_property(GLOBAL PROPERTY RULE_MESSAGES OFF) @@ -25,8 +25,8 @@ set(CPACK_SOURCE_IGNORE_FILES "~$;\\.cvsignore$;^C:/hoffman/My Builds/testcase.* macro(ASSERT value msg) if (NOT ${value}) message ("Assertion failure:" ${msg} ) - endif (NOT ${value}) -endmacro(ASSERT) + endif () +endmacro() # invoke the macro ASSERT(Complex_BINARY_DIR "The PROJECT command is broken") @@ -38,8 +38,8 @@ macro(TEST_ARGC value1 value2) add_definitions(${value1} ${value2}) if (${ARGC} MATCHES 4) add_definitions(${ARGV2} ${ARGV3}) - endif (${ARGC} MATCHES 4) -endmacro(TEST_ARGC) + endif () +endmacro() # invoke the macro TEST_ARGC(-DCMAKE_ARGV1 -DCMAKE_ARGV2 -DCMAKE_ARGV3 -DCMAKE_ARGV4) @@ -47,34 +47,34 @@ TEST_ARGC(-DCMAKE_ARGV1 -DCMAKE_ARGV2 -DCMAKE_ARGV3 -DCMAKE_ARGV4) macro(TEST_VAR_ARG fa) if("${ARGV}" MATCHES "^1;2;3$") message(STATUS "ARGV works") - else("${ARGV}" MATCHES "^1;2;3$") + else() message(FATAL_ERROR "ARGV does not work; got \"${ARGV}\" instead of \"1;2;3\"") - endif("${ARGV}" MATCHES "^1;2;3$") + endif() if("${ARGN}" MATCHES "^2;3$") message(STATUS "ARGN works") - else("${ARGN}" MATCHES "^2;3$") + else() message(FATAL_ERROR "ARGV does not work; got \"${ARGN}\" instead of \"2;3\"") - endif("${ARGN}" MATCHES "^2;3$") -endmacro(TEST_VAR_ARG) + endif() +endmacro() TEST_VAR_ARG(1 2 3) # Floating-point comparison test. if(2.4 LESS 2.4) message(FATAL_ERROR "Failed: 2.4 LESS 2.4") -endif(2.4 LESS 2.4) +endif() if(2.4 GREATER 2.4) message(FATAL_ERROR "Failed: 2.4 GREATER 2.4") -endif(2.4 GREATER 2.4) +endif() if(NOT 2.4 EQUAL 2.4) message(FATAL_ERROR "Failed: NOT 2.4 EQUAL 2.4") -endif(NOT 2.4 EQUAL 2.4) +endif() if(CMAKE_SYSTEM MATCHES "OSF1-V.*") if(NOT CMAKE_COMPILER_IS_GNUCXX) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -timplicit_local -no_implicit_include ") - endif(NOT CMAKE_COMPILER_IS_GNUCXX) -endif(CMAKE_SYSTEM MATCHES "OSF1-V.*") + endif() +endif() add_definitions(-DCMAKE_IS_FUN) @@ -93,7 +93,7 @@ separate_arguments(TEST_SEP) # if (EXISTS ${Complex_SOURCE_DIR}/VarTests.cmake) include(${Complex_SOURCE_DIR}/VarTests.cmake) -endif (EXISTS ${Complex_SOURCE_DIR}/VarTests.cmake) +endif () include(fileshouldnotbehere OPTIONAL) load_cache(${Complex_SOURCE_DIR}/Cache EXCLUDE @@ -104,9 +104,9 @@ load_cache(${Complex_SOURCE_DIR}/Cache load_cache(${Complex_SOURCE_DIR}/Cache READ_WITH_PREFIX foo CACHE_TEST_VAR2) if(${fooCACHE_TEST_VAR2} MATCHES bar) message("Load cache worked: ${fooCACHE_TEST_VAR2}") -else(${fooCACHE_TEST_VAR2} MATCHES bar) +else() message(FATAL_ERROR "Load cache with prefix failed: ${fooCACHE_TEST_VAR2}") -endif(${fooCACHE_TEST_VAR2} MATCHES bar) +endif() @@ -151,9 +151,9 @@ message("\nIgnore this message") option(NO_EXEC_PROGRAM "Do not test EXEC_PROGRAM" 0) if (NOT NO_EXEC_PROGRAM) exec_program(${CMAKE_COMMAND} ARGS -E echo NO_EXEC_PROGRAM "${Complex_BINARY_DIR}") -else (NOT NO_EXEC_PROGRAM) +else () message("Set this option ON") -endif (NOT NO_EXEC_PROGRAM) +endif () mark_as_advanced(NO_EXEC_PROGRAM) mark_as_advanced(CLEAR NO_EXEC_PROGRAM) @@ -164,9 +164,9 @@ execute_process( OUTPUT_VARIABLE TEST_OUT ) if("${TEST_OUT}" MATCHES "^ABCDEFG\n$") -else("${TEST_OUT}" MATCHES "^ABCDEFG\n$") +else() message(SEND_ERROR "EXECUTE_PROCESS output test failed: [${TEST_OUT}]") -endif("${TEST_OUT}" MATCHES "^ABCDEFG\n$") +endif() # This test has some problems on UNIX systems. Disabling for now. # @@ -180,9 +180,9 @@ endif("${TEST_OUT}" MATCHES "^ABCDEFG\n$") # if("${RESULT}" MATCHES "^0$") # message(SEND_ERROR # "EXECUTE_PROCESS result test failed with RESULT=[${RESULT}]") -# else("${RESULT}" MATCHES "^0$") +# else() # message(STATUS "EXECUTE_PROCESS result test passed with RESULT=[${RESULT}]") -# endif("${RESULT}" MATCHES "^0$") +# endif() # # Create directory. @@ -206,7 +206,7 @@ foreach (ext ${CMAKE_SHLIB_SUFFIX};.so;.a;.sl ${Complex_SOURCE_DIR}/Library/dummy ${Complex_BINARY_DIR}/Library/libdummylib${ext} COPYONLY IMMEDIATE) -endforeach (ext) +endforeach () find_library(FIND_DUMMY_LIB dummylib @@ -288,8 +288,8 @@ if (WIN32) "[${hkey}]" DOC "Registry_Test_Path") exec_program(${CMAKE_COMMAND} ARGS "-E delete_regv \"${hkey}\"") exec_program(${CMAKE_COMMAND} ARGS "-E remove \"${dir}/${file}\"") - endif (NOT UNIX) -endif (WIN32) + endif () +endif () # # Test a set and a remove @@ -305,17 +305,17 @@ foreach(x "a") if(${x} MATCHES "a") # Should always execute. set(IF_INSIDE_FOREACH_THEN_EXECUTED 1) - else(${x} MATCHES "a") + else() # Should never execute. set(IF_INSIDE_FOREACH_ELSE_EXECUTED 1) - endif(${x} MATCHES "a") -endforeach(x) + endif() +endforeach() # test WHILE command set (while_var 1) while (while_var LESS 1000) set(while_var ${while_var}0) -endwhile(while_var LESS 1000) +endwhile() set(SHOULD_BE_ZERO ) set(SHOULD_BE_ONE 1) @@ -328,7 +328,7 @@ if (RESULT EQUAL 1) set (ELSEIF_RESULT 1) elseif (RESULT EQUAL 3) set (ELSEIF_RESULT 1) - endif (RESULT EQUAL 2) + endif () elseif (RESULT EQUAL 2) set (ELSEIF_RESULT 1) elseif (RESULT EQUAL 3) @@ -337,25 +337,25 @@ elseif (RESULT EQUAL 3) elseif (RESULT EQUAL 3) if (NOT ELSEIF_RESULT EQUAL 1) set (ELSEIF_RESULT 2) - endif (NOT ELSEIF_RESULT EQUAL 1) - endif (RESULT EQUAL 2) + endif () + endif () elseif (RESULT EQUAL 4) if (RESULT EQUAL 2) set (ELSEIF_RESULT 1) elseif (RESULT EQUAL 3) set (ELSEIF_RESULT 1) - endif (RESULT EQUAL 2) -else (RESULT EQUAL 1) + endif () +else () if (RESULT EQUAL 2) set (ELSEIF_RESULT 1) elseif (RESULT EQUAL 3) set (ELSEIF_RESULT 1) - endif (RESULT EQUAL 2) -endif (RESULT EQUAL 1) + endif () +endif () if (NOT ELSEIF_RESULT EQUAL 2) set (ELSEIF_RESULT 0) -endif (NOT ELSEIF_RESULT EQUAL 2) +endif () # test handling of parenthetical groups in conditionals if (2 GREATER 1 AND (4 LESS 3 OR 5 LESS 6) AND NOT (7 GREATER 8)) @@ -381,19 +381,19 @@ configure_file( string(REGEX MATCH "b" RESULT "abc") if(NOT RESULT) message(SEND_ERROR "string(REGEX MATCH ... ) test failed.") -endif(NOT RESULT) +endif() string(REGEX MATCHALL "b" RESULT "abcb") if(NOT RESULT) message(SEND_ERROR "string(REGEX MATCHALL ... ) test failed.") -endif(NOT RESULT) +endif() string(REGEX REPLACE ".([bd])." "[\\1]" RESULT "a(b)c(d)e") if("x${RESULT}" MATCHES "^xa\\[b\\]c\\[d\\]e$") set(STRING_REGEX_PASSED 1) -endif("x${RESULT}" MATCHES "^xa\\[b\\]c\\[d\\]e$") +endif() if(NOT STRING_REGEX_PASSED) message(SEND_ERROR "string(REGEX REPLACE ... ) test failed (\"${RESULT}\" v. \"a[b]c[d]e\")") -endif(NOT STRING_REGEX_PASSED) +endif() # diff --git a/Tests/Complex/Executable/CMakeLists.txt b/Tests/Complex/Executable/CMakeLists.txt index 4138835..432dbf8 100644 --- a/Tests/Complex/Executable/CMakeLists.txt +++ b/Tests/Complex/Executable/CMakeLists.txt @@ -11,16 +11,16 @@ add_library(ExeImportedTarget UNKNOWN IMPORTED) # Test if(TARGET) command. if(NOT TARGET CMakeTestLibrary) message(FATAL_ERROR "if(NOT TARGET CMakeTestLibrary) returned true!") -endif(NOT TARGET CMakeTestLibrary) +endif() if(NOT TARGET ExeImportedTarget) message(FATAL_ERROR "if(NOT TARGET ExeImportedTarget) returned true!") -endif(NOT TARGET ExeImportedTarget) +endif() if(TARGET LibImportedTarget) message(FATAL_ERROR "if(TARGET LibImportedTarget) returned true!") -endif(TARGET LibImportedTarget) +endif() if(TARGET NotATarget) message(FATAL_ERROR "if(TARGET NotATarget) returned true!") -endif(TARGET NotATarget) +endif() # Use LINK_LIBRARIES instead of TARGET_LINK_LIBRARIES to set(COMPLEX_LIBS CMakeTestLibrary;CMakeTestLibraryShared;CMakeTestCLibraryShared) @@ -46,37 +46,37 @@ add_executable(complex.file complex.file.cxx complex_nobuild.cxx if (UNIX) target_link_libraries(complex ${CMAKE_DL_LIBS}) -else(UNIX) +else() if (NOT BORLAND) if(NOT MINGW) target_link_libraries(complex rpcrt4.lib) - endif(NOT MINGW) - endif(NOT BORLAND) -endif (UNIX) + endif() + endif() +endif () # Test linking to static lib when a shared lib has the same name. if(CMAKE_EXE_LINK_STATIC_CXX_FLAGS) add_definitions(-DCOMPLEX_TEST_LINK_STATIC) target_link_libraries(complex CMakeTestLinkStatic) -endif(CMAKE_EXE_LINK_STATIC_CXX_FLAGS) +endif() # can we get the path to a source file get_source_file_property(A_LOCATION A.cxx LOCATION) if ("${A_LOCATION}" STREQUAL "${CMAKE_CURRENT_SOURCE_DIR}/A.cxx") add_definitions(-DCMAKE_FOUND_ACXX) -endif ("${A_LOCATION}" STREQUAL "${CMAKE_CURRENT_SOURCE_DIR}/A.cxx") +endif () # get the directory parent get_directory_property(P_VALUE PARENT_DIRECTORY) if ("${P_VALUE}" STREQUAL "${CMAKE_SOURCE_DIR}") add_definitions(-DCMAKE_FOUND_PARENT) -endif ("${P_VALUE}" STREQUAL "${CMAKE_SOURCE_DIR}") +endif () # get the stack of listfiles include(Included.cmake) if ("${LF_VALUE}" STREQUAL "${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt;${CMAKE_CURRENT_SOURCE_DIR}/Included.cmake") add_definitions(-DCMAKE_FOUND_LISTFILE_STACK) -endif ("${LF_VALUE}" STREQUAL "${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt;${CMAKE_CURRENT_SOURCE_DIR}/Included.cmake") +endif () # Test add/remove definitions. add_definitions( @@ -128,7 +128,7 @@ target_link_libraries(notInAllExe notInAllLib) if(MSVC) set_target_properties(notInAllExe PROPERTIES LINK_FLAGS "/NODEFAULTLIB:LIBC;LIBCMT;MSVCRT") -endif(MSVC) +endif() # Test creating a custom target that builds not-in-all targets. add_custom_target(notInAllCustom) @@ -146,7 +146,7 @@ add_subdirectory(Temp) if(CMAKE_COMPILER_IS_GNUCXX AND CMAKE_INCLUDE_SYSTEM_FLAG_CXX) add_executable(testSystemDir testSystemDir.cxx) set_target_properties(testSystemDir PROPERTIES COMPILE_FLAGS "-Werror") -endif(CMAKE_COMPILER_IS_GNUCXX AND CMAKE_INCLUDE_SYSTEM_FLAG_CXX) +endif() # # Extra coverage.Not used. diff --git a/Tests/Complex/Library/CMakeLists.txt b/Tests/Complex/Library/CMakeLists.txt index 41faeba..5c43052 100644 --- a/Tests/Complex/Library/CMakeLists.txt +++ b/Tests/Complex/Library/CMakeLists.txt @@ -33,10 +33,10 @@ if(WIN32) target_link_libraries(CMakeTestLibrary optimized kernel32.lib) - endif(NOT MINGW) - endif(NOT BORLAND) - endif(NOT CYGWIN) -endif(WIN32) + endif() + endif() + endif() +endif() # # Create shared library @@ -53,12 +53,12 @@ define_property( set_target_properties(CMakeTestCLibraryShared PROPERTIES FOO BAR) if(NOT BEOS AND NOT WIN32) # No libm on BeOS. set_target_properties(CMakeTestCLibraryShared PROPERTIES LINK_FLAGS "-lm") -endif(NOT BEOS AND NOT WIN32) +endif() get_target_property(FOO_BAR_VAR CMakeTestCLibraryShared FOO) if(${FOO_BAR_VAR} MATCHES "BAR") -else(${FOO_BAR_VAR} MATCHES "BAR") +else() message(SEND_ERROR "SET_TARGET_PROPERTIES or GET_TARGET_PROPERTY failed, FOO_BAR_VAR should be BAR, but is ${FOO_BAR_VAR}") -endif(${FOO_BAR_VAR} MATCHES "BAR") +endif() # Create static and shared lib of same name. if(CMAKE_EXE_LINK_STATIC_CXX_FLAGS) @@ -66,7 +66,7 @@ if(CMAKE_EXE_LINK_STATIC_CXX_FLAGS) add_library(CMakeTestLinkShared SHARED TestLink.c) set_target_properties(CMakeTestLinkStatic CMakeTestLinkShared PROPERTIES OUTPUT_NAME CMakeTestLink) -endif(CMAKE_EXE_LINK_STATIC_CXX_FLAGS) +endif() # # Attach pre-build/pre-link/post-build custom-commands to the lib. @@ -127,7 +127,7 @@ if("${CMAKE_GENERATOR}" MATCHES "Makefile" AND CMAKE_MAKE_PROGRAM) if(ARCH_COUNT GREATER 1) # OSX does not support preprocessing more than one architecture. set(MAYBE_ALL) - endif(ARCH_COUNT GREATER 1) + endif() # Custom target to try preprocessing invocation. add_custom_target(test_preprocess ${MAYBE_ALL} @@ -136,5 +136,5 @@ if("${CMAKE_GENERATOR}" MATCHES "Makefile" AND CMAKE_MAKE_PROGRAM) COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_SOURCE_DIR}/test_preprocess.cmake WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} ) - endif(CMAKE_CXX_CREATE_PREPROCESSED_SOURCE) -endif("${CMAKE_GENERATOR}" MATCHES "Makefile" AND CMAKE_MAKE_PROGRAM) + endif() +endif() diff --git a/Tests/Complex/Library/test_preprocess.cmake b/Tests/Complex/Library/test_preprocess.cmake index 885c613..4c8ec21 100644 --- a/Tests/Complex/Library/test_preprocess.cmake +++ b/Tests/Complex/Library/test_preprocess.cmake @@ -2,6 +2,6 @@ set(TEST_FILE CMakeFiles/create_file.dir/create_file.i) file(READ ${TEST_FILE} CONTENTS) if("${CONTENTS}" MATCHES "Unable to close") message(STATUS "${TEST_FILE} created successfully!") -else("${CONTENTS}" MATCHES "Unable to close") +else() message(FATAL_ERROR "${TEST_FILE} creation failed!") -endif("${CONTENTS}" MATCHES "Unable to close") +endif() diff --git a/Tests/Complex/VarTests.cmake b/Tests/Complex/VarTests.cmake index 7e968fd..52ec1fc 100644 --- a/Tests/Complex/VarTests.cmake +++ b/Tests/Complex/VarTests.cmake @@ -6,9 +6,9 @@ set (ZERO_VAR2 0) if(ZERO_VAR) add_definitions(-DSHOULD_NOT_BE_DEFINED) -else(ZERO_VAR) +else() add_definitions(-DSHOULD_BE_DEFINED) -endif(ZERO_VAR) +endif() set(ONE_VAR 1) set(ONE_VAR2 1) @@ -25,83 +25,83 @@ variable_requires(ONE_VAR # if(NOT ZERO_VAR) add_definitions(-DSHOULD_BE_DEFINED_NOT) -else(NOT ZERO_VAR) +else() add_definitions(-DSHOULD_NOT_BE_DEFINED_NOT) -endif(NOT ZERO_VAR) +endif() if(NOT ONE_VAR) add_definitions(-DSHOULD_NOT_BE_DEFINED_NOT2) -else(NOT ONE_VAR) +else() add_definitions(-DSHOULD_BE_DEFINED_NOT2) -endif(NOT ONE_VAR) +endif() if(ONE_VAR AND ONE_VAR2) add_definitions(-DSHOULD_BE_DEFINED_AND) -else(ONE_VAR AND ONE_VAR2) +else() add_definitions(-DSHOULD_NOT_BE_DEFINED_AND) -endif(ONE_VAR AND ONE_VAR2) +endif() if(ONE_VAR AND ZERO_VAR) add_definitions(-DSHOULD_NOT_BE_DEFINED_AND2) -else(ONE_VAR AND ZERO_VAR) +else() add_definitions(-DSHOULD_BE_DEFINED_AND2) -endif(ONE_VAR AND ZERO_VAR) +endif() if(ZERO_VAR OR ONE_VAR2) add_definitions(-DSHOULD_BE_DEFINED_OR) -else(ZERO_VAR OR ONE_VAR2) +else() add_definitions(-DSHOULD_NOT_BE_DEFINED_OR) -endif(ZERO_VAR OR ONE_VAR2) +endif() if(ZERO_VAR OR ZERO_VAR2) add_definitions(-DSHOULD_NOT_BE_DEFINED_OR2) -else(ZERO_VAR OR ZERO_VAR2) +else() add_definitions(-DSHOULD_BE_DEFINED_OR2) -endif(ZERO_VAR OR ZERO_VAR2) +endif() if(STRING_VAR MATCHES "^CMake") add_definitions(-DSHOULD_BE_DEFINED_MATCHES) -else(STRING_VAR MATCHES "^CMake") +else() add_definitions(-DSHOULD_NOT_BE_DEFINED_MATCHES) -endif(STRING_VAR MATCHES "^CMake") +endif() if(STRING_VAR MATCHES "^foo") add_definitions(-DSHOULD_NOT_BE_DEFINED_MATCHES2) -else(STRING_VAR MATCHES "^foo") +else() add_definitions(-DSHOULD_BE_DEFINED_MATCHES2) -endif(STRING_VAR MATCHES "^foo") +endif() if(COMMAND "IF") add_definitions(-DSHOULD_BE_DEFINED_COMMAND) -else(COMMAND "IF") +else() add_definitions(-DSHOULD_NOT_BE_DEFINED_COMMAND) -endif(COMMAND "IF") +endif() if(COMMAND "ROQUEFORT") add_definitions(-DSHOULD_NOT_BE_DEFINED_COMMAND2) -else(COMMAND "ROQUEFORT") +else() add_definitions(-DSHOULD_BE_DEFINED_COMMAND2) -endif(COMMAND "ROQUEFORT") +endif() if (EXISTS ${Complex_SOURCE_DIR}/VarTests.cmake) add_definitions(-DSHOULD_BE_DEFINED_EXISTS) -else(EXISTS ${Complex_SOURCE_DIR}/VarTests.cmake) +else() add_definitions(-DSHOULD_NOT_BE_DEFINED_EXISTS) -endif (EXISTS ${Complex_SOURCE_DIR}/VarTests.cmake) +endif () if (EXISTS ${Complex_SOURCE_DIR}/roquefort.txt) add_definitions(-DSHOULD_NOT_BE_DEFINED_EXISTS2) -else(EXISTS ${Complex_SOURCE_DIR}/roquefort.txt) +else() add_definitions(-DSHOULD_BE_DEFINED_EXISTS2) -endif (EXISTS ${Complex_SOURCE_DIR}/roquefort.txt) +endif () if (IS_DIRECTORY ${Complex_SOURCE_DIR}) add_definitions(-DSHOULD_BE_DEFINED_IS_DIRECTORY) -endif (IS_DIRECTORY ${Complex_SOURCE_DIR}) +endif () if (NOT IS_DIRECTORY ${Complex_SOURCE_DIR}/VarTests.cmake) add_definitions(-DSHOULD_BE_DEFINED_IS_DIRECTORY2) -endif (NOT IS_DIRECTORY ${Complex_SOURCE_DIR}/VarTests.cmake) +endif () set (SNUM1_VAR "1") set (SNUM2_VAR "2") @@ -110,78 +110,78 @@ set (SNUM3_VAR "1") if (SNUM1_VAR LESS SNUM2_VAR) add_definitions(-DSHOULD_BE_DEFINED_LESS) -else (SNUM1_VAR LESS SNUM2_VAR) +else () add_definitions(-DSHOULD_NOT_BE_DEFINED_LESS) -endif (SNUM1_VAR LESS SNUM2_VAR) +endif () if (SNUM2_VAR LESS SNUM1_VAR) add_definitions(-DSHOULD_NOT_BE_DEFINED_LESS2) -else (SNUM2_VAR LESS SNUM1_VAR) +else () add_definitions(-DSHOULD_BE_DEFINED_LESS2) -endif (SNUM2_VAR LESS SNUM1_VAR) +endif () if (SNUM2_VAR GREATER SNUM1_VAR) add_definitions(-DSHOULD_BE_DEFINED_GREATER) -else (SNUM2_VAR GREATER SNUM1_VAR) +else () add_definitions(-DSHOULD_NOT_BE_DEFINED_GREATER) -endif (SNUM2_VAR GREATER SNUM1_VAR) +endif () if (SNUM2_VAR EQUAL SNUM1_VAR) add_definitions(-DSHOULD_NOT_BE_DEFINED_EQUAL) -else (SNUM2_VAR EQUAL SNUM1_VAR) +else () add_definitions(-DSHOULD_BE_DEFINED_EQUAL) -endif (SNUM2_VAR EQUAL SNUM1_VAR) +endif () if (SNUM3_VAR EQUAL SNUM1_VAR) add_definitions(-DSHOULD_BE_DEFINED_EQUAL) -else (SNUM3_VAR EQUAL SNUM1_VAR) +else () add_definitions(-DSHOULD_NOT_BE_DEFINED_EQUAL) -endif (SNUM3_VAR EQUAL SNUM1_VAR) +endif () if (SNUM1_VAR GREATER SNUM2_VAR) add_definitions(-DSHOULD_NOT_BE_DEFINED_GREATER2) -else (SNUM1_VAR GREATER SNUM2_VAR) +else () add_definitions(-DSHOULD_BE_DEFINED_GREATER2) -endif (SNUM1_VAR GREATER SNUM2_VAR) +endif () set (SSTR1_VAR "abc") set (SSTR2_VAR "bcd") if (SSTR1_VAR STRLESS SSTR2_VAR) add_definitions(-DSHOULD_BE_DEFINED_STRLESS) -else (SSTR1_VAR STRLESS SSTR2_VAR) +else () add_definitions(-DSHOULD_NOT_BE_DEFINED_STRLESS) -endif (SSTR1_VAR STRLESS SSTR2_VAR) +endif () if (SSTR2_VAR STRLESS SSTR1_VAR) add_definitions(-DSHOULD_NOT_BE_DEFINED_STRLESS2) -else (SSTR2_VAR STRLESS SSTR1_VAR) +else () add_definitions(-DSHOULD_BE_DEFINED_STRLESS2) -endif (SSTR2_VAR STRLESS SSTR1_VAR) +endif () if (SSTR2_VAR STRGREATER SSTR1_VAR) add_definitions(-DSHOULD_BE_DEFINED_STRGREATER) -else (SSTR2_VAR STRGREATER SSTR1_VAR) +else () add_definitions(-DSHOULD_NOT_BE_DEFINED_STRGREATER) -endif (SSTR2_VAR STRGREATER SSTR1_VAR) +endif () if (SSTR1_VAR STRGREATER SSTR2_VAR) add_definitions(-DSHOULD_NOT_BE_DEFINED_STRGREATER2) -else (SSTR1_VAR STRGREATER SSTR2_VAR) +else () add_definitions(-DSHOULD_BE_DEFINED_STRGREATER2) -endif (SSTR1_VAR STRGREATER SSTR2_VAR) +endif () # # Test FOREACH # foreach (INDEX 1 2) set(FOREACH_VAR${INDEX} "VALUE${INDEX}") -endforeach(INDEX) +endforeach() set(FOREACH_CONCAT "") foreach (INDEX a;b;c;d;e;f;g) set(FOREACH_CONCAT "${FOREACH_CONCAT}${INDEX}") -endforeach(INDEX) +endforeach() # # Test FIND_FILE, FIND_PATH and various GET_FILENAME_COMPONENT combinations diff --git a/Tests/ComplexOneConfig/CMakeLists.txt b/Tests/ComplexOneConfig/CMakeLists.txt index 1080933..b0748fe 100644 --- a/Tests/ComplexOneConfig/CMakeLists.txt +++ b/Tests/ComplexOneConfig/CMakeLists.txt @@ -11,8 +11,8 @@ if(POLICY CMP0003) cmake_policy(GET CMP0003 P3) if(NOT "${P3}" STREQUAL "NEW") message(FATAL_ERROR "cmake_policy(GET) did not report NEW!") - endif(NOT "${P3}" STREQUAL "NEW") -endif(POLICY CMP0003) + endif() +endif() # Test building without per-rule echo lines in Makefiles. set_property(GLOBAL PROPERTY RULE_MESSAGES OFF) @@ -25,8 +25,8 @@ set(CPACK_SOURCE_IGNORE_FILES "~$;\\.cvsignore$;^C:/hoffman/My Builds/testcase.* macro(ASSERT value msg) if (NOT ${value}) message ("Assertion failure:" ${msg} ) - endif (NOT ${value}) -endmacro(ASSERT) + endif () +endmacro() # invoke the macro ASSERT(Complex_BINARY_DIR "The PROJECT command is broken") @@ -38,8 +38,8 @@ macro(TEST_ARGC value1 value2) add_definitions(${value1} ${value2}) if (${ARGC} MATCHES 4) add_definitions(${ARGV2} ${ARGV3}) - endif (${ARGC} MATCHES 4) -endmacro(TEST_ARGC) + endif () +endmacro() # invoke the macro TEST_ARGC(-DCMAKE_ARGV1 -DCMAKE_ARGV2 -DCMAKE_ARGV3 -DCMAKE_ARGV4) @@ -47,34 +47,34 @@ TEST_ARGC(-DCMAKE_ARGV1 -DCMAKE_ARGV2 -DCMAKE_ARGV3 -DCMAKE_ARGV4) macro(TEST_VAR_ARG fa) if("${ARGV}" MATCHES "^1;2;3$") message(STATUS "ARGV works") - else("${ARGV}" MATCHES "^1;2;3$") + else() message(FATAL_ERROR "ARGV does not work; got \"${ARGV}\" instead of \"1;2;3\"") - endif("${ARGV}" MATCHES "^1;2;3$") + endif() if("${ARGN}" MATCHES "^2;3$") message(STATUS "ARGN works") - else("${ARGN}" MATCHES "^2;3$") + else() message(FATAL_ERROR "ARGV does not work; got \"${ARGN}\" instead of \"2;3\"") - endif("${ARGN}" MATCHES "^2;3$") -endmacro(TEST_VAR_ARG) + endif() +endmacro() TEST_VAR_ARG(1 2 3) # Floating-point comparison test. if(2.4 LESS 2.4) message(FATAL_ERROR "Failed: 2.4 LESS 2.4") -endif(2.4 LESS 2.4) +endif() if(2.4 GREATER 2.4) message(FATAL_ERROR "Failed: 2.4 GREATER 2.4") -endif(2.4 GREATER 2.4) +endif() if(NOT 2.4 EQUAL 2.4) message(FATAL_ERROR "Failed: NOT 2.4 EQUAL 2.4") -endif(NOT 2.4 EQUAL 2.4) +endif() if(CMAKE_SYSTEM MATCHES "OSF1-V.*") if(NOT CMAKE_COMPILER_IS_GNUCXX) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -timplicit_local -no_implicit_include ") - endif(NOT CMAKE_COMPILER_IS_GNUCXX) -endif(CMAKE_SYSTEM MATCHES "OSF1-V.*") + endif() +endif() add_definitions(-DCMAKE_IS_FUN) @@ -93,7 +93,7 @@ separate_arguments(TEST_SEP) # if (EXISTS ${Complex_SOURCE_DIR}/VarTests.cmake) include(${Complex_SOURCE_DIR}/VarTests.cmake) -endif (EXISTS ${Complex_SOURCE_DIR}/VarTests.cmake) +endif () include(fileshouldnotbehere OPTIONAL) load_cache(${Complex_SOURCE_DIR}/Cache EXCLUDE @@ -104,9 +104,9 @@ load_cache(${Complex_SOURCE_DIR}/Cache load_cache(${Complex_SOURCE_DIR}/Cache READ_WITH_PREFIX foo CACHE_TEST_VAR2) if(${fooCACHE_TEST_VAR2} MATCHES bar) message("Load cache worked: ${fooCACHE_TEST_VAR2}") -else(${fooCACHE_TEST_VAR2} MATCHES bar) +else() message(FATAL_ERROR "Load cache with prefix failed: ${fooCACHE_TEST_VAR2}") -endif(${fooCACHE_TEST_VAR2} MATCHES bar) +endif() @@ -151,9 +151,9 @@ message("\nIgnore this message") option(NO_EXEC_PROGRAM "Do not test EXEC_PROGRAM" 0) if (NOT NO_EXEC_PROGRAM) exec_program(${CMAKE_COMMAND} ARGS -E echo NO_EXEC_PROGRAM "${Complex_BINARY_DIR}") -else (NOT NO_EXEC_PROGRAM) +else () message("Set this option ON") -endif (NOT NO_EXEC_PROGRAM) +endif () mark_as_advanced(NO_EXEC_PROGRAM) mark_as_advanced(CLEAR NO_EXEC_PROGRAM) @@ -164,9 +164,9 @@ execute_process( OUTPUT_VARIABLE TEST_OUT ) if("${TEST_OUT}" MATCHES "^ABCDEFG\n$") -else("${TEST_OUT}" MATCHES "^ABCDEFG\n$") +else() message(SEND_ERROR "EXECUTE_PROCESS output test failed: [${TEST_OUT}]") -endif("${TEST_OUT}" MATCHES "^ABCDEFG\n$") +endif() # This test has some problems on UNIX systems. Disabling for now. # @@ -180,9 +180,9 @@ endif("${TEST_OUT}" MATCHES "^ABCDEFG\n$") # if("${RESULT}" MATCHES "^0$") # message(SEND_ERROR # "EXECUTE_PROCESS result test failed with RESULT=[${RESULT}]") -# else("${RESULT}" MATCHES "^0$") +# else() # message(STATUS "EXECUTE_PROCESS result test passed with RESULT=[${RESULT}]") -# endif("${RESULT}" MATCHES "^0$") +# endif() # # Create directory. @@ -204,7 +204,7 @@ foreach (ext ${CMAKE_SHLIB_SUFFIX};.so;.a;.sl) ${Complex_SOURCE_DIR}/Library/dummy ${Complex_BINARY_DIR}/Library/libdummylib${ext} COPYONLY IMMEDIATE) -endforeach (ext) +endforeach () find_library(FIND_DUMMY_LIB dummylib @@ -258,8 +258,8 @@ if (WIN32) "[${hkey}]" DOC "Registry_Test_Path") exec_program(${CMAKE_COMMAND} ARGS "-E delete_regv \"${hkey}\"") exec_program(${CMAKE_COMMAND} ARGS "-E remove \"${dir}/${file}\"") - endif (NOT UNIX) -endif (WIN32) + endif () +endif () # # Test a set and a remove @@ -275,17 +275,17 @@ foreach(x "a") if(${x} MATCHES "a") # Should always execute. set(IF_INSIDE_FOREACH_THEN_EXECUTED 1) - else(${x} MATCHES "a") + else() # Should never execute. set(IF_INSIDE_FOREACH_ELSE_EXECUTED 1) - endif(${x} MATCHES "a") -endforeach(x) + endif() +endforeach() # test WHILE command set (while_var 1) while (while_var LESS 1000) set(while_var ${while_var}0) -endwhile(while_var LESS 1000) +endwhile() set(SHOULD_BE_ZERO ) set(SHOULD_BE_ONE 1) @@ -298,7 +298,7 @@ if (RESULT EQUAL 1) set (ELSEIF_RESULT 1) elseif (RESULT EQUAL 3) set (ELSEIF_RESULT 1) - endif (RESULT EQUAL 2) + endif () elseif (RESULT EQUAL 2) set (ELSEIF_RESULT 1) elseif (RESULT EQUAL 3) @@ -307,25 +307,25 @@ elseif (RESULT EQUAL 3) elseif (RESULT EQUAL 3) if (NOT ELSEIF_RESULT EQUAL 1) set (ELSEIF_RESULT 2) - endif (NOT ELSEIF_RESULT EQUAL 1) - endif (RESULT EQUAL 2) + endif () + endif () elseif (RESULT EQUAL 4) if (RESULT EQUAL 2) set (ELSEIF_RESULT 1) elseif (RESULT EQUAL 3) set (ELSEIF_RESULT 1) - endif (RESULT EQUAL 2) -else (RESULT EQUAL 1) + endif () +else () if (RESULT EQUAL 2) set (ELSEIF_RESULT 1) elseif (RESULT EQUAL 3) set (ELSEIF_RESULT 1) - endif (RESULT EQUAL 2) -endif (RESULT EQUAL 1) + endif () +endif () if (NOT ELSEIF_RESULT EQUAL 2) set (ELSEIF_RESULT 0) -endif (NOT ELSEIF_RESULT EQUAL 2) +endif () # test handling of parenthetical groups in conditionals if (2 GREATER 1 AND (4 LESS 3 OR 5 LESS 6) AND NOT (7 GREATER 8)) @@ -351,19 +351,19 @@ configure_file( string(REGEX MATCH "b" RESULT "abc") if(NOT RESULT) message(SEND_ERROR "string(REGEX MATCH ... ) test failed.") -endif(NOT RESULT) +endif() string(REGEX MATCHALL "b" RESULT "abcb") if(NOT RESULT) message(SEND_ERROR "string(REGEX MATCHALL ... ) test failed.") -endif(NOT RESULT) +endif() string(REGEX REPLACE ".([bd])." "[\\1]" RESULT "a(b)c(d)e") if("x${RESULT}" MATCHES "^xa\\[b\\]c\\[d\\]e$") set(STRING_REGEX_PASSED 1) -endif("x${RESULT}" MATCHES "^xa\\[b\\]c\\[d\\]e$") +endif() if(NOT STRING_REGEX_PASSED) message(SEND_ERROR "string(REGEX REPLACE ... ) test failed (\"${RESULT}\" v. \"a[b]c[d]e\")") -endif(NOT STRING_REGEX_PASSED) +endif() # diff --git a/Tests/ComplexOneConfig/Executable/CMakeLists.txt b/Tests/ComplexOneConfig/Executable/CMakeLists.txt index 4138835..432dbf8 100644 --- a/Tests/ComplexOneConfig/Executable/CMakeLists.txt +++ b/Tests/ComplexOneConfig/Executable/CMakeLists.txt @@ -11,16 +11,16 @@ add_library(ExeImportedTarget UNKNOWN IMPORTED) # Test if(TARGET) command. if(NOT TARGET CMakeTestLibrary) message(FATAL_ERROR "if(NOT TARGET CMakeTestLibrary) returned true!") -endif(NOT TARGET CMakeTestLibrary) +endif() if(NOT TARGET ExeImportedTarget) message(FATAL_ERROR "if(NOT TARGET ExeImportedTarget) returned true!") -endif(NOT TARGET ExeImportedTarget) +endif() if(TARGET LibImportedTarget) message(FATAL_ERROR "if(TARGET LibImportedTarget) returned true!") -endif(TARGET LibImportedTarget) +endif() if(TARGET NotATarget) message(FATAL_ERROR "if(TARGET NotATarget) returned true!") -endif(TARGET NotATarget) +endif() # Use LINK_LIBRARIES instead of TARGET_LINK_LIBRARIES to set(COMPLEX_LIBS CMakeTestLibrary;CMakeTestLibraryShared;CMakeTestCLibraryShared) @@ -46,37 +46,37 @@ add_executable(complex.file complex.file.cxx complex_nobuild.cxx if (UNIX) target_link_libraries(complex ${CMAKE_DL_LIBS}) -else(UNIX) +else() if (NOT BORLAND) if(NOT MINGW) target_link_libraries(complex rpcrt4.lib) - endif(NOT MINGW) - endif(NOT BORLAND) -endif (UNIX) + endif() + endif() +endif () # Test linking to static lib when a shared lib has the same name. if(CMAKE_EXE_LINK_STATIC_CXX_FLAGS) add_definitions(-DCOMPLEX_TEST_LINK_STATIC) target_link_libraries(complex CMakeTestLinkStatic) -endif(CMAKE_EXE_LINK_STATIC_CXX_FLAGS) +endif() # can we get the path to a source file get_source_file_property(A_LOCATION A.cxx LOCATION) if ("${A_LOCATION}" STREQUAL "${CMAKE_CURRENT_SOURCE_DIR}/A.cxx") add_definitions(-DCMAKE_FOUND_ACXX) -endif ("${A_LOCATION}" STREQUAL "${CMAKE_CURRENT_SOURCE_DIR}/A.cxx") +endif () # get the directory parent get_directory_property(P_VALUE PARENT_DIRECTORY) if ("${P_VALUE}" STREQUAL "${CMAKE_SOURCE_DIR}") add_definitions(-DCMAKE_FOUND_PARENT) -endif ("${P_VALUE}" STREQUAL "${CMAKE_SOURCE_DIR}") +endif () # get the stack of listfiles include(Included.cmake) if ("${LF_VALUE}" STREQUAL "${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt;${CMAKE_CURRENT_SOURCE_DIR}/Included.cmake") add_definitions(-DCMAKE_FOUND_LISTFILE_STACK) -endif ("${LF_VALUE}" STREQUAL "${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt;${CMAKE_CURRENT_SOURCE_DIR}/Included.cmake") +endif () # Test add/remove definitions. add_definitions( @@ -128,7 +128,7 @@ target_link_libraries(notInAllExe notInAllLib) if(MSVC) set_target_properties(notInAllExe PROPERTIES LINK_FLAGS "/NODEFAULTLIB:LIBC;LIBCMT;MSVCRT") -endif(MSVC) +endif() # Test creating a custom target that builds not-in-all targets. add_custom_target(notInAllCustom) @@ -146,7 +146,7 @@ add_subdirectory(Temp) if(CMAKE_COMPILER_IS_GNUCXX AND CMAKE_INCLUDE_SYSTEM_FLAG_CXX) add_executable(testSystemDir testSystemDir.cxx) set_target_properties(testSystemDir PROPERTIES COMPILE_FLAGS "-Werror") -endif(CMAKE_COMPILER_IS_GNUCXX AND CMAKE_INCLUDE_SYSTEM_FLAG_CXX) +endif() # # Extra coverage.Not used. diff --git a/Tests/ComplexOneConfig/Library/CMakeLists.txt b/Tests/ComplexOneConfig/Library/CMakeLists.txt index 41faeba..5c43052 100644 --- a/Tests/ComplexOneConfig/Library/CMakeLists.txt +++ b/Tests/ComplexOneConfig/Library/CMakeLists.txt @@ -33,10 +33,10 @@ if(WIN32) target_link_libraries(CMakeTestLibrary optimized kernel32.lib) - endif(NOT MINGW) - endif(NOT BORLAND) - endif(NOT CYGWIN) -endif(WIN32) + endif() + endif() + endif() +endif() # # Create shared library @@ -53,12 +53,12 @@ define_property( set_target_properties(CMakeTestCLibraryShared PROPERTIES FOO BAR) if(NOT BEOS AND NOT WIN32) # No libm on BeOS. set_target_properties(CMakeTestCLibraryShared PROPERTIES LINK_FLAGS "-lm") -endif(NOT BEOS AND NOT WIN32) +endif() get_target_property(FOO_BAR_VAR CMakeTestCLibraryShared FOO) if(${FOO_BAR_VAR} MATCHES "BAR") -else(${FOO_BAR_VAR} MATCHES "BAR") +else() message(SEND_ERROR "SET_TARGET_PROPERTIES or GET_TARGET_PROPERTY failed, FOO_BAR_VAR should be BAR, but is ${FOO_BAR_VAR}") -endif(${FOO_BAR_VAR} MATCHES "BAR") +endif() # Create static and shared lib of same name. if(CMAKE_EXE_LINK_STATIC_CXX_FLAGS) @@ -66,7 +66,7 @@ if(CMAKE_EXE_LINK_STATIC_CXX_FLAGS) add_library(CMakeTestLinkShared SHARED TestLink.c) set_target_properties(CMakeTestLinkStatic CMakeTestLinkShared PROPERTIES OUTPUT_NAME CMakeTestLink) -endif(CMAKE_EXE_LINK_STATIC_CXX_FLAGS) +endif() # # Attach pre-build/pre-link/post-build custom-commands to the lib. @@ -127,7 +127,7 @@ if("${CMAKE_GENERATOR}" MATCHES "Makefile" AND CMAKE_MAKE_PROGRAM) if(ARCH_COUNT GREATER 1) # OSX does not support preprocessing more than one architecture. set(MAYBE_ALL) - endif(ARCH_COUNT GREATER 1) + endif() # Custom target to try preprocessing invocation. add_custom_target(test_preprocess ${MAYBE_ALL} @@ -136,5 +136,5 @@ if("${CMAKE_GENERATOR}" MATCHES "Makefile" AND CMAKE_MAKE_PROGRAM) COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_SOURCE_DIR}/test_preprocess.cmake WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} ) - endif(CMAKE_CXX_CREATE_PREPROCESSED_SOURCE) -endif("${CMAKE_GENERATOR}" MATCHES "Makefile" AND CMAKE_MAKE_PROGRAM) + endif() +endif() diff --git a/Tests/ComplexOneConfig/Library/test_preprocess.cmake b/Tests/ComplexOneConfig/Library/test_preprocess.cmake index 885c613..4c8ec21 100644 --- a/Tests/ComplexOneConfig/Library/test_preprocess.cmake +++ b/Tests/ComplexOneConfig/Library/test_preprocess.cmake @@ -2,6 +2,6 @@ set(TEST_FILE CMakeFiles/create_file.dir/create_file.i) file(READ ${TEST_FILE} CONTENTS) if("${CONTENTS}" MATCHES "Unable to close") message(STATUS "${TEST_FILE} created successfully!") -else("${CONTENTS}" MATCHES "Unable to close") +else() message(FATAL_ERROR "${TEST_FILE} creation failed!") -endif("${CONTENTS}" MATCHES "Unable to close") +endif() diff --git a/Tests/ComplexOneConfig/VarTests.cmake b/Tests/ComplexOneConfig/VarTests.cmake index 7e968fd..52ec1fc 100644 --- a/Tests/ComplexOneConfig/VarTests.cmake +++ b/Tests/ComplexOneConfig/VarTests.cmake @@ -6,9 +6,9 @@ set (ZERO_VAR2 0) if(ZERO_VAR) add_definitions(-DSHOULD_NOT_BE_DEFINED) -else(ZERO_VAR) +else() add_definitions(-DSHOULD_BE_DEFINED) -endif(ZERO_VAR) +endif() set(ONE_VAR 1) set(ONE_VAR2 1) @@ -25,83 +25,83 @@ variable_requires(ONE_VAR # if(NOT ZERO_VAR) add_definitions(-DSHOULD_BE_DEFINED_NOT) -else(NOT ZERO_VAR) +else() add_definitions(-DSHOULD_NOT_BE_DEFINED_NOT) -endif(NOT ZERO_VAR) +endif() if(NOT ONE_VAR) add_definitions(-DSHOULD_NOT_BE_DEFINED_NOT2) -else(NOT ONE_VAR) +else() add_definitions(-DSHOULD_BE_DEFINED_NOT2) -endif(NOT ONE_VAR) +endif() if(ONE_VAR AND ONE_VAR2) add_definitions(-DSHOULD_BE_DEFINED_AND) -else(ONE_VAR AND ONE_VAR2) +else() add_definitions(-DSHOULD_NOT_BE_DEFINED_AND) -endif(ONE_VAR AND ONE_VAR2) +endif() if(ONE_VAR AND ZERO_VAR) add_definitions(-DSHOULD_NOT_BE_DEFINED_AND2) -else(ONE_VAR AND ZERO_VAR) +else() add_definitions(-DSHOULD_BE_DEFINED_AND2) -endif(ONE_VAR AND ZERO_VAR) +endif() if(ZERO_VAR OR ONE_VAR2) add_definitions(-DSHOULD_BE_DEFINED_OR) -else(ZERO_VAR OR ONE_VAR2) +else() add_definitions(-DSHOULD_NOT_BE_DEFINED_OR) -endif(ZERO_VAR OR ONE_VAR2) +endif() if(ZERO_VAR OR ZERO_VAR2) add_definitions(-DSHOULD_NOT_BE_DEFINED_OR2) -else(ZERO_VAR OR ZERO_VAR2) +else() add_definitions(-DSHOULD_BE_DEFINED_OR2) -endif(ZERO_VAR OR ZERO_VAR2) +endif() if(STRING_VAR MATCHES "^CMake") add_definitions(-DSHOULD_BE_DEFINED_MATCHES) -else(STRING_VAR MATCHES "^CMake") +else() add_definitions(-DSHOULD_NOT_BE_DEFINED_MATCHES) -endif(STRING_VAR MATCHES "^CMake") +endif() if(STRING_VAR MATCHES "^foo") add_definitions(-DSHOULD_NOT_BE_DEFINED_MATCHES2) -else(STRING_VAR MATCHES "^foo") +else() add_definitions(-DSHOULD_BE_DEFINED_MATCHES2) -endif(STRING_VAR MATCHES "^foo") +endif() if(COMMAND "IF") add_definitions(-DSHOULD_BE_DEFINED_COMMAND) -else(COMMAND "IF") +else() add_definitions(-DSHOULD_NOT_BE_DEFINED_COMMAND) -endif(COMMAND "IF") +endif() if(COMMAND "ROQUEFORT") add_definitions(-DSHOULD_NOT_BE_DEFINED_COMMAND2) -else(COMMAND "ROQUEFORT") +else() add_definitions(-DSHOULD_BE_DEFINED_COMMAND2) -endif(COMMAND "ROQUEFORT") +endif() if (EXISTS ${Complex_SOURCE_DIR}/VarTests.cmake) add_definitions(-DSHOULD_BE_DEFINED_EXISTS) -else(EXISTS ${Complex_SOURCE_DIR}/VarTests.cmake) +else() add_definitions(-DSHOULD_NOT_BE_DEFINED_EXISTS) -endif (EXISTS ${Complex_SOURCE_DIR}/VarTests.cmake) +endif () if (EXISTS ${Complex_SOURCE_DIR}/roquefort.txt) add_definitions(-DSHOULD_NOT_BE_DEFINED_EXISTS2) -else(EXISTS ${Complex_SOURCE_DIR}/roquefort.txt) +else() add_definitions(-DSHOULD_BE_DEFINED_EXISTS2) -endif (EXISTS ${Complex_SOURCE_DIR}/roquefort.txt) +endif () if (IS_DIRECTORY ${Complex_SOURCE_DIR}) add_definitions(-DSHOULD_BE_DEFINED_IS_DIRECTORY) -endif (IS_DIRECTORY ${Complex_SOURCE_DIR}) +endif () if (NOT IS_DIRECTORY ${Complex_SOURCE_DIR}/VarTests.cmake) add_definitions(-DSHOULD_BE_DEFINED_IS_DIRECTORY2) -endif (NOT IS_DIRECTORY ${Complex_SOURCE_DIR}/VarTests.cmake) +endif () set (SNUM1_VAR "1") set (SNUM2_VAR "2") @@ -110,78 +110,78 @@ set (SNUM3_VAR "1") if (SNUM1_VAR LESS SNUM2_VAR) add_definitions(-DSHOULD_BE_DEFINED_LESS) -else (SNUM1_VAR LESS SNUM2_VAR) +else () add_definitions(-DSHOULD_NOT_BE_DEFINED_LESS) -endif (SNUM1_VAR LESS SNUM2_VAR) +endif () if (SNUM2_VAR LESS SNUM1_VAR) add_definitions(-DSHOULD_NOT_BE_DEFINED_LESS2) -else (SNUM2_VAR LESS SNUM1_VAR) +else () add_definitions(-DSHOULD_BE_DEFINED_LESS2) -endif (SNUM2_VAR LESS SNUM1_VAR) +endif () if (SNUM2_VAR GREATER SNUM1_VAR) add_definitions(-DSHOULD_BE_DEFINED_GREATER) -else (SNUM2_VAR GREATER SNUM1_VAR) +else () add_definitions(-DSHOULD_NOT_BE_DEFINED_GREATER) -endif (SNUM2_VAR GREATER SNUM1_VAR) +endif () if (SNUM2_VAR EQUAL SNUM1_VAR) add_definitions(-DSHOULD_NOT_BE_DEFINED_EQUAL) -else (SNUM2_VAR EQUAL SNUM1_VAR) +else () add_definitions(-DSHOULD_BE_DEFINED_EQUAL) -endif (SNUM2_VAR EQUAL SNUM1_VAR) +endif () if (SNUM3_VAR EQUAL SNUM1_VAR) add_definitions(-DSHOULD_BE_DEFINED_EQUAL) -else (SNUM3_VAR EQUAL SNUM1_VAR) +else () add_definitions(-DSHOULD_NOT_BE_DEFINED_EQUAL) -endif (SNUM3_VAR EQUAL SNUM1_VAR) +endif () if (SNUM1_VAR GREATER SNUM2_VAR) add_definitions(-DSHOULD_NOT_BE_DEFINED_GREATER2) -else (SNUM1_VAR GREATER SNUM2_VAR) +else () add_definitions(-DSHOULD_BE_DEFINED_GREATER2) -endif (SNUM1_VAR GREATER SNUM2_VAR) +endif () set (SSTR1_VAR "abc") set (SSTR2_VAR "bcd") if (SSTR1_VAR STRLESS SSTR2_VAR) add_definitions(-DSHOULD_BE_DEFINED_STRLESS) -else (SSTR1_VAR STRLESS SSTR2_VAR) +else () add_definitions(-DSHOULD_NOT_BE_DEFINED_STRLESS) -endif (SSTR1_VAR STRLESS SSTR2_VAR) +endif () if (SSTR2_VAR STRLESS SSTR1_VAR) add_definitions(-DSHOULD_NOT_BE_DEFINED_STRLESS2) -else (SSTR2_VAR STRLESS SSTR1_VAR) +else () add_definitions(-DSHOULD_BE_DEFINED_STRLESS2) -endif (SSTR2_VAR STRLESS SSTR1_VAR) +endif () if (SSTR2_VAR STRGREATER SSTR1_VAR) add_definitions(-DSHOULD_BE_DEFINED_STRGREATER) -else (SSTR2_VAR STRGREATER SSTR1_VAR) +else () add_definitions(-DSHOULD_NOT_BE_DEFINED_STRGREATER) -endif (SSTR2_VAR STRGREATER SSTR1_VAR) +endif () if (SSTR1_VAR STRGREATER SSTR2_VAR) add_definitions(-DSHOULD_NOT_BE_DEFINED_STRGREATER2) -else (SSTR1_VAR STRGREATER SSTR2_VAR) +else () add_definitions(-DSHOULD_BE_DEFINED_STRGREATER2) -endif (SSTR1_VAR STRGREATER SSTR2_VAR) +endif () # # Test FOREACH # foreach (INDEX 1 2) set(FOREACH_VAR${INDEX} "VALUE${INDEX}") -endforeach(INDEX) +endforeach() set(FOREACH_CONCAT "") foreach (INDEX a;b;c;d;e;f;g) set(FOREACH_CONCAT "${FOREACH_CONCAT}${INDEX}") -endforeach(INDEX) +endforeach() # # Test FIND_FILE, FIND_PATH and various GET_FILENAME_COMPONENT combinations diff --git a/Tests/CustomCommand/CMakeLists.txt b/Tests/CustomCommand/CMakeLists.txt index 58408d7..d3ced3f 100644 --- a/Tests/CustomCommand/CMakeLists.txt +++ b/Tests/CustomCommand/CMakeLists.txt @@ -337,7 +337,7 @@ if(NOT MINGW) # * # MinGW programs on windows always expands the wildcard! # / # MSys make converts a leading slash to the mingw home directory list(APPEND CHECK_ARGS * /) -endif(NOT MINGW) +endif() # The windows command shell does not support a double quote by itself: # double\"quote @@ -359,7 +359,7 @@ foreach(arg ${CHECK_ARGS} "") set(EXPECTED_ARGUMENTS "${EXPECTED_ARGUMENTS} \"${ARG}\", ") -endforeach(arg) +endforeach() configure_file(${CMAKE_CURRENT_SOURCE_DIR}/check_command_line.c.in ${CMAKE_CURRENT_BINARY_DIR}/check_command_line.c @ONLY IMMEDIATE) diff --git a/Tests/CustomCommand/check_mark.cmake b/Tests/CustomCommand/check_mark.cmake index f8638d4..1f47fd0 100644 --- a/Tests/CustomCommand/check_mark.cmake +++ b/Tests/CustomCommand/check_mark.cmake @@ -1,5 +1,5 @@ if(EXISTS "${MARK_FILE}") message(FATAL_ERROR "Custom command run more than once!") -else(EXISTS "${MARK_FILE}") +else() file(WRITE "${MARK_FILE}" "check for running custom command twice\n") -endif(EXISTS "${MARK_FILE}") +endif() diff --git a/Tests/EnforceConfig.cmake.in b/Tests/EnforceConfig.cmake.in index 27ee1fd..8c0817c 100644 --- a/Tests/EnforceConfig.cmake.in +++ b/Tests/EnforceConfig.cmake.in @@ -1,9 +1,9 @@ # Choose a configuration with which to drive CTest tests. if(CTEST_CONFIGURATION_TYPE) set(CTestTest_CONFIG "${CTEST_CONFIGURATION_TYPE}") -else(CTEST_CONFIGURATION_TYPE) +else() set(CTestTest_CONFIG "@CTestTest_CONFIG@") -endif(CTEST_CONFIGURATION_TYPE) +endif() # Choose a configuration that was built if none is given. if(NOT CTEST_CONFIGURATION_TYPE) @@ -14,13 +14,13 @@ if(NOT CTEST_CONFIGURATION_TYPE) if(NOT CTEST_CONFIGURATION_TYPE) if(EXISTS "${CTEST_DIR}/${cfg}/${CTEST_EXE}") set(CTEST_CONFIGURATION_TYPE ${cfg}) - endif(EXISTS "${CTEST_DIR}/${cfg}/${CTEST_EXE}") - endif(NOT CTEST_CONFIGURATION_TYPE) - endforeach(cfg) + endif() + endif() + endforeach() if(NOT CTEST_CONFIGURATION_TYPE) set(CTEST_CONFIGURATION_TYPE NoConfig) - endif(NOT CTEST_CONFIGURATION_TYPE) + endif() message("Guessing configuration ${CTEST_CONFIGURATION_TYPE}") -endif(NOT CTEST_CONFIGURATION_TYPE) +endif() @TEST_HOME_ENV_CODE@ diff --git a/Tests/ExportImport/CMakeLists.txt b/Tests/ExportImport/CMakeLists.txt index ccfb894..d6593e8 100644 --- a/Tests/ExportImport/CMakeLists.txt +++ b/Tests/ExportImport/CMakeLists.txt @@ -14,13 +14,13 @@ set_property( if(CMAKE_CONFIGURATION_TYPES) set(NESTED_CONFIG_TYPE -C "${CMAKE_CFG_INTDIR}") -else(CMAKE_CONFIGURATION_TYPES) +else() if(CMAKE_BUILD_TYPE) set(NESTED_CONFIG_TYPE -C "${CMAKE_BUILD_TYPE}") - else(CMAKE_BUILD_TYPE) + else() set(NESTED_CONFIG_TYPE) - endif(CMAKE_BUILD_TYPE) -endif(CMAKE_CONFIGURATION_TYPES) + endif() +endif() if(MINGW OR MSYS) # Test CMAKE_GNUtoMS whether we have VS or not. diff --git a/Tests/ExportImport/Export/CMakeLists.txt b/Tests/ExportImport/Export/CMakeLists.txt index f06a465..f118c30 100644 --- a/Tests/ExportImport/Export/CMakeLists.txt +++ b/Tests/ExportImport/Export/CMakeLists.txt @@ -56,7 +56,7 @@ add_library(testLib6 STATIC testLib6.cxx testLib6c.c) set(VS6) if("${CMAKE_GENERATOR}" MATCHES "Visual Studio 6") set(VS6 1) -endif("${CMAKE_GENERATOR}" MATCHES "Visual Studio 6") +endif() # Test using the target_link_libraries command to set the # LINK_INTERFACE_LIBRARIES* properties. We construct two libraries @@ -129,7 +129,7 @@ install(EXPORT exp NAMESPACE exp_ DESTINATION lib/exp) # Install testLib5.dll outside the export. if(WIN32) install(TARGETS testLib5 RUNTIME DESTINATION bin) -endif(WIN32) +endif() # Export from build tree. export(TARGETS testExe1 testLib1 testLib2 testLib3 diff --git a/Tests/ExportImport/Import/A/CMakeLists.txt b/Tests/ExportImport/Import/A/CMakeLists.txt index a21e1b0..650af6a 100644 --- a/Tests/ExportImport/Import/A/CMakeLists.txt +++ b/Tests/ExportImport/Import/A/CMakeLists.txt @@ -73,7 +73,7 @@ target_link_libraries(imp_mod1b bld_testExe2) foreach(c DEBUG RELWITHDEBINFO) set_property(TARGET imp_testExe1 PROPERTY COMPILE_DEFINITIONS_${c} EXE_DBG) set_property(TARGET imp_testExe1b PROPERTY COMPILE_DEFINITIONS_${c} EXE_DBG) -endforeach(c) +endforeach() #----------------------------------------------------------------------------- # Create a custom target to generate a header for the libraries below. diff --git a/Tests/ExternalOBJ/CMakeLists.txt b/Tests/ExternalOBJ/CMakeLists.txt index 542bfab..458c88b 100644 --- a/Tests/ExternalOBJ/CMakeLists.txt +++ b/Tests/ExternalOBJ/CMakeLists.txt @@ -7,9 +7,9 @@ if(APPLE) # check for Power PC and change to ppc if("${_CMAKE_OSX_MACHINE}" MATCHES "Power") set(_CMAKE_OSX_MACHINE ppc) - endif("${_CMAKE_OSX_MACHINE}" MATCHES "Power") + endif() set(CMAKE_OSX_ARCHITECTURES ${_CMAKE_OSX_MACHINE}) -endif(APPLE) +endif() # Build the external object file. try_compile(EXTERNAL_OBJECT_BUILT @@ -24,12 +24,12 @@ if(EXTERNAL_OBJECT_BUILT) "Building external_object.cxx succeeded with the following output:\n" "[${OUTPUT}]" ) -else(EXTERNAL_OBJECT_BUILT) +else() message(FATAL_ERROR "Building external_object.cxx failed with the following output:\n" "[${OUTPUT}]" ) -endif(EXTERNAL_OBJECT_BUILT) +endif() # Find the external object file. set(DIR ${ExternalOBJ_BINARY_DIR}/Object) @@ -38,9 +38,9 @@ file(GLOB_RECURSE EXTERNAL_OBJECT if(EXTERNAL_OBJECT) list (GET EXTERNAL_OBJECT 0 EXTERNAL_OBJECT) message("Found \"${EXTERNAL_OBJECT}\".") -else(EXTERNAL_OBJECT) +else() message(FATAL_ERROR "Could not find external object.") -endif(EXTERNAL_OBJECT) +endif() # Test creation of external objects by custom commands. set(CUSTOM_OBJECT diff --git a/Tests/ExternalOBJ/Object/CMakeLists.txt b/Tests/ExternalOBJ/Object/CMakeLists.txt index b24e91b..dbfe09e 100644 --- a/Tests/ExternalOBJ/Object/CMakeLists.txt +++ b/Tests/ExternalOBJ/Object/CMakeLists.txt @@ -6,8 +6,8 @@ if(APPLE) # check for Power PC and change to ppc if("${_CMAKE_OSX_MACHINE}" MATCHES "Power") set(_CMAKE_OSX_MACHINE ppc) - endif("${_CMAKE_OSX_MACHINE}" MATCHES "Power") + endif() set(CMAKE_OSX_ARCHITECTURES ${_CMAKE_OSX_MACHINE}) -endif(APPLE) +endif() add_executable(external external_object.cxx external_main.cxx) diff --git a/Tests/ExternalProject/TryCheckout.cmake b/Tests/ExternalProject/TryCheckout.cmake index de069eb..6a396c3 100644 --- a/Tests/ExternalProject/TryCheckout.cmake +++ b/Tests/ExternalProject/TryCheckout.cmake @@ -25,7 +25,7 @@ function(try_cvs_checkout repository module dir result_var) message(STATUS "try_cvs_checkout -- done") endif() -endfunction(try_cvs_checkout) +endfunction() function(try_svn_checkout repository dir result_var) @@ -51,4 +51,4 @@ function(try_svn_checkout repository dir result_var) message(STATUS "try_svn_checkout -- done") endif() -endfunction(try_svn_checkout) +endfunction() diff --git a/Tests/FindModulesExecuteAll/CMakeLists.txt b/Tests/FindModulesExecuteAll/CMakeLists.txt index df51626..21b9d38 100644 --- a/Tests/FindModulesExecuteAll/CMakeLists.txt +++ b/Tests/FindModulesExecuteAll/CMakeLists.txt @@ -23,8 +23,8 @@ foreach(module ${all_modules}) # disabled for now, since too many modules break: # if(NOT DEFINED ${packageNameUpper}_FOUND) # message(SEND_ERROR "${packageNameUpper}_FOUND not defined !") -# endif(NOT DEFINED ${packageNameUpper}_FOUND) +# endif() -endforeach(module ${all_modules}) +endforeach() add_executable(FindModulesExecuteAll main.c) diff --git a/Tests/FindPackageTest/Baz 1.1/BazConfigVersion.cmake b/Tests/FindPackageTest/Baz 1.1/BazConfigVersion.cmake index 61db416..979bbdf 100644 --- a/Tests/FindPackageTest/Baz 1.1/BazConfigVersion.cmake +++ b/Tests/FindPackageTest/Baz 1.1/BazConfigVersion.cmake @@ -3,6 +3,6 @@ if("${PACKAGE_FIND_VERSION_MAJOR}" EQUAL 1) set(PACKAGE_VERSION_COMPATIBLE 1) if("${PACKAGE_FIND_VERSION_MINOR}" EQUAL 1) set(PACKAGE_VERSION_EXACT 1) - endif("${PACKAGE_FIND_VERSION_MINOR}" EQUAL 1) -endif("${PACKAGE_FIND_VERSION_MAJOR}" EQUAL 1) + endif() +endif() diff --git a/Tests/FindPackageTest/Baz 1.2/CMake/BazConfigVersion.cmake b/Tests/FindPackageTest/Baz 1.2/CMake/BazConfigVersion.cmake index e0042d5..17caaa7 100644 --- a/Tests/FindPackageTest/Baz 1.2/CMake/BazConfigVersion.cmake +++ b/Tests/FindPackageTest/Baz 1.2/CMake/BazConfigVersion.cmake @@ -3,6 +3,6 @@ if("${PACKAGE_FIND_VERSION_MAJOR}" EQUAL 1) set(PACKAGE_VERSION_COMPATIBLE 1) if("${PACKAGE_FIND_VERSION_MINOR}" EQUAL 2) set(PACKAGE_VERSION_EXACT 1) - endif("${PACKAGE_FIND_VERSION_MINOR}" EQUAL 2) -endif("${PACKAGE_FIND_VERSION_MAJOR}" EQUAL 1) + endif() +endif() diff --git a/Tests/FindPackageTest/CMakeLists.txt b/Tests/FindPackageTest/CMakeLists.txt index d344649..bca149b 100644 --- a/Tests/FindPackageTest/CMakeLists.txt +++ b/Tests/FindPackageTest/CMakeLists.txt @@ -30,7 +30,7 @@ find_path(FOO_DIR foo.h) if(NOT FOO_DIR) message(FATAL_ERROR "Did not find foo.h which is in ${CMAKE_CURRENT_SOURCE_DIR}/include CMAKE_PREFIX_PATH = ${CMAKE_PREFIX_PATH}") -endif(NOT FOO_DIR) +endif() find_package(VersionTestA 1) find_package(VersionTestB 1.2) @@ -93,7 +93,7 @@ set(PACKAGES ) foreach(p ${PACKAGES}) set(${p}_DIR "" CACHE FILEPATH "Wipe out find results for testing." FORCE) -endforeach(p) +endforeach() # Enable framework and bundle searching. Make sure bundles are found # before unix-syle packages. @@ -238,58 +238,58 @@ foreach(p ${PACKAGES}) # Debugging output. if(CMAKE_FIND_DEBUG_MODE) message("Package ${p} found [${REL_${p}_CONFIG}]") - endif(CMAKE_FIND_DEBUG_MODE) + endif() # Check and report failure. if(NOT "${REL_${p}_CONFIG}" STREQUAL "${${p}_EXPECTED}") message(SEND_ERROR "Package ${p} should have been [${${p}_EXPECTED}] but " "was [${REL_${p}_CONFIG}]") - endif(NOT "${REL_${p}_CONFIG}" STREQUAL "${${p}_EXPECTED}") + endif() else() message(SEND_ERROR "Package ${p} not found!") endif() -endforeach(p) +endforeach() # Check that version information was extracted. if(NOT "${VersionedA_VERSION}" STREQUAL "2.0") message(SEND_ERROR "Package VersionedA is version [${VersionedA_VERSION}], not [2.0]") -endif(NOT "${VersionedA_VERSION}" STREQUAL "2.0") +endif() if(NOT "${VersionedA_VERSION_MAJOR}" STREQUAL "2") message(SEND_ERROR "Package VersionedA is major version [${VersionedA_VERSION_MAJOR}], not [2]") -endif(NOT "${VersionedA_VERSION_MAJOR}" STREQUAL "2") +endif() if(NOT "${VersionedA_VERSION_MINOR}" STREQUAL "0") message(SEND_ERROR "Package VersionedA is minor version [${VersionedA_VERSION_MINOR}], not [0]") -endif(NOT "${VersionedA_VERSION_MINOR}" STREQUAL "0") +endif() if(NOT "${VersionedB_VERSION}" STREQUAL "3.1") message(SEND_ERROR "Package VersionedB is version [${VersionedB_VERSION}], not [3.1]") -endif(NOT "${VersionedB_VERSION}" STREQUAL "3.1") +endif() if(NOT "${VersionedB_VERSION_MAJOR}" STREQUAL "3") message(SEND_ERROR "Package VersionedB is major version [${VersionedB_VERSION_MAJOR}], not [3]") -endif(NOT "${VersionedB_VERSION_MAJOR}" STREQUAL "3") +endif() if(NOT "${VersionedB_VERSION_MINOR}" STREQUAL "1") message(SEND_ERROR "Package VersionedB is minor version [${VersionedB_VERSION_MINOR}], not [1]") -endif(NOT "${VersionedB_VERSION_MINOR}" STREQUAL "1") +endif() if(NOT "${Special_VERSION}" STREQUAL "1.2") message(SEND_ERROR "Package Special is version [${Special_VERSION}], not [1.2]") -endif(NOT "${Special_VERSION}" STREQUAL "1.2") +endif() if(NOT "${Special_VERSION_MAJOR}" STREQUAL "1") message(SEND_ERROR "Package Special is major version [${Special_VERSION_MAJOR}], not [1]") -endif(NOT "${Special_VERSION_MAJOR}" STREQUAL "1") +endif() if(NOT "${Special_VERSION_MINOR}" STREQUAL "2") message(SEND_ERROR "Package Special is minor version [${Special_VERSION_MINOR}], not [2]") -endif(NOT "${Special_VERSION_MINOR}" STREQUAL "2") +endif() # Test version number comparison. if(NOT "1.2.3.4" VERSION_LESS "1.2.3.5") diff --git a/Tests/FindPackageTest/FindVersionTestA.cmake b/Tests/FindPackageTest/FindVersionTestA.cmake index c6031d9..9828593 100644 --- a/Tests/FindPackageTest/FindVersionTestA.cmake +++ b/Tests/FindPackageTest/FindVersionTestA.cmake @@ -1,18 +1,18 @@ if(NOT "${VersionTestA_FIND_VERSION}" STREQUAL "1") message(SEND_ERROR "VersionTestA_FIND_VERSION=${VersionTestA_FIND_VERSION} is not 1") -endif(NOT "${VersionTestA_FIND_VERSION}" STREQUAL "1") +endif() if(NOT "${VersionTestA_FIND_VERSION_MAJOR}" STREQUAL "1") message(SEND_ERROR "VersionTestA_FIND_VERSION_MAJOR=${VersionTestA_FIND_VERSION_MAJOR} is not 1") -endif(NOT "${VersionTestA_FIND_VERSION_MAJOR}" STREQUAL "1") +endif() if(NOT "${VersionTestA_FIND_VERSION_MINOR}" STREQUAL "0") message(SEND_ERROR "VersionTestA_FIND_VERSION_MINOR=${VersionTestA_FIND_VERSION_MINOR} is not 0") -endif(NOT "${VersionTestA_FIND_VERSION_MINOR}" STREQUAL "0") +endif() if(NOT "${VersionTestA_FIND_VERSION_PATCH}" STREQUAL "0") message(SEND_ERROR "VersionTestA_FIND_VERSION_PATCH=${VersionTestA_FIND_VERSION_PATCH} is not 0") -endif(NOT "${VersionTestA_FIND_VERSION_PATCH}" STREQUAL "0") +endif() if(NOT "${VersionTestA_FIND_VERSION_TWEAK}" STREQUAL "0") message(SEND_ERROR "VersionTestA_FIND_VERSION_TWEAK=${VersionTestA_FIND_VERSION_TWEAK} is not 0") -endif(NOT "${VersionTestA_FIND_VERSION_TWEAK}" STREQUAL "0") +endif() if(NOT "${VersionTestA_FIND_VERSION_COUNT}" STREQUAL "1") message(SEND_ERROR "VersionTestA_FIND_VERSION_COUNT=${VersionTestA_FIND_VERSION_COUNT} is not 1") -endif(NOT "${VersionTestA_FIND_VERSION_COUNT}" STREQUAL "1") +endif() diff --git a/Tests/FindPackageTest/FindVersionTestB.cmake b/Tests/FindPackageTest/FindVersionTestB.cmake index 914d5a7..1ebb823 100644 --- a/Tests/FindPackageTest/FindVersionTestB.cmake +++ b/Tests/FindPackageTest/FindVersionTestB.cmake @@ -1,18 +1,18 @@ if(NOT "${VersionTestB_FIND_VERSION}" STREQUAL "1.2") message(SEND_ERROR "VersionTestB_FIND_VERSION=${VersionTestB_FIND_VERSION} is not 1.2") -endif(NOT "${VersionTestB_FIND_VERSION}" STREQUAL "1.2") +endif() if(NOT "${VersionTestB_FIND_VERSION_MAJOR}" STREQUAL "1") message(SEND_ERROR "VersionTestB_FIND_VERSION_MAJOR=${VersionTestB_FIND_VERSION_MAJOR} is not 1") -endif(NOT "${VersionTestB_FIND_VERSION_MAJOR}" STREQUAL "1") +endif() if(NOT "${VersionTestB_FIND_VERSION_MINOR}" STREQUAL "2") message(SEND_ERROR "VersionTestB_FIND_VERSION_MINOR=${VersionTestB_FIND_VERSION_MINOR} is not 2") -endif(NOT "${VersionTestB_FIND_VERSION_MINOR}" STREQUAL "2") +endif() if(NOT "${VersionTestB_FIND_VERSION_PATCH}" STREQUAL "0") message(SEND_ERROR "VersionTestB_FIND_VERSION_PATCH=${VersionTestB_FIND_VERSION_PATCH} is not 0") -endif(NOT "${VersionTestB_FIND_VERSION_PATCH}" STREQUAL "0") +endif() if(NOT "${VersionTestB_FIND_VERSION_TWEAK}" STREQUAL "0") message(SEND_ERROR "VersionTestB_FIND_VERSION_TWEAK=${VersionTestB_FIND_VERSION_TWEAK} is not 0") -endif(NOT "${VersionTestB_FIND_VERSION_TWEAK}" STREQUAL "0") +endif() if(NOT "${VersionTestB_FIND_VERSION_COUNT}" STREQUAL "2") message(SEND_ERROR "VersionTestB_FIND_VERSION_COUNT=${VersionTestB_FIND_VERSION_COUNT} is not 2") -endif(NOT "${VersionTestB_FIND_VERSION_COUNT}" STREQUAL "2") +endif() diff --git a/Tests/FindPackageTest/FindVersionTestC.cmake b/Tests/FindPackageTest/FindVersionTestC.cmake index 66e07ea..450c2e9 100644 --- a/Tests/FindPackageTest/FindVersionTestC.cmake +++ b/Tests/FindPackageTest/FindVersionTestC.cmake @@ -1,18 +1,18 @@ if(NOT "${VersionTestC_FIND_VERSION}" STREQUAL "1.2.3") message(SEND_ERROR "VersionTestC_FIND_VERSION=${VersionTestC_FIND_VERSION} is not 1.2.3") -endif(NOT "${VersionTestC_FIND_VERSION}" STREQUAL "1.2.3") +endif() if(NOT "${VersionTestC_FIND_VERSION_MAJOR}" STREQUAL "1") message(SEND_ERROR "VersionTestC_FIND_VERSION_MAJOR=${VersionTestC_FIND_VERSION_MAJOR} is not 1") -endif(NOT "${VersionTestC_FIND_VERSION_MAJOR}" STREQUAL "1") +endif() if(NOT "${VersionTestC_FIND_VERSION_MINOR}" STREQUAL "2") message(SEND_ERROR "VersionTestC_FIND_VERSION_MINOR=${VersionTestC_FIND_VERSION_MINOR} is not 2") -endif(NOT "${VersionTestC_FIND_VERSION_MINOR}" STREQUAL "2") +endif() if(NOT "${VersionTestC_FIND_VERSION_PATCH}" STREQUAL "3") message(SEND_ERROR "VersionTestC_FIND_VERSION_PATCH=${VersionTestC_FIND_VERSION_PATCH} is not 3") -endif(NOT "${VersionTestC_FIND_VERSION_PATCH}" STREQUAL "3") +endif() if(NOT "${VersionTestC_FIND_VERSION_TWEAK}" STREQUAL "0") message(SEND_ERROR "VersionTestC_FIND_VERSION_TWEAK=${VersionTestC_FIND_VERSION_TWEAK} is not 0") -endif(NOT "${VersionTestC_FIND_VERSION_TWEAK}" STREQUAL "0") +endif() if(NOT "${VersionTestC_FIND_VERSION_COUNT}" STREQUAL "3") message(SEND_ERROR "VersionTestC_FIND_VERSION_COUNT=${VersionTestC_FIND_VERSION_COUNT} is not 3") -endif(NOT "${VersionTestC_FIND_VERSION_COUNT}" STREQUAL "3") +endif() diff --git a/Tests/FindPackageTest/FindVersionTestD.cmake b/Tests/FindPackageTest/FindVersionTestD.cmake index 88d9299..9f2db72 100644 --- a/Tests/FindPackageTest/FindVersionTestD.cmake +++ b/Tests/FindPackageTest/FindVersionTestD.cmake @@ -1,18 +1,18 @@ if(NOT "${VersionTestD_FIND_VERSION}" STREQUAL "1.2.3.4") message(SEND_ERROR "VersionTestD_FIND_VERSION=${VersionTestD_FIND_VERSION} is not 1.2.3.4") -endif(NOT "${VersionTestD_FIND_VERSION}" STREQUAL "1.2.3.4") +endif() if(NOT "${VersionTestD_FIND_VERSION_MAJOR}" STREQUAL "1") message(SEND_ERROR "VersionTestD_FIND_VERSION_MAJOR=${VersionTestD_FIND_VERSION_MAJOR} is not 1") -endif(NOT "${VersionTestD_FIND_VERSION_MAJOR}" STREQUAL "1") +endif() if(NOT "${VersionTestD_FIND_VERSION_MINOR}" STREQUAL "2") message(SEND_ERROR "VersionTestD_FIND_VERSION_MINOR=${VersionTestD_FIND_VERSION_MINOR} is not 2") -endif(NOT "${VersionTestD_FIND_VERSION_MINOR}" STREQUAL "2") +endif() if(NOT "${VersionTestD_FIND_VERSION_PATCH}" STREQUAL "3") message(SEND_ERROR "VersionTestD_FIND_VERSION_PATCH=${VersionTestD_FIND_VERSION_PATCH} is not 3") -endif(NOT "${VersionTestD_FIND_VERSION_PATCH}" STREQUAL "3") +endif() if(NOT "${VersionTestD_FIND_VERSION_TWEAK}" STREQUAL "4") message(SEND_ERROR "VersionTestD_FIND_VERSION_TWEAK=${VersionTestD_FIND_VERSION_TWEAK} is not 4") -endif(NOT "${VersionTestD_FIND_VERSION_TWEAK}" STREQUAL "4") +endif() if(NOT "${VersionTestD_FIND_VERSION_COUNT}" STREQUAL "4") message(SEND_ERROR "VersionTestD_FIND_VERSION_COUNT=${VersionTestD_FIND_VERSION_COUNT} is not 4") -endif(NOT "${VersionTestD_FIND_VERSION_COUNT}" STREQUAL "4") +endif() diff --git a/Tests/FindPackageTest/lib/arch/cmake/zot-4.0/zot-config-version.cmake b/Tests/FindPackageTest/lib/arch/cmake/zot-4.0/zot-config-version.cmake index 514e830..822b449 100644 --- a/Tests/FindPackageTest/lib/arch/cmake/zot-4.0/zot-config-version.cmake +++ b/Tests/FindPackageTest/lib/arch/cmake/zot-4.0/zot-config-version.cmake @@ -3,5 +3,5 @@ if("${PACKAGE_FIND_VERSION_MAJOR}" EQUAL 4) set(PACKAGE_VERSION_COMPATIBLE 1) if("${PACKAGE_FIND_VERSION_MINOR}" EQUAL 0) set(PACKAGE_VERSION_EXACT 1) - endif("${PACKAGE_FIND_VERSION_MINOR}" EQUAL 0) -endif("${PACKAGE_FIND_VERSION_MAJOR}" EQUAL 4) + endif() +endif() diff --git a/Tests/FindPackageTest/lib/arch/zot-3.1/zot-config-version.cmake b/Tests/FindPackageTest/lib/arch/zot-3.1/zot-config-version.cmake index 59fe59d..31573b9 100644 --- a/Tests/FindPackageTest/lib/arch/zot-3.1/zot-config-version.cmake +++ b/Tests/FindPackageTest/lib/arch/zot-3.1/zot-config-version.cmake @@ -3,5 +3,5 @@ if("${PACKAGE_FIND_VERSION_MAJOR}" EQUAL 3) set(PACKAGE_VERSION_COMPATIBLE 1) if("${PACKAGE_FIND_VERSION_MINOR}" EQUAL 1) set(PACKAGE_VERSION_EXACT 1) - endif("${PACKAGE_FIND_VERSION_MINOR}" EQUAL 1) -endif("${PACKAGE_FIND_VERSION_MAJOR}" EQUAL 3) + endif() +endif() diff --git a/Tests/FindPackageTest/lib/cmake/zot-4.0/zot-config-version.cmake b/Tests/FindPackageTest/lib/cmake/zot-4.0/zot-config-version.cmake index 7afcc9b..bcefcd7 100644 --- a/Tests/FindPackageTest/lib/cmake/zot-4.0/zot-config-version.cmake +++ b/Tests/FindPackageTest/lib/cmake/zot-4.0/zot-config-version.cmake @@ -3,6 +3,6 @@ if("${PACKAGE_FIND_VERSION_MAJOR}" EQUAL 4) set(PACKAGE_VERSION_COMPATIBLE 1) if("${PACKAGE_FIND_VERSION_MINOR}" EQUAL 0) set(PACKAGE_VERSION_EXACT 1) - endif("${PACKAGE_FIND_VERSION_MINOR}" EQUAL 0) -endif("${PACKAGE_FIND_VERSION_MAJOR}" EQUAL 4) + endif() +endif() diff --git a/Tests/FindPackageTest/lib/suffix/test/SuffixTestConfigVersion.cmake b/Tests/FindPackageTest/lib/suffix/test/SuffixTestConfigVersion.cmake index 4e8ee82..b37bc8e 100644 --- a/Tests/FindPackageTest/lib/suffix/test/SuffixTestConfigVersion.cmake +++ b/Tests/FindPackageTest/lib/suffix/test/SuffixTestConfigVersion.cmake @@ -3,5 +3,5 @@ if("${PACKAGE_FIND_VERSION_MAJOR}" EQUAL 1) set(PACKAGE_VERSION_COMPATIBLE 1) if("${PACKAGE_FIND_VERSION_MINOR}" EQUAL 2) set(PACKAGE_VERSION_EXACT 1) - endif("${PACKAGE_FIND_VERSION_MINOR}" EQUAL 2) -endif("${PACKAGE_FIND_VERSION_MAJOR}" EQUAL 1) + endif() +endif() diff --git a/Tests/FindPackageTest/lib/zot-2.0/zot-config-version.cmake b/Tests/FindPackageTest/lib/zot-2.0/zot-config-version.cmake index 78e41a5..db3a8a4 100644 --- a/Tests/FindPackageTest/lib/zot-2.0/zot-config-version.cmake +++ b/Tests/FindPackageTest/lib/zot-2.0/zot-config-version.cmake @@ -1,5 +1,5 @@ set(PACKAGE_VERSION 2.0) if("${PACKAGE_FIND_VERSION_MAJOR}" EQUAL 2) set(PACKAGE_VERSION_COMPATIBLE 1) -endif("${PACKAGE_FIND_VERSION_MAJOR}" EQUAL 2) +endif() diff --git a/Tests/FindPackageTest/lib/zot-3.0/zot-config-version.cmake b/Tests/FindPackageTest/lib/zot-3.0/zot-config-version.cmake index 8e3daff..dd9c939 100644 --- a/Tests/FindPackageTest/lib/zot-3.0/zot-config-version.cmake +++ b/Tests/FindPackageTest/lib/zot-3.0/zot-config-version.cmake @@ -1,5 +1,5 @@ set(PACKAGE_VERSION 3.0) if("${PACKAGE_FIND_VERSION_MAJOR}" EQUAL 3) set(PACKAGE_VERSION_COMPATIBLE 1) -endif("${PACKAGE_FIND_VERSION_MAJOR}" EQUAL 3) +endif() diff --git a/Tests/FindPackageTest/lib/zot-3.1/zot-config-version.cmake b/Tests/FindPackageTest/lib/zot-3.1/zot-config-version.cmake index b09c008..8fa767e 100644 --- a/Tests/FindPackageTest/lib/zot-3.1/zot-config-version.cmake +++ b/Tests/FindPackageTest/lib/zot-3.1/zot-config-version.cmake @@ -3,6 +3,6 @@ if("${PACKAGE_FIND_VERSION_MAJOR}" EQUAL 3) set(PACKAGE_VERSION_COMPATIBLE 1) if("${PACKAGE_FIND_VERSION_MINOR}" EQUAL 1) set(PACKAGE_VERSION_EXACT 1) - endif("${PACKAGE_FIND_VERSION_MINOR}" EQUAL 1) -endif("${PACKAGE_FIND_VERSION_MAJOR}" EQUAL 3) + endif() +endif() diff --git a/Tests/FindPackageTest/lib/zot/zot-config-version.cmake b/Tests/FindPackageTest/lib/zot/zot-config-version.cmake index 5674f70..430f009 100644 --- a/Tests/FindPackageTest/lib/zot/zot-config-version.cmake +++ b/Tests/FindPackageTest/lib/zot/zot-config-version.cmake @@ -5,6 +5,6 @@ if("${PACKAGE_FIND_VERSION_MAJOR}" EQUAL 3) set(PACKAGE_VERSION_COMPATIBLE 1) if("${PACKAGE_FIND_VERSION_MINOR}" EQUAL 1) set(PACKAGE_VERSION_EXACT 1) - endif("${PACKAGE_FIND_VERSION_MINOR}" EQUAL 1) -endif("${PACKAGE_FIND_VERSION_MAJOR}" EQUAL 3) + endif() +endif() diff --git a/Tests/Fortran/CMakeLists.txt b/Tests/Fortran/CMakeLists.txt index 679ec83..6e78f42 100644 --- a/Tests/Fortran/CMakeLists.txt +++ b/Tests/Fortran/CMakeLists.txt @@ -167,7 +167,7 @@ if(CMAKE_Fortran_COMPILER_SUPPORTS_F90) add_executable(test_preprocess test_preprocess.F90) set(TEST_MODULE_DEPENDS 1) -endif(CMAKE_Fortran_COMPILER_SUPPORTS_F90) +endif() if(TEST_MODULE_DEPENDS) # Build the external project separately using a custom target. @@ -175,10 +175,10 @@ if(TEST_MODULE_DEPENDS) if(CMAKE_CONFIGURATION_TYPES) set(External_CONFIG_TYPE -C "${CMAKE_CFG_INTDIR}") set(External_BUILD_TYPE) - else(CMAKE_CONFIGURATION_TYPES) + else() set(External_CONFIG_TYPE) set(External_BUILD_TYPE -DCMAKE_BUILD_TYPE:STRING=${CMAKE_BUILD_TYPE}) - endif(CMAKE_CONFIGURATION_TYPES) + endif() set(External_SOURCE_DIR "${testf_SOURCE_DIR}/External") set(External_BINARY_DIR "${testf_BINARY_DIR}/External") if("${testf_BINARY_DIR}" MATCHES " ") @@ -211,10 +211,10 @@ if(TEST_MODULE_DEPENDS) # Test module output directory if available. if(CMAKE_Fortran_MODDIR_FLAG) set(Library_MODDIR "${testf_BINARY_DIR}/Library/modules") - else(CMAKE_Fortran_MODDIR_FLAG) + else() set(Library_MODDIR "${testf_BINARY_DIR}/Library") - endif(CMAKE_Fortran_MODDIR_FLAG) + endif() add_subdirectory(Library) add_subdirectory(Executable) -endif(TEST_MODULE_DEPENDS) +endif() diff --git a/Tests/Fortran/Library/CMakeLists.txt b/Tests/Fortran/Library/CMakeLists.txt index 6e39cda..17438ca 100644 --- a/Tests/Fortran/Library/CMakeLists.txt +++ b/Tests/Fortran/Library/CMakeLists.txt @@ -8,4 +8,4 @@ if(CMAKE_Fortran_MODDIR_FLAG) set_target_properties(subdir_mods PROPERTIES Fortran_MODULE_DIRECTORY modules ) -endif(CMAKE_Fortran_MODDIR_FLAG) +endif() diff --git a/Tests/FunctionTest/CMakeLists.txt b/Tests/FunctionTest/CMakeLists.txt index 204a824..d1fada4 100644 --- a/Tests/FunctionTest/CMakeLists.txt +++ b/Tests/FunctionTest/CMakeLists.txt @@ -4,63 +4,63 @@ project (FunctionTest) function(FAILED testname) message(SEND_ERROR "${testname} failed ${ARGN}") -endfunction(FAILED) +endfunction() function(PASS testname) message("${testname} passed ${ARGN}") -endfunction(PASS) +endfunction() # test scope set(COUNT 3) function(scope_test) set(COUNT 4) -endfunction(scope_test) +endfunction() scope_test() if(COUNT EQUAL "3") PASS("scope") -else(COUNT EQUAL "3") +else() FAILED("COUNT Got: ${COUNT}") -endif(COUNT EQUAL "3") +endif() # test ARGC function(weird_name) if("${ARGC}" EQUAL "3") PASS("ARGC") - else("${ARGC}" EQUAL "3") + else() FAILED("ARGC" "Got: ${ARGC}") - endif("${ARGC}" EQUAL "3") -endfunction(weird_name) + endif() +endfunction() WeIrD_nAmE(a1 a2 a3) # test ARGN function(test_argn_function argument) if("${ARGN}" EQUAL "3") PASS("ARGN") - else("${ARGN}" EQUAL "3") + else() FAILED("ARGN" "Got: ${ARGN}") - endif("${ARGN}" EQUAL "3") -endfunction(test_argn_function) + endif() +endfunction() Test_Argn_Function(ignored 3) # test argument naming and raise scope function(track_find_variable cache_variable is_changed) set("${is_changed}" changed PARENT_SCOPE) -endfunction(track_find_variable) +endfunction() track_find_variable(testvar is_changed) if ("${is_changed}" STREQUAL changed) pass("same argument name test") -else ("${is_changed}" STREQUAL changed) +else () pass("same argument name test") -endif ("${is_changed}" STREQUAL changed) +endif () include("Util.cmake") tester() if (tester_res STREQUAL "${CMAKE_CURRENT_LIST_FILE}") pass("CMAKE_CURRENT_LIST_FILE test") -else (tester_res STREQUAL "${CMAKE_CURRENT_LIST_FILE}") +else () pass("CMAKE_CURRENT_LIST_FILE test") -endif (tester_res STREQUAL "${CMAKE_CURRENT_LIST_FILE}") +endif () @@ -68,67 +68,67 @@ endif (tester_res STREQUAL "${CMAKE_CURRENT_LIST_FILE}") function (factorial argument result) if (argument LESS 2) set (lresult 1) - else (argument LESS 2) + else () math (EXPR temp "${argument} - 1") factorial (${temp} tresult) math (EXPR lresult "${argument}*${tresult}") - endif (argument LESS 2) + endif () set ("${result}" "${lresult}" PARENT_SCOPE) -endfunction (factorial) +endfunction () factorial (5 fresult) if (fresult EQUAL 120) pass("factorial") -else (fresult EQUAL 120) +else () failed ("factorial, computed ${fresult} instead of 120") -endif (fresult EQUAL 120) +endif () # case test function(strange_function m) set("${m}" strange_function PARENT_SCOPE) -endfunction(strange_function m) +endfunction() STRANGE_FUNCTION(var) set(second_var "second_var") if("${var}" STREQUAL "strange_function" AND "${second_var}" STREQUAL "second_var") PASS("Case Test" "(${var} ${second_var})") -else("${var}" STREQUAL "strange_function" AND "${second_var}" STREQUAL "second_var") +else() FAILED("Case test" "(${var} ${second_var})") -endif("${var}" STREQUAL "strange_function" AND "${second_var}" STREQUAL "second_var") +endif() # test backing up command function(ADD_EXECUTABLE exec) _ADD_EXECUTABLE(mini${exec} ${ARGN}) -endfunction(ADD_EXECUTABLE) +endfunction() # var undef case function(undef_var m) set("${m}" PARENT_SCOPE) -endfunction(undef_var) +endfunction() set(FUNCTION_UNDEFINED 1) undef_var(FUNCTION_UNDEFINED) if(DEFINED FUNCTION_UNDEFINED) FAILED("Function Undefine Test" "(${FUNCTION_UNDEFINED})") -else(DEFINED FUNCTION_UNDEFINED) +else() PASS("Function Undefine Test" "(${FUNCTION_UNDEFINED})") -endif(DEFINED FUNCTION_UNDEFINED) +endif() # Subdirectory scope raise. set(SUBDIR_UNDEFINED 1) add_subdirectory(SubDirScope) if(DEFINED SUBDIR_UNDEFINED) FAILED("Subdir Undefine Test" "(${SUBDIR_UNDEFINED})") -else(DEFINED SUBDIR_UNDEFINED) +else() PASS("Subdir Undefine Test" "(${SUBDIR_UNDEFINED})") -endif(DEFINED SUBDIR_UNDEFINED) +endif() if(DEFINED SUBDIR_DEFINED) PASS("Subdir Define Test" "(${SUBDIR_DEFINED})") -else(DEFINED SUBDIR_DEFINED) +else() FAILED("Subdir Define Test" "(${SUBDIR_DEFINED})") -endif(DEFINED SUBDIR_DEFINED) +endif() # Test function-scoped directory. function(ADD_SUBDIR2 dir) @@ -136,15 +136,15 @@ function(ADD_SUBDIR2 dir) # The parent scope sets in the subdir should be visible here. if(DEFINED SUBDIR_UNDEFINED) FAILED("Subdir Function Undefine Test 1" "(${SUBDIR_UNDEFINED})") - else(DEFINED SUBDIR_UNDEFINED) + else() PASS("Subdir Function Undefine Test 1" "(${SUBDIR_UNDEFINED})") - endif(DEFINED SUBDIR_UNDEFINED) + endif() if(DEFINED SUBDIR_DEFINED) PASS("Subdir Function Define Test 1" "(${SUBDIR_DEFINED})") - else(DEFINED SUBDIR_DEFINED) + else() FAILED("Subdir Function Define Test 1" "(${SUBDIR_DEFINED})") - endif(DEFINED SUBDIR_DEFINED) -endfunction(ADD_SUBDIR2) + endif() +endfunction() # Reset test variables. set(SUBDIR_UNDEFINED 1) @@ -156,14 +156,14 @@ ADD_SUBDIR2(SubDirScope) # The parent scope sets in the subdir should not be visible here. if(DEFINED SUBDIR_UNDEFINED) PASS("Subdir Function Undefine Test 2" "(${SUBDIR_UNDEFINED})") -else(DEFINED SUBDIR_UNDEFINED) +else() FAILED("Subdir Function Undefine Test 2" "(${SUBDIR_UNDEFINED})") -endif(DEFINED SUBDIR_UNDEFINED) +endif() if(DEFINED SUBDIR_DEFINED) FAILED("Subdir Function Define Test 2" "(${SUBDIR_DEFINED})") -else(DEFINED SUBDIR_DEFINED) +else() PASS("Subdir Function Define Test 2" "(${SUBDIR_DEFINED})") -endif(DEFINED SUBDIR_DEFINED) +endif() add_executable(FunctionTest functionTest.c) diff --git a/Tests/FunctionTest/SubDirScope/CMakeLists.txt b/Tests/FunctionTest/SubDirScope/CMakeLists.txt index c40fadb..c1a3cfb 100644 --- a/Tests/FunctionTest/SubDirScope/CMakeLists.txt +++ b/Tests/FunctionTest/SubDirScope/CMakeLists.txt @@ -4,11 +4,11 @@ set(SUBDIR_UNDEFINED PARENT_SCOPE) # The above sets should not affect the current scope. if(DEFINED SUBDIR_UNDEFINED) PASS("SubdirScope Undefine Test" "(${SUBDIR_UNDEFINED})") -else(DEFINED SUBDIR_UNDEFINED) +else() FAILED("SubdirScope Undefine Test" "(${SUBDIR_UNDEFINED})") -endif(DEFINED SUBDIR_UNDEFINED) +endif() if(DEFINED SUBDIR_DEFINED) FAILED("SubdirScope Define Test" "(${SUBDIR_DEFINED})") -else(DEFINED SUBDIR_DEFINED) +else() PASS("SubdirScope Define Test" "(${SUBDIR_DEFINED})") -endif(DEFINED SUBDIR_DEFINED) +endif() diff --git a/Tests/FunctionTest/Util.cmake b/Tests/FunctionTest/Util.cmake index f0c73b5..846abd7 100644 --- a/Tests/FunctionTest/Util.cmake +++ b/Tests/FunctionTest/Util.cmake @@ -1,3 +1,3 @@ function(tester) set (tester_res "${CMAKE_CURRENT_LIST_FILE}" PARENT_SCOPE) -endfunction(tester) +endfunction() diff --git a/Tests/JCTest/CMakeLists.txt b/Tests/JCTest/CMakeLists.txt index 17cea0f..31dcc3a 100644 --- a/Tests/JCTest/CMakeLists.txt +++ b/Tests/JCTest/CMakeLists.txt @@ -6,4 +6,4 @@ add_executable(TestTime TestTime.cxx) foreach(f 1 2 3 4 5 6 7 8 9 10 11 12 12 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30) add_test(TestTime${f} TestTime 50000000) -endforeach(f) +endforeach() diff --git a/Tests/Jump/Executable/CMakeLists.txt b/Tests/Jump/Executable/CMakeLists.txt index a09bac7..bc6731f 100644 --- a/Tests/Jump/Executable/CMakeLists.txt +++ b/Tests/Jump/Executable/CMakeLists.txt @@ -1,6 +1,6 @@ if(NOT LIBRARY_OUTPUT_PATH) link_directories(${Jump_BINARY_DIR}/Library/Static ${Jump_BINARY_DIR}/Library/Shared) -endif(NOT LIBRARY_OUTPUT_PATH) +endif() add_executable(jumpExecutable jumpExecutable.cxx) target_link_libraries(jumpExecutable jumpStatic jumpShared) diff --git a/Tests/Jump/Library/Shared/CMakeLists.txt b/Tests/Jump/Library/Shared/CMakeLists.txt index 87d40e5..a37299a 100644 --- a/Tests/Jump/Library/Shared/CMakeLists.txt +++ b/Tests/Jump/Library/Shared/CMakeLists.txt @@ -6,7 +6,7 @@ endif() if(APPLE) set(SHARED_MUST_BE_IN_EXE_DIR 1) -endif(APPLE) +endif() if(SHARED_MUST_BE_IN_EXE_DIR) set(LIB_NAME @@ -14,13 +14,13 @@ if(SHARED_MUST_BE_IN_EXE_DIR) set(EXE_DIR ${Jump_BINARY_DIR}/Executable) if(EXECUTABLE_OUTPUT_PATH) set(EXE_DIR ${EXECUTABLE_OUTPUT_PATH}) - endif(EXECUTABLE_OUTPUT_PATH) + endif() set(LIB_DIR ${Jump_BINARY_DIR}/Library/Shared) if(LIBRARY_OUTPUT_PATH) set(LIB_DIR ${LIBRARY_OUTPUT_PATH}) - endif(LIBRARY_OUTPUT_PATH) + endif() add_custom_command(TARGET jumpShared POST_BUILD COMMAND ${CMAKE_COMMAND} ARGS -E copy ${LIB_DIR}/${CMAKE_CFG_INTDIR}/${LIB_NAME} ${EXE_DIR}/${CMAKE_CFG_INTDIR}/${LIB_NAME}) -endif(SHARED_MUST_BE_IN_EXE_DIR) +endif() diff --git a/Tests/LibName/CMakeLists.txt b/Tests/LibName/CMakeLists.txt index b3ad311..3ac125f 100644 --- a/Tests/LibName/CMakeLists.txt +++ b/Tests/LibName/CMakeLists.txt @@ -13,7 +13,7 @@ add_executable(foobar foobar.c) target_link_libraries(foobar foo) if(UNIX) target_link_libraries(foobar -L/usr/local/lib) -endif(UNIX) +endif() # check with lib version diff --git a/Tests/LoadCommand/CMakeCommands/CMakeLists.txt b/Tests/LoadCommand/CMakeCommands/CMakeLists.txt index 276fdb6..99b1aba 100644 --- a/Tests/LoadCommand/CMakeCommands/CMakeLists.txt +++ b/Tests/LoadCommand/CMakeCommands/CMakeLists.txt @@ -3,7 +3,7 @@ project(CMAKE_LOADED_COMMANDS) if (MUDSLIDE_TYPE MATCHES MUCHO) add_definitions(-DMUCHO_MUDSLIDE) -endif (MUDSLIDE_TYPE MATCHES MUCHO) +endif () include_directories(${CMAKE_ROOT}/include ${CMAKE_ROOT}/Source) @@ -11,4 +11,4 @@ add_library(cmCMAKE_TEST_COMMAND MODULE cmTestCommand.c) if(WATCOM) target_link_libraries(cmCMAKE_TEST_COMMAND clbsdll.lib) -endif(WATCOM) +endif() diff --git a/Tests/LoadCommand/CMakeLists.txt b/Tests/LoadCommand/CMakeLists.txt index 9787f83..c933798 100644 --- a/Tests/LoadCommand/CMakeLists.txt +++ b/Tests/LoadCommand/CMakeLists.txt @@ -20,7 +20,7 @@ include_directories(${LoadCommand_BINARY_DIR}) # try to compile the command # make sure it is not already loaded if(COMMAND CMAKE_TEST_COMMAND) -else(COMMAND CMAKE_TEST_COMMAND) +else() try_compile(COMPILE_OK ${LoadCommand_BINARY_DIR}/CMakeCommands ${LoadCommand_SOURCE_DIR}/CMakeCommands @@ -33,7 +33,7 @@ else(COMMAND CMAKE_TEST_COMMAND) ${LoadCommand_SOURCE_DIR}/CMakeCommands CMAKE_LOADED_COMMANDS CMAKE_FLAGS -DMUDSLIDE_TYPE:STRING=MUCHO OUTPUT_VARIABLE OUTPUT ) -endif(COMMAND CMAKE_TEST_COMMAND) +endif() message("Output from try compile: ${OUTPUT}") @@ -51,13 +51,13 @@ if (COMPILE_OK) "${LoadCommand_BINARY_DIR}/LoadedCommand2.cxx.in" "${LoadCommand_BINARY_DIR}/LoadedCommand3.cxx" ) - endif (COMMAND CMAKE_TEST_COMMAND) -else (COMPILE_OK) + endif () +else () message("failed to compile CMAKE_LOADED_COMMANDS") -endif (COMPILE_OK) +endif () # TEST_DEF is set by the loaded command cmTestCommand.c if (TEST_DEF AND SOME_CACHE_VARIABLE AND TEST_EXEC) add_definitions(-DCMAKE_IS_FUN) -endif (TEST_DEF AND SOME_CACHE_VARIABLE AND TEST_EXEC) +endif () diff --git a/Tests/LoadCommandOneConfig/CMakeCommands/CMakeLists.txt b/Tests/LoadCommandOneConfig/CMakeCommands/CMakeLists.txt index 2d96b04..5ee2ed0 100644 --- a/Tests/LoadCommandOneConfig/CMakeCommands/CMakeLists.txt +++ b/Tests/LoadCommandOneConfig/CMakeCommands/CMakeLists.txt @@ -3,15 +3,15 @@ project(CMAKE_LOADED_COMMANDS) if (MUDSLIDE_TYPE MATCHES MUCHO) add_definitions(-DMUCHO_MUDSLIDE) -endif (MUDSLIDE_TYPE MATCHES MUCHO) +endif () if(WATCOM) set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS}") -endif(WATCOM) +endif() include_directories(${CMAKE_ROOT}/include ${CMAKE_ROOT}/Source) add_library(cmCMAKE_TEST_COMMAND MODULE cmTestCommand.c) if(WATCOM) target_link_libraries(cmCMAKE_TEST_COMMAND clbsdll.lib) -endif(WATCOM) +endif() diff --git a/Tests/LoadCommandOneConfig/CMakeLists.txt b/Tests/LoadCommandOneConfig/CMakeLists.txt index a443605..a75ad5a 100644 --- a/Tests/LoadCommandOneConfig/CMakeLists.txt +++ b/Tests/LoadCommandOneConfig/CMakeLists.txt @@ -26,7 +26,7 @@ include_directories(${LoadCommand_BINARY_DIR}) # try to compile the command # make sure it is not already loaded if(COMMAND CMAKE_TEST_COMMAND) -else(COMMAND CMAKE_TEST_COMMAND) +else() try_compile(COMPILE_OK ${LoadCommand_BINARY_DIR}/CMakeCommands ${LoadCommand_SOURCE_DIR}/CMakeCommands @@ -39,7 +39,7 @@ else(COMMAND CMAKE_TEST_COMMAND) ${LoadCommand_SOURCE_DIR}/CMakeCommands CMAKE_LOADED_COMMANDS CMAKE_FLAGS -DMUDSLIDE_TYPE:STRING=MUCHO OUTPUT_VARIABLE OUTPUT ) -endif(COMMAND CMAKE_TEST_COMMAND) +endif() message("Output from try compile: ${OUTPUT}") @@ -57,13 +57,13 @@ if (COMPILE_OK) "${LoadCommand_BINARY_DIR}/LoadedCommand2.cxx.in" "${LoadCommand_BINARY_DIR}/LoadedCommand3.cxx" ) - endif (COMMAND CMAKE_TEST_COMMAND) -else (COMPILE_OK) + endif () +else () message("failed to compile CMAKE_LOADED_COMMANDS") -endif (COMPILE_OK) +endif () # TEST_DEF is set by the loaded command cmTestCommand.c if (TEST_DEF AND SOME_CACHE_VARIABLE AND TEST_EXEC) add_definitions(-DCMAKE_IS_FUN) -endif (TEST_DEF AND SOME_CACHE_VARIABLE AND TEST_EXEC) +endif () diff --git a/Tests/MacroTest/CMakeLists.txt b/Tests/MacroTest/CMakeLists.txt index 9d189b9..02bb31f 100644 --- a/Tests/MacroTest/CMakeLists.txt +++ b/Tests/MacroTest/CMakeLists.txt @@ -4,48 +4,48 @@ project (MacroTest) macro(FAILED testname) message(SEND_ERROR "${testname} failed ${ARGN}") -endmacro(FAILED) +endmacro() macro(PASS testname) message("${testname} passed ${ARGN}") -endmacro(PASS) +endmacro() # test ARGC macro(weird_name) if("${ARGC}" EQUAL "3") PASS("ARGC") - else("${ARGC}" EQUAL "3") + else() FAILED("ARGC" "Got: ${ARGC}") - endif("${ARGC}" EQUAL "3") -endmacro(weird_name) + endif() +endmacro() WeIrD_nAmE(a1 a2 a3) # test ARGN macro(test_argn_macro argument) if("${ARGN}" EQUAL "3") PASS("ARGN") - else("${ARGN}" EQUAL "3") + else() FAILED("ARGN" "Got: ${ARGN}") - endif("${ARGN}" EQUAL "3") -endmacro(test_argn_macro) + endif() +endmacro() Test_Argn_Macro(ignored 3) # case test macro(strange_macro m) set("${m}" strange_macro) -endmacro(strange_macro m) +endmacro() STRANGE_MACRO(var) set(second_var "second_var") if("${var}" STREQUAL "strange_macro" AND "${second_var}" STREQUAL "second_var") PASS("Case Test" "(${var} ${second_var})") -else("${var}" STREQUAL "strange_macro" AND "${second_var}" STREQUAL "second_var") +else() FAILED("Case test" "(${var} ${second_var})") -endif("${var}" STREQUAL "strange_macro" AND "${second_var}" STREQUAL "second_var") +endif() # test backing up command macro(ADD_EXECUTABLE exec) _ADD_EXECUTABLE("mini${exec}" ${ARGN}) -endmacro(ADD_EXECUTABLE) +endmacro() include(CheckCSourceCompiles) Check_C_Source_Compiles( @@ -64,9 +64,9 @@ int main(int ac, char*av[]){ SOME_CHECK) if(SOME_CHECK) message("CheckCSourceCompiles works") -else(SOME_CHECK) +else() message(FATAL_ERROR "CheckCSourceCompiles does not work") -endif(SOME_CHECK) +endif() include(CheckCXXSourceCompiles) Check_CXX_Source_Compiles( @@ -79,13 +79,13 @@ int main(int ac, char*av[]){ SOME_CHECK) if(SOME_CHECK) message("CheckCXXSourceCompiles works") -else(SOME_CHECK) +else() message(FATAL_ERROR "CheckCXXSourceCompiles does not work") -endif(SOME_CHECK) +endif() add_executable(MacroTest macroTest.c) macro(GET_CURRENT_FILE var) set(${var} ${CMAKE_CURRENT_LIST_FILE}) -endmacro(GET_CURRENT_FILE) +endmacro() include(context.cmake) diff --git a/Tests/MacroTest/context.cmake b/Tests/MacroTest/context.cmake index 82eb485..f7350d7 100644 --- a/Tests/MacroTest/context.cmake +++ b/Tests/MacroTest/context.cmake @@ -7,4 +7,4 @@ if(NOT "${current_file}" STREQUAL "${CMAKE_CURRENT_LIST_FILE}") " ${current_file}\n" "from the macro." ) -endif(NOT "${current_file}" STREQUAL "${CMAKE_CURRENT_LIST_FILE}") +endif() diff --git a/Tests/MakeClean/CMakeLists.txt b/Tests/MakeClean/CMakeLists.txt index 7400754..13348a2 100644 --- a/Tests/MakeClean/CMakeLists.txt +++ b/Tests/MakeClean/CMakeLists.txt @@ -13,12 +13,12 @@ if(TOCLEAN_BUILT) "Building ToClean succeeded with the following output:\n" "[${OUTPUT}]" ) -else(TOCLEAN_BUILT) +else() message(FATAL_ERROR "Building ToClean failed with the following output:\n" "[${OUTPUT}]" ) -endif(TOCLEAN_BUILT) +endif() # Get the set of files to check from the ToClean project. include(${MakeClean_BINARY_DIR}/ToClean/ToCleanFiles.cmake) @@ -26,16 +26,16 @@ include(${MakeClean_BINARY_DIR}/ToClean/ToCleanFiles.cmake) # Check for the existence of the files. foreach(f ${TOCLEAN_FILES}) if(EXISTS "${f}") - else(EXISTS "${f}") + else() message(FATAL_ERROR "File \"${f}\" does not exist!") - endif(EXISTS "${f}") -endforeach(f) + endif() +endforeach() # Configure an executable to check that all the files are missing. set(CHECK_FILES) foreach(f ${TOCLEAN_FILES}) set(CHECK_FILES "${CHECK_FILES} \"${f}\",\n") -endforeach(f) +endforeach() configure_file(${MakeClean_SOURCE_DIR}/check_clean.c.in ${MakeClean_BINARY_DIR}/check_clean.c @ONLY IMMEDIATE) add_executable(check_clean ${MakeClean_BINARY_DIR}/check_clean.c) diff --git a/Tests/MathTest/CMakeLists.txt b/Tests/MathTest/CMakeLists.txt index 44d4aae..34beaa0 100644 --- a/Tests/MathTest/CMakeLists.txt +++ b/Tests/MathTest/CMakeLists.txt @@ -17,7 +17,7 @@ foreach(expression ${expressions}) math(EXPR expr "${expression}") set(FILE_EXPRESSIONS "${FILE_EXPRESSIONS}TEST_EXPRESSION(${expression}, ${expr})\n") -endforeach(expression) +endforeach() configure_file( "${CMAKE_CURRENT_SOURCE_DIR}/MathTestTests.h.in" diff --git a/Tests/OutOfSource/CMakeLists.txt b/Tests/OutOfSource/CMakeLists.txt index 420310f..de1603a 100644 --- a/Tests/OutOfSource/CMakeLists.txt +++ b/Tests/OutOfSource/CMakeLists.txt @@ -8,7 +8,7 @@ get_directory_property(ANIMAL DIRECTORY OutOfSourceSubdir DEFINITION WEASELS) get_directory_property(ANIMALREL DIRECTORY SubDir/../OutOfSourceSubdir DEFINITION WEASELS) if(NOT "${ANIMAL}" STREQUAL "${ANIMALREL}") message(FATAL_ERROR "GET_DIRECTORY_PROPERTY does not seem to collapse paths.") -endif(NOT "${ANIMAL}" STREQUAL "${ANIMALREL}") +endif() configure_file( ${OutOfSource_SOURCE_DIR}/testdp.h.in diff --git a/Tests/OutOfSource/OutOfSourceSubdir/CMakeLists.txt b/Tests/OutOfSource/OutOfSourceSubdir/CMakeLists.txt index d418809..10a2f59 100644 --- a/Tests/OutOfSource/OutOfSourceSubdir/CMakeLists.txt +++ b/Tests/OutOfSource/OutOfSourceSubdir/CMakeLists.txt @@ -36,7 +36,7 @@ if ("${PROJECT_SOURCE_DIR}" STREQUAL "${ANOTHER_PROJ_SOURCE_DIR}") while("${DEEPDIR_LEN}" LESS "${MAXPATH}") set(DEEPDIR ${DEEPDIR}/and/deeper) string(LENGTH "${DEEPDIR}" DEEPDIR_LEN) - endwhile("${DEEPDIR_LEN}" LESS "${MAXPATH}") + endwhile() set(DEEPSRC ${DEEPDIR}/simple.cxx) string(LENGTH "${DEEPSRC}" DEEPSRC_LEN) configure_file(simple.cxx.in ${DEEPSRC} COPYONLY) @@ -46,12 +46,12 @@ if ("${PROJECT_SOURCE_DIR}" STREQUAL "${ANOTHER_PROJ_SOURCE_DIR}") if(${CMAKE_GENERATOR} MATCHES "Watcom WMake") set(DEEPSRC "") add_definitions(-DNO_DEEPSRC) - endif(${CMAKE_GENERATOR} MATCHES "Watcom WMake") + endif() add_library(testlib testlib.cxx) add_executable (simple simple.cxx ../simple.cxx ${DEEPSRC}) target_link_libraries(simple testlib outlib) -endif ("${PROJECT_SOURCE_DIR}" STREQUAL "${ANOTHER_PROJ_SOURCE_DIR}") +endif () # test getting a definition from a subdir set (WEASELS SIZZLING) @@ -59,4 +59,4 @@ set (WEASELS SIZZLING) get_directory_property(incDirs INCLUDE_DIRECTORIES) if(NOT incDirs) message(FATAL_ERROR "get_directory_property(INCLUDE_DIRECTORIES) returned empty list") -endif(NOT incDirs) +endif() diff --git a/Tests/PolicyScope/CMakeLists.txt b/Tests/PolicyScope/CMakeLists.txt index e6f2edc..413195a 100644 --- a/Tests/PolicyScope/CMakeLists.txt +++ b/Tests/PolicyScope/CMakeLists.txt @@ -7,7 +7,7 @@ function(check msg lhs rhs) if(NOT "${lhs}" STREQUAL "${rhs}") message(FATAL_ERROR "${msg}: expected [${lhs}], got [${rhs}]") endif() -endfunction(check) +endfunction() #----------------------------------------------------------------------------- # Test using a development framework that sets policies for us. @@ -52,7 +52,7 @@ if(1) # CMP0002 should be changed when this function is invoked cmake_policy(GET CMP0002 cmp) check(CMP0002 "OLD" "${cmp}") - endfunction(func1) + endfunction() # Unset CMP0002 cmake_policy(VERSION 2.4) @@ -65,8 +65,8 @@ if(1) cmake_policy(SET CMP0002 OLD) cmake_policy(GET CMP0002 cmp) check(CMP0002 "OLD" "${cmp}") - endmacro(macro1) -endif(1) + endmacro() +endif() cmake_policy(POP) # CMP0002 should still be NEW in this context. diff --git a/Tests/PrecompiledHeader/CMakeLists.txt b/Tests/PrecompiledHeader/CMakeLists.txt index e5ac6d3..6958131 100644 --- a/Tests/PrecompiledHeader/CMakeLists.txt +++ b/Tests/PrecompiledHeader/CMakeLists.txt @@ -12,28 +12,28 @@ if(CMAKE_CONFIGURATION_TYPES) foreach(cfg ${CMAKE_CONFIGURATION_TYPES}) file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/PCH/${cfg}) endforeach() -else(CMAKE_CONFIGURATION_TYPES) +else() set(PCH_DIR "${CMAKE_CURRENT_BINARY_DIR}/PCH") file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/PCH) -endif(CMAKE_CONFIGURATION_TYPES) +endif() # The VS6 IDE does not support renaming .pch files with /Fp. if("${CMAKE_GENERATOR}" MATCHES "Visual Studio 6") set(PCH_USE_INCLUDE_DIR 1) set(PCH_FILE) -else("${CMAKE_GENERATOR}" MATCHES "Visual Studio 6") +else() set(PCH_USE_INCLUDE_DIR 0) set(PCH_FILE "\"/Fp${PCH_DIR}/foo_precompiled.pch\"") -endif("${CMAKE_GENERATOR}" MATCHES "Visual Studio 6") +endif() # Choose between an explicit include path and using /I during # precompilation. The /I form is used to test that the PCH is # actually used. In practice the include path form would be used. if(PCH_USE_INCLUDE_DIR) include_directories(${CMAKE_CURRENT_SOURCE_DIR}/include) -else(PCH_USE_INCLUDE_DIR) +else() set(PCH_INCLUDE_DIR "\"/I${CMAKE_CURRENT_SOURCE_DIR}/include\"") -endif(PCH_USE_INCLUDE_DIR) +endif() # Create a target that will use a precompiled header. set(foo_SRCS foo1.c foo2.c) @@ -56,4 +56,4 @@ if("${CMAKE_GENERATOR}" MATCHES "Makefile" OR # These source files use the precompiled header. set_source_files_properties(${foo_SRCS} PROPERTIES OBJECT_DEPENDS "${PCH_DIR}/foo_precompiled.pch") -endif("${CMAKE_GENERATOR}" MATCHES "Makefile") +endif() diff --git a/Tests/Preprocess/CMakeLists.txt b/Tests/Preprocess/CMakeLists.txt index 1ed7b83..78746e7 100644 --- a/Tests/Preprocess/CMakeLists.txt +++ b/Tests/Preprocess/CMakeLists.txt @@ -9,37 +9,37 @@ project(Preprocess) # to work with each tool and documents those known to not work. if("${CMAKE_GENERATOR}" MATCHES "Xcode") set(PP_XCODE 1) -endif("${CMAKE_GENERATOR}" MATCHES "Xcode") +endif() if("${CMAKE_GENERATOR}" MATCHES "Visual Studio 6") set(PP_VS6 1) -endif("${CMAKE_GENERATOR}" MATCHES "Visual Studio 6") +endif() if("${CMAKE_GENERATOR}" MATCHES "Unix Makefiles") set(PP_UMAKE 1) -endif("${CMAKE_GENERATOR}" MATCHES "Unix Makefiles") +endif() if("${CMAKE_GENERATOR}" MATCHES "NMake Makefiles") set(PP_NMAKE 1) -endif("${CMAKE_GENERATOR}" MATCHES "NMake Makefiles") +endif() if("${CMAKE_GENERATOR}" MATCHES "MinGW Makefiles") set(PP_MINGW 1) -endif("${CMAKE_GENERATOR}" MATCHES "MinGW Makefiles") +endif() if("${CMAKE_GENERATOR}" MATCHES "Borland Makefiles") set(PP_BORLAND 1) -endif("${CMAKE_GENERATOR}" MATCHES "Borland Makefiles") +endif() if("${CMAKE_GENERATOR}" MATCHES "Watcom WMake") set(PP_WATCOM 1) -endif("${CMAKE_GENERATOR}" MATCHES "Watcom WMake") +endif() if("${CMAKE_GENERATOR}" MATCHES "Visual Studio 7$") set(PP_VS70 1) -endif("${CMAKE_GENERATOR}" MATCHES "Visual Studio 7$") +endif() if("${CMAKE_GENERATOR}" MATCHES "Visual Studio") set(PP_VS 1) -endif("${CMAKE_GENERATOR}" MATCHES "Visual Studio") +endif() if("${CMAKE_GENERATOR}" MATCHES "Visual Studio 10") set(PP_VS100 1) -endif("${CMAKE_GENERATOR}" MATCHES "Visual Studio 10") +endif() if("${CMAKE_GENERATOR}" MATCHES "Visual Studio 11") set(PP_VS110 1) -endif("${CMAKE_GENERATOR}" MATCHES "Visual Studio 11") +endif() # Some tests below check the PP_* variables set above. They are meant # to test the case that the build tool is at fault. Other tests below @@ -80,8 +80,8 @@ if(NOT PP_VS6) # trouble passing to other tools, and the compiler may be directly # invoked from the command line. set(STRING_EXTRA "${STRING_EXTRA} ") - endif(NOT PP_BORLAND AND NOT PP_WATCOM) -endif(NOT PP_VS6) + endif() +endif() if(NOT PP_VS) # VS: , @@ -89,21 +89,21 @@ if(NOT PP_VS) # The comma-separated list of PreprocessorDefinitions in the project # file seems to be parsed before the content of entries is examined. set(STRING_EXTRA "${STRING_EXTRA},") -endif(NOT PP_VS) +endif() if(NOT PP_MINGW) # MinGW: & # When inside -D"FOO=\"a & b\"" MinGW make wants -D"FOO=\"a "&" b\"" # but it does not like quoted ampersand elsewhere. set(STRING_EXTRA "${STRING_EXTRA}&") -endif(NOT PP_MINGW) +endif() if(NOT PP_MINGW) # MinGW: | # When inside -D"FOO=\"a | b\"" MinGW make wants -D"FOO=\"a "|" b\"" # but it does not like quoted pipe elsewhere. set(STRING_EXTRA "${STRING_EXTRA}|") -endif(NOT PP_MINGW) +endif() if(NOT PP_BORLAND AND NOT PP_MINGW AND NOT PP_NMAKE) # Borland, NMake, MinGW: ^ @@ -111,13 +111,13 @@ if(NOT PP_BORLAND AND NOT PP_MINGW AND NOT PP_NMAKE) # but do not like quoted carrot elsewhere. In NMake the non-quoted # syntax works when the flags are not in a make variable. set(STRING_EXTRA "${STRING_EXTRA}^") -endif(NOT PP_BORLAND AND NOT PP_MINGW AND NOT PP_NMAKE) +endif() if(NOT PP_BORLAND AND NOT PP_MINGW AND NOT PP_NMAKE) # Borland, MinGW: < > # Angle-brackets have funny behavior that is hard to escape. set(STRING_EXTRA "${STRING_EXTRA}<>") -endif(NOT PP_BORLAND AND NOT PP_MINGW AND NOT PP_NMAKE) +endif() set(EXPR_OP1 "/") if((NOT MSVC OR PP_NMAKE) AND @@ -150,7 +150,7 @@ endif() # - NMake is okay with just \\\" if(PP_NMAKE OR PP_UMAKE) set(STRING_EXTRA "${STRING_EXTRA}\\\"") -endif(PP_NMAKE OR PP_UMAKE) +endif() # General: # # MSVC will not accept a # in the value of a string definition on the @@ -187,7 +187,7 @@ set(EXPR "x*y+!(x==(y+1*2))*f(x${EXPR_OP1}2)") if(NOT WATCOM) # Watcom does not support - or / because it parses them as options. set(EXPR "${EXPR} + y/x-x") -endif(NOT WATCOM) +endif() #----------------------------------------------------------------------------- @@ -199,11 +199,11 @@ set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DPREPROCESS_DEBUG") # Inform the test if it built from Xcode or VS6 IDE. if(PP_XCODE) set(PREPROCESS_XCODE 1) -endif(PP_XCODE) +endif() if(PP_VS6) set(PREPROCESS_VS6 1) set(VS6 _vs6) -endif(PP_VS6) +endif() # Test old-style definitions. add_definitions(-DOLD_DEF -DOLD_EXPR=2) @@ -213,7 +213,7 @@ set(OLD_DEFS_EXPECTED "OLD_DEF;OLD_EXPR=2") get_property(OLD_DEFS DIRECTORY PROPERTY COMPILE_DEFINITIONS) if(NOT "${OLD_DEFS}" STREQUAL "${OLD_DEFS_EXPECTED}") message(SEND_ERROR "add_definitions not converted to directory property!") -endif(NOT "${OLD_DEFS}" STREQUAL "${OLD_DEFS_EXPECTED}") +endif() add_executable(Preprocess preprocess.c preprocess${VS6}.cxx) @@ -234,14 +234,14 @@ foreach(c "" "_DEBUG" "_RELEASE") SOURCE preprocess.c preprocess${VS6}.cxx PROPERTY COMPILE_DEFINITIONS${c} "FILE_DEF${c}" ) -endforeach(c) +endforeach() # Add definitions with values. if(NOT PREPROCESS_VS6) # The path might have spaces, which VS6 does not support. set(DEF_TARGET_PATH "TARGET_PATH=\"${TARGET_PATH}\"") set(DEF_FILE_PATH "FILE_PATH=\"${FILE_PATH}\"") -endif(NOT PREPROCESS_VS6) +endif() set_property( TARGET Preprocess APPEND PROPERTY COMPILE_DEFINITIONS @@ -263,7 +263,7 @@ add_custom_target(drive COMMAND Preprocess) # Configure the header file with the desired string value. if(SEMICOLON) set(STRING_VALUE "${STRING_VALUE};") -endif(SEMICOLON) +endif() configure_file(${Preprocess_SOURCE_DIR}/preprocess.h.in ${Preprocess_BINARY_DIR}/preprocess.h) include_directories(${Preprocess_BINARY_DIR}) diff --git a/Tests/Properties/CMakeLists.txt b/Tests/Properties/CMakeLists.txt index ed6d2d4..7bf9c2d 100644 --- a/Tests/Properties/CMakeLists.txt +++ b/Tests/Properties/CMakeLists.txt @@ -27,7 +27,7 @@ get_property(GLOBALRESULT GLOBAL PROPERTY GLOBALTEST DEFINED) if (GLOBALRESULT) message(SEND_ERROR "Error: global prop defined when it should not be, " "result is GLOBALRESULT=${GLOBALRESULT}") -endif (GLOBALRESULT) +endif () define_property(GLOBAL PROPERTY GLOBALTEST BRIEF_DOCS "A test property" @@ -38,7 +38,7 @@ get_property(GLOBALRESULT GLOBAL PROPERTY GLOBALTEST DEFINED) if (NOT GLOBALRESULT) message(SEND_ERROR "Error: global prop not defined " "result is GLOBALRESULT=${GLOBALRESULT}") -endif (NOT GLOBALRESULT) +endif () set_property(GLOBAL PROPERTY GLOBALTEST 1) set_property(DIRECTORY PROPERTY DIRECTORYTEST 1) @@ -69,7 +69,7 @@ get_property(TARGETRESULT TARGET Properties PROPERTY TARGETTEST) if (NOT TARGETRESULT) message(SEND_ERROR "Error: target result is TARGETRESULT=${TARGETRESULT}") -endif (NOT TARGETRESULT) +endif () # test APPEND and APPEND_STRING set_property() set_property(TARGET Properties PROPERTY FOO foo) @@ -94,7 +94,7 @@ get_property(TARGETRESULT TARGET Properties PROPERTY TARGETTEST SET) if (NOT TARGETRESULT) message(SEND_ERROR "Error: target prop not set, result is TARGETRESULT=${TARGETRESULT}") -endif (NOT TARGETRESULT) +endif () # test unsetting a property set_property(TARGET Properties PROPERTY TARGETTEST) @@ -102,7 +102,7 @@ get_property(TARGETRESULT TARGET Properties PROPERTY TARGETTEST SET) if (TARGETRESULT) message(SEND_ERROR "Error: target prop not unset, " "result is TARGETRESULT=${TARGETRESULT}") -endif (TARGETRESULT) +endif () @@ -114,7 +114,7 @@ if(NOT RESULT4) message(SEND_ERROR "Error: target result is" " RESULT4=${RESULT4}" " Properties_SOURCES=[${Properties_SOURCES}]") -endif(NOT RESULT4) +endif() # test CACHE properties macro(check_cache_props) @@ -123,8 +123,8 @@ macro(check_cache_props) if(NOT "x${result}" STREQUAL "x${expect_${prop}}") message(SEND_ERROR "CACHE property ${prop} is [${result}], not [${expect_${prop}}]") endif() - endforeach(prop) -endmacro(check_cache_props) + endforeach() +endmacro() set(expect_VALUE "ON") set(expect_TYPE "BOOL") set(expect_HELPSTRING "sample cache entry") diff --git a/Tests/ReturnTest/CMakeLists.txt b/Tests/ReturnTest/CMakeLists.txt index a08855e..3bd7ce0 100644 --- a/Tests/ReturnTest/CMakeLists.txt +++ b/Tests/ReturnTest/CMakeLists.txt @@ -4,24 +4,24 @@ project (ReturnTest) function (FAILED testname) message (SEND_ERROR "${testname} failed ${ARGN}") -endfunction (FAILED) +endfunction () function (PASS testname) message ("${testname} passed ${ARGN}") -endfunction (PASS) +endfunction () # test simple return function (simple) set(simpleResult 1 PARENT_SCOPE) return() set(simpleResult 0 PARENT_SCOPE) -endfunction (simple) +endfunction () simple() if ("${simpleResult}") pass ("simple") -else ("${simpleResult}") +else () failed ("simple got: ${simpleResult}") -endif ("${simpleResult}") +endif () #test return in an if statement set (simple2IF 1) @@ -29,15 +29,15 @@ function (simple2) set(simple2Result 1 PARENT_SCOPE) if (simple2IF) return() - endif (simple2IF) + endif () set(simple2Result 0 PARENT_SCOPE) -endfunction (simple2) +endfunction () simple2() if ("${simple2Result}") pass ("simple2") -else ("${simple2Result}") +else () failed ("simple2 got: ${simple2Result}") -endif ("${simple2Result}") +endif () #test return in a foreach loop function (looptest) @@ -45,15 +45,15 @@ function (looptest) set (looptestResult "${iter}" PARENT_SCOPE) if ("${iter}" EQUAL 3) return () - endif ("${iter}" EQUAL 3) - endforeach (iter) -endfunction (looptest) + endif () + endforeach () +endfunction () looptest() if ("${looptestResult}" EQUAL 3) pass ("looptest") -else ("${looptestResult}" EQUAL 3) +else () failed ("looptest got: ${looptestResult}") -endif ("${looptestResult}" EQUAL 3) +endif () #test return in a while loop function (whiletest) @@ -62,58 +62,58 @@ function (whiletest) set (whiletestResult "${iter}" PARENT_SCOPE) if ("${iter}" STREQUAL "aaa") return () - endif ("${iter}" STREQUAL "aaa") + endif () set (iter "${iter}a") - endwhile(NOT "${iter}" STREQUAL "aaaaa") -endfunction (whiletest) + endwhile() +endfunction () whiletest() if ("${whiletestResult}" STREQUAL "aaa") pass ("whiletest") -else ("${whiletestResult}" STREQUAL "aaa") +else () failed ("whiletest got: ${whiletestResult}") -endif ("${whiletestResult}" STREQUAL "aaa") +endif () # check subdir return add_subdirectory(subdir) get_directory_property(subdirResult DIRECTORY subdir DEFINITION subdirreturn) if ("${subdirResult}" EQUAL 1) pass ("subdir") -else ("${subdirResult}" EQUAL 1) +else () failed ("subdir got: ${subdirResult}") -endif ("${subdirResult}" EQUAL 1) +endif () # check return from a file include(include_return.cmake) if ("${include_returnResult}" EQUAL 1) pass ("include_return") -else ("${include_returnResult}" EQUAL 1) +else () failed ("include_return got: ${include_returnResult}") -endif ("${include_returnResult}" EQUAL 1) +endif () # check return from within a macro macro (mymacro) set (foo 1) if (foo) return() - endif (foo) -endmacro(mymacro) + endif () +endmacro() # test simple return function (simple3) set (bar 0) set(simple3Result 1 PARENT_SCOPE) if (bar) - else (bar) + else () mymacro() - endif(bar) + endif() set(simple3Result 0 PARENT_SCOPE) -endfunction (simple3) +endfunction () simple3() if ("${simple3Result}") pass ("macrotest") -else ("${simple3Result}") +else () failed ("macrotest got: ${simple3Result}") -endif ("${simple3Result}") +endif () # test break command now in a foreach @@ -121,27 +121,27 @@ foreach (iter RANGE 1 5) set (break1 "${iter}") if ("${iter}" EQUAL 3) break () - endif ("${iter}" EQUAL 3) -endforeach (iter) + endif () +endforeach () if ("${break1}" EQUAL 3) pass ("break in foreach") -else ("${break1}" EQUAL 3) +else () failed ("break in foreach got: ${break1}") -endif ("${break1}" EQUAL 3) +endif () # test break in a while loop set (iter "a") while(NOT "${iter}" STREQUAL "aaaaa") if ("${iter}" STREQUAL "aaa") break () - endif ("${iter}" STREQUAL "aaa") + endif () set (iter "${iter}a") -endwhile(NOT "${iter}" STREQUAL "aaaaa") +endwhile() if ("${iter}" STREQUAL "aaa") pass ("break in a while") -else ("${iter}" STREQUAL "aaa") +else () failed ("break in a whi;e got: ${whiletestResult}") -endif ("${iter}" STREQUAL "aaa") +endif () add_executable (ReturnTest returnTest.c) diff --git a/Tests/RunCMake/include_external_msproject/check_utils.cmake b/Tests/RunCMake/include_external_msproject/check_utils.cmake index 7d6b8f8..7f5ef53 100644 --- a/Tests/RunCMake/include_external_msproject/check_utils.cmake +++ b/Tests/RunCMake/include_external_msproject/check_utils.cmake @@ -8,8 +8,8 @@ macro(check_line_exists TARGET_FILE REG_EXP_REF) if(_VAR_LEN GREATER 0) set(IS_FOUND "TRUE") - endif(_VAR_LEN GREATER 0) -endmacro(check_line_exists TARGET_FILE REG_EXP_REF) + endif() +endmacro() # Search and parse project section line by project name. # If search was successful stores found type and guid into FOUND_TYPE and FOUND_GUID variables respectively. @@ -20,13 +20,13 @@ macro(parse_project_section TARGET_FILE PROJECT_NAME) check_line_exists(${TARGET_FILE} REG_EXP) if(NOT IS_FOUND) return() - endif(NOT IS_FOUND) + endif() string(REGEX REPLACE "${REG_EXP}" "\\1;\\2" _GUIDS "${FOUND_LINE}") list(GET _GUIDS 0 FOUND_TYPE) list(GET _GUIDS 1 FOUND_GUID) -endmacro(parse_project_section TARGET_FILE PROJECT_NAME) +endmacro() # Search project section line by project name and type. # Returns TRUE if found and FALSE otherwise @@ -36,8 +36,8 @@ function(check_project_type TARGET_FILE PROJECT_NAME PROJECT_TYPE RESULT) parse_project_section(${TARGET_FILE} ${PROJECT_NAME}) if(IS_FOUND AND FOUND_TYPE STREQUAL PROJECT_TYPE) set(${RESULT} "TRUE" PARENT_SCOPE) - endif(IS_FOUND AND FOUND_TYPE STREQUAL PROJECT_TYPE) -endfunction(check_project_type TARGET_FILE PROJECT_NAME PROJECT_TYPE RESULT) + endif() +endfunction() # Search project section line by project name and id. @@ -48,8 +48,8 @@ function(check_project_guid TARGET_FILE PROJECT_NAME PROJECT_GUID RESULT) parse_project_section(${TARGET_FILE} ${PROJECT_NAME}) if(IS_FOUND AND FOUND_GUID STREQUAL PROJECT_GUID) set(${RESULT} "TRUE" PARENT_SCOPE) - endif(IS_FOUND AND FOUND_GUID STREQUAL PROJECT_GUID) -endfunction(check_project_guid TARGET_FILE PROJECT_NAME PROJECT_GUID RESULT) + endif() +endfunction() # Search project's build configuration line by project name and target platform name. @@ -61,7 +61,7 @@ function(check_custom_platform TARGET_FILE PROJECT_NAME PLATFORM_NAME RESULT) parse_project_section(${TARGET_FILE} ${PROJECT_NAME}) if(NOT IS_FOUND) return() - endif(NOT IS_FOUND) + endif() # probably whould be better to use configuration name # extracted from CMAKE_CONFIGURATION_TYPES than just hardcoded "Debug" instead @@ -69,7 +69,7 @@ function(check_custom_platform TARGET_FILE PROJECT_NAME PLATFORM_NAME RESULT) check_line_exists(${TARGET_FILE} REG_EXP) set(${RESULT} ${IS_FOUND} PARENT_SCOPE) -endfunction(check_custom_platform TARGET_FILE PLATFORM_NAME RESULT) +endfunction() # RunCMake test check helper function(check_project test name guid type platform) diff --git a/Tests/RuntimePath/CMakeLists.txt b/Tests/RuntimePath/CMakeLists.txt index 2164cdb..6583a87 100644 --- a/Tests/RuntimePath/CMakeLists.txt +++ b/Tests/RuntimePath/CMakeLists.txt @@ -30,4 +30,4 @@ if(CMAKE_SHARED_LIBRARY_SONAME_C_FLAG) set_property(TARGET bar2 PROPERTY OUTPUT_NAME bar) set_property(TARGET bar2 PROPERTY LIBRARY_OUTPUT_DIRECTORY A) target_link_libraries(bar2 foo2) -endif(CMAKE_SHARED_LIBRARY_SONAME_C_FLAG) +endif() diff --git a/Tests/Simple/CMakeLists.txt b/Tests/Simple/CMakeLists.txt index 20d9705..a951c2d 100644 --- a/Tests/Simple/CMakeLists.txt +++ b/Tests/Simple/CMakeLists.txt @@ -14,4 +14,4 @@ target_link_libraries (Simple simpleLib) # make sure optimized libs are not used by debug builds if(CMAKE_BUILD_TYPE MATCHES Debug) target_link_libraries(Simple optimized c:/not/here.lib ) -endif(CMAKE_BUILD_TYPE MATCHES Debug) +endif() diff --git a/Tests/SimpleCOnly/CMakeLists.txt b/Tests/SimpleCOnly/CMakeLists.txt index d0ed651..fb24779 100644 --- a/Tests/SimpleCOnly/CMakeLists.txt +++ b/Tests/SimpleCOnly/CMakeLists.txt @@ -14,4 +14,4 @@ message(STATUS "sizeof(float): ${SIZE_FLOAT}") # make sure optimized libs are not used by debug builds if(CMAKE_BUILD_TYPE MATCHES Debug) target_link_libraries(Simple optimized c:/not/here.lib ) -endif(CMAKE_BUILD_TYPE MATCHES Debug) +endif() diff --git a/Tests/SimpleExclude/run.cmake.in b/Tests/SimpleExclude/run.cmake.in index 8f83380..d31d2e5 100644 --- a/Tests/SimpleExclude/run.cmake.in +++ b/Tests/SimpleExclude/run.cmake.in @@ -8,6 +8,6 @@ message("T9 ${t9_name} resulted ${t9_var}") if ( "${t4_var}" EQUAL "0" AND "${t9_var}" EQUAL "0" ) message("Everything is good, Yoshimi won...") -else ( "${t4_var}" EQUAL "0" AND "${t9_var}" EQUAL "0" ) +else () message(FATAL_ERROR "Yoshimi lost... The evil pink robots will take over the world") -endif ( "${t4_var}" EQUAL "0" AND "${t9_var}" EQUAL "0" ) +endif () diff --git a/Tests/SimpleInstall/CMakeLists.txt b/Tests/SimpleInstall/CMakeLists.txt index f05587e..479d6ec 100644 --- a/Tests/SimpleInstall/CMakeLists.txt +++ b/Tests/SimpleInstall/CMakeLists.txt @@ -40,13 +40,13 @@ if(STAGE2) include(${CMAKE_INSTALL_PREFIX}/MyTest/InstallScriptOut.cmake OPTIONAL) if(CMAKE_INSTALL_SCRIPT_DID_RUN) message(STATUS "Stage 1 did run install script 2.") - else(CMAKE_INSTALL_SCRIPT_DID_RUN) + else() message(SEND_ERROR "Stage 1 did not run install script 2.") - endif(CMAKE_INSTALL_SCRIPT_DID_RUN) + endif() if(CYGWIN OR MINGW) set(LIBPATHS ${LIBPATHS} "${CMAKE_INSTALL_PREFIX}/MyTest/bin") - endif(CYGWIN OR MINGW) + endif() message("Search for library in: ${LIBPATHS}") set(TEST1_LIBRARY "TEST1_LIBRARY-NOTFOUND" CACHE FILEPATH "Force find." FORCE) @@ -77,44 +77,44 @@ if(STAGE2) if("${TEST1_LIBRARY}" MATCHES "static") message(STATUS "test1 correctly found in lib/static") - else("${TEST1_LIBRARY}" MATCHES "static") + else() message(SEND_ERROR "test1 not found in lib/static!") - endif("${TEST1_LIBRARY}" MATCHES "static") + endif() # Check for failure of configuration-specific installation. if(EXISTS "${CMAKE_INSTALL_PREFIX}/MyTest/include/Release/lib1debug.h") message(FATAL_ERROR "Debug-configuration file installed for Release!") - endif(EXISTS "${CMAKE_INSTALL_PREFIX}/MyTest/include/Release/lib1debug.h") + endif() if(EXISTS "${CMAKE_INSTALL_PREFIX}/MyTest/include/Debug/lib1release.h") message(FATAL_ERROR "Release-configuration file installed for Debug!") - endif(EXISTS "${CMAKE_INSTALL_PREFIX}/MyTest/include/Debug/lib1release.h") + endif() # Check for failure of directory installation. if(NOT EXISTS "${CMAKE_INSTALL_PREFIX}/MyTest/share/TestSubDir/TSD.h") message(FATAL_ERROR "Directory installation did not install TSD.h") - endif(NOT EXISTS "${CMAKE_INSTALL_PREFIX}/MyTest/share/TestSubDir/TSD.h") + endif() if(EXISTS "${CMAKE_INSTALL_PREFIX}/MyTest/share/TestSubDir/CVS") message(FATAL_ERROR "Directory installation installed CVS directory.") - endif(EXISTS "${CMAKE_INSTALL_PREFIX}/MyTest/share/TestSubDir/CVS") + endif() if(EXISTS "${CMAKE_INSTALL_PREFIX}/MyTest/share/CVS") message(FATAL_ERROR "Directory installation installed CVS directory.") - endif(EXISTS "${CMAKE_INSTALL_PREFIX}/MyTest/share/CVS") + endif() if(EXISTS "${CMAKE_INSTALL_PREFIX}/MyTest/share/CMakeLists.txt") message(FATAL_ERROR "Directory installation installed CMakeLists.txt.") - endif(EXISTS "${CMAKE_INSTALL_PREFIX}/MyTest/share/CMakeLists.txt") + endif() if(NOT EXISTS "${CMAKE_INSTALL_PREFIX}/MyTest/share/alt/TestSubDir/TSD.h") message(FATAL_ERROR "Directory installation did not install alternate TSD.h") - endif(NOT EXISTS "${CMAKE_INSTALL_PREFIX}/MyTest/share/alt/TestSubDir/TSD.h") + endif() if(EXISTS "${CMAKE_INSTALL_PREFIX}/MyTest/share/alt/TestSubDir/TSD.cxx") message(FATAL_ERROR "Directory installation installed alternate TSD.cxx") - endif(EXISTS "${CMAKE_INSTALL_PREFIX}/MyTest/share/alt/TestSubDir/TSD.cxx") + endif() # Check that scripts properly installed. if(WIN32 AND NOT CYGWIN) set(BAT .bat) - else(WIN32 AND NOT CYGWIN) + else() set(BAT) - endif(WIN32 AND NOT CYGWIN) + endif() foreach(loc share share/old1 share/old2 share/old3 share/alt) set(CUR_SCRIPT "${CMAKE_INSTALL_PREFIX}/MyTest/${loc}/sample_script${BAT}") execute_process( @@ -125,21 +125,21 @@ if(STAGE2) if(NOT "${SAMPLE_SCRIPT_RESULT}" MATCHES "^0$") message(FATAL_ERROR "Sample script [${CUR_SCRIPT}] failed: [${SAMPLE_SCRIPT_RESULT}]") - endif(NOT "${SAMPLE_SCRIPT_RESULT}" MATCHES "^0$") + endif() if(NOT "${SAMPLE_SCRIPT_OUTPUT}" MATCHES "Sample Script Output") message(FATAL_ERROR "Bad sample script [${CUR_SCRIPT}] output: [${SAMPLE_SCRIPT_OUTPUT}]") - endif(NOT "${SAMPLE_SCRIPT_OUTPUT}" MATCHES "Sample Script Output") - endforeach(loc) + endif() + endforeach() # Check for failure of empty directory installation. if(NOT EXISTS "${CMAKE_INSTALL_PREFIX}/MyTest/share/empty") message(FATAL_ERROR "Empty directory installation did not install.") - endif(NOT EXISTS "${CMAKE_INSTALL_PREFIX}/MyTest/share/empty") + endif() file(GLOB EMPTY_FILES "${CMAKE_INSTALL_PREFIX}/MyTest/share/empty/*") if(EMPTY_FILES) message(FATAL_ERROR "Empty directory installed [${EMPTY_FILES}].") - endif(EMPTY_FILES) + endif() # Make sure the test executable can run from the install tree. set_target_properties(SimpleInstExeS2 PROPERTIES @@ -153,9 +153,9 @@ if(STAGE2) get_target_property(simpleInstallImported S1_SimpleInstall IMPORTED) if(NOT simpleInstallImported) message(FATAL_ERROR "Target S1_SimpleInstall could not be imported") - endif(NOT simpleInstallImported) + endif() -else(STAGE2) +else() # Wipe out the install directory to do a fresh test. file(REMOVE_RECURSE ${CMAKE_INSTALL_PREFIX}/MyTest) @@ -177,7 +177,7 @@ else(STAGE2) # Disable VERSION test until it is implemented in the Xcode generator. if(NOT XCODE) set_target_properties(SimpleInstall PROPERTIES VERSION 1.2) - endif(NOT XCODE) + endif() # Make sure the test executable can run from the install tree. set_target_properties(SimpleInstall PROPERTIES @@ -190,7 +190,7 @@ else(STAGE2) if(CMAKE_GENERATOR MATCHES "Makefiles") add_subdirectory(TestSubDir) add_dependencies(SimpleInstall TSD) - endif(CMAKE_GENERATOR MATCHES "Makefiles") + endif() add_dependencies(SimpleInstall test3) add_dependencies(test2 test3) @@ -305,13 +305,13 @@ else(STAGE2) ${CMAKE_CURRENT_SOURCE_DIR}/PostInstall.cmake) set_target_properties(test4 PROPERTIES VERSION 1.2 SOVERSION 3 INSTALL_NAME_DIR @executable_path/../lib) -endif(STAGE2) +endif() if(CMAKE_CONFIGURATION_TYPES) set(SI_CONFIG -C ${CMAKE_CFG_INTDIR}) -else(CMAKE_CONFIGURATION_TYPES) +else() set(SI_CONFIG) -endif(CMAKE_CONFIGURATION_TYPES) +endif() # Dummy test of CPack set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Test of packaging with cpack") @@ -325,8 +325,8 @@ if(WIN32 AND NOT UNIX) ) if(NOT NSIS_MAKENSIS) set(CPACK_GENERATOR TGZ) - endif(NOT NSIS_MAKENSIS) -endif(WIN32 AND NOT UNIX) + endif() +endif() if(UNIX AND NOT APPLE) set(CPACK_GENERATOR "TGZ;STGZ;TZ") # find_program(found_compress @@ -335,31 +335,31 @@ if(UNIX AND NOT APPLE) # find_program(file_command NAMES file) # if(NOT file_command) # set(file_command file) - # endif(NOT file_command) + # endif() # execute_process(COMMAND ${file_command} ${found_compress} # OUTPUT_VARIABLE output) # set(SKIP_TZ FALSE) # if("${output}" MATCHES "script") # set(SKIP_TZ TRUE) - # endif("${output}" MATCHES "script") + # endif() # if("${output}" MATCHES "dummy.sh") # set(SKIP_TZ TRUE) - # endif("${output}" MATCHES "dummy.sh") + # endif() # if(NOT SKIP_TZ) # message("compress found and it was not a script") # message("output from file command: [${output}]") # set(CPACK_GENERATOR "${CPACK_GENERATOR};TZ") - # else(NOT SKIP_TZ) + # else() # message("compress found, but it was a script so dont use it") # message("output from file command: [${output}]") - # endif(NOT SKIP_TZ) - # endif(found_compress) + # endif() + # endif() find_program(found_bz2 NAMES bzip2) if(found_bz2) set(CPACK_GENERATOR "${CPACK_GENERATOR};TBZ2") - endif(found_bz2) -endif(UNIX AND NOT APPLE) + endif() +endif() set(CPACK_PACKAGE_EXECUTABLES "SimpleInstall" "Simple Install") set(CMAKE_INSTALL_MFC_LIBRARIES 1) @@ -374,9 +374,9 @@ if(CTEST_TEST_CPACK) # set(CPACK_BINARY_ZIP OFF) set(CPACK_MONOLITHIC_INSTALL ON) -else(CTEST_TEST_CPACK) +else() set(PACKAGE_TARGET) -endif(CTEST_TEST_CPACK) +endif() include(CPack) diff --git a/Tests/SimpleInstall/InstallScript1.cmake b/Tests/SimpleInstall/InstallScript1.cmake index 85465bf..ef9da57 100644 --- a/Tests/SimpleInstall/InstallScript1.cmake +++ b/Tests/SimpleInstall/InstallScript1.cmake @@ -2,4 +2,4 @@ message("This is install script 1.") set(INSTALL_SCRIPT_1_DID_RUN 1) if(INSTALL_CODE_DID_RUN) message(FATAL_ERROR "Install script 1 did not run before install code.") -endif(INSTALL_CODE_DID_RUN) +endif() diff --git a/Tests/SimpleInstall/InstallScript2.cmake b/Tests/SimpleInstall/InstallScript2.cmake index a675df7..c1d20a3 100644 --- a/Tests/SimpleInstall/InstallScript2.cmake +++ b/Tests/SimpleInstall/InstallScript2.cmake @@ -1,14 +1,14 @@ message("This is install script 2.") if(INSTALL_SCRIPT_1_DID_RUN) message("Install script ordering works.") -else(INSTALL_SCRIPT_1_DID_RUN) +else() message(FATAL_ERROR "Install script 1 did not run before install script 2.") -endif(INSTALL_SCRIPT_1_DID_RUN) +endif() if(INSTALL_CODE_DID_RUN) message("Install code ordering works.") -else(INSTALL_CODE_DID_RUN) +else() message(FATAL_ERROR "Install script 2 did not run after install code.") -endif(INSTALL_CODE_DID_RUN) +endif() file(WRITE "${CMAKE_INSTALL_PREFIX}/MyTest/InstallScriptOut.cmake" "set(CMAKE_INSTALL_SCRIPT_DID_RUN 1)\n" ) diff --git a/Tests/SimpleInstall/InstallScript3.cmake b/Tests/SimpleInstall/InstallScript3.cmake index a955be1..6485156 100644 --- a/Tests/SimpleInstall/InstallScript3.cmake +++ b/Tests/SimpleInstall/InstallScript3.cmake @@ -2,11 +2,11 @@ message("This is install script 3.") set(INSTALL_SCRIPT_3_DID_RUN 1) if(INSTALL_CODE_WITH_COMPONENT_DID_RUN) message(FATAL_ERROR "Install script 3 did not run before install code with component.") -endif(INSTALL_CODE_WITH_COMPONENT_DID_RUN) +endif() if(CMAKE_INSTALL_COMPONENT) if(NOT "${CMAKE_INSTALL_COMPONENT}" STREQUAL "Development") message("CMAKE_INSTALL_COMPONENT=\"${CMAKE_INSTALL_COMPONENT}\"") message(FATAL_ERROR "Install script 3 should only run for \"Development\" INSTALL COMPONENT.") -endif(NOT "${CMAKE_INSTALL_COMPONENT}" STREQUAL "Development") -endif(CMAKE_INSTALL_COMPONENT) +endif() +endif() diff --git a/Tests/SimpleInstall/InstallScript4.cmake b/Tests/SimpleInstall/InstallScript4.cmake index 0bbd9d2..34d0a73 100644 --- a/Tests/SimpleInstall/InstallScript4.cmake +++ b/Tests/SimpleInstall/InstallScript4.cmake @@ -1,21 +1,21 @@ message("This is install script 4.") if(INSTALL_SCRIPT_3_DID_RUN) message("Install script ordering works.") -else(INSTALL_SCRIPT_3_DID_RUN) +else() message(FATAL_ERROR "Install script 3 did not run before install script 4.") -endif(INSTALL_SCRIPT_3_DID_RUN) +endif() if(INSTALL_CODE_WITH_COMPONENT_DID_RUN) message("Install code ordering works.") -else(INSTALL_CODE_WITH_COMPONENT_DID_RUN) +else() message(FATAL_ERROR "Install script 4 did not run after install with component code.") -endif(INSTALL_CODE_WITH_COMPONENT_DID_RUN) +endif() if(CMAKE_INSTALL_COMPONENT) if(NOT "${CMAKE_INSTALL_COMPONENT}" STREQUAL "Development") message("CMAKE_INSTALL_COMPONENT=\"${CMAKE_INSTALL_COMPONENT}\"") message(FATAL_ERROR "Install script 4 should only run for \"Development\" INSTALL COMPONENT.") -endif(NOT "${CMAKE_INSTALL_COMPONENT}" STREQUAL "Development") -endif(CMAKE_INSTALL_COMPONENT) +endif() +endif() file(WRITE "${CMAKE_INSTALL_PREFIX}/MyTest/InstallScript4Out.cmake" "set(CMAKE_INSTALL_SCRIPT_4_DID_RUN 1)\n" diff --git a/Tests/SimpleInstall/PackageScript.cmake b/Tests/SimpleInstall/PackageScript.cmake index be07f89..53b7909 100644 --- a/Tests/SimpleInstall/PackageScript.cmake +++ b/Tests/SimpleInstall/PackageScript.cmake @@ -6,5 +6,5 @@ get_cmake_property(res VARIABLES) foreach(var ${res}) file(APPEND ${CMAKE_INSTALL_PREFIX}/AllVariables.txt "${var} \"${${var}}\"\n") -endforeach(var ${res}) +endforeach() diff --git a/Tests/SimpleInstall/PostInstall.cmake b/Tests/SimpleInstall/PostInstall.cmake index 222cc5a..d616221 100644 --- a/Tests/SimpleInstall/PostInstall.cmake +++ b/Tests/SimpleInstall/PostInstall.cmake @@ -1,6 +1,6 @@ message("In post install") if(PRE_INSTALL_DID_RUN) message("Pre and post install work fine") -else(PRE_INSTALL_DID_RUN) +else() message(FATAL_ERROR "Pre install did not run before post install") -endif(PRE_INSTALL_DID_RUN) +endif() diff --git a/Tests/SimpleInstallS2/CMakeLists.txt b/Tests/SimpleInstallS2/CMakeLists.txt index f05587e..479d6ec 100644 --- a/Tests/SimpleInstallS2/CMakeLists.txt +++ b/Tests/SimpleInstallS2/CMakeLists.txt @@ -40,13 +40,13 @@ if(STAGE2) include(${CMAKE_INSTALL_PREFIX}/MyTest/InstallScriptOut.cmake OPTIONAL) if(CMAKE_INSTALL_SCRIPT_DID_RUN) message(STATUS "Stage 1 did run install script 2.") - else(CMAKE_INSTALL_SCRIPT_DID_RUN) + else() message(SEND_ERROR "Stage 1 did not run install script 2.") - endif(CMAKE_INSTALL_SCRIPT_DID_RUN) + endif() if(CYGWIN OR MINGW) set(LIBPATHS ${LIBPATHS} "${CMAKE_INSTALL_PREFIX}/MyTest/bin") - endif(CYGWIN OR MINGW) + endif() message("Search for library in: ${LIBPATHS}") set(TEST1_LIBRARY "TEST1_LIBRARY-NOTFOUND" CACHE FILEPATH "Force find." FORCE) @@ -77,44 +77,44 @@ if(STAGE2) if("${TEST1_LIBRARY}" MATCHES "static") message(STATUS "test1 correctly found in lib/static") - else("${TEST1_LIBRARY}" MATCHES "static") + else() message(SEND_ERROR "test1 not found in lib/static!") - endif("${TEST1_LIBRARY}" MATCHES "static") + endif() # Check for failure of configuration-specific installation. if(EXISTS "${CMAKE_INSTALL_PREFIX}/MyTest/include/Release/lib1debug.h") message(FATAL_ERROR "Debug-configuration file installed for Release!") - endif(EXISTS "${CMAKE_INSTALL_PREFIX}/MyTest/include/Release/lib1debug.h") + endif() if(EXISTS "${CMAKE_INSTALL_PREFIX}/MyTest/include/Debug/lib1release.h") message(FATAL_ERROR "Release-configuration file installed for Debug!") - endif(EXISTS "${CMAKE_INSTALL_PREFIX}/MyTest/include/Debug/lib1release.h") + endif() # Check for failure of directory installation. if(NOT EXISTS "${CMAKE_INSTALL_PREFIX}/MyTest/share/TestSubDir/TSD.h") message(FATAL_ERROR "Directory installation did not install TSD.h") - endif(NOT EXISTS "${CMAKE_INSTALL_PREFIX}/MyTest/share/TestSubDir/TSD.h") + endif() if(EXISTS "${CMAKE_INSTALL_PREFIX}/MyTest/share/TestSubDir/CVS") message(FATAL_ERROR "Directory installation installed CVS directory.") - endif(EXISTS "${CMAKE_INSTALL_PREFIX}/MyTest/share/TestSubDir/CVS") + endif() if(EXISTS "${CMAKE_INSTALL_PREFIX}/MyTest/share/CVS") message(FATAL_ERROR "Directory installation installed CVS directory.") - endif(EXISTS "${CMAKE_INSTALL_PREFIX}/MyTest/share/CVS") + endif() if(EXISTS "${CMAKE_INSTALL_PREFIX}/MyTest/share/CMakeLists.txt") message(FATAL_ERROR "Directory installation installed CMakeLists.txt.") - endif(EXISTS "${CMAKE_INSTALL_PREFIX}/MyTest/share/CMakeLists.txt") + endif() if(NOT EXISTS "${CMAKE_INSTALL_PREFIX}/MyTest/share/alt/TestSubDir/TSD.h") message(FATAL_ERROR "Directory installation did not install alternate TSD.h") - endif(NOT EXISTS "${CMAKE_INSTALL_PREFIX}/MyTest/share/alt/TestSubDir/TSD.h") + endif() if(EXISTS "${CMAKE_INSTALL_PREFIX}/MyTest/share/alt/TestSubDir/TSD.cxx") message(FATAL_ERROR "Directory installation installed alternate TSD.cxx") - endif(EXISTS "${CMAKE_INSTALL_PREFIX}/MyTest/share/alt/TestSubDir/TSD.cxx") + endif() # Check that scripts properly installed. if(WIN32 AND NOT CYGWIN) set(BAT .bat) - else(WIN32 AND NOT CYGWIN) + else() set(BAT) - endif(WIN32 AND NOT CYGWIN) + endif() foreach(loc share share/old1 share/old2 share/old3 share/alt) set(CUR_SCRIPT "${CMAKE_INSTALL_PREFIX}/MyTest/${loc}/sample_script${BAT}") execute_process( @@ -125,21 +125,21 @@ if(STAGE2) if(NOT "${SAMPLE_SCRIPT_RESULT}" MATCHES "^0$") message(FATAL_ERROR "Sample script [${CUR_SCRIPT}] failed: [${SAMPLE_SCRIPT_RESULT}]") - endif(NOT "${SAMPLE_SCRIPT_RESULT}" MATCHES "^0$") + endif() if(NOT "${SAMPLE_SCRIPT_OUTPUT}" MATCHES "Sample Script Output") message(FATAL_ERROR "Bad sample script [${CUR_SCRIPT}] output: [${SAMPLE_SCRIPT_OUTPUT}]") - endif(NOT "${SAMPLE_SCRIPT_OUTPUT}" MATCHES "Sample Script Output") - endforeach(loc) + endif() + endforeach() # Check for failure of empty directory installation. if(NOT EXISTS "${CMAKE_INSTALL_PREFIX}/MyTest/share/empty") message(FATAL_ERROR "Empty directory installation did not install.") - endif(NOT EXISTS "${CMAKE_INSTALL_PREFIX}/MyTest/share/empty") + endif() file(GLOB EMPTY_FILES "${CMAKE_INSTALL_PREFIX}/MyTest/share/empty/*") if(EMPTY_FILES) message(FATAL_ERROR "Empty directory installed [${EMPTY_FILES}].") - endif(EMPTY_FILES) + endif() # Make sure the test executable can run from the install tree. set_target_properties(SimpleInstExeS2 PROPERTIES @@ -153,9 +153,9 @@ if(STAGE2) get_target_property(simpleInstallImported S1_SimpleInstall IMPORTED) if(NOT simpleInstallImported) message(FATAL_ERROR "Target S1_SimpleInstall could not be imported") - endif(NOT simpleInstallImported) + endif() -else(STAGE2) +else() # Wipe out the install directory to do a fresh test. file(REMOVE_RECURSE ${CMAKE_INSTALL_PREFIX}/MyTest) @@ -177,7 +177,7 @@ else(STAGE2) # Disable VERSION test until it is implemented in the Xcode generator. if(NOT XCODE) set_target_properties(SimpleInstall PROPERTIES VERSION 1.2) - endif(NOT XCODE) + endif() # Make sure the test executable can run from the install tree. set_target_properties(SimpleInstall PROPERTIES @@ -190,7 +190,7 @@ else(STAGE2) if(CMAKE_GENERATOR MATCHES "Makefiles") add_subdirectory(TestSubDir) add_dependencies(SimpleInstall TSD) - endif(CMAKE_GENERATOR MATCHES "Makefiles") + endif() add_dependencies(SimpleInstall test3) add_dependencies(test2 test3) @@ -305,13 +305,13 @@ else(STAGE2) ${CMAKE_CURRENT_SOURCE_DIR}/PostInstall.cmake) set_target_properties(test4 PROPERTIES VERSION 1.2 SOVERSION 3 INSTALL_NAME_DIR @executable_path/../lib) -endif(STAGE2) +endif() if(CMAKE_CONFIGURATION_TYPES) set(SI_CONFIG -C ${CMAKE_CFG_INTDIR}) -else(CMAKE_CONFIGURATION_TYPES) +else() set(SI_CONFIG) -endif(CMAKE_CONFIGURATION_TYPES) +endif() # Dummy test of CPack set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Test of packaging with cpack") @@ -325,8 +325,8 @@ if(WIN32 AND NOT UNIX) ) if(NOT NSIS_MAKENSIS) set(CPACK_GENERATOR TGZ) - endif(NOT NSIS_MAKENSIS) -endif(WIN32 AND NOT UNIX) + endif() +endif() if(UNIX AND NOT APPLE) set(CPACK_GENERATOR "TGZ;STGZ;TZ") # find_program(found_compress @@ -335,31 +335,31 @@ if(UNIX AND NOT APPLE) # find_program(file_command NAMES file) # if(NOT file_command) # set(file_command file) - # endif(NOT file_command) + # endif() # execute_process(COMMAND ${file_command} ${found_compress} # OUTPUT_VARIABLE output) # set(SKIP_TZ FALSE) # if("${output}" MATCHES "script") # set(SKIP_TZ TRUE) - # endif("${output}" MATCHES "script") + # endif() # if("${output}" MATCHES "dummy.sh") # set(SKIP_TZ TRUE) - # endif("${output}" MATCHES "dummy.sh") + # endif() # if(NOT SKIP_TZ) # message("compress found and it was not a script") # message("output from file command: [${output}]") # set(CPACK_GENERATOR "${CPACK_GENERATOR};TZ") - # else(NOT SKIP_TZ) + # else() # message("compress found, but it was a script so dont use it") # message("output from file command: [${output}]") - # endif(NOT SKIP_TZ) - # endif(found_compress) + # endif() + # endif() find_program(found_bz2 NAMES bzip2) if(found_bz2) set(CPACK_GENERATOR "${CPACK_GENERATOR};TBZ2") - endif(found_bz2) -endif(UNIX AND NOT APPLE) + endif() +endif() set(CPACK_PACKAGE_EXECUTABLES "SimpleInstall" "Simple Install") set(CMAKE_INSTALL_MFC_LIBRARIES 1) @@ -374,9 +374,9 @@ if(CTEST_TEST_CPACK) # set(CPACK_BINARY_ZIP OFF) set(CPACK_MONOLITHIC_INSTALL ON) -else(CTEST_TEST_CPACK) +else() set(PACKAGE_TARGET) -endif(CTEST_TEST_CPACK) +endif() include(CPack) diff --git a/Tests/SimpleInstallS2/InstallScript1.cmake b/Tests/SimpleInstallS2/InstallScript1.cmake index 85465bf..ef9da57 100644 --- a/Tests/SimpleInstallS2/InstallScript1.cmake +++ b/Tests/SimpleInstallS2/InstallScript1.cmake @@ -2,4 +2,4 @@ message("This is install script 1.") set(INSTALL_SCRIPT_1_DID_RUN 1) if(INSTALL_CODE_DID_RUN) message(FATAL_ERROR "Install script 1 did not run before install code.") -endif(INSTALL_CODE_DID_RUN) +endif() diff --git a/Tests/SimpleInstallS2/InstallScript2.cmake b/Tests/SimpleInstallS2/InstallScript2.cmake index a675df7..c1d20a3 100644 --- a/Tests/SimpleInstallS2/InstallScript2.cmake +++ b/Tests/SimpleInstallS2/InstallScript2.cmake @@ -1,14 +1,14 @@ message("This is install script 2.") if(INSTALL_SCRIPT_1_DID_RUN) message("Install script ordering works.") -else(INSTALL_SCRIPT_1_DID_RUN) +else() message(FATAL_ERROR "Install script 1 did not run before install script 2.") -endif(INSTALL_SCRIPT_1_DID_RUN) +endif() if(INSTALL_CODE_DID_RUN) message("Install code ordering works.") -else(INSTALL_CODE_DID_RUN) +else() message(FATAL_ERROR "Install script 2 did not run after install code.") -endif(INSTALL_CODE_DID_RUN) +endif() file(WRITE "${CMAKE_INSTALL_PREFIX}/MyTest/InstallScriptOut.cmake" "set(CMAKE_INSTALL_SCRIPT_DID_RUN 1)\n" ) diff --git a/Tests/SimpleInstallS2/InstallScript3.cmake b/Tests/SimpleInstallS2/InstallScript3.cmake index a955be1..6485156 100644 --- a/Tests/SimpleInstallS2/InstallScript3.cmake +++ b/Tests/SimpleInstallS2/InstallScript3.cmake @@ -2,11 +2,11 @@ message("This is install script 3.") set(INSTALL_SCRIPT_3_DID_RUN 1) if(INSTALL_CODE_WITH_COMPONENT_DID_RUN) message(FATAL_ERROR "Install script 3 did not run before install code with component.") -endif(INSTALL_CODE_WITH_COMPONENT_DID_RUN) +endif() if(CMAKE_INSTALL_COMPONENT) if(NOT "${CMAKE_INSTALL_COMPONENT}" STREQUAL "Development") message("CMAKE_INSTALL_COMPONENT=\"${CMAKE_INSTALL_COMPONENT}\"") message(FATAL_ERROR "Install script 3 should only run for \"Development\" INSTALL COMPONENT.") -endif(NOT "${CMAKE_INSTALL_COMPONENT}" STREQUAL "Development") -endif(CMAKE_INSTALL_COMPONENT) +endif() +endif() diff --git a/Tests/SimpleInstallS2/InstallScript4.cmake b/Tests/SimpleInstallS2/InstallScript4.cmake index 0bbd9d2..34d0a73 100644 --- a/Tests/SimpleInstallS2/InstallScript4.cmake +++ b/Tests/SimpleInstallS2/InstallScript4.cmake @@ -1,21 +1,21 @@ message("This is install script 4.") if(INSTALL_SCRIPT_3_DID_RUN) message("Install script ordering works.") -else(INSTALL_SCRIPT_3_DID_RUN) +else() message(FATAL_ERROR "Install script 3 did not run before install script 4.") -endif(INSTALL_SCRIPT_3_DID_RUN) +endif() if(INSTALL_CODE_WITH_COMPONENT_DID_RUN) message("Install code ordering works.") -else(INSTALL_CODE_WITH_COMPONENT_DID_RUN) +else() message(FATAL_ERROR "Install script 4 did not run after install with component code.") -endif(INSTALL_CODE_WITH_COMPONENT_DID_RUN) +endif() if(CMAKE_INSTALL_COMPONENT) if(NOT "${CMAKE_INSTALL_COMPONENT}" STREQUAL "Development") message("CMAKE_INSTALL_COMPONENT=\"${CMAKE_INSTALL_COMPONENT}\"") message(FATAL_ERROR "Install script 4 should only run for \"Development\" INSTALL COMPONENT.") -endif(NOT "${CMAKE_INSTALL_COMPONENT}" STREQUAL "Development") -endif(CMAKE_INSTALL_COMPONENT) +endif() +endif() file(WRITE "${CMAKE_INSTALL_PREFIX}/MyTest/InstallScript4Out.cmake" "set(CMAKE_INSTALL_SCRIPT_4_DID_RUN 1)\n" diff --git a/Tests/SimpleInstallS2/PackageScript.cmake b/Tests/SimpleInstallS2/PackageScript.cmake index be07f89..53b7909 100644 --- a/Tests/SimpleInstallS2/PackageScript.cmake +++ b/Tests/SimpleInstallS2/PackageScript.cmake @@ -6,5 +6,5 @@ get_cmake_property(res VARIABLES) foreach(var ${res}) file(APPEND ${CMAKE_INSTALL_PREFIX}/AllVariables.txt "${var} \"${${var}}\"\n") -endforeach(var ${res}) +endforeach() diff --git a/Tests/SimpleInstallS2/PostInstall.cmake b/Tests/SimpleInstallS2/PostInstall.cmake index 222cc5a..d616221 100644 --- a/Tests/SimpleInstallS2/PostInstall.cmake +++ b/Tests/SimpleInstallS2/PostInstall.cmake @@ -1,6 +1,6 @@ message("In post install") if(PRE_INSTALL_DID_RUN) message("Pre and post install work fine") -else(PRE_INSTALL_DID_RUN) +else() message(FATAL_ERROR "Pre install did not run before post install") -endif(PRE_INSTALL_DID_RUN) +endif() diff --git a/Tests/StringFileTest/CMakeLists.txt b/Tests/StringFileTest/CMakeLists.txt index 0af11f7..6d798b0 100644 --- a/Tests/StringFileTest/CMakeLists.txt +++ b/Tests/StringFileTest/CMakeLists.txt @@ -10,9 +10,9 @@ file(READ "${CMAKE_CURRENT_SOURCE_DIR}/test.bin" hexContents HEX) if("${hexContents}" STREQUAL "0001027700") message("file(READ HEX) correctly read [${hexContents}]") -else("${hexContents}" STREQUAL "0001027700") +else() message(SEND_ERROR "file(READ HEX) incorrectly read [${hexContents}], but expected was [0001027700]") -endif("${hexContents}" STREQUAL "0001027700") +endif() # file(STRINGS) test file(STRINGS "${CMAKE_CURRENT_SOURCE_DIR}/InputFile.h.in" infile_strings @@ -21,17 +21,17 @@ file(STRINGS "${CMAKE_CURRENT_SOURCE_DIR}/InputFile.h.in" infile_strings set(infile_strings_goal "#include \"includefile\"\n") if("${infile_strings}" STREQUAL "${infile_strings_goal}") message("file(STRINGS) correctly read [${infile_strings}]") -else("${infile_strings}" STREQUAL "${infile_strings_goal}") +else() message(SEND_ERROR "file(STRINGS) incorrectly read [${infile_strings}]") -endif("${infile_strings}" STREQUAL "${infile_strings_goal}") +endif() # test reading a file and getting its binary data as hex string file(READ "${CMAKE_CURRENT_SOURCE_DIR}/main.srec" infilehex LIMIT 4 HEX) if(NOT "${infilehex}" STREQUAL "53313036") message(SEND_ERROR "file(READ ... HEX) error, read: \"${infilehex}\", expected \"53313036\"") -endif(NOT "${infilehex}" STREQUAL "53313036") +endif() # test that file(STRINGS) also work with Intel hex and Motorola S-record files @@ -40,20 +40,20 @@ file(STRINGS "${CMAKE_CURRENT_SOURCE_DIR}/main.ihx" infile_strings REGEX INFO) set(infile_strings_goal "INFO:compiler\\[SDCC-HEX\\]") if("${infile_strings}" MATCHES "${infile_strings_goal}") message("file(STRINGS) correctly read from hex file [${infile_strings}]") -else("${infile_strings}" MATCHES "${infile_strings_goal}") +else() message(SEND_ERROR "file(STRINGS) incorrectly read from hex file [${infile_strings}]") -endif("${infile_strings}" MATCHES "${infile_strings_goal}") +endif() # this file has been created with "sdcc main.c --out-fmt-s19" file(STRINGS "${CMAKE_CURRENT_SOURCE_DIR}/main.srec" infile_strings REGEX INFO) set(infile_strings_goal "INFO:compiler\\[SDCC-SREC\\]") if("${infile_strings}" MATCHES "${infile_strings_goal}") message("file(STRINGS) correctly read from srec file [${infile_strings}]") -else("${infile_strings}" MATCHES "${infile_strings_goal}") +else() message(SEND_ERROR "file(STRINGS) incorrectly read from srec file [${infile_strings}]") -endif("${infile_strings}" MATCHES "${infile_strings_goal}") +endif() # String test string(REGEX MATCH "[cC][mM][aA][kK][eE]" rmvar "CMake is great") @@ -75,35 +75,35 @@ string(REPLACE "Autoconf" "CMake" repvar "People should use Autoconf") if("abc" STREQUAL "xyz") message(SEND_ERROR "Problem with the if(STREQUAL), \"abc\" and \"xyz\" considered equal") -endif("abc" STREQUAL "xyz") +endif() if("CMake is cool" MATCHES "(CMake) (is).+") if(NOT "${CMAKE_MATCH_0}" STREQUAL "CMake is cool") message(SEND_ERROR "CMAKE_MATCH_0 wrong: \"${CMAKE_MATCH_0}\", expected \"CMake is cool\"") - endif(NOT "${CMAKE_MATCH_0}" STREQUAL "CMake is cool") + endif() if(NOT "${CMAKE_MATCH_1}" STREQUAL "CMake") message(SEND_ERROR "CMAKE_MATCH_1 wrong: \"${CMAKE_MATCH_1}\", expected \"CMake\"") - endif(NOT "${CMAKE_MATCH_1}" STREQUAL "CMake") + endif() if(NOT "${CMAKE_MATCH_2}" STREQUAL "is") message(SEND_ERROR "CMAKE_MATCH_2 wrong: \"${CMAKE_MATCH_2}\", expected \"is\"") - endif(NOT "${CMAKE_MATCH_2}" STREQUAL "is") -else("CMake is cool" MATCHES "(CMake) (is).+") + endif() +else() message(SEND_ERROR "Problem with the if(MATCHES), no match found") -endif("CMake is cool" MATCHES "(CMake) (is).+") +endif() string(REGEX MATCH "(People).+CMake" matchResultVar "People should use CMake") if(NOT "${matchResultVar}" STREQUAL "People should use CMake") message(SEND_ERROR "string(REGEX MATCH) problem: \"${matchResultVar}\", expected \"People should use CMake\"") -endif(NOT "${matchResultVar}" STREQUAL "People should use CMake") +endif() if(NOT "${CMAKE_MATCH_0}" STREQUAL "People should use CMake") message(SEND_ERROR "CMAKE_MATCH_0 wrong: \"${CMAKE_MATCH_0}\", expected \"People should use CMake\"") -endif(NOT "${CMAKE_MATCH_0}" STREQUAL "People should use CMake") +endif() if(NOT "${CMAKE_MATCH_1}" STREQUAL "People") message(SEND_ERROR "CMAKE_MATCH_1 wrong: \"${CMAKE_MATCH_1}\", expected \"People\"") -endif(NOT "${CMAKE_MATCH_1}" STREQUAL "People") +endif() if(NOT "${CMAKE_MATCH_2}" STREQUAL "") message(SEND_ERROR "CMAKE_MATCH_2 wrong: \"${CMAKE_MATCH_2}\", expected empty string") -endif(NOT "${CMAKE_MATCH_2}" STREQUAL "") +endif() string(STRIP " @@ -115,10 +115,10 @@ string(STRIP " ST3" ST3) foreach(var ST1 ST2 ST3) if("${var}" STREQUAL "${${var}}") message("[${var}] == [${${var}}]") - else("${var}" STREQUAL "${${var}}") + else() message(SEND_ERROR "Problem with the STRIP command for ${var}: [${${var}}]") - endif("${var}" STREQUAL "${${var}}") -endforeach(var) + endif() +endforeach() string(SUBSTRING "People should use Autoconf" 7 10 substringres) set(substringres "Everybody ${substringres} CMake") @@ -139,7 +139,7 @@ message("Output: [${var}]") string(COMPARE EQUAL "${var}" "$(VAR1)$(VAR2)/$(VAR3)" result) if(NOT result) message(SEND_ERROR "Unquoted $(VAR) syntax is broken.") -endif(NOT result) +endif() # Obscure environment variable name set("ENV{x+(y)}" "Obscure environment variable value") @@ -178,12 +178,12 @@ foreach(var tuvar tlvar) file(APPEND "${file}" "#define ${var} \"${${var}}\"\n") -endforeach(var) +endforeach() # Verify that the file was created recently. if(NOT "${file}" IS_NEWER_THAN "${CMAKE_CURRENT_SOURCE_DIR}/InputFile.h.in") message(FATAL_ERROR "if(FILE_IS_NEWER) does not seem to work.") -endif(NOT "${file}" IS_NEWER_THAN "${CMAKE_CURRENT_SOURCE_DIR}/InputFile.h.in") +endif() # Test configuration of the string set(TEST_DEFINED 123) @@ -225,13 +225,13 @@ macro(TEST_RANGE ARGS CHECK) set(r) foreach(a RANGE ${ARGS}) set(r ${r} ${a}) - endforeach(a) + endforeach() message("FOREACH with RANGE ${ARGS} produces ${r}") if("x${r}x" MATCHES "^x${CHECK}x$") - else("x${r}x" MATCHES "^x${CHECK}x$") + else() message(SEND_ERROR "The range resulted in: ${r} should be ${CHECK}") - endif("x${r}x" MATCHES "^x${CHECK}x$") -endmacro(TEST_RANGE) + endif() +endmacro() TEST_RANGE("5" "0;1;2;3;4;5") TEST_RANGE("3;5" "3;4;5") TEST_RANGE("5;3" "5;4;3") @@ -246,7 +246,7 @@ set(var_a) set(var_b) foreach(item IN LISTS list1 list2 ITEMS "" a "") set(var_${item} "${var_${item}}x") -endforeach(item) +endforeach() if(NOT "${var_}" STREQUAL "xxxxx") message(FATAL_ERROR "count incorrect for \"\": [${var_}]") endif() @@ -267,16 +267,16 @@ string(SUBSTRING ${ST_INPUTSTRING} 9 -1 ST_NINE) if(ST_EMPTY) message(SEND_ERROR "SUBSTRING with length 0 does not return an empty string") -endif(ST_EMPTY) +endif() if(NOT ST_ONE STREQUAL "1") message(SEND_ERROR "SUBSTING command does not cut the correct selected character, was \"" ${ST_ONE} "\", should be \"1\"") -endif(NOT ST_ONE STREQUAL "1") +endif() if(NOT ST_INPUTSTRING STREQUAL ST_ALL) message(SEND_ERROR "SUBSTRING does not return the whole string when selected with length") -endif(NOT ST_INPUTSTRING STREQUAL ST_ALL) +endif() if(NOT ST_INPUTSTRING STREQUAL ST_ALL_MINUS) message(SEND_ERROR "SUBSTRING does not return the whole string when selected with -1") -endif(NOT ST_INPUTSTRING STREQUAL ST_ALL_MINUS) +endif() if(NOT ST_NINE STREQUAL "9") message(SEND_ERROR "SUBSTRING does not return the tail when selected with -1") -endif(NOT ST_NINE STREQUAL "9") +endif() diff --git a/Tests/SubDir/CMakeLists.txt b/Tests/SubDir/CMakeLists.txt index 2aec956..6822e6b 100644 --- a/Tests/SubDir/CMakeLists.txt +++ b/Tests/SubDir/CMakeLists.txt @@ -7,11 +7,11 @@ if(WATCOM) set(PLUS_NAME_FILES AnotherSubdir/pair_int.int.c vcl_algorithm_vcl_pair_double.foo.c) -else(WATCOM) +else() set(PLUS_NAME_FILES AnotherSubdir/pair+int.int.c vcl_algorithm+vcl_pair+double.foo.c) -endif(WATCOM) +endif() add_executable(TestFromSubdir AnotherSubdir/testfromsubdir.c @@ -23,24 +23,24 @@ aux_source_directory(ThirdSubDir SOURCES) if(WATCOM) foreach(f ${SOURCES}) if("${f}" STREQUAL "ThirdSubDir/pair+int.int1.c") - else("${f}" STREQUAL "ThirdSubDir/pair+int.int1.c") + else() set(SOURCES2 ${f} ${SOURCES2}) - endif("${f}" STREQUAL "ThirdSubDir/pair+int.int1.c") - endforeach(f) + endif() + endforeach() set(SOURCES ${SOURCES2}) set(SOURCES ${SOURCES} vcl_algorithm_vcl_pair_double.foo.c) -else(WATCOM) +else() foreach(f ${SOURCES}) if("${f}" STREQUAL "ThirdSubDir/pair_int.int1.c") - else("${f}" STREQUAL "ThirdSubDir/pair_int.int1.c") + else() set(SOURCES2 ${f} ${SOURCES2}) message("${f}") - endif("${f}" STREQUAL "ThirdSubDir/pair_int.int1.c") - endforeach(f) + endif() + endforeach() set(SOURCES ${SOURCES2}) set(SOURCES ${SOURCES} vcl_algorithm+vcl_pair+double.foo.c) -endif(WATCOM) +endif() message("Sources: ${SOURCES}") add_executable(TestWithAuxSourceDir ${SOURCES}) diff --git a/Tests/SubDirSpaces/CMakeLists.txt b/Tests/SubDirSpaces/CMakeLists.txt index f1ace0f..69f1d68 100644 --- a/Tests/SubDirSpaces/CMakeLists.txt +++ b/Tests/SubDirSpaces/CMakeLists.txt @@ -4,7 +4,7 @@ project(SUBDIR) # Some systems do not seem to support rpath with spaces. if("${CMAKE_SYSTEM}" MATCHES "IRIX|QNX") set(CMAKE_SKIP_BUILD_RPATH 1) -endif("${CMAKE_SYSTEM}" MATCHES "IRIX|QNX") +endif() # be able to see output from make on dashboards set(CMAKE_VERBOSE_MAKEFILE 1) @@ -26,9 +26,9 @@ endif() if(CMAKE_PAREN) add_definitions(-DCMAKE_PAREN=1) subdirs("Executable Sources" "Some(x86) Sources" EXCLUDE_FROM_ALL "Some Examples") -else(CMAKE_PAREN) +else() subdirs("Executable Sources" EXCLUDE_FROM_ALL "Some Examples") -endif(CMAKE_PAREN) +endif() write_file(${SUBDIR_BINARY_DIR}/ShouldBeHere "This file should exist.") #WATCOM WMAKE does not support + in the name of a file! @@ -36,11 +36,11 @@ if(WATCOM) set(PLUS_NAME_FILES "Another Subdir/pair_int.int.c" vcl_algorithm_vcl_pair_double.foo.c) -else(WATCOM) +else() set(PLUS_NAME_FILES "Another Subdir/pair+int.int.c" vcl_algorithm+vcl_pair+double.foo.c) -endif(WATCOM) +endif() add_executable(TestFromSubdir "Another Subdir/testfromsubdir.c" @@ -52,26 +52,26 @@ aux_source_directory(ThirdSubDir SOURCES) if(WATCOM) foreach(f ${SOURCES}) if("${f}" STREQUAL "ThirdSubDir/pair+int.int1.c") - else("${f}" STREQUAL "ThirdSubDir/pair+int.int1.c") + else() set(SOURCES2 ${f} ${SOURCES2}) - endif("${f}" STREQUAL "ThirdSubDir/pair+int.int1.c") - endforeach(f) + endif() + endforeach() set(SOURCES ${SOURCES2}) set(SOURCES ${SOURCES} vcl_algorithm_vcl_pair_double.foo.c) -else(WATCOM) +else() foreach(f ${SOURCES}) if("${f}" STREQUAL "ThirdSubDir/pair_int.int1.c") - else("${f}" STREQUAL "ThirdSubDir/pair_int.int1.c") + else() set(SOURCES2 ${f} ${SOURCES2}) - endif("${f}" STREQUAL "ThirdSubDir/pair_int.int1.c") - endforeach(f) + endif() + endforeach() set(SOURCES ${SOURCES2}) set(SOURCES ${SOURCES} vcl_algorithm+vcl_pair+double.foo.c) -endif(WATCOM) +endif() add_executable(TestWithAuxSourceDir ${SOURCES}) if(CMAKE_PAREN) target_link_libraries(TestWithAuxSourceDir testOddPath) -endif(CMAKE_PAREN) +endif() diff --git a/Tests/SwigTest/CMakeLists.txt b/Tests/SwigTest/CMakeLists.txt index b3017f1..17a502d 100644 --- a/Tests/SwigTest/CMakeLists.txt +++ b/Tests/SwigTest/CMakeLists.txt @@ -11,33 +11,33 @@ if(${language} MATCHES python) find_package(PythonLibs) include_directories(${PYTHON_INCLUDE_PATH}) set(SWIG_LANG_LIBRARIES ${PYTHON_LIBRARIES}) -endif(${language} MATCHES python) +endif() if(${language} MATCHES perl) find_package(PerlLibs) include_directories(${PERL_INCLUDE_PATH}) add_definitions(${PERL_EXTRA_C_FLAGS}) set(SWIG_LANG_LIBRARIES ${PERL_LIBRARY}) -endif(${language} MATCHES perl) +endif() if(${language} MATCHES tcl) find_package(TCL) include_directories(${TCL_INCLUDE_PATH}) set(SWIG_LANG_LIBRARIES ${TCL_LIBRARY}) -endif(${language} MATCHES tcl) +endif() if(${language} MATCHES ruby) find_package(Ruby) include_directories(${RUBY_INCLUDE_PATH}) set(SWIG_LANG_LIBRARIES ${RUBY_LIBRARY}) -endif(${language} MATCHES ruby) +endif() if(${language} MATCHES php4) find_package(PHP4) include_directories(${PHP4_INCLUDE_PATH}) set(SWIG_LANG_LIBRARIES ${PHP4_LIBRARY}) -endif(${language} MATCHES php4) +endif() if(${language} MATCHES pike) find_package(Pike) include_directories(${PIKE_INCLUDE_PATH}) set(SWIG_LANG_LIBRARIES ${PIKE_LIBRARY}) -endif(${language} MATCHES pike) +endif() include_directories(${CMAKE_CURRENT_SOURCE_DIR}) diff --git a/Tests/SystemInformation/CMakeLists.txt b/Tests/SystemInformation/CMakeLists.txt index c29f3e8..838fd4a 100644 --- a/Tests/SystemInformation/CMakeLists.txt +++ b/Tests/SystemInformation/CMakeLists.txt @@ -16,7 +16,7 @@ add_executable(SystemInformation DumpInformation.cxx) macro(FOO args) message("Test macro") -endmacro(FOO) +endmacro() FOO(lala) @@ -25,34 +25,34 @@ get_cmake_property(res VARIABLES) foreach(var ${res}) file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/AllVariables.txt "${var} \"${${var}}\"\n") -endforeach(var ${res}) +endforeach() file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/AllCommands.txt "") get_cmake_property(res COMMANDS) foreach(var ${res}) file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/AllCommands.txt "${var}\n") -endforeach(var ${res}) +endforeach() file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/AllMacros.txt "") get_cmake_property(res MACROS) foreach(var ${res}) file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/AllMacros.txt "${var}\n") -endforeach(var ${res}) +endforeach() file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/OtherProperties.txt "") get_directory_property(res INCLUDE_DIRECTORIES) foreach(var ${res}) file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/OtherProperties.txt "INCLUDE_DIRECTORY: ${var}\n") -endforeach(var) +endforeach() get_directory_property(res LINK_DIRECTORIES) foreach(var ${res}) file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/OtherProperties.txt "LINK_DIRECTORIES: ${var}\n") -endforeach(var) +endforeach() get_directory_property(res INCLUDE_REGULAR_EXPRESSION) file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/OtherProperties.txt diff --git a/Tests/TarTest/CMakeLists.txt b/Tests/TarTest/CMakeLists.txt index b1f1c6d..bcc340b 100644 --- a/Tests/TarTest/CMakeLists.txt +++ b/Tests/TarTest/CMakeLists.txt @@ -6,15 +6,15 @@ macro(EXEC_TAR_COMMAND DIR ARGS) exec_program("${CMAKE_COMMAND}" "${DIR}" ARGS "-E tar ${ARGS}" RETURN_VALUE RET) if(${RET}) message(FATAL_ERROR "CMake tar command failed with arguments \"${ARGS}\"") - endif(${RET}) -endmacro(EXEC_TAR_COMMAND) + endif() +endmacro() # Create a directory structure set(CHECK_FILES) macro(COPY F1 F2) configure_file("${CMAKE_CURRENT_SOURCE_DIR}/${F1}" "${CMAKE_CURRENT_BINARY_DIR}/tar_dir/${F2}" COPYONLY) set(CHECK_FILES ${CHECK_FILES} "${F2}") -endmacro(COPY) +endmacro() COPY("CMakeLists.txt" "f1.txt") COPY("CMakeLists.txt" "d1/f1.txt") COPY("CMakeLists.txt" "d 2/f1.txt") @@ -26,7 +26,7 @@ COPY("CMakeLists.txt" "My Special Directory/f1.txt") if(UNIX) exec_program("ln" ARGS "-sf f1.txt \"${CMAKE_CURRENT_BINARY_DIR}/tar_dir/d1/f2.txt\"") set(CHECK_FILES ${CHECK_FILES} "d1/f2.txt") -endif(UNIX) +endif() # cleanup first in case there are files left from previous runs # if the umask is odd on the machine it might create files that @@ -54,14 +54,14 @@ macro(CHECK_DIR_STRUCTURE DIR) set(rfile "${CMAKE_CURRENT_BINARY_DIR}/tar_dir/${file}") if(NOT EXISTS "${sfile}") message(SEND_ERROR "Cannot find file ${sfile}") - else(NOT EXISTS "${sfile}") + else() exec_program("${CMAKE_COMMAND}" ARGS "-E compare_files \"${sfile}\" \"${rfile}\"" RETURN_VALUE ret) if(${ret}) message(SEND_ERROR "Files \"${sfile}\" \"${rfile}\" are different") - endif(${ret}) - endif(NOT EXISTS "${sfile}") - endforeach(file) -endmacro(CHECK_DIR_STRUCTURE) + endif() + endif() + endforeach() +endmacro() CHECK_DIR_STRUCTURE("${CMAKE_CURRENT_BINARY_DIR}/test_output_tar/tar_dir") diff --git a/Tests/TargetName/scripts/CMakeLists.txt b/Tests/TargetName/scripts/CMakeLists.txt index a693e40..58af64d 100644 --- a/Tests/TargetName/scripts/CMakeLists.txt +++ b/Tests/TargetName/scripts/CMakeLists.txt @@ -10,4 +10,4 @@ if(NOT CMAKE_BINARY_DIR STREQUAL "${CMAKE_SOURCE_DIR}") DEPENDS #hello_world ${CMAKE_CURRENT_BINARY_DIR}/hello_world ) -endif(NOT CMAKE_BINARY_DIR STREQUAL "${CMAKE_SOURCE_DIR}") +endif() diff --git a/Tests/Testing/CMakeLists.txt b/Tests/Testing/CMakeLists.txt index 20af09b..8f69cbe 100644 --- a/Tests/Testing/CMakeLists.txt +++ b/Tests/Testing/CMakeLists.txt @@ -20,9 +20,9 @@ set (EXECUTABLE_OUTPUT_PATH # if (EXECUTABLE_OUTPUT_PATH) set (CXX_TEST_PATH ${EXECUTABLE_OUTPUT_PATH}) -else (EXECUTABLE_OUTPUT_PATH) +else () set (CXX_TEST_PATH .) -endif (EXECUTABLE_OUTPUT_PATH) +endif () # # Include Dart diff --git a/Tests/TryCompile/CMakeLists.txt b/Tests/TryCompile/CMakeLists.txt index 90f878e..b6b66d8 100644 --- a/Tests/TryCompile/CMakeLists.txt +++ b/Tests/TryCompile/CMakeLists.txt @@ -4,26 +4,26 @@ project(TryCompile) macro(TEST_ASSERT value msg) if (NOT ${value}) message (SEND_ERROR "Assertion failure:" ${msg} ) - endif (NOT ${value}) -endmacro(TEST_ASSERT) + endif () +endmacro() macro(TEST_FAIL value msg) if (${value}) message (SEND_ERROR "Failing test succeeded:" ${msg} ) - endif (${value}) -endmacro(TEST_FAIL) + endif () +endmacro() macro(TEST_EXPECT_EXACT command expected) if(NOT "x${result}" STREQUAL "x${expected}") message(SEND_ERROR "${CMAKE_CURRENT_LIST_LINE}: TEST \"${command}\" failed: \"${result}\" expected: \"${expected}\"") - endif(NOT "x${result}" STREQUAL "x${expected}") -endmacro(TEST_EXPECT_EXACT command expected) + endif() +endmacro() macro(TEST_EXPECT_CONTAINS command expected) if(NOT "${result}" MATCHES "${expected}") message(SEND_ERROR "${CMAKE_CURRENT_LIST_LINE}: TEST \"${command}\" failed: \"${result}\" expected: \"${expected}\"") - endif(NOT "${result}" MATCHES "${expected}") -endmacro(TEST_EXPECT_CONTAINS command expected) + endif() +endmacro() # try to compile a file that should compile @@ -37,12 +37,12 @@ try_compile(SHOULD_PASS if(NOT SHOULD_PASS) message(SEND_ERROR "should pass failed ${TRY_OUT}") -endif(NOT SHOULD_PASS) +endif() if(NOT EXISTS "${TryCompile_BINARY_DIR}/CopyOfPass") message(SEND_ERROR "COPY_FILE to \"${TryCompile_BINARY_DIR}/CopyOfPass\" failed") -else(NOT EXISTS "${TryCompile_BINARY_DIR}/CopyOfPass") +else() file(REMOVE "${TryCompile_BINARY_DIR}/CopyOfPass") -endif(NOT EXISTS "${TryCompile_BINARY_DIR}/CopyOfPass") +endif() # try to compile a file that should not compile try_compile(SHOULD_FAIL @@ -51,7 +51,7 @@ try_compile(SHOULD_FAIL OUTPUT_VARIABLE TRY_OUT) if(SHOULD_FAIL) message(SEND_ERROR "Should fail passed ${TRY_OUT}") -endif(SHOULD_FAIL) +endif() # try to compile a file that should compile try_compile(SHOULD_PASS @@ -60,7 +60,7 @@ try_compile(SHOULD_PASS OUTPUT_VARIABLE TRY_OUT) if(NOT SHOULD_PASS) message(SEND_ERROR "should pass failed ${TRY_OUT}") -endif(NOT SHOULD_PASS) +endif() # try to compile a file that should not compile try_compile(SHOULD_FAIL @@ -69,42 +69,42 @@ try_compile(SHOULD_FAIL OUTPUT_VARIABLE TRY_OUT) if(SHOULD_FAIL) message(SEND_ERROR "Should fail passed ${TRY_OUT}") -endif(SHOULD_FAIL) +endif() if(NOT SHOULD_FAIL) if(SHOULD_PASS) message("All Tests passed, ignore all previous output.") - else(SHOULD_PASS) + else() message("Test failed") - endif(SHOULD_PASS) -else(NOT SHOULD_FAIL) + endif() +else() message("Test failed") -endif(NOT SHOULD_FAIL) +endif() try_compile(CMAKE_ANSI_FOR_SCOPE ${TryCompile_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp ${CMAKE_ROOT}/Modules/TestForAnsiForScope.cxx OUTPUT_VARIABLE OUT) if (CMAKE_ANSI_FOR_SCOPE) message("Compiler supports ansi for") -else(CMAKE_ANSI_FOR_SCOPE) +else() message("Compiler does not support ansi for scope") -endif(CMAKE_ANSI_FOR_SCOPE) +endif() try_compile(CMAKE_ANSI_FOR_SCOPE ${TryCompile_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp ${CMAKE_ROOT}/Modules/TestForAnsiForScope.cxx OUTPUT_VARIABLE OUT) if (CMAKE_ANSI_FOR_SCOPE) message("Compiler supports ansi for") -else(CMAKE_ANSI_FOR_SCOPE) +else() message("Compiler does not support ansi for scope") -endif(CMAKE_ANSI_FOR_SCOPE) +endif() message("use the module now") include(${CMAKE_ROOT}/Modules/TestForANSIForScope.cmake) if (CMAKE_ANSI_FOR_SCOPE) message("Compiler supports ansi for") -else(CMAKE_ANSI_FOR_SCOPE) +else() message("Compiler does not support ansi for scope") -endif(CMAKE_ANSI_FOR_SCOPE) +endif() message("Testing try_compile project mode") try_compile(TEST_INNER @@ -129,18 +129,18 @@ try_run(SHOULD_RUN SHOULD_COMPILE OUTPUT_VARIABLE TRY_OUT) if(NOT SHOULD_COMPILE) message(SEND_ERROR "exit_success failed compiling: ${TRY_OUT}") -endif(NOT SHOULD_COMPILE) +endif() if(NOT "${SHOULD_RUN}" STREQUAL "0") message(SEND_ERROR "exit_success failed running with exit code ${SHOULD_RUN}") -endif(NOT "${SHOULD_RUN}" STREQUAL "0") +endif() # check the compile output for the filename if(NOT "${TRY_OUT}" MATCHES "exit_success") message(SEND_ERROR " TRY_OUT didn't contain \"exit_success\": \"${TRY_OUT}\"") -endif(NOT "${TRY_OUT}" MATCHES "exit_success") +endif() # check the run output if(NOT "${TRY_OUT}" MATCHES "hello world") message(SEND_ERROR " TRY_OUT didn't contain \"hello world\": \"${TRY_OUT}\"") -endif(NOT "${TRY_OUT}" MATCHES "hello world") +endif() try_run(ARG_TEST_RUN ARG_TEST_COMPILE ${TryCompile_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp @@ -149,10 +149,10 @@ try_run(ARG_TEST_RUN ARG_TEST_COMPILE ARGS arg1 arg2) if(NOT ARG_TEST_COMPILE) message(SEND_ERROR "expect_arg failed compiling: ${TRY_OUT}") -endif(NOT ARG_TEST_COMPILE) +endif() if(NOT "${ARG_TEST_RUN}" STREQUAL "0") message(SEND_ERROR "expect_arg failed running with exit code ${ARG_TEST_RUN} ${TRY_OUT}") -endif(NOT "${ARG_TEST_RUN}" STREQUAL "0") +endif() # try to run a file that should compile and run, but return an error try_run(SHOULD_EXIT_WITH_ERROR SHOULD_COMPILE @@ -163,23 +163,23 @@ try_run(SHOULD_EXIT_WITH_ERROR SHOULD_COMPILE if(NOT SHOULD_COMPILE) message(STATUS " exit_with_error failed compiling: ${COMPILE_OUTPUT}") -endif(NOT SHOULD_COMPILE) +endif() if("${SHOULD_EXIT_WITH_ERROR}" STREQUAL "0") message(SEND_ERROR " exit_with_error passed with exit code ${SHOULD_EXIT_WITH_ERROR}") -endif("${SHOULD_EXIT_WITH_ERROR}" STREQUAL "0") +endif() # check the compile output, it should contain the filename if(NOT "${COMPILE_OUTPUT}" MATCHES "exit_with_error") message(SEND_ERROR " COMPILE_OUT didn't contain \"exit_with_error\": \"${COMPILE_OUTPUT}\"") -endif(NOT "${COMPILE_OUTPUT}" MATCHES "exit_with_error") +endif() #... but not the run time output if("${COMPILE_OUTPUT}" MATCHES "hello world") message(SEND_ERROR " COMPILE_OUT contains the run output: \"${COMPILE_OUTPUT}\"") -endif("${COMPILE_OUTPUT}" MATCHES "hello world") +endif() # check the run output, it should stdout if(NOT "${RUN_OUTPUT}" MATCHES "hello world") message(SEND_ERROR " RUN_OUTPUT didn't contain \"hello world\": \"${RUN_OUTPUT}\"") -endif(NOT "${RUN_OUTPUT}" MATCHES "hello world") +endif() ####################################################################### # diff --git a/Tests/Tutorial/Step2/CMakeLists.txt b/Tests/Tutorial/Step2/CMakeLists.txt index c82b7df..cf1d30e 100644 --- a/Tests/Tutorial/Step2/CMakeLists.txt +++ b/Tests/Tutorial/Step2/CMakeLists.txt @@ -24,7 +24,7 @@ if (USE_MYMATH) include_directories ("${PROJECT_SOURCE_DIR}/MathFunctions") add_subdirectory (MathFunctions) set (EXTRA_LIBS ${EXTRA_LIBS} MathFunctions) -endif (USE_MYMATH) +endif () # add the executable add_executable (Tutorial tutorial.cxx) diff --git a/Tests/Tutorial/Step3/CMakeLists.txt b/Tests/Tutorial/Step3/CMakeLists.txt index 22d7150..762302b 100644 --- a/Tests/Tutorial/Step3/CMakeLists.txt +++ b/Tests/Tutorial/Step3/CMakeLists.txt @@ -24,7 +24,7 @@ if (USE_MYMATH) include_directories ("${PROJECT_SOURCE_DIR}/MathFunctions") add_subdirectory (MathFunctions) set (EXTRA_LIBS ${EXTRA_LIBS} MathFunctions) -endif (USE_MYMATH) +endif () # add the executable add_executable (Tutorial tutorial.cxx) diff --git a/Tests/Tutorial/Step4/CMakeLists.txt b/Tests/Tutorial/Step4/CMakeLists.txt index fbceedb..6994aa1 100644 --- a/Tests/Tutorial/Step4/CMakeLists.txt +++ b/Tests/Tutorial/Step4/CMakeLists.txt @@ -29,7 +29,7 @@ if (USE_MYMATH) include_directories ("${PROJECT_SOURCE_DIR}/MathFunctions") add_subdirectory (MathFunctions) set (EXTRA_LIBS ${EXTRA_LIBS} MathFunctions) -endif (USE_MYMATH) +endif () # add the executable add_executable (Tutorial tutorial.cxx) @@ -59,7 +59,7 @@ macro (do_test arg result) set_tests_properties (TutorialComp${arg} PROPERTIES PASS_REGULAR_EXPRESSION ${result} ) -endmacro (do_test) +endmacro () # do a bunch of result based tests do_test (25 "25 is 5") diff --git a/Tests/Tutorial/Step5/CMakeLists.txt b/Tests/Tutorial/Step5/CMakeLists.txt index dcd735b..e40b676 100644 --- a/Tests/Tutorial/Step5/CMakeLists.txt +++ b/Tests/Tutorial/Step5/CMakeLists.txt @@ -29,7 +29,7 @@ if (USE_MYMATH) include_directories ("${PROJECT_SOURCE_DIR}/MathFunctions") add_subdirectory (MathFunctions) set (EXTRA_LIBS ${EXTRA_LIBS} MathFunctions) -endif (USE_MYMATH) +endif () # add the executable add_executable (Tutorial tutorial.cxx) @@ -59,7 +59,7 @@ macro (do_test arg result) set_tests_properties (TutorialComp${arg} PROPERTIES PASS_REGULAR_EXPRESSION ${result} ) -endmacro (do_test) +endmacro () # do a bunch of result based tests do_test (4 "4 is 2") diff --git a/Tests/Tutorial/Step6/CMakeLists.txt b/Tests/Tutorial/Step6/CMakeLists.txt index 92a29fa..0fb7cac 100644 --- a/Tests/Tutorial/Step6/CMakeLists.txt +++ b/Tests/Tutorial/Step6/CMakeLists.txt @@ -29,7 +29,7 @@ if (USE_MYMATH) include_directories ("${PROJECT_SOURCE_DIR}/MathFunctions") add_subdirectory (MathFunctions) set (EXTRA_LIBS ${EXTRA_LIBS} MathFunctions) -endif (USE_MYMATH) +endif () # add the executable add_executable (Tutorial tutorial.cxx) @@ -59,7 +59,7 @@ macro (do_test arg result) set_tests_properties (TutorialComp${arg} PROPERTIES PASS_REGULAR_EXPRESSION ${result} ) -endmacro (do_test) +endmacro () # do a bunch of result based tests do_test (4 "4 is 2") diff --git a/Tests/Tutorial/Step7/CMakeLists.txt b/Tests/Tutorial/Step7/CMakeLists.txt index 898723a..d9a92fb 100644 --- a/Tests/Tutorial/Step7/CMakeLists.txt +++ b/Tests/Tutorial/Step7/CMakeLists.txt @@ -29,7 +29,7 @@ if (USE_MYMATH) include_directories ("${PROJECT_SOURCE_DIR}/MathFunctions") add_subdirectory (MathFunctions) set (EXTRA_LIBS ${EXTRA_LIBS} MathFunctions) -endif (USE_MYMATH) +endif () # add the executable add_executable (Tutorial tutorial.cxx) @@ -59,7 +59,7 @@ macro (do_test arg result) set_tests_properties (TutorialComp${arg} PROPERTIES PASS_REGULAR_EXPRESSION ${result} ) -endmacro (do_test) +endmacro () # do a bunch of result based tests do_test (4 "4 is 2") diff --git a/Tests/Unset/CMakeLists.txt b/Tests/Unset/CMakeLists.txt index bacb6d2..781da3f 100644 --- a/Tests/Unset/CMakeLists.txt +++ b/Tests/Unset/CMakeLists.txt @@ -5,51 +5,51 @@ project(Unset C) set(x 42) if(NOT x EQUAL 42) message(FATAL_ERROR "x!=42") -endif(NOT x EQUAL 42) +endif() if(NOT DEFINED x) message(FATAL_ERROR "x should be defined!") -endif(NOT DEFINED x) +endif() unset(x) if(DEFINED x) message(FATAL_ERROR "x should be undefined now!") -endif(DEFINED x) +endif() # Local variable test unset via set() set(x 43) if(NOT x EQUAL 43) message(FATAL_ERROR "x!=43") -endif(NOT x EQUAL 43) +endif() set(x) if(DEFINED x) message(FATAL_ERROR "x should be undefined now!") -endif(DEFINED x) +endif() # Cache variable set(BAR "test" CACHE STRING "documentation") if(NOT DEFINED BAR) message(FATAL_ERROR "BAR not defined") -endif(NOT DEFINED BAR) +endif() # Test interaction of cache entries with variables. set(BAR "test-var") if(NOT "$CACHE{BAR}" STREQUAL "test") message(FATAL_ERROR "\$CACHE{BAR} changed by variable BAR") -endif(NOT "$CACHE{BAR}" STREQUAL "test") +endif() if(NOT "${BAR}" STREQUAL "test-var") message(FATAL_ERROR "\${BAR} not separate from \$CACHE{BAR}") -endif(NOT "${BAR}" STREQUAL "test-var") +endif() unset(BAR) if(NOT "${BAR}" STREQUAL "test") message(FATAL_ERROR "\${BAR} does not fall through to \$CACHE{BAR}") -endif(NOT "${BAR}" STREQUAL "test") +endif() # Test unsetting of CACHE entry. unset(BAR CACHE) if(DEFINED BAR) message(FATAL_ERROR "BAR still defined") -endif(DEFINED BAR) +endif() add_executable(Unset unset.c) diff --git a/Tests/VSExternalInclude/CMakeLists.txt b/Tests/VSExternalInclude/CMakeLists.txt index af0b18f..399ac69 100644 --- a/Tests/VSExternalInclude/CMakeLists.txt +++ b/Tests/VSExternalInclude/CMakeLists.txt @@ -3,9 +3,9 @@ project(VSExternalInclude) if(${CMAKE_GENERATOR} MATCHES "Visual Studio 6") set(PROJECT_EXT dsp) -else(${CMAKE_GENERATOR} MATCHES "Visual Studio 6") +else() set(PROJECT_EXT vcproj) -endif(${CMAKE_GENERATOR} MATCHES "Visual Studio 6") +endif() if(${CMAKE_GENERATOR} MATCHES "Visual Studio 1[01]") set(PROJECT_EXT vcxproj) endif() diff --git a/Tests/Wrapping/CMakeLists.txt b/Tests/Wrapping/CMakeLists.txt index 344b11d..22233df 100644 --- a/Tests/Wrapping/CMakeLists.txt +++ b/Tests/Wrapping/CMakeLists.txt @@ -24,9 +24,9 @@ set (EXECUTABLE_OUTPUT_PATH # if (EXECUTABLE_OUTPUT_PATH) set (CXX_TEST_PATH ${EXECUTABLE_OUTPUT_PATH}) -else (EXECUTABLE_OUTPUT_PATH) +else () set (CXX_TEST_PATH .) -endif (EXECUTABLE_OUTPUT_PATH) +endif () # # Add exe @@ -36,7 +36,7 @@ add_executable (wrapping wrapping.cxx) add_executable (Wrap Wrap.c) if(WIN32) set(EXE_EXT ".exe") -endif(WIN32) +endif() set(WRAP ${EXECUTABLE_OUTPUT_PATH}/${CMAKE_CFG_INTDIR}/Wrap${EXE_EXT}) # @@ -75,9 +75,9 @@ if (QT_FOUND AND QT_WRAP_UI) target_link_libraries(qtwrapping myqtlib) target_link_libraries( qtwrapping ${QT_LIBRARIES} ) -else (QT_FOUND AND QT_WRAP_UI) +else () add_executable (qtwrapping qtnoqtmain.cxx) -endif (QT_FOUND AND QT_WRAP_UI) +endif () # # FLTK Wrappers diff --git a/Tests/X11/CMakeLists.txt b/Tests/X11/CMakeLists.txt index 33ee277..76ae58c 100644 --- a/Tests/X11/CMakeLists.txt +++ b/Tests/X11/CMakeLists.txt @@ -16,9 +16,9 @@ if(APPLE) if(NOT EXISTS /usr/X11R6/lib//libSM.6.dylib) set(X11_FOUND FALSE) message("disable X11, because of universal binary and sysroot") - endif(NOT EXISTS /usr/X11R6/lib//libSM.6.dylib) - endif(NUMARCH GREATER 1) -endif(APPLE) + endif() + endif() +endif() if(X11_FOUND) add_definitions(-DCMAKE_HAS_X) @@ -33,8 +33,8 @@ if(X11_FOUND) set(CPACK_BINARY_PACKAGEMAKER OFF CACHE BOOL "" FORCE ) set(CPACK_PACKAGE_NAME HelloWorldX11Package) set(CPACK_PACKAGE_EXECUTABLES HelloWorldX11 HelloWorldX11) - endif(APPLE) -endif(X11_FOUND) + endif() +endif() # build a CPack driven installer package include(CPack) diff --git a/Utilities/CMakeLists.txt b/Utilities/CMakeLists.txt index 98c1cfd..c39be8b 100644 --- a/Utilities/CMakeLists.txt +++ b/Utilities/CMakeLists.txt @@ -68,8 +68,8 @@ macro(ADD_DOCS target dependency) ${CMake_BINARY_DIR}/Docs/${target}.docbook ) list(APPEND HTML_FILES ${CMake_BINARY_DIR}/Docs/${target}.html) - endif(CMD) -endmacro(ADD_DOCS target dependency) + endif() +endmacro() # Help cmake-gui find the Qt DLLs on Windows. set(WIN_SHELL_GENS "Visual Studio|NMake|MinGW|Watcom|Borland") @@ -80,7 +80,7 @@ if(BUILD_QtDialog AND "${CMAKE_GENERATOR}" MATCHES "${WIN_SHELL_GENS}" # Tell the macro to set the path before running cmake-gui. string(REPLACE ";" "\\;" _PATH "PATH=${Qt_BIN_DIR};%PATH%") set(cmake-gui-PATH COMMAND set "${_PATH}") - endif(EXISTS "${Qt_BIN_DIR}/QtCore4.dll") + endif() endif(BUILD_QtDialog AND "${CMAKE_GENERATOR}" MATCHES "${WIN_SHELL_GENS}" AND EXISTS "${QT_QMAKE_EXECUTABLE}" AND NOT CMAKE_NO_AUTO_QT_ENV) diff --git a/Utilities/Doxygen/CMakeLists.txt b/Utilities/Doxygen/CMakeLists.txt index ab40fdf..813e34d 100644 --- a/Utilities/Doxygen/CMakeLists.txt +++ b/Utilities/Doxygen/CMakeLists.txt @@ -22,7 +22,7 @@ if (BUILD_DOCUMENTATION) # if(NOT DOT_PATH) get_filename_component(DOT_PATH ${DOT} PATH) - endif(NOT DOT_PATH) + endif() configure_file( ${CMake_SOURCE_DIR}/Utilities/Doxygen/doxyfile.in @@ -36,4 +36,4 @@ if (BUILD_DOCUMENTATION) ${BASH} ${CMake_BINARY_DIR}/Utilities/Doxygen/doc_makeall.sh) -endif (BUILD_DOCUMENTATION) +endif () diff --git a/Utilities/KWStyle/CMakeLists.txt b/Utilities/KWStyle/CMakeLists.txt index b08dbde..b2c798c 100644 --- a/Utilities/KWStyle/CMakeLists.txt +++ b/Utilities/KWStyle/CMakeLists.txt @@ -47,11 +47,11 @@ if(CMAKE_USE_KWSTYLE) if(KWSTYLE_USE_VIM_FORMAT) set(KWSTYLE_ARGUMENTS -vim ${KWSTYLE_ARGUMENTS}) - endif(KWSTYLE_USE_VIM_FORMAT) + endif() if(KWSTYLE_USE_MSVC_FORMAT) set(KWSTYLE_ARGUMENTS -msvc ${KWSTYLE_ARGUMENTS}) - endif(KWSTYLE_USE_MSVC_FORMAT) + endif() configure_file(${CMake_SOURCE_DIR}/Utilities/KWStyle/CMake.kws.xml.in ${CMake_BINARY_DIR}/CMake.kws.xml) @@ -75,4 +75,4 @@ if(CMAKE_USE_KWSTYLE) ) add_custom_target(StyleCheck DEPENDS ${CMake_BINARY_DIR}/KWStyleReport.txt) -endif(CMAKE_USE_KWSTYLE) +endif() diff --git a/Utilities/Release/Cygwin/CMakeLists.txt b/Utilities/Release/Cygwin/CMakeLists.txt index 6a45361..c59a6fa 100644 --- a/Utilities/Release/Cygwin/CMakeLists.txt +++ b/Utilities/Release/Cygwin/CMakeLists.txt @@ -5,9 +5,9 @@ foreach(f ${INSTALLED_CURSES}) string(REGEX REPLACE ".*-([0-9]*).dll" "\\1" NUMBER "${f}") if(NUMBER GREATER MAX) set(MAX ${NUMBER}) - endif(NUMBER GREATER MAX) - endif(NOT "${f}" MATCHES "\\+") -endforeach(f) + endif() + endif() +endforeach() string(REGEX REPLACE "/usr/bin/" "\\1" NUMBER "${f}") set(CMAKE_NCURSES_VERSION "libncurses${MAX}") message(STATUS "Using curses version: libncurses${MAX}") diff --git a/Utilities/Release/create-cmake-release.cmake b/Utilities/Release/create-cmake-release.cmake index c304e67..37e223d 100644 --- a/Utilities/Release/create-cmake-release.cmake +++ b/Utilities/Release/create-cmake-release.cmake @@ -32,7 +32,7 @@ ${CMAKE_COMMAND} -DCMAKE_CREATE_VERSION=${CMAKE_CREATE_VERSION} -P ${CMAKE_ROOT} xterm -geometry 64x6+${x}+${y} -sb -sl 2000 -T ${f}-${CMAKE_CREATE_VERSION}.log -e tail -f ${CMAKE_CURRENT_SOURCE_DIR}/logs/${f}-${CMAKE_CREATE_VERSION}.log& ") math(EXPR i "${i}+1") - endforeach(f) + endforeach() execute_process(COMMAND chmod a+x ${filename}) endfunction() diff --git a/Utilities/Release/release_cmake.cmake b/Utilities/Release/release_cmake.cmake index 04ec2e5..f351ac8 100644 --- a/Utilities/Release/release_cmake.cmake +++ b/Utilities/Release/release_cmake.cmake @@ -3,31 +3,31 @@ get_filename_component(SCRIPT_PATH "${CMAKE_CURRENT_LIST_FILE}" PATH) # default to self extracting tgz, tgz, and tar.Z if(NOT DEFINED CPACK_BINARY_GENERATORS) set(CPACK_BINARY_GENERATORS "STGZ TGZ TZ") -endif(NOT DEFINED CPACK_BINARY_GENERATORS) +endif() if(DEFINED EXTRA_COPY) set(HAS_EXTRA_COPY 1) -endif(DEFINED EXTRA_COPY) +endif() if(NOT DEFINED CMAKE_RELEASE_DIRECTORY) set(CMAKE_RELEASE_DIRECTORY "~/CMakeReleaseDirectory") -endif(NOT DEFINED CMAKE_RELEASE_DIRECTORY) +endif() if(NOT DEFINED SCRIPT_NAME) set(SCRIPT_NAME "${HOST}") -endif(NOT DEFINED SCRIPT_NAME) +endif() if(NOT DEFINED MAKE_PROGRAM) message(FATAL_ERROR "MAKE_PROGRAM must be set") -endif(NOT DEFINED MAKE_PROGRAM) +endif() if(NOT DEFINED MAKE) set(MAKE "${MAKE_PROGRAM}") -endif(NOT DEFINED MAKE) +endif() if(NOT DEFINED RUN_SHELL) set(RUN_SHELL "/bin/sh") -endif(NOT DEFINED RUN_SHELL) +endif() if(NOT DEFINED PROCESSORS) set(PROCESSORS 1) -endif(NOT DEFINED PROCESSORS) +endif() if(NOT DEFINED CMAKE_CREATE_VERSION) message(FATAL_ERROR "CMAKE_CREATE_VERSION not defined") -endif(NOT DEFINED CMAKE_CREATE_VERSION) +endif() if(NOT DEFINED GIT_COMMAND) set(GIT_COMMAND git) endif() @@ -40,14 +40,14 @@ endif() if(NOT DEFINED FINAL_PATH ) set(FINAL_PATH ${CMAKE_RELEASE_DIRECTORY}/${CMAKE_CREATE_VERSION}-build) -endif(NOT DEFINED FINAL_PATH ) +endif() if(NOT HOST) message(FATAL_ERROR "HOST must be specified with -DHOST=host") -endif(NOT HOST) +endif() if(NOT DEFINED MAKE) message(FATAL_ERROR "MAKE must be specified with -DMAKE=\"make -j2\"") -endif(NOT DEFINED MAKE) +endif() message("Creating CMake release ${CMAKE_CREATE_VERSION} on ${HOST} with parallel = ${PROCESSORS}") @@ -57,14 +57,14 @@ macro(remote_command comment command) if(${ARGC} GREATER 2) message("ssh ${HOST} ${EXTRA_HOP} ${command}") execute_process(COMMAND ssh ${HOST} ${EXTRA_HOP} ${command} RESULT_VARIABLE result INPUT_FILE ${ARGV2}) - else(${ARGC} GREATER 2) + else() message("ssh ${HOST} ${EXTRA_HOP} ${command}") execute_process(COMMAND ssh ${HOST} ${EXTRA_HOP} ${command} RESULT_VARIABLE result) - endif(${ARGC} GREATER 2) + endif() if(${result} GREATER 0) message(FATAL_ERROR "Error running command: ${command}, return value = ${result}") - endif(${result} GREATER 0) -endmacro(remote_command) + endif() +endmacro() # set this so configure file will work from script mode # create the script specific for the given host @@ -75,10 +75,10 @@ configure_file(${SCRIPT_PATH}/release_cmake.sh.in ${SCRIPT_FILE} @ONLY) # then using the script file as input to the shell if(RUN_LOCAL) message(FATAL_ERROR "run this command: ${RUN_SHELL} ${SCRIPT_FILE}") -else(RUN_LOCAL) +else() remote_command("run release_cmake-${HOST}.sh on server" "${RUN_SHELL}" ${SCRIPT_FILE}) -endif(RUN_LOCAL) +endif() # now figure out which types of packages were created set(generators ${CPACK_BINARY_GENERATORS} ${CPACK_SOURCE_GENERATORS}) @@ -86,30 +86,30 @@ separate_arguments(generators) foreach(gen ${generators}) if("${gen}" STREQUAL "TGZ") set(SUFFIXES ${SUFFIXES} "*.tar.gz") - endif("${gen}" STREQUAL "TGZ") + endif() if("${gen}" STREQUAL "STGZ") set(SUFFIXES ${SUFFIXES} "*.sh") - endif("${gen}" STREQUAL "STGZ") + endif() if("${gen}" STREQUAL "PackageMaker") set(SUFFIXES ${SUFFIXES} "*.dmg") - endif("${gen}" STREQUAL "PackageMaker") + endif() if("${gen}" STREQUAL "TBZ2") set(SUFFIXES ${SUFFIXES} "*.tar.bz2") - endif("${gen}" STREQUAL "TBZ2") + endif() if("${gen}" MATCHES "Cygwin") set(SUFFIXES ${SUFFIXES} "*.tar.bz2") set(extra_files setup.hint) - endif("${gen}" MATCHES "Cygwin") + endif() if("${gen}" STREQUAL "TZ") set(SUFFIXES ${SUFFIXES} "*.tar.Z") - endif("${gen}" STREQUAL "TZ") + endif() if("${gen}" STREQUAL "ZIP") set(SUFFIXES ${SUFFIXES} "*.zip") - endif("${gen}" STREQUAL "ZIP") + endif() if("${gen}" STREQUAL "NSIS") set(SUFFIXES ${SUFFIXES} "*.exe") - endif("${gen}" STREQUAL "NSIS") -endforeach(gen) + endif() +endforeach() # copy all the files over from the remote machine set(PROJECT_PREFIX cmake-) foreach(suffix ${SUFFIXES}) @@ -119,8 +119,8 @@ foreach(suffix ${SUFFIXES}) RESULT_VARIABLE result) if(${result} GREATER 0) message("error getting file back scp ${HOST}:${FINAL_PATH}/${PROJECT_PREFIX}${suffix} .") - endif(${result} GREATER 0) -endforeach(suffix) + endif() +endforeach() # if there are extra files to copy get them as well if(extra_files) @@ -131,6 +131,6 @@ if(extra_files) RESULT_VARIABLE result) if(${result} GREATER 0) message("error getting file back scp ${HOST}:${FINAL_PATH}/${f} .") - endif(${result} GREATER 0) - endforeach(f) -endif(extra_files) + endif() + endforeach() +endif() diff --git a/Utilities/Release/upload_release.cmake b/Utilities/Release/upload_release.cmake index 827e683..9bf3523 100644 --- a/Utilities/Release/upload_release.cmake +++ b/Utilities/Release/upload_release.cmake @@ -34,7 +34,7 @@ foreach(file ${FILES}) math(EXPR count "${count} + 1") endif() -endforeach(file) +endforeach() if(${count} EQUAL 0) message(FATAL_ERROR "Error no files uploaded.") endif() diff --git a/cmake_uninstall.cmake.in b/cmake_uninstall.cmake.in index 0005d9e..7cd7fc1 100644 --- a/cmake_uninstall.cmake.in +++ b/cmake_uninstall.cmake.in @@ -1,6 +1,6 @@ if(NOT EXISTS "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt") message(FATAL_ERROR "Cannot find install manifest: \"@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt\"") -endif(NOT EXISTS "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt") +endif() file(READ "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt" files) string(REGEX REPLACE "\n" ";" files "${files}") @@ -13,10 +13,10 @@ foreach(file ${files}) RETURN_VALUE rm_retval ) if("${rm_retval}" STREQUAL 0) - else("${rm_retval}" STREQUAL 0) + else() message(FATAL_ERROR "Problem when removing \"$ENV{DESTDIR}${file}\"") - endif("${rm_retval}" STREQUAL 0) - else(EXISTS "$ENV{DESTDIR}${file}") + endif() + else() message(STATUS "File \"$ENV{DESTDIR}${file}\" does not exist.") - endif(EXISTS "$ENV{DESTDIR}${file}") -endforeach(file) + endif() +endforeach() |