diff --git a/CMakeLists.txt b/CMakeLists.txt index 0a01c8e87c..523a8039a8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -323,6 +323,15 @@ include_directories("src/include/gen") include_directories("${CMAKE_CURRENT_BINARY_DIR}/src/include") 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 @@ set_output_directory (btyacc . CURRENT_DIR) 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 diff --git a/builds/cmake/BuildFunctions.cmake b/builds/cmake/BuildFunctions.cmake index 36b97a854e..6285161bb0 100644 --- a/builds/cmake/BuildFunctions.cmake +++ b/builds/cmake/BuildFunctions.cmake @@ -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 @@ function(set_output_directory target dir) 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 @@ if (UNIX) endif(UNIX) -####################################### +######################################## # FUNCTION epp_process -####################################### +######################################## function(epp_process type files) set(epp_suffix ".${type}.cpp") @@ -122,9 +122,9 @@ function(epp_process type files) 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 @@ function(add_epp_suffix files suffix) 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 $/${CMAKE_SHARED_LIBRARY_PREFIX}${name}${CMAKE_SHARED_LIBRARY_SUFFIX}) add_custom_command( @@ -209,16 +209,16 @@ function(copy_and_rename_lib target name) ) 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 @@ function(set_generated_directory) 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 @@ function(create_command command type out) 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 @@ function(create_boot_commands) endforeach() endfunction(create_boot_commands) -####################################### +######################################## # FUNCTION create_master_commands -####################################### +######################################## function(create_master_commands) set(cmd_list isql @@ -341,4 +341,4 @@ function(create_master_commands) endforeach() endfunction(create_master_commands) -############################################################################### +################################################################################ diff --git a/builds/cmake/Configure.cmake b/builds/cmake/Configure.cmake index a4287d6a6a..ae4ba1f1ed 100644 --- a/builds/cmake/Configure.cmake +++ b/builds/cmake/Configure.cmake @@ -1,12 +1,12 @@ -############################################################################### +################################################################################ # # configure # -############################################################################### +################################################################################ -####################################### +######################################## # FUNCTION check_includes -####################################### +######################################## function(check_includes files) foreach(F ${${files}}) set(name ${F}) @@ -20,9 +20,9 @@ function(check_includes files) endforeach() endfunction(check_includes) -####################################### +######################################## # FUNCTION check_functions -####################################### +######################################## function(check_functions functions) foreach(F ${${functions}}) set(name ${F}) @@ -34,9 +34,9 @@ function(check_functions functions) 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 @@ function(check_type_alignment type var) 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 @@ if (EXISTS "/proc/self/exe") set(HAVE__PROC_SELF_EXE 1) endif() -####################################### +######################################## if (NOT CMAKE_CROSSCOMPILING) check_type_alignment(long FB_ALIGNMENT) @@ -328,7 +331,7 @@ else() # CMAKE_CROSSCOMPILING endif() endif() -####################################### +######################################## if (WIN32) set(ENABLE_BINRELOC 0) @@ -342,4 +345,4 @@ if (APPLE) set(CASE_SENSITIVITY "false") endif() -############################################################################### +################################################################################ diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt index 324a69a8b9..0ebec41374 100644 --- a/examples/CMakeLists.txt +++ b/examples/CMakeLists.txt @@ -91,6 +91,7 @@ project_group (udrcpp_example Examples) 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 @@ project_group (dbcrypt_example Examples) 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) ############################################################################### diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index a0744efc5b..252f7e91fe 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -269,6 +269,29 @@ add_custom_target(parse 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 @@ endif() 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 boot) 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 @@ add_epp_suffix(engine12_generated_src master) 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)