mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
CMake - remove parameter repetition in else() and endif() statements - part 2
This follows Professional CMake's recommended practises I missed plenty of these in my first commit. This one should fix these remaining occurrences.
This commit is contained in:
@@ -34,11 +34,11 @@ function(gnc_add_scheme_targets _TARGET _SOURCE_FILES _OUTPUT_DIR _GUILE_DEPENDS
|
||||
message(" SOURCE_FILES: ${_SOURCE_FILES}")
|
||||
message(" GUILE_DEPENDS: ${_GUILE_DEPENDS}")
|
||||
message(" DIRECTORIES: ${BINDIR_BUILD}, ${LIBDIR_BUILD}, ${DATADIR_BUILD}")
|
||||
endif(__DEBUG)
|
||||
endif()
|
||||
set(_CMD "create_symlink")
|
||||
if(WIN32)
|
||||
set(_CMD "copy")
|
||||
endif(WIN32)
|
||||
endif()
|
||||
set(current_srcdir ${CMAKE_CURRENT_SOURCE_DIR})
|
||||
set(current_bindir ${CMAKE_CURRENT_BINARY_DIR})
|
||||
set(build_bindir ${BINDIR_BUILD})
|
||||
@@ -75,7 +75,7 @@ function(gnc_add_scheme_targets _TARGET _SOURCE_FILES _OUTPUT_DIR _GUILE_DEPENDS
|
||||
endif()
|
||||
endforeach(scheme_file)
|
||||
add_custom_target(${_TARGET}-links ALL DEPENDS ${_SCHEME_LINKS})
|
||||
endif(MAKE_LINKS)
|
||||
endif()
|
||||
|
||||
# Construct the guile source and compiled load paths
|
||||
set(_GUILE_LOAD_PATH "${current_srcdir}"
|
||||
@@ -120,18 +120,18 @@ function(gnc_add_scheme_targets _TARGET _SOURCE_FILES _OUTPUT_DIR _GUILE_DEPENDS
|
||||
set(fpath "")
|
||||
file(TO_CMAKE_PATH "$ENV{PATH}" fpath)
|
||||
set(LIBRARY_PATH "PATH=${BINDIR_BUILD};${fpath}")
|
||||
else (MINGW64)
|
||||
else()
|
||||
set (LIBRARY_PATH "LD_LIBRARY_PATH=${LIBDIR_BUILD}:${LIBDIR_BUILD}/gnucash")
|
||||
endif (MINGW64)
|
||||
endif()
|
||||
if (APPLE)
|
||||
set (LIBRARY_PATH "DYLD_LIBRARY_PATH=${LIBDIR_BUILD}:${LIBDIR_BUILD}/gnucash")
|
||||
endif (APPLE)
|
||||
endif()
|
||||
set(_GNC_MODULE_PATH "")
|
||||
if(MINGW64)
|
||||
set(_GNC_MODULE_PATH "${build_bindir}")
|
||||
else(MINGW64)
|
||||
else()
|
||||
set(_GNC_MODULE_PATH "${LIBDIR_BUILD}" "${LIBDIR_BUILD}/gnucash" "${GNC_MODULE_PATH}")
|
||||
endif(MINGW64)
|
||||
endif()
|
||||
if(NOT MINGW64 OR ${GUILE_EFFECTIVE_VERSION} VERSION_LESS 2.2)
|
||||
make_unix_path_list(_GUILE_LOAD_PATH)
|
||||
make_unix_path_list(_GUILE_LOAD_COMPILED_PATH)
|
||||
@@ -143,7 +143,7 @@ function(gnc_add_scheme_targets _TARGET _SOURCE_FILES _OUTPUT_DIR _GUILE_DEPENDS
|
||||
message(" GUILE_LOAD_PATH: ${_GUILE_LOAD_PATH}")
|
||||
message(" GUILE_LOAD_COMPILED_PATH: ${_GUILE_LOAD_COMPILED_PATH}")
|
||||
message(" GNC_MODULE_PATH: ${_GNC_MODULE_PATH}")
|
||||
endif(__DEBUG)
|
||||
endif()
|
||||
#We quote the arguments to stop CMake stripping the path separators.
|
||||
add_custom_command(
|
||||
OUTPUT ${output_file}
|
||||
@@ -162,7 +162,7 @@ function(gnc_add_scheme_targets _TARGET _SOURCE_FILES _OUTPUT_DIR _GUILE_DEPENDS
|
||||
endforeach(source_file)
|
||||
if (__DEBUG)
|
||||
message("TARGET_FILES are ${_TARGET_FILES}")
|
||||
endif(__DEBUG)
|
||||
endif()
|
||||
add_custom_target(${_TARGET} ALL DEPENDS ${_TARGET_FILES})
|
||||
install(FILES ${_TARGET_FILES} DESTINATION ${SCHEME_INSTALLED_CACHE_DIR}/${_OUTPUT_DIR})
|
||||
install(FILES ${_SOURCE_FILES} DESTINATION ${SCHEME_INSTALLED_SOURCE_DIR}/${_OUTPUT_DIR})
|
||||
|
||||
@@ -27,7 +27,7 @@ function(get_guile_env)
|
||||
set(compiled_path "${LIBDIR_BUILD}/gnucash/scm/ccache/${GUILE_EFFECTIVE_VERSION}")
|
||||
string(REGEX REPLACE "^([A-Za-z]):" "/\\1" compiled_path ${compiled_path})
|
||||
list(APPEND env GUILE_LOAD_COMPILED_PATH=${compiled_path})
|
||||
endif(MINGW64)
|
||||
endif()
|
||||
list(APPEND env "GNC_MODULE_PATH=${_GNC_MODULE_PATH}")
|
||||
list(APPEND env "GUILE=${GUILE_EXECUTABLE}")
|
||||
|
||||
@@ -49,7 +49,7 @@ function(get_guile_env)
|
||||
list(APPEND new_path ${load_item})
|
||||
endforeach(load_item)
|
||||
set(guile_load_path ${new_path})
|
||||
endif (MINGW64)
|
||||
endif()
|
||||
if (WIN32 AND NOT MINGW64)
|
||||
string(REPLACE ";" "\\\\;" GUILE_LOAD_PATH "${guile_load_path}")
|
||||
else()
|
||||
|
||||
@@ -11,9 +11,9 @@ macro (macro_add_source_file_compile_flags _sourcefile _additionalflags)
|
||||
get_source_file_property (_flags ${_sourcefile} COMPILE_FLAGS)
|
||||
if (_flags)
|
||||
set(_flags "${_flags} ${_additionalflags}")
|
||||
else (_flags)
|
||||
else()
|
||||
set(_flags "${_additionalflags}")
|
||||
endif (_flags)
|
||||
endif()
|
||||
set_source_files_properties (${_sourcefile} PROPERTIES COMPILE_FLAGS "${_flags}")
|
||||
|
||||
endmacro (macro_add_source_file_compile_flags)
|
||||
|
||||
@@ -20,7 +20,7 @@ function(run_dist_check PACKAGE_PREFIX EXT)
|
||||
FIND_PROGRAM(NINJA_COMMAND NAMES ninja ninja-build)
|
||||
if (${NINJA_COMMAND} STREQUAL "NINJA_COMMAND-NOTFOUND")
|
||||
message(FATAL_ERROR "Can't find the 'ninja' or 'ninja-build' program.")
|
||||
endif ()
|
||||
endif()
|
||||
|
||||
execute_process_and_check_result(
|
||||
COMMAND ${CMAKE_COMMAND} -E tar ${TAR_OPTION} ${tarball}
|
||||
|
||||
Reference in New Issue
Block a user