From: <ego...@us...> - 2015-04-07 10:09:07
|
Revision: 61255 http://sourceforge.net/p/firebird/code/61255 Author: egorpugin Date: 2015-04-07 10:08:58 +0000 (Tue, 07 Apr 2015) Log Message: ----------- Add cloop to CMake build. Modified Paths: -------------- firebird/trunk/CMakeLists.txt firebird/trunk/builds/cmake/BuildFunctions.cmake firebird/trunk/builds/cmake/Configure.cmake firebird/trunk/examples/CMakeLists.txt firebird/trunk/src/CMakeLists.txt Modified: firebird/trunk/CMakeLists.txt =================================================================== --- firebird/trunk/CMakeLists.txt 2015-04-07 03:19:51 UTC (rev 61254) +++ firebird/trunk/CMakeLists.txt 2015-04-07 10:08:58 UTC (rev 61255) @@ -324,6 +324,15 @@ include_directories("${CMAKE_CURRENT_BINARY_DIR}/src/include/gen") ######################################## +# LIBRARY libtommath +######################################## + +file(GLOB libtommath_src "extern/libtommath/*.c" "extern/libtommath/*.h") + +add_library (libtommath ${libtommath_src}) +project_group (libtommath Extern) + +######################################## # EXECUTABLE btyacc ######################################## @@ -337,15 +346,14 @@ endif() # if (NOT CMAKE_CROSSCOMPILING) - ######################################## -# LIBRARY btyacc +# EXECUTABLE cloop ######################################## -file(GLOB libtommath_src "extern/libtommath/*.c" "extern/libtommath/*.h") +file(GLOB cloop_src "extern/cloop/src/cloop/*.cpp" "extern/cloop/src/cloop/*.h") -add_library (libtommath ${libtommath_src}) -project_group (libtommath Extern) +add_executable (cloop ${cloop_src}) +project_group (cloop Extern) ######################################## # subdirectories Modified: firebird/trunk/builds/cmake/BuildFunctions.cmake =================================================================== --- firebird/trunk/builds/cmake/BuildFunctions.cmake 2015-04-07 03:19:51 UTC (rev 61254) +++ firebird/trunk/builds/cmake/BuildFunctions.cmake 2015-04-07 10:08:58 UTC (rev 61255) @@ -1,12 +1,12 @@ -############################################################################### +################################################################################ # # macros and functions # -############################################################################### +################################################################################ -####################################### +######################################## # FUNCTION set_output_directory -####################################### +######################################## function(set_output_directory target dir) set(out ${output_dir}) if (MSVC OR XCODE) # multiconfiguration builds @@ -31,18 +31,18 @@ endif() endfunction(set_output_directory) -####################################### +######################################## # FUNCTION set_output_directory_unix -####################################### +######################################## function(set_output_directory_unix target dir) if (UNIX) set_output_directory(${target} ${dir} ${ARGN}) endif() endfunction(set_output_directory_unix) -####################################### +######################################## # FUNCTION set_exported_symbols -####################################### +######################################## if (WIN32) function(set_exported_symbols target filename) set(def_file ${filename}.def) @@ -79,9 +79,9 @@ endif(UNIX) -####################################### +######################################## # FUNCTION epp_process -####################################### +######################################## function(epp_process type files) set(epp_suffix ".${type}.cpp") @@ -122,9 +122,9 @@ endforeach() endfunction(epp_process) -####################################### +######################################## # FUNCTION add_epp_suffix -####################################### +######################################## function(add_epp_suffix files suffix) foreach(F ${${files}}) list(APPEND ${files}_${suffix} ${CMAKE_CURRENT_SOURCE_DIR}/${F}) @@ -134,72 +134,72 @@ set(${files}_${suffix} ${${files}_${suffix}} PARENT_SCOPE) endfunction(add_epp_suffix) -####################################### +######################################## # FUNCTION set_win32 -####################################### +######################################## function(set_win32 var) if (WIN32) set(${var} "${ARGN}" PARENT_SCOPE) endif() endfunction(set_win32) -####################################### +######################################## # FUNCTION set_unix -####################################### +######################################## function(set_unix var) if (UNIX) set(${var} "${ARGN}" PARENT_SCOPE) endif() endfunction(set_unix) -####################################### +######################################## # FUNCTION set_apple -####################################### +######################################## function(set_apple var) if (APPLE) set(${var} "${ARGN}" PARENT_SCOPE) endif() endfunction(set_apple) -####################################### +######################################## # FUNCTION add_src_win32 -####################################### +######################################## function(add_src_win32 var) if (WIN32) set(${var} ${${var}} ${ARGN} PARENT_SCOPE) endif() endfunction(add_src_win32) -####################################### +######################################## # FUNCTION add_src_unix -####################################### +######################################## function(add_src_unix var) if (UNIX) set(${var} ${${var}} ${ARGN} PARENT_SCOPE) endif() endfunction(add_src_unix) -####################################### +######################################## # FUNCTION add_src_unix_not_apple -####################################### +######################################## function(add_src_unix_not_apple var) if (UNIX AND NOT APPLE) set(${var} ${${var}} ${ARGN} PARENT_SCOPE) endif() endfunction(add_src_unix_not_apple) -####################################### +######################################## # FUNCTION add_src_apple -####################################### +######################################## function(add_src_apple var) if (APPLE) set(${var} ${${var}} ${ARGN} PARENT_SCOPE) endif() endfunction(add_src_apple) -####################################### +######################################## # FUNCTION copy_and_rename_lib -####################################### +######################################## function(copy_and_rename_lib target name) set(name2 $<TARGET_FILE_DIR:${target}>/${CMAKE_SHARED_LIBRARY_PREFIX}${name}${CMAKE_SHARED_LIBRARY_SUFFIX}) add_custom_command( @@ -209,16 +209,16 @@ ) endfunction(copy_and_rename_lib) -####################################### +######################################## # FUNCTION project_group -####################################### +######################################## function(project_group target name) set_target_properties(${target} PROPERTIES FOLDER ${name}) endfunction(project_group) -####################################### +######################################## # FUNCTION set_generated_directory -####################################### +######################################## function(set_generated_directory) if (NOT CMAKE_CROSSCOMPILING) set(GENERATED_DIR ${CMAKE_CURRENT_BINARY_DIR} PARENT_SCOPE) @@ -228,36 +228,36 @@ endif() endfunction(set_generated_directory) -####################################### +######################################## # FUNCTION add_dependencies_cc (cross compile) -####################################### +######################################## function(add_dependencies_cc target) if (NOT CMAKE_CROSSCOMPILING) add_dependencies(${target} ${ARGN}) endif() endfunction(add_dependencies_cc) -####################################### +######################################## # FUNCTION add_dependencies_unix_cc (cross compile) -####################################### +######################################## function(add_dependencies_unix_cc target) if (UNIX) add_dependencies_cc(${target} ${ARGN}) endif() endfunction(add_dependencies_unix_cc) -####################################### +######################################## # FUNCTION crosscompile_prebuild_steps -####################################### +######################################## function(crosscompile_prebuild_steps) if (CMAKE_CROSSCOMPILING) execute_process(COMMAND ${CMAKE_COMMAND} -E copy_if_different ${NATIVE_BUILD_DIR}/src/include/gen/parse.h ${CMAKE_BINARY_DIR}/src/include/gen/parse.h) endif() endfunction(crosscompile_prebuild_steps) -####################################### +######################################## # FUNCTION create_command -####################################### +######################################## function(create_command command type out) set(dir ${output_dir}) if ("${type}" STREQUAL "boot") @@ -307,9 +307,9 @@ set(${out} ${CMD}_CMD PARENT_SCOPE) endfunction(create_command) -####################################### +######################################## # FUNCTION create_boot_commands -####################################### +######################################## function(create_boot_commands) set(cmd_list boot_isql @@ -326,9 +326,9 @@ endforeach() endfunction(create_boot_commands) -####################################### +######################################## # FUNCTION create_master_commands -####################################### +######################################## function(create_master_commands) set(cmd_list isql @@ -341,4 +341,4 @@ endforeach() endfunction(create_master_commands) -############################################################################### +################################################################################ Modified: firebird/trunk/builds/cmake/Configure.cmake =================================================================== --- firebird/trunk/builds/cmake/Configure.cmake 2015-04-07 03:19:51 UTC (rev 61254) +++ firebird/trunk/builds/cmake/Configure.cmake 2015-04-07 10:08:58 UTC (rev 61255) @@ -1,12 +1,12 @@ -############################################################################### +################################################################################ # # configure # -############################################################################### +################################################################################ -####################################### +######################################## # FUNCTION check_includes -####################################### +######################################## function(check_includes files) foreach(F ${${files}}) set(name ${F}) @@ -20,9 +20,9 @@ endforeach() endfunction(check_includes) -####################################### +######################################## # FUNCTION check_functions -####################################### +######################################## function(check_functions functions) foreach(F ${${functions}}) set(name ${F}) @@ -34,9 +34,9 @@ endforeach() endfunction(check_functions) -####################################### +######################################## # FUNCTION check_type_alignment -####################################### +######################################## function(check_type_alignment type var) if (NOT DEFINED ${var}) check_c_source_runs("main(){struct s{char a;${type} b;};exit((int)&((struct s*)0)->b);}" ${var}) @@ -46,20 +46,23 @@ endif() endfunction(check_type_alignment) -####################################### +######################################## # FUNCTION check_symbol -####################################### +######################################## function(check_symbol symbol var) - foreach(f ${ARGN}) - if (NOT ${var}) - unset(${var} CACHE) - message(STATUS "Looking for ${symbol} - ${f}") - check_symbol_exists(${symbol} ${f} ${var}) - endif() - endforeach() + if (NOT ${var}_SYMBOL) + foreach(f ${ARGN}) + if (NOT ${var}) + unset(${var} CACHE) + message(STATUS "Looking for ${symbol} - ${f}") + check_symbol_exists(${symbol} ${f} ${var}) + endif() + endforeach() + endif() + set(${var}_SYMBOL 1 CACHE INTERNAL "Do not check this symbol again") endfunction(check_symbol) -####################################### +######################################## include(CheckCSourceCompiles) include(CheckCSourceRuns) @@ -315,7 +318,7 @@ set(HAVE__PROC_SELF_EXE 1) endif() -####################################### +######################################## if (NOT CMAKE_CROSSCOMPILING) check_type_alignment(long FB_ALIGNMENT) @@ -328,7 +331,7 @@ endif() endif() -####################################### +######################################## if (WIN32) set(ENABLE_BINRELOC 0) @@ -342,4 +345,4 @@ set(CASE_SENSITIVITY "false") endif() -############################################################################### +################################################################################ Modified: firebird/trunk/examples/CMakeLists.txt =================================================================== --- firebird/trunk/examples/CMakeLists.txt 2015-04-07 03:19:51 UTC (rev 61254) +++ firebird/trunk/examples/CMakeLists.txt 2015-04-07 10:08:58 UTC (rev 61255) @@ -91,6 +91,7 @@ add_library (dbcrypt_example SHARED dbcrypt/DbCrypt.cpp) set_target_properties (dbcrypt_example PROPERTIES OUTPUT_NAME DbCrypt_example) set_output_directory (dbcrypt_example plugins) +add_dependencies_cc (dbcrypt_example UpdateCloopInterfaces) project_group (dbcrypt_example Examples) @@ -101,6 +102,7 @@ add_library (cryptkeyholder_example SHARED dbcrypt/CryptKeyHolder.cpp) set_target_properties (cryptkeyholder_example PROPERTIES OUTPUT_NAME CryptKeyHolder_example) set_output_directory (cryptkeyholder_example plugins) +add_dependencies_cc (cryptkeyholder_example UpdateCloopInterfaces) project_group (cryptkeyholder_example Examples) ############################################################################### Modified: firebird/trunk/src/CMakeLists.txt =================================================================== --- firebird/trunk/src/CMakeLists.txt 2015-04-07 03:19:51 UTC (rev 61254) +++ firebird/trunk/src/CMakeLists.txt 2015-04-07 10:08:58 UTC (rev 61255) @@ -269,6 +269,29 @@ project_group(parse "Boot/Custom build steps") set_source_files_properties(dsql/parse.cpp include/gen/parse.h PROPERTIES GENERATED TRUE) + +######################################## +# BUILD_STEP UpdateCloopInterfaces +######################################## + +add_custom_command( + OUTPUT ${CMAKE_CURRENT_SOURCE_DIR}/include/firebird/IdlFbInterfaces.h + DEPENDS + cloop + ${CMAKE_CURRENT_SOURCE_DIR}/include/firebird/FirebirdInterface.idl + COMMAND cloop + ${CMAKE_CURRENT_SOURCE_DIR}/include/firebird/FirebirdInterface.idl + c++ + ${CMAKE_CURRENT_SOURCE_DIR}/include/firebird/IdlFbInterfaces.h + IDL_FB_INTERFACES_H Firebird I + COMMENT "Updating cloop interfaces..." +) +add_custom_target(UpdateCloopInterfaces + DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/include/firebird/IdlFbInterfaces.h + SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/include/firebird/FirebirdInterface.idl +) +project_group(UpdateCloopInterfaces "Boot/Custom build steps") + endif() # if (NOT CMAKE_CROSSCOMPILING) @@ -348,6 +371,7 @@ add_library (common ${common_src} ${common_os_src} ${common_include}) target_link_libraries (common ${LIB_mpr}) +add_dependencies_cc (common UpdateCloopInterfaces) ################################################################################ @@ -381,7 +405,7 @@ add_epp_suffix(yvalve_generated_src master) add_library (yvalve_common OBJECT ${yvalve_src} ${yvalve_include}) -add_dependencies_cc (yvalve_common parse) +add_dependencies_cc (yvalve_common parse UpdateCloopInterfaces) if (NOT CMAKE_CROSSCOMPILING) @@ -470,7 +494,7 @@ file(GLOB_RECURSE engine12_include "dsql/*.h" "jrd/*.h" include/gen/iberror.h) add_library (engine12_common ${engine12_src} ${engine12_include} ${parse_src}) -add_dependencies_cc (engine12_common parse) +add_dependencies_cc (engine12_common parse UpdateCloopInterfaces) if (NOT CMAKE_CROSSCOMPILING) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |