From d75a3ec4d65877f0d2903423bf83a0fa354183c0 Mon Sep 17 00:00:00 2001 From: egorpugin Date: Mon, 26 Jan 2015 15:23:27 +0000 Subject: [PATCH] [build] [cmake] Update build according to the last changes. --- CMakeLists.txt | 9 ++++---- builds/cmake/BuildFunctions.cmake | 6 +++--- examples/CMakeLists.txt | 34 +++++++++++++++---------------- src/CMakeLists.txt | 4 +++- 4 files changed, 28 insertions(+), 25 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index c47583bf61..7980bcfd15 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -238,8 +238,9 @@ file(GLOB btyacc_src "extern/btyacc/*.c" "extern/btyacc/*.h") if (NOT CMAKE_CROSSCOMPILING) -add_executable (btyacc ${btyacc_src}) -project_group (btyacc Extern) +add_executable (btyacc ${btyacc_src}) +project_group (btyacc Extern) +set_output_directory (btyacc . FORCE) endif() # if (NOT CMAKE_CROSSCOMPILING) @@ -250,8 +251,8 @@ endif() # if (NOT CMAKE_CROSSCOMPILING) file(GLOB libtommath_src "extern/libtommath/*.c" "extern/libtommath/*.h") -add_library (libtommath ${libtommath_src}) -project_group (libtommath Extern) +add_library (libtommath ${libtommath_src}) +project_group (libtommath Extern) ######################################## diff --git a/builds/cmake/BuildFunctions.cmake b/builds/cmake/BuildFunctions.cmake index d149ee13c5..56c48cba45 100644 --- a/builds/cmake/BuildFunctions.cmake +++ b/builds/cmake/BuildFunctions.cmake @@ -136,7 +136,7 @@ endfunction(add_epp_suffix) ####################################### function(set_win32 var) if (WIN32) - set(${var} ${ARGN} PARENT_SCOPE) + set(${var} "${ARGN}" PARENT_SCOPE) endif() endfunction(set_win32) @@ -145,7 +145,7 @@ endfunction(set_win32) ####################################### function(set_unix var) if (UNIX) - set(${var} ${ARGN} PARENT_SCOPE) + set(${var} "${ARGN}" PARENT_SCOPE) endif() endfunction(set_unix) @@ -154,7 +154,7 @@ endfunction(set_unix) ####################################### function(set_apple var) if (APPLE) - set(${var} ${ARGN} PARENT_SCOPE) + set(${var} "${ARGN}" PARENT_SCOPE) endif() endfunction(set_apple) diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt index 31f0f21f4c..73cebfa8fd 100644 --- a/examples/CMakeLists.txt +++ b/examples/CMakeLists.txt @@ -31,9 +31,9 @@ add_custom_command( COMMAND gpre -r -m -n -z ${CMAKE_CURRENT_SOURCE_DIR}/empbuild/empbuild.e empbuild.c ) -add_executable (empbuild empbuild.c ${CMAKE_CURRENT_SOURCE_DIR}/empbuild/empbuild.e) +add_executable (empbuild empbuild.c empbuild.fdb ${CMAKE_CURRENT_SOURCE_DIR}/empbuild/empbuild.e) target_link_libraries (empbuild yvalve) -set_output_directory (empbuild empbuild FORCE) +set_output_directory (empbuild . FORCE) add_dependencies (empbuild gfix engine12 fbtrace) project_group (empbuild Examples) @@ -47,21 +47,19 @@ foreach(F ${files}) COMMAND ${CMAKE_COMMAND} -E copy_if_different ${F} ${name}) endforeach() -set_unix (CMD PATH=${output_dir}/bin) -set_apple(CMD DYLD_LIBRARY_PATH=${output_dir}/plugins:${output_dir}/lib ${CMD}) +set(EMPBUILD_CMD empbuild employe2.fdb) +set_win32(EMPBUILD_CMD set PATH=%PATH%\\\\;${output_dir} COMMAND ${EMPBUILD_CMD}) +set_unix (EMPBUILD_CMD PATH=${output_dir}/bin ${EMPBUILD_CMD}) +set_apple(EMPBUILD_CMD DYLD_LIBRARY_PATH=${output_dir}/plugins:${output_dir}/lib ${EMPBUILD_CMD}) -if (WIN32) - add_custom_command(OUTPUT employe2.fdb DEPENDS empbuild ${files} - COMMAND ${CMAKE_COMMAND} -E remove employe2.fdb - COMMAND set PATH=%PATH%\;${output_dir} - COMMAND ${CMD} $ employe2.fdb - ) -else() - add_custom_command(OUTPUT employe2.fdb DEPENDS empbuild ${files} - COMMAND ${CMAKE_COMMAND} -E remove employe2.fdb - COMMAND ${CMD} $ employe2.fdb - ) -endif() +add_custom_command( + OUTPUT employe2.fdb + DEPENDS + empbuild + ${files} + COMMAND ${CMAKE_COMMAND} -E remove employe2.fdb + COMMAND ${EMPBUILD_CMD} +) add_custom_target (employee_db DEPENDS employe2.fdb SOURCES ${files}) project_group (employee_db Examples) @@ -71,7 +69,9 @@ endif() # if (NOT CMAKE_CROSSCOMPILING) # SHARED LIBRARY udrcpp_example ######################################## -add_library (udrcpp_example SHARED udr/UdrCppExample.cpp) +file(GLOB udrcpp_example_src "udr/*") + +add_library (udrcpp_example SHARED ${udrcpp_example_src}) target_link_libraries (udrcpp_example udr_engine) set_output_directory (udrcpp_example plugins/udr) project_group (udrcpp_example Examples) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 14bfd4a8cb..6acac4381e 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -181,8 +181,10 @@ add_custom_command( add_custom_target(databases DEPENDS boot_engine12 - msg.fdb help.fdb + metadata.fdb + msg.fdb + security.fdb SOURCES ${databases_src} )