From: John L. <jr...@us...> - 2011-11-15 04:59:15
|
Update of /cvsroot/wxlua/wxLua/build In directory vz-cvs-4.sog:/tmp/cvs-serv13675/build Modified Files: CMakeFunctions.txt Log Message: Add new client/server example, thanks to Andre Arpin. Fix image sample bug. Minor CMake build fixes. Index: CMakeFunctions.txt =================================================================== RCS file: /cvsroot/wxlua/wxLua/build/CMakeFunctions.txt,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** CMakeFunctions.txt 12 Nov 2011 05:44:48 -0000 1.4 --- CMakeFunctions.txt 15 Nov 2011 04:59:13 -0000 1.5 *************** *** 19,23 **** # ADD_TEST() - overrides CMake's ADD_TEST(), remembers what was added # ADD_GTEST() - Add a test using Google's GTest, tests for failure. ! # ADD_STATIC_ANALYSIS_TEST() - Add test using cppcheck (if available) # # ADD_LIBRARY_FULL() - Complete wrapper for ADD_LIBRARY() with many conveniences. --- 19,23 ---- # ADD_TEST() - overrides CMake's ADD_TEST(), remembers what was added # ADD_GTEST() - Add a test using Google's GTest, tests for failure. ! # ADD_CPPCHECK_TEST() - Add a static analysis test using cppcheck (if available) # # ADD_LIBRARY_FULL() - Complete wrapper for ADD_LIBRARY() with many conveniences. *************** *** 39,52 **** # are not cached so it needs to be be run for each configuration. # Using properties does the trick of storing a variable per configuration run, ! # accessible at all scopes, but having it cleared for the next run. # =========================================================================== ! get_property(PROP_CMAKEFUNCTIONS_RUN_ONCE GLOBAL PROPERTY CMAKEFUNCTIONS_RUN_ONCE SET) ! if (PROP_CMAKEFUNCTIONS_RUN_ONCE) return() endif() ! set_property(GLOBAL PROPERTY CMAKEFUNCTIONS_RUN_ONCE TRUE) # =========================================================================== --- 39,54 ---- # are not cached so it needs to be be run for each configuration. # Using properties does the trick of storing a variable per configuration run, ! # accessible at all scopes like a cache var, but it is cleared each run. # =========================================================================== ! get_property(CMAKEFUNCTIONS_RUN_ONCE_CALLED DIRECTORY ${CMAKE_HOME_DIRECTORY} ! PROPERTY CMAKEFUNCTIONS_RUN_ONCE SET) ! if (CMAKEFUNCTIONS_RUN_ONCE_CALLED) return() endif() ! set_property(DIRECTORY ${CMAKE_HOME_DIRECTORY} ! PROPERTY CMAKEFUNCTIONS_RUN_ONCE TRUE) # =========================================================================== *************** *** 122,126 **** endif() endforeach() - ENDFUNCTION() --- 124,127 ---- *************** *** 136,140 **** FUNCTION( GET_OBJECT_FILES target_name object_file_list source_files ) - if (MSVC) foreach(f ${source_files}) --- 137,140 ---- *************** *** 149,153 **** endforeach() else() - # Backwards compat to CMake <= 2.8.4 if ("${CMAKE_CURRENT_LIST_DIR}" STREQUAL "") --- 149,152 ---- *************** *** 182,188 **** UNSET(ADD_TEST_DIR_LIST CACHE) UNSET(ADD_TEST_DIR_NAME_LIST CACHE) ! UNSET(ADD_STATIC_ANALYSIS_TEST_LIST CACHE) ! UNSET(ADD_STATIC_ANALYSIS_TEST_DIR_LIST CACHE) ! UNSET(ADD_STATIC_ANALYSIS_TEST_DIR_NAME_LIST CACHE) # --------------------------------------------------------------------------- --- 181,187 ---- UNSET(ADD_TEST_DIR_LIST CACHE) UNSET(ADD_TEST_DIR_NAME_LIST CACHE) ! UNSET(ADD_CPPCHECK_TEST_LIST CACHE) ! UNSET(ADD_CPPCHECK_TEST_DIR_LIST CACHE) ! UNSET(ADD_CPPCHECK_TEST_DIR_NAME_LIST CACHE) # --------------------------------------------------------------------------- *************** *** 190,197 **** # --------------------------------------------------------------------------- FUNCTION( PRINT_ADD_SUBDIRECTORY ) ! MESSAGE( STATUS "* Subdirectories that contain generated build files from ADD_SUBDIRECTORY():" ) ! LIST(SORT ADD_SUBDIRECTORY_LIST) # ok to sort this list inplace ! STRING(REGEX REPLACE ";" "\n* - " ADD_SUBDIRECTORY_LIST_STR "${ADD_SUBDIRECTORY_LIST}") MESSAGE( STATUS "* - ${ADD_SUBDIRECTORY_LIST_STR}") ENDFUNCTION() --- 189,197 ---- # --------------------------------------------------------------------------- FUNCTION( PRINT_ADD_SUBDIRECTORY ) ! MESSAGE( STATUS "* Subdirectories that contain projects from ADD_SUBDIRECTORY():" ) ! SET(ADD_SUBDIRECTORY_LIST_SORTED ${ADD_SUBDIRECTORY_LIST}) ! LIST(SORT ADD_SUBDIRECTORY_LIST_SORTED) ! STRING(REGEX REPLACE ";" "\n* - " ADD_SUBDIRECTORY_LIST_STR "${ADD_SUBDIRECTORY_LIST_SORTED}") MESSAGE( STATUS "* - ${ADD_SUBDIRECTORY_LIST_STR}") ENDFUNCTION() *************** *** 222,226 **** # --------------------------------------------------------------------------- ! # Replace the ADD_SUBDIRECTORY() function to remember what # subdirectories were added so we can do things with them. # --------------------------------------------------------------------------- --- 222,226 ---- # --------------------------------------------------------------------------- ! # Replace the ADD_SUBDIRECTORY(source_dir) function to remember what # subdirectories were added so we can do things with them. # --------------------------------------------------------------------------- *************** *** 242,246 **** # --------------------------------------------------------------------------- ! # Replace the ADD_LIBRARY() function to remember what # library targets were added so we can do things with them. # --------------------------------------------------------------------------- --- 242,246 ---- # --------------------------------------------------------------------------- ! # Replace the ADD_LIBRARY(name ...) function to remember what # library targets were added so we can do things with them. # --------------------------------------------------------------------------- *************** *** 257,261 **** # --------------------------------------------------------------------------- ! # Replace the ADD_EXECUTABLE() function to remember what # executable targets were added so we can do things with them. # --------------------------------------------------------------------------- --- 257,261 ---- # --------------------------------------------------------------------------- ! # Replace the ADD_EXECUTABLE(name ...) function to remember what # executable targets were added so we can do things with them. # --------------------------------------------------------------------------- *************** *** 272,276 **** # --------------------------------------------------------------------------- ! # Replace the ADD_TEST() function to remember what # test targets were added so we can do things with them. # --------------------------------------------------------------------------- --- 272,276 ---- # --------------------------------------------------------------------------- ! # Replace the ADD_TEST(name ...) function to remember what # test targets were added so we can do things with them. # --------------------------------------------------------------------------- *************** *** 287,290 **** --- 287,291 ---- # --------------------------------------------------------------------------- + # ADD_GTEST(exe_target_name) # Add a function to create an ADD_TEST() that properly checks the output # of Google GTests. Use this function instead of ADD_TEST for running GTests in your exe. *************** *** 298,301 **** --- 299,303 ---- # --------------------------------------------------------------------------- + # ADD_CPPCHECK_TEST( name ) # Add a function to call cppcheck to do a static analysis test on the project # source dir and its children dirs using the cppcheck program. *************** *** 304,308 **** # --------------------------------------------------------------------------- ! FUNCTION( ADD_STATIC_ANALYSIS_TEST name ) IF ( "${cppcheck}" STREQUAL "") # Find the program cppcheck; ${cppcheck} will be either the exe path or "cppcheck-NOTFOUND" --- 306,310 ---- # --------------------------------------------------------------------------- ! FUNCTION( ADD_CPPCHECK_TEST name ) IF ( "${cppcheck}" STREQUAL "") # Find the program cppcheck; ${cppcheck} will be either the exe path or "cppcheck-NOTFOUND" *************** *** 310,316 **** IF ( "${cppcheck}" STREQUAL "cppcheck-NOTFOUND" ) ! MESSAGE( STATUS "* WARNING: cppcheck NOT found, NOT generating ADD_STATIC_ANALYSIS_TEST() tests" ) ELSE() ! MESSAGE( STATUS "* cppcheck found, generating ADD_STATIC_ANALYSIS_TEST() tests" ) ENDIF() ENDIF() --- 312,318 ---- IF ( "${cppcheck}" STREQUAL "cppcheck-NOTFOUND" ) ! MESSAGE( STATUS "* WARNING: cppcheck NOT found, NOT generating ADD_CPPCHECK_TEST() tests" ) ELSE() ! MESSAGE( STATUS "* cppcheck found, generating ADD_CPPCHECK_TEST() tests" ) ENDIF() ENDIF() *************** *** 321,335 **** STRING(REPLACE "${CMAKE_HOME_DIRECTORY}/" "" PROJ_DIR_TEMP ${CMAKE_CURRENT_SOURCE_DIR}) ! LIST(FIND ADD_STATIC_ANALYSIS_TEST_DIR_LIST ${PROJ_DIR_TEMP} PROJ_DIR_IDX_TEMP) IF ("${PROJ_DIR_IDX_TEMP}" GREATER "-1") ! MESSAGE(STATUS "* WARNING: Duplicate static_analysis tests for dir ${CMAKE_CURRENT_SOURCE_DIR} with names ${name}, you need only one ADD_STATIC_ANALYSIS_TEST per directory.") ELSE() ADD_TEST( ${name} ${cppcheck} "--verbose" "--quiet" ${CMAKE_CURRENT_SOURCE_DIR} ) SET_TESTS_PROPERTIES( ${name} PROPERTIES FAIL_REGULAR_EXPRESSION "(error)") ! SET(ADD_STATIC_ANALYSIS_TEST_LIST ${ADD_STATIC_ANALYSIS_TEST_LIST} "${name}" CACHE INTERNAL "") ! SET(ADD_STATIC_ANALYSIS_TEST_DIR_LIST ${ADD_STATIC_ANALYSIS_TEST_DIR_LIST} "${PROJ_DIR_TEMP}" CACHE INTERNAL "") ! SET(ADD_STATIC_ANALYSIS_TEST_DIR_NAME_LIST ${ADD_STATIC_ANALYSIS_TEST_DIR_NAME_LIST} "${PROJ_DIR_TEMP}/${name}" CACHE INTERNAL "") ENDIF() ENDIF() --- 323,337 ---- STRING(REPLACE "${CMAKE_HOME_DIRECTORY}/" "" PROJ_DIR_TEMP ${CMAKE_CURRENT_SOURCE_DIR}) ! LIST(FIND ADD_CPPCHECK_TEST_DIR_LIST ${PROJ_DIR_TEMP} PROJ_DIR_IDX_TEMP) IF ("${PROJ_DIR_IDX_TEMP}" GREATER "-1") ! MESSAGE(STATUS "* WARNING: Duplicate cppcheck tests for dir ${CMAKE_CURRENT_SOURCE_DIR} with names ${name}, you need only one ADD_CPPCHECK_TEST per directory.") ELSE() ADD_TEST( ${name} ${cppcheck} "--verbose" "--quiet" ${CMAKE_CURRENT_SOURCE_DIR} ) SET_TESTS_PROPERTIES( ${name} PROPERTIES FAIL_REGULAR_EXPRESSION "(error)") ! SET(ADD_CPPCHECK_TEST_LIST ${ADD_CPPCHECK_TEST_LIST} "${name}" CACHE INTERNAL "") ! SET(ADD_CPPCHECK_TEST_DIR_LIST ${ADD_CPPCHECK_TEST_DIR_LIST} "${PROJ_DIR_TEMP}" CACHE INTERNAL "") ! SET(ADD_CPPCHECK_TEST_DIR_NAME_LIST ${ADD_CPPCHECK_TEST_DIR_NAME_LIST} "${PROJ_DIR_TEMP}/${name}" CACHE INTERNAL "") ENDIF() ENDIF() *************** *** 719,725 **** FOREACH(arg ${ARGN}) - if (PROPERTIES) - # We get the old prop value, append the new and apply it to each target --- 721,725 ---- *************** *** 739,743 **** set(PROP_NAME "") endif() - elseif ("${arg}" STREQUAL "PROPERTIES") set(PROPERTIES TRUE) --- 739,742 ---- *************** *** 769,775 **** FOREACH(arg ${ARGN}) - if (PROPERTIES) - # We get the old prop value, append the new and apply it to each target --- 768,772 ---- *************** *** 789,793 **** set(PROP_NAME "") endif() - elseif ("${arg}" STREQUAL "PROPERTIES") set(PROPERTIES TRUE) --- 786,789 ---- *************** *** 810,814 **** # Note that MSVC will error for SOURCES that do not have the line # #include "PCH_INCLUDE" (where PCH_INCLUDE is identical to what's passed to this function) ! # See FORCE_INCLUDE flag for a workaround. # # FORCE_INCLUDE flag may be used to tell the compiler to include the precomp header --- 806,813 ---- # Note that MSVC will error for SOURCES that do not have the line # #include "PCH_INCLUDE" (where PCH_INCLUDE is identical to what's passed to this function) ! # See FORCE_INCLUDE flag for a workaround that uses the compiler's ! # directive to #include a file before compilation. ! # This also works well for GCC and allows you to use precomp headers w/o ! # modifying any code at all. # # FORCE_INCLUDE flag may be used to tell the compiler to include the precomp header *************** *** 1011,1015 **** # --------------------------------------------------------------------------- ! # ADD_DOXYGEN() function to make adding a doxygen target easy. # Usage : ADD_DOXYGEN( doc # ${CMAKE_SOURCE_DIR}/build/Doxyfile.in --- 1010,1017 ---- # --------------------------------------------------------------------------- ! # ADD_DOXYGEN(target_name doxyfile_in doxyfile_out doxygen_working_dir) ! # A function to make adding a doxygen target easy, the doxyfile_in will have ! # @vars@ replaced by configure and copied to doxyfile_out and a target_name will ! # made to call "doxygen ${doxyfile_out}" from the doxygen_working_dir. # Usage : ADD_DOXYGEN( doc # ${CMAKE_SOURCE_DIR}/build/Doxyfile.in *************** *** 1046,1077 **** macro(GET_ALL_CMAKE_VARIABLES all_vars cache_vars) ! get_cmake_property(props VARIABLES) ! foreach(var ${props}) ! #message( STATUS "@ VARIABLES: ${var} = \"${${var}}\"" ) ! set(${all_vars} ${${all_vars}} "${var}") endforeach() ! unset(var) ! unset(props) ! get_cmake_property(props CACHE_VARIABLES) ! foreach(var ${props}) ! #message( STATUS "@ CACHE_VARIABLES: ${var} = \"${${var}}\"" ) ! set(${all_vars} ${${all_vars}} "${var}") ! set(${cache_vars} ${${cache_vars}} "${var}") endforeach() ! unset(var) ! unset(props) # merge the VARIABLES and CACHE_VARIABLES since they're mostly the same list(SORT ${all_vars}) list(REMOVE_DUPLICATES ${all_vars}) - endmacro() macro(PRINT_ALL_CMAKE_VARIABLES) - set(CMAKE_ALL_VARIABLES_LIST) set(CMAKE_ALL_CACHE_VARIABLES_LIST) --- 1048,1077 ---- macro(GET_ALL_CMAKE_VARIABLES all_vars cache_vars) ! get_cmake_property(_props VARIABLES) ! foreach(_var ${_props}) ! #message( STATUS "@ VARIABLES: ${_var} = \"${${_var}}\"" ) ! set(${all_vars} ${${all_vars}} "${_var}") endforeach() ! unset(_var) ! unset(_props) ! get_cmake_property(_props CACHE_VARIABLES) ! foreach(_var ${_props}) ! #message( STATUS "@ CACHE_VARIABLES: ${_var} = \"${${_var}}\"" ) ! set(${all_vars} ${${all_vars}} "${_var}") ! set(${cache_vars} ${${cache_vars}} "${_var}") endforeach() ! unset(_var) ! unset(_props) # merge the VARIABLES and CACHE_VARIABLES since they're mostly the same list(SORT ${all_vars}) list(REMOVE_DUPLICATES ${all_vars}) endmacro() macro(PRINT_ALL_CMAKE_VARIABLES) set(CMAKE_ALL_VARIABLES_LIST) set(CMAKE_ALL_CACHE_VARIABLES_LIST) *************** *** 1084,1116 **** message( STATUS "@----------------------------------------------------------------------------") ! foreach(var ${CMAKE_ALL_VARIABLES_LIST}) ! list(FIND CMAKE_ALL_CACHE_VARIABLES_LIST ${var} _IS_CACHED) ! if (_IS_CACHED GREATER "-1") ! message( STATUS "@ CACHE VAR: ${var} = \"${${var}}\"" ) else() ! message( STATUS "@ VARIABLE : ${var} = \"${${var}}\"" ) endif() endforeach() ! get_cmake_property(props COMMANDS) ! foreach(var ${props}) ! message( STATUS "@ COMMANDS: ${var} = \"${${var}}\"" ) endforeach() ! get_cmake_property(props MACROS) ! foreach(var ${props}) ! message( STATUS "@ MACROS: ${var} = \"${${var}}\"" ) endforeach() ! get_cmake_property(props COMPONENTS) ! foreach(var ${props}) ! message( STATUS "@ COMPONENTS: ${var} = \"${${var}}\"" ) endforeach() # Unset the variables for the PRINT_NEW_CMAKE_VARIABLES() macro ! unset(var) ! unset(props) ! unset(_IS_CACHED) message( STATUS "@----------------------------------------------------------------------------") --- 1084,1116 ---- message( STATUS "@----------------------------------------------------------------------------") ! foreach(_var ${CMAKE_ALL_VARIABLES_LIST}) ! list(FIND CMAKE_ALL_CACHE_VARIABLES_LIST ${_var} _is_cached) ! if (_is_cached GREATER "-1") ! message( STATUS "@ CACHE VAR: ${_var} = \"${${_var}}\"" ) else() ! message( STATUS "@ VARIABLE : ${_var} = \"${${_var}}\"" ) endif() endforeach() ! get_cmake_property(_props COMMANDS) ! foreach(_var ${_props}) ! message( STATUS "@ COMMANDS: ${_var} = \"${${_var}}\"" ) endforeach() ! get_cmake_property(_props MACROS) ! foreach(_var ${_props}) ! message( STATUS "@ MACROS: ${_var} = \"${${_var}}\"" ) endforeach() ! get_cmake_property(_props COMPONENTS) ! foreach(_var ${_props}) ! message( STATUS "@ COMPONENTS: ${_var} = \"${${_var}}\"" ) endforeach() # Unset the variables for the PRINT_NEW_CMAKE_VARIABLES() macro ! unset(_var) ! unset(_props) ! unset(_is_cached) message( STATUS "@----------------------------------------------------------------------------") *************** *** 1118,1122 **** message( STATUS "@----------------------------------------------------------------------------") message( STATUS " ") - endmacro() --- 1118,1121 ---- *************** *** 1126,1130 **** macro( PRINT_NEW_CMAKE_VARIABLES ) - message( STATUS " ") message( STATUS "@----------------------------------------------------------------------------") --- 1125,1128 ---- *************** *** 1138,1149 **** # merge the VARIABLES and CACHE_VARIABLES since they're mostly the same ! foreach(var ${CMAKE_ALL_VARIABLES_LIST2}) ! list(FIND CMAKE_ALL_VARIABLES_LIST ${var} _IS_NEW) ! if (_IS_NEW EQUAL "-1") ! list(FIND CMAKE_ALL_CACHE_VARIABLES_LIST ${var} _IS_CACHED) ! if (_IS_CACHED GREATER "-1") ! message( STATUS "@ CACHE VAR: ${var} = \"${${var}}\"" ) else() ! message( STATUS "@ VARIABLE : ${var} = \"${${var}}\"" ) endif() endif() --- 1136,1147 ---- # merge the VARIABLES and CACHE_VARIABLES since they're mostly the same ! foreach(_var ${CMAKE_ALL_VARIABLES_LIST2}) ! list(FIND CMAKE_ALL_VARIABLES_LIST ${_var} _is_new) ! if (_is_new EQUAL "-1") ! list(FIND CMAKE_ALL_CACHE_VARIABLES_LIST ${_var} _is_cached) ! if (_is_cached GREATER "-1") ! message( STATUS "@ CACHE VAR: ${_var} = \"${${_var}}\"" ) else() ! message( STATUS "@ VARIABLE : ${_var} = \"${${_var}}\"" ) endif() endif() *************** *** 1155,1165 **** message( STATUS " ") ! unset(var) ! unset(_IS_NEW) ! unset(_IS_CACHED) set(CMAKE_ALL_VARIABLES_LIST ${CMAKE_ALL_VARIABLES_LIST2}) set(CMAKE_ALL_CACHE_VARIABLES_LIST ${CMAKE_ALL_CACHE_VARIABLES_LIST2}) - endmacro() --- 1153,1162 ---- message( STATUS " ") ! unset(_var) ! unset(_is_new) ! unset(_is_cached) set(CMAKE_ALL_VARIABLES_LIST ${CMAKE_ALL_VARIABLES_LIST2}) set(CMAKE_ALL_CACHE_VARIABLES_LIST ${CMAKE_ALL_CACHE_VARIABLES_LIST2}) endmacro() *************** *** 1177,1185 **** if ( CMAKE_DEBUG_VARIABLES ) PRINT_ALL_CMAKE_VARIABLES() - - #set(aaa "5") - #PRINT_NEW_CMAKE_VARIABLES() - #set(bbb "5") - #PRINT_NEW_CMAKE_VARIABLES() endif() - --- 1174,1176 ---- |