diff options
author | Kitware Robot <kwrobot@kitware.com> | 2012-08-13 17:47:32 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2012-08-13 18:19:16 (GMT) |
commit | 77543bde41b0e52c3959016698b529835945d62d (patch) | |
tree | ff63e5fbec326c4a5d821e7496c6d2cb52f75b92 /Source | |
parent | 7bbaa4283de26864b2e55e819db0884771585467 (diff) | |
download | CMake-77543bde41b0e52c3959016698b529835945d62d.zip CMake-77543bde41b0e52c3959016698b529835945d62d.tar.gz CMake-77543bde41b0e52c3959016698b529835945d62d.tar.bz2 |
Convert CMake-language commands to lower case
Ancient CMake versions required upper-case commands. Later command
names became case-insensitive. Now the preferred style is lower-case.
Run the following shell code:
cmake --help-command-list |
grep -v "cmake version" |
while read c; do
echo 's/\b'"$(echo $c | tr '[:lower:]' '[:upper:]')"'\(\s*\)(/'"$c"'\1(/g'
done >convert.sed &&
git ls-files -z -- bootstrap '*.cmake' '*.cmake.in' '*CMakeLists.txt' |
egrep -z -v '^(Utilities/cm|Source/kwsys/)' |
xargs -0 sed -i -f convert.sed &&
rm convert.sed
Diffstat (limited to 'Source')
-rw-r--r-- | Source/CMakeLists.txt | 264 | ||||
-rw-r--r-- | Source/CMakeVersion.cmake | 10 | ||||
-rw-r--r-- | Source/CursesDialog/CMakeLists.txt | 14 | ||||
-rw-r--r-- | Source/CursesDialog/form/CMakeLists.txt | 22 | ||||
-rw-r--r-- | Source/QtDialog/CMakeLists.txt | 82 | ||||
-rw-r--r-- | Source/QtDialog/QtDialogCPack.cmake.in | 22 |
6 files changed, 207 insertions, 207 deletions
diff --git a/Source/CMakeLists.txt b/Source/CMakeLists.txt index e9c5a58..106e78f 100644 --- a/Source/CMakeLists.txt +++ b/Source/CMakeLists.txt @@ -9,33 +9,33 @@ # implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. # See the License for more information. #============================================================================= -INCLUDE(CheckIncludeFile) +include(CheckIncludeFile) # Check if we can build support for ELF parsing. CHECK_INCLUDE_FILE("elf.h" HAVE_ELF_H) -IF(HAVE_ELF_H) - SET(CMAKE_USE_ELF_PARSER 1) -ELSE(HAVE_ELF_H) - SET(CMAKE_USE_ELF_PARSER) -ENDIF(HAVE_ELF_H) +if(HAVE_ELF_H) + set(CMAKE_USE_ELF_PARSER 1) +else(HAVE_ELF_H) + set(CMAKE_USE_ELF_PARSER) +endif(HAVE_ELF_H) -SET(EXECUTABLE_OUTPUT_PATH ${CMake_BIN_DIR}) +set(EXECUTABLE_OUTPUT_PATH ${CMake_BIN_DIR}) # configure the .h file -CONFIGURE_FILE( +configure_file( "${CMake_SOURCE_DIR}/Source/cmConfigure.cmake.h.in" "${CMake_BINARY_DIR}/Source/cmConfigure.h" ) -CONFIGURE_FILE( +configure_file( "${CMake_SOURCE_DIR}/Source/cmVersionConfig.h.in" "${CMake_BINARY_DIR}/Source/cmVersionConfig.h" ) -CONFIGURE_FILE( +configure_file( "${CMake_SOURCE_DIR}/Source/CPack/cmCPackConfigure.h.in" "${CMake_BINARY_DIR}/Source/CPack/cmCPackConfigure.h" ) # add the include path to find the .h -INCLUDE_DIRECTORIES( +include_directories( "${CMake_BINARY_DIR}/Source" "${CMake_SOURCE_DIR}/Source" ${CMAKE_ZLIB_INCLUDES} @@ -45,72 +45,72 @@ INCLUDE_DIRECTORIES( ) # let cmake know it is supposed to use it -ADD_DEFINITIONS(-DCMAKE_BUILD_WITH_CMAKE) +add_definitions(-DCMAKE_BUILD_WITH_CMAKE) -OPTION(CMAKE_REGENERATE_YACCLEX +option(CMAKE_REGENERATE_YACCLEX "Regenerate YACC and LEXX files" OFF) -MARK_AS_ADVANCED(CMAKE_REGENERATE_YACCLEX) -IF(CMAKE_REGENERATE_YACCLEX) - SET(parsersLexers cmDependsFortran cmCommandArgument cmExpr) - FIND_PROGRAM(YACC_EXECUTABLE +mark_as_advanced(CMAKE_REGENERATE_YACCLEX) +if(CMAKE_REGENERATE_YACCLEX) + set(parsersLexers cmDependsFortran cmCommandArgument cmExpr) + find_program(YACC_EXECUTABLE NAMES yacc bison PATHS /usr/bin DOC "Yacc or Bison executable") - FIND_PROGRAM(FLEX_EXECUTABLE + find_program(FLEX_EXECUTABLE NAMES flex PATHS /usr/bin DOC "Flex executable") - MARK_AS_ADVANCED(YACC_EXECUTABLE FLEX_EXECUTABLE) - IF(YACC_EXECUTABLE) - SET(BISON_FLAGS) - IF(YACC_EXECUTABLE MATCHES "bison") - SET(BISON_FLAGS "--yacc") - ENDIF(YACC_EXECUTABLE MATCHES "bison") - SET(yacc_files) - FOREACH(name ${parsersLexers}) - SET(src "${CMAKE_CURRENT_SOURCE_DIR}/${name}Parser.y") - SET(dst "${CMAKE_CURRENT_BINARY_DIR}/${name}Parser.cxx") - SET(hdr "${CMAKE_CURRENT_BINARY_DIR}/${name}ParserTokens.h") - ADD_CUSTOM_COMMAND( + mark_as_advanced(YACC_EXECUTABLE FLEX_EXECUTABLE) + if(YACC_EXECUTABLE) + set(BISON_FLAGS) + if(YACC_EXECUTABLE MATCHES "bison") + set(BISON_FLAGS "--yacc") + endif(YACC_EXECUTABLE MATCHES "bison") + set(yacc_files) + foreach(name ${parsersLexers}) + set(src "${CMAKE_CURRENT_SOURCE_DIR}/${name}Parser.y") + set(dst "${CMAKE_CURRENT_BINARY_DIR}/${name}Parser.cxx") + set(hdr "${CMAKE_CURRENT_BINARY_DIR}/${name}ParserTokens.h") + add_custom_command( OUTPUT "${dst}" DEPENDS "${src}" COMMAND ${YACC_EXECUTABLE} --name-prefix=${name}_yy --defines=${hdr} -o${dst} ${src} ) - SET(yacc_files ${yacc_files} "${dst}") - ENDFOREACH(name) - ADD_CUSTOM_TARGET(RerunYacc DEPENDS ${yacc_files}) - ENDIF(YACC_EXECUTABLE) - IF(FLEX_EXECUTABLE) - SET(lex_files) - FOREACH(name ${parsersLexers}) - SET(src "${CMAKE_CURRENT_SOURCE_DIR}/${name}Lexer.in.l") - SET(dst "${CMAKE_CURRENT_BINARY_DIR}/${name}Lexer.cxx") - SET(hdr "${CMAKE_CURRENT_BINARY_DIR}/${name}Lexer.h") - ADD_CUSTOM_COMMAND( + set(yacc_files ${yacc_files} "${dst}") + endforeach(name) + add_custom_target(RerunYacc DEPENDS ${yacc_files}) + endif(YACC_EXECUTABLE) + if(FLEX_EXECUTABLE) + set(lex_files) + foreach(name ${parsersLexers}) + set(src "${CMAKE_CURRENT_SOURCE_DIR}/${name}Lexer.in.l") + set(dst "${CMAKE_CURRENT_BINARY_DIR}/${name}Lexer.cxx") + set(hdr "${CMAKE_CURRENT_BINARY_DIR}/${name}Lexer.h") + add_custom_command( OUTPUT "${dst}" DEPENDS "${src}" COMMAND ${FLEX_EXECUTABLE} --prefix=${name}_yy --header-file=${hdr} -o${dst} ${src} ) - SET(lex_files ${lex_files} "${dst}") - ENDFOREACH(name) - ADD_CUSTOM_TARGET(RerunLex DEPENDS ${lex_files}) - ENDIF(FLEX_EXECUTABLE) + set(lex_files ${lex_files} "${dst}") + endforeach(name) + add_custom_target(RerunLex DEPENDS ${lex_files}) + endif(FLEX_EXECUTABLE) -ENDIF(CMAKE_REGENERATE_YACCLEX) +endif(CMAKE_REGENERATE_YACCLEX) # 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) +if(CMAKE_USE_ELF_PARSER) + set(ELF_SRCS cmELF.h cmELF.cxx) +endif(CMAKE_USE_ELF_PARSER) # # Sources for CMakeLib # -SET(SRCS +set(SRCS cmStandardIncludes.cxx cmArchiveWrite.cxx cmBootstrapCommands.cxx @@ -275,30 +275,30 @@ SET(SRCS ) # Kdevelop only works on UNIX and not windows -IF(UNIX) - SET(SRCS ${SRCS} cmGlobalKdevelopGenerator.cxx) -ENDIF(UNIX) +if(UNIX) + set(SRCS ${SRCS} cmGlobalKdevelopGenerator.cxx) +endif(UNIX) # Xcode only works on Apple -IF(APPLE) - SET(SRCS ${SRCS} +if(APPLE) + set(SRCS ${SRCS} cmXCodeObject.cxx cmXCode21Object.cxx cmGlobalXCodeGenerator.cxx cmGlobalXCodeGenerator.h cmLocalXCodeGenerator.cxx cmLocalXCodeGenerator.h) -ENDIF(APPLE) +endif(APPLE) -IF (WIN32) - SET(SRCS ${SRCS} +if (WIN32) + set(SRCS ${SRCS} cmCallVisualStudioMacro.cxx cmCallVisualStudioMacro.h ) - IF(NOT UNIX) - SET(SRCS ${SRCS} + if(NOT UNIX) + set(SRCS ${SRCS} cmGlobalBorlandMakefileGenerator.cxx cmGlobalBorlandMakefileGenerator.h cmGlobalMSYSMakefileGenerator.cxx @@ -356,11 +356,11 @@ IF (WIN32) cmWin32ProcessExecution.cxx cmWin32ProcessExecution.h ) - ENDIF(NOT UNIX) -ENDIF (WIN32) + endif(NOT UNIX) +endif (WIN32) # Ninja support -SET(SRCS ${SRCS} +set(SRCS ${SRCS} cmGlobalNinjaGenerator.cxx cmGlobalNinjaGenerator.h cmNinjaTypes.h @@ -373,34 +373,34 @@ SET(SRCS ${SRCS} cmNinjaUtilityTargetGenerator.cxx cmNinjaUtilityTargetGenerator.h ) -IF(WIN32 AND NOT CYGWIN AND NOT BORLAND) - SET_SOURCE_FILES_PROPERTIES(cmcldeps.cxx PROPERTIES COMPILE_DEFINITIONS _WIN32_WINNT=0x0501) - ADD_EXECUTABLE(cmcldeps cmcldeps.cxx) - TARGET_LINK_LIBRARIES(cmcldeps CMakeLib) - INSTALL_TARGETS(/bin cmcldeps) -ENDIF() +if(WIN32 AND NOT CYGWIN AND NOT BORLAND) + set_source_files_properties(cmcldeps.cxx PROPERTIES COMPILE_DEFINITIONS _WIN32_WINNT=0x0501) + add_executable(cmcldeps cmcldeps.cxx) + target_link_libraries(cmcldeps CMakeLib) + install_targets(/bin cmcldeps) +endif() # create a library used by the command line and the GUI -ADD_LIBRARY(CMakeLib ${SRCS}) -TARGET_LINK_LIBRARIES(CMakeLib cmsys +add_library(CMakeLib ${SRCS}) +target_link_libraries(CMakeLib cmsys ${CMAKE_EXPAT_LIBRARIES} ${CMAKE_ZLIB_LIBRARIES} ${CMAKE_TAR_LIBRARIES} ${CMAKE_COMPRESS_LIBRARIES} ${CMAKE_CURL_LIBRARIES} ) # On Apple we need CoreFoundation -IF(APPLE) - TARGET_LINK_LIBRARIES(CMakeLib "-framework CoreFoundation") -ENDIF(APPLE) +if(APPLE) + target_link_libraries(CMakeLib "-framework CoreFoundation") +endif(APPLE) # 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) +if(CMAKE_BUILD_ON_VISUAL_STUDIO OR MINGW) + target_link_libraries(CMakeLib rpcrt4) +endif(CMAKE_BUILD_ON_VISUAL_STUDIO OR MINGW) # # CTestLib # -INCLUDE_DIRECTORIES( +include_directories( "${CMake_SOURCE_DIR}/Source/CTest" ${CMAKE_XMLRPC_INCLUDES} ${CMAKE_CURL_INCLUDES} @@ -408,7 +408,7 @@ INCLUDE_DIRECTORIES( # # Sources for CTestLib # -SET(CTEST_SRCS cmCTest.cxx +set(CTEST_SRCS cmCTest.cxx CTest/cmProcess.cxx CTest/cmCTestBatchTestHandler.cxx CTest/cmCTestBuildAndTestHandler.cxx @@ -461,13 +461,13 @@ SET(CTEST_SRCS cmCTest.cxx ) # Build CTestLib -ADD_LIBRARY(CTestLib ${CTEST_SRCS}) -TARGET_LINK_LIBRARIES(CTestLib CMakeLib ${CMAKE_CURL_LIBRARIES} ${CMAKE_XMLRPC_LIBRARIES}) +add_library(CTestLib ${CTEST_SRCS}) +target_link_libraries(CTestLib CMakeLib ${CMAKE_CURL_LIBRARIES} ${CMAKE_XMLRPC_LIBRARIES}) # # Sources for CPack # -SET(CPACK_SRCS +set(CPACK_SRCS CPack/cmCPackArchiveGenerator.cxx CPack/cmCPackComponentGroup.cxx CPack/cmCPackGeneratorFactory.cxx @@ -483,82 +483,82 @@ SET(CPACK_SRCS CPack/cmCPackDocumentMacros.cxx ) -IF(CYGWIN) - SET(CPACK_SRCS ${CPACK_SRCS} +if(CYGWIN) + set(CPACK_SRCS ${CPACK_SRCS} CPack/cmCPackCygwinBinaryGenerator.cxx CPack/cmCPackCygwinSourceGenerator.cxx ) -ENDIF(CYGWIN) +endif(CYGWIN) -IF(UNIX) - SET(CPACK_SRCS ${CPACK_SRCS} +if(UNIX) + set(CPACK_SRCS ${CPACK_SRCS} CPack/cmCPackDebGenerator.cxx CPack/cmCPackRPMGenerator.cxx ) -ENDIF(UNIX) +endif(UNIX) -IF(APPLE) - SET(CPACK_SRCS ${CPACK_SRCS} +if(APPLE) + set(CPACK_SRCS ${CPACK_SRCS} CPack/cmCPackBundleGenerator.cxx CPack/cmCPackDragNDropGenerator.cxx CPack/cmCPackOSXX11Generator.cxx CPack/cmCPackPackageMakerGenerator.cxx ) -ENDIF(APPLE) +endif(APPLE) # Build CPackLib -ADD_LIBRARY(CPackLib ${CPACK_SRCS}) -TARGET_LINK_LIBRARIES(CPackLib CMakeLib) +add_library(CPackLib ${CPACK_SRCS}) +target_link_libraries(CPackLib CMakeLib) -IF(APPLE) - ADD_EXECUTABLE(cmakexbuild cmakexbuild.cxx) - TARGET_LINK_LIBRARIES(cmakexbuild CMakeLib) - ADD_EXECUTABLE(OSXScriptLauncher +if(APPLE) + add_executable(cmakexbuild cmakexbuild.cxx) + target_link_libraries(cmakexbuild CMakeLib) + add_executable(OSXScriptLauncher CPack/OSXScriptLauncher.cxx) - TARGET_LINK_LIBRARIES(OSXScriptLauncher cmsys) - TARGET_LINK_LIBRARIES(OSXScriptLauncher "-framework CoreFoundation") -ENDIF(APPLE) + target_link_libraries(OSXScriptLauncher cmsys) + target_link_libraries(OSXScriptLauncher "-framework CoreFoundation") +endif(APPLE) # Build CMake executable -ADD_EXECUTABLE(cmake cmakemain.cxx) -TARGET_LINK_LIBRARIES(cmake CMakeLib) +add_executable(cmake cmakemain.cxx) +target_link_libraries(cmake CMakeLib) # Build special executable for running programs on Windows 98 -IF(WIN32) - IF(NOT UNIX) - ADD_EXECUTABLE(cmw9xcom cmw9xcom.cxx) - TARGET_LINK_LIBRARIES(cmw9xcom CMakeLib) - INSTALL_TARGETS(/bin cmw9xcom) - ENDIF(NOT UNIX) -ENDIF(WIN32) +if(WIN32) + if(NOT UNIX) + add_executable(cmw9xcom cmw9xcom.cxx) + target_link_libraries(cmw9xcom CMakeLib) + install_targets(/bin cmw9xcom) + endif(NOT UNIX) +endif(WIN32) # Build CTest executable -ADD_EXECUTABLE(ctest ctest.cxx) -TARGET_LINK_LIBRARIES(ctest CTestLib) +add_executable(ctest ctest.cxx) +target_link_libraries(ctest CTestLib) # Build CPack executable -ADD_EXECUTABLE(cpack CPack/cpack.cxx) -TARGET_LINK_LIBRARIES(cpack CPackLib) +add_executable(cpack CPack/cpack.cxx) +target_link_libraries(cpack CPackLib) # Curses GUI -IF(BUILD_CursesDialog) - INCLUDE(${CMake_SOURCE_DIR}/Source/CursesDialog/CMakeLists.txt) -ENDIF(BUILD_CursesDialog) +if(BUILD_CursesDialog) + include(${CMake_SOURCE_DIR}/Source/CursesDialog/CMakeLists.txt) +endif(BUILD_CursesDialog) # Qt GUI -OPTION(BUILD_QtDialog "Build Qt dialog for CMake" FALSE) -IF(BUILD_QtDialog) - SUBDIRS(QtDialog) -ENDIF(BUILD_QtDialog) - -INCLUDE (${CMake_BINARY_DIR}/Source/LocalUserOptions.cmake OPTIONAL) -INCLUDE (${CMake_SOURCE_DIR}/Source/LocalUserOptions.cmake OPTIONAL) - -INSTALL_TARGETS(/bin cmake) -INSTALL_TARGETS(/bin ctest) -INSTALL_TARGETS(/bin cpack) -IF(APPLE) - INSTALL_TARGETS(/bin cmakexbuild) -ENDIF(APPLE) - -INSTALL_FILES(${CMAKE_DATA_DIR}/include cmCPluginAPI.h) +option(BUILD_QtDialog "Build Qt dialog for CMake" FALSE) +if(BUILD_QtDialog) + subdirs(QtDialog) +endif(BUILD_QtDialog) + +include (${CMake_BINARY_DIR}/Source/LocalUserOptions.cmake OPTIONAL) +include (${CMake_SOURCE_DIR}/Source/LocalUserOptions.cmake OPTIONAL) + +install_targets(/bin cmake) +install_targets(/bin ctest) +install_targets(/bin cpack) +if(APPLE) + install_targets(/bin cmakexbuild) +endif(APPLE) + +install_files(${CMAKE_DATA_DIR}/include cmCPluginAPI.h) diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake index 0181722..a18d820 100644 --- a/Source/CMakeVersion.cmake +++ b/Source/CMakeVersion.cmake @@ -1,6 +1,6 @@ # CMake version number components. -SET(CMake_VERSION_MAJOR 2) -SET(CMake_VERSION_MINOR 8) -SET(CMake_VERSION_PATCH 9) -SET(CMake_VERSION_TWEAK 20120813) -#SET(CMake_VERSION_RC 1) +set(CMake_VERSION_MAJOR 2) +set(CMake_VERSION_MINOR 8) +set(CMake_VERSION_PATCH 9) +set(CMake_VERSION_TWEAK 20120813) +#set(CMake_VERSION_RC 1) diff --git a/Source/CursesDialog/CMakeLists.txt b/Source/CursesDialog/CMakeLists.txt index 3349ebe..96e28b4 100644 --- a/Source/CursesDialog/CMakeLists.txt +++ b/Source/CursesDialog/CMakeLists.txt @@ -10,7 +10,7 @@ # See the License for more information. #============================================================================= -SET( CURSES_SRCS +set( CURSES_SRCS CursesDialog/cmCursesBoolWidget CursesDialog/cmCursesCacheEntryComposite CursesDialog/cmCursesDummyWidget @@ -25,13 +25,13 @@ SET( CURSES_SRCS CursesDialog/ccmake ) -INCLUDE_DIRECTORIES(${CMake_SOURCE_DIR}/Source/CursesDialog/form +include_directories(${CMake_SOURCE_DIR}/Source/CursesDialog/form ${CMake_BINARY_DIR}/Source/CursesDialog/form) -INCLUDE_DIRECTORIES(${CURSES_INCLUDE_PATH}) +include_directories(${CURSES_INCLUDE_PATH}) -ADD_EXECUTABLE(ccmake ${CURSES_SRCS} ) -TARGET_LINK_LIBRARIES(ccmake CMakeLib) -TARGET_LINK_LIBRARIES(ccmake cmForm) +add_executable(ccmake ${CURSES_SRCS} ) +target_link_libraries(ccmake CMakeLib) +target_link_libraries(ccmake cmForm) -INSTALL_TARGETS(/bin ccmake) +install_targets(/bin ccmake) diff --git a/Source/CursesDialog/form/CMakeLists.txt b/Source/CursesDialog/form/CMakeLists.txt index 2435f393..d5cc1bd 100644 --- a/Source/CursesDialog/form/CMakeLists.txt +++ b/Source/CursesDialog/form/CMakeLists.txt @@ -9,14 +9,14 @@ # implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. # See the License for more information. #============================================================================= -PROJECT(CMAKE_FORM) +project(CMAKE_FORM) -INCLUDE_REGULAR_EXPRESSION("^.*$") -INCLUDE_DIRECTORIES(${CURSES_INCLUDE_PATH} "${CMAKE_CURRENT_BINARY_DIR}") +include_regular_expression("^.*$") +include_directories(${CURSES_INCLUDE_PATH} "${CMAKE_CURRENT_BINARY_DIR}") -CONFIGURE_FILE(cmFormConfigure.h.in "${CMAKE_CURRENT_BINARY_DIR}/cmFormConfigure.h") +configure_file(cmFormConfigure.h.in "${CMAKE_CURRENT_BINARY_DIR}/cmFormConfigure.h") -SET( FORM_SRCS +set( FORM_SRCS fld_arg.c fld_attr.c fld_current.c @@ -58,9 +58,9 @@ SET( FORM_SRCS fty_regex.c ) -INCLUDE_DIRECTORIES(${CMAKE_FORM_SOURCE_DIR}) -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) +include_directories(${CMAKE_FORM_SOURCE_DIR}) +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) diff --git a/Source/QtDialog/CMakeLists.txt b/Source/QtDialog/CMakeLists.txt index 07ec106..d962d8d 100644 --- a/Source/QtDialog/CMakeLists.txt +++ b/Source/QtDialog/CMakeLists.txt @@ -9,17 +9,17 @@ # implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. # See the License for more information. #============================================================================= -PROJECT(QtDialog) -SET(QT_MIN_VERSION "4.4.0") -FIND_PACKAGE(Qt4 REQUIRED) +project(QtDialog) +set(QT_MIN_VERSION "4.4.0") +find_package(Qt4 REQUIRED) -IF(NOT QT4_FOUND) - MESSAGE(SEND_ERROR "Failed to find Qt 4.4 or greater.") -ELSE(NOT QT4_FOUND) +if(NOT QT4_FOUND) + message(SEND_ERROR "Failed to find Qt 4.4 or greater.") +else(NOT QT4_FOUND) - INCLUDE(${QT_USE_FILE}) - SET(CMAKE_PACKAGE_QTGUI TRUE) - SET(SRCS + include(${QT_USE_FILE}) + set(CMAKE_PACKAGE_QTGUI TRUE) + set(SRCS AddCacheEntry.cxx AddCacheEntry.h CMakeSetup.cxx @@ -55,53 +55,53 @@ ELSE(NOT QT4_FOUND) ) QT4_ADD_RESOURCES(RC_SRCS CMakeSetup.qrc) - SET(SRCS ${SRCS} ${UI_SRCS} ${MOC_SRCS} ${RC_SRCS}) - IF(Q_WS_WIN) - SET(SRCS ${SRCS} CMakeSetup.rc) - ENDIF(Q_WS_WIN) - IF(Q_WS_MAC) - SET(SRCS ${SRCS} CMakeSetup.icns) - SET(MACOSX_BUNDLE_ICON_FILE CMakeSetup.icns) - SET_SOURCE_FILES_PROPERTIES(CMakeSetup.icns PROPERTIES + set(SRCS ${SRCS} ${UI_SRCS} ${MOC_SRCS} ${RC_SRCS}) + if(Q_WS_WIN) + set(SRCS ${SRCS} CMakeSetup.rc) + endif(Q_WS_WIN) + 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(Q_WS_MAC) - INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}) - INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) + include_directories(${CMAKE_CURRENT_BINARY_DIR}) + include_directories(${CMAKE_CURRENT_SOURCE_DIR}) - ADD_EXECUTABLE(cmake-gui WIN32 MACOSX_BUNDLE ${SRCS}) - TARGET_LINK_LIBRARIES(cmake-gui CMakeLib ${QT_QTMAIN_LIBRARY} ${QT_LIBRARIES}) - IF(${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION} GREATER 2.4) - IF(APPLE) - SET_TARGET_PROPERTIES(cmake-gui PROPERTIES + add_executable(cmake-gui WIN32 MACOSX_BUNDLE ${SRCS}) + target_link_libraries(cmake-gui CMakeLib ${QT_QTMAIN_LIBRARY} ${QT_LIBRARIES}) + if(${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION} GREATER 2.4) + if(APPLE) + set_target_properties(cmake-gui PROPERTIES OUTPUT_NAME ${CMAKE_BUNDLE_NAME}) - ENDIF(APPLE) - SET(CMAKE_INSTALL_DESTINATION_ARGS + endif(APPLE) + set(CMAKE_INSTALL_DESTINATION_ARGS BUNDLE DESTINATION "${CMAKE_BUNDLE_LOCATION}") - ENDIF(${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION} GREATER 2.4) + endif(${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION} GREATER 2.4) - INSTALL(TARGETS cmake-gui RUNTIME DESTINATION bin ${CMAKE_INSTALL_DESTINATION_ARGS}) + install(TARGETS cmake-gui RUNTIME DESTINATION bin ${CMAKE_INSTALL_DESTINATION_ARGS}) - IF(UNIX) + if(UNIX) # install a desktop file so CMake appears in the application start menu # with an icon - INSTALL(FILES CMake.desktop DESTINATION share/applications ) - INSTALL(FILES CMakeSetup32.png DESTINATION share/pixmaps ) - INSTALL(FILES cmakecache.xml DESTINATION share/mime/packages ) - ENDIF(UNIX) + install(FILES CMake.desktop DESTINATION share/applications ) + install(FILES CMakeSetup32.png DESTINATION share/pixmaps ) + install(FILES cmakecache.xml DESTINATION share/mime/packages ) + endif(UNIX) - IF(APPLE) - SET(CMAKE_POSTFLIGHT_SCRIPT + if(APPLE) + set(CMAKE_POSTFLIGHT_SCRIPT "${CMake_BINARY_DIR}/Source/QtDialog/postflight.sh") - SET(CMAKE_POSTUPGRADE_SCRIPT + set(CMAKE_POSTUPGRADE_SCRIPT "${CMake_BINARY_DIR}/Source/QtDialog/postupgrade.sh") configure_file("${CMake_SOURCE_DIR}/Source/QtDialog/postflight.sh.in" "${CMake_BINARY_DIR}/Source/QtDialog/postflight.sh") configure_file("${CMake_SOURCE_DIR}/Source/QtDialog/postupgrade.sh.in" "${CMake_BINARY_DIR}/Source/QtDialog/postupgrade.sh") - INSTALL(CODE "execute_process(COMMAND ln -s \"../MacOS/${CMAKE_BUNDLE_NAME}\" cmake-gui + install(CODE "execute_process(COMMAND ln -s \"../MacOS/${CMAKE_BUNDLE_NAME}\" cmake-gui WORKING_DIRECTORY \$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX}/bin)") - ENDIF(APPLE) + endif(APPLE) if(APPLE OR WIN32) # install rules for including 3rd party libs such as Qt @@ -117,7 +117,7 @@ ELSE(NOT QT4_FOUND) ") endif(APPLE OR WIN32) - CONFIGURE_FILE("${QtDialog_SOURCE_DIR}/QtDialogCPack.cmake.in" + configure_file("${QtDialog_SOURCE_DIR}/QtDialogCPack.cmake.in" "${QtDialog_BINARY_DIR}/QtDialogCPack.cmake" @ONLY) -ENDIF(NOT QT4_FOUND) +endif(NOT QT4_FOUND) diff --git a/Source/QtDialog/QtDialogCPack.cmake.in b/Source/QtDialog/QtDialogCPack.cmake.in index e73e23f..f43e1c3 100644 --- a/Source/QtDialog/QtDialogCPack.cmake.in +++ b/Source/QtDialog/QtDialogCPack.cmake.in @@ -1,18 +1,18 @@ -SET(IS_APPLE @APPLE@) -SET(CMAKE_PACKAGE_QTGUI @CMAKE_PACKAGE_QTGUI@) +set(IS_APPLE @APPLE@) +set(CMAKE_PACKAGE_QTGUI @CMAKE_PACKAGE_QTGUI@) -IF(CMAKE_PACKAGE_QTGUI) - SET(CPACK_PACKAGE_EXECUTABLES "cmake-gui" "CMake (cmake-gui)" ${CPACK_PACKAGE_EXECUTABLES}) - SET(CPACK_CREATE_DESKTOP_LINKS "cmake-gui" ${CPACK_CREATE_DESKTOP_LINKS}) - IF(IS_APPLE) +if(CMAKE_PACKAGE_QTGUI) + set(CPACK_PACKAGE_EXECUTABLES "cmake-gui" "CMake (cmake-gui)" ${CPACK_PACKAGE_EXECUTABLES}) + set(CPACK_CREATE_DESKTOP_LINKS "cmake-gui" ${CPACK_CREATE_DESKTOP_LINKS}) + if(IS_APPLE) # for apple install we set the install prefix to # / and then install # cmake into the bundle for cmake-gui and must use DESTDIR - SET(CPACK_SET_DESTDIR TRUE) + set(CPACK_SET_DESTDIR TRUE) # 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) + set(CPACK_POSTFLIGHT_SCRIPT "@CMAKE_POSTFLIGHT_SCRIPT@") + set(CPACK_POSTUPGRADE_SCRIPT "@CMAKE_POSTUPGRADE_SCRIPT@") + endif(IS_APPLE) +endif(CMAKE_PACKAGE_QTGUI) |