Commit 930b1446 authored by Heng Liu's avatar Heng Liu

Merge branch 'cgg' into 'clean_edge_collapse'

Cgg

See merge request !76
parents 08699df5 b5d2a0bb
Pipeline #12422 passed with stage
in 5 minutes and 4 seconds
......@@ -11,3 +11,4 @@ cppcheck.log
*.gcda
*.gcno
.DS_Store
Version X (?/?/?)
Version 2.1 (2019/09/09)
- Modern target-based CMake 3 build system
- !!!Break compatiblity with C++98, require C++11 as mininum!!!
- Renamed *T.cc into *T_impl.hh to avoid ugly problems ith several IDEs
- Fix bug in halfface reordering
......@@ -19,6 +20,8 @@ Version X (?/?/?)
- Fix bug in edge split of tetrahedral meshes
- Ensure that halfface iterators start with a boundary halffaces when cells are deleted
- Added new iterators (VertexIHalfEdgeIter, VertexEdgeIter, VertexHalfFaceIter, EdgeHalfFaceIter, EdgeFaceIter, EdgeCellIter)
- Added `hidden` flag to StatusAttrib for visualisation purposes
- Added InterfaceAttrib to denote interior interfaces
......
......@@ -45,9 +45,13 @@ ECHO "LIBPATH : %LIBPATH%"
ECHO "==============================================================="
ECHO "==============================================================="
set GTEST_PREFIX=%LIBPATH%\%ARCHITECTURE%\%GTESTVERSION%
set GTEST_INCLUDE_DIR=%GTEST_PREFIX%\include
set GTEST_LIBRARY=%GTEST_PREFIX%\lib\gtest.lib
set GTEST_MAIN_LIBRARY=%GTEST_PREFIX%\lib\gtest_main.lib
"C:\Program Files\CMake\bin\cmake.exe" -DGTEST_PREFIX="%LIBPATH%\%ARCHITECTURE%\%GTESTVERSION%" -G "%GENERATOR%" -DCMAKE_BUILD_TYPE=Release %CMAKE_CONFIGURATION% ..
"C:\Program Files\CMake\bin\cmake.exe" -DGTEST_LIBRARY="%GTEST_LIBRARY%" -DGTEST_INCLUDE_DIR="%GTEST_INCLUDE_DIR%" -DGTEST_MAIN_LIBRARY="%GTEST_MAIN_LIBRARY%" -G "%GENERATOR%" -DCMAKE_BUILD_TYPE=Release %CMAKE_CONFIGURATION% ..
%VS_PATH% /Build "Release" OpenVolumeMesh.sln /Project "ALL_BUILD"
......@@ -57,7 +61,7 @@ cd ..
cd src\Unittests\TestFiles
..\..\..\build-release\src\Unittests\Release\unittests.exe
..\..\..\build-release\Unittests\Release\unittests.exe
cd ..\..\..\
......@@ -68,7 +72,10 @@ mkdir build-debug
cd build-debug
"C:\Program Files\CMake\bin\cmake.exe" -DGTEST_PREFIX="%LIBPATH%\%ARCHITECTURE%\%GTESTVERSION%" -G "%GENERATOR%" -DCMAKE_BUILD_TYPE=Debug %CMAKE_CONFIGURATION% ..
set GTEST_LIBRARY=%GTEST_PREFIX%\lib\gtestd.lib
set GTEST_MAIN_LIBRARY=%GTEST_PREFIX%\lib\gtest_maind.lib
"C:\Program Files\CMake\bin\cmake.exe" -DGTEST_LIBRARY="%GTEST_LIBRARY%" -DGTEST_INCLUDE_DIR="%GTEST_INCLUDE_DIR%" -DGTEST_MAIN_LIBRARY="%GTEST_MAIN_LIBRARY%" -G "%GENERATOR%" -DCMAKE_BUILD_TYPE=Debug %CMAKE_CONFIGURATION% ..
%VS_PATH% /Build "Debug" OpenVolumeMesh.sln /Project "ALL_BUILD"
......@@ -78,7 +85,7 @@ cd ..
cd src\Unittests\TestFiles
..\..\..\build-debug\src\Unittests\Debug\unittests.exe
..\..\..\build-debug\Unittests\Debug\unittests.exe
IF %errorlevel% NEQ 0 exit /b %errorlevel%
......@@ -10,6 +10,12 @@ NC='\033[0m'
OUTPUT='\033[0;32m'
WARNING='\033[0;93m'
BUILDPATH="build-cppcheck"
mkdir -p "${BUILDPATH}"
cd "${BUILDPATH}"
cmake -DCMAKE_EXPORT_COMPILE_COMMANDS=ON ..
cd ..
echo -e "${OUTPUT}"
echo "=============================================================================="
echo "Running cppcheck"
......@@ -20,7 +26,17 @@ echo -e "${NC}"
echo "Please Wait ..."
# Run cppcheck and output into file
cppcheck --enable=all . -I src -i Doc/ --force --suppress=missingIncludeSystem --inline-suppr --quiet -Umin -Umax -UBMPOSTFIX -DOPENVOLUMEMESHDLLEXPORT="" 2>&1 | tee cppcheck.log
# we do not enable 'style' and 'unusedFunction' (the latter gives false positive
# for the public library interface)
cppcheck \
--project=${BUILDPATH}/compile_commands.json \
--force \
--enable=warning,performance,portability,information,missingInclude \
--suppress=missingIncludeSystem \
--suppress=unmatchedSuppression \
--inline-suppr \
--quiet \
2>&1 | tee cppcheck.log
COUNT=$(wc -l < cppcheck.log )
......@@ -30,7 +46,7 @@ echo "CPPCHECK Summary"
echo "=============================================================================="
echo -e "${NC}"
if [ $COUNT -gt 5 ]; then
if [ $COUNT -gt 3 ]; then
echo -e ${WARNING}
echo "Total CPPCHECK error Count is $COUNT, which is too High! CPPCHECK Run failed";
echo -e "${NC}"
......
......@@ -37,7 +37,7 @@ fi
cd build-release-$BUILDPATH
cmake -DCMAKE_BUILD_TYPE=Release -DSTL_VECTOR_CHECKS=ON $OPTIONS ../
cmake -DCMAKE_BUILD_TYPE=Release -DSTL_DEBUG=ON $OPTIONS ../
#build it
make
......@@ -68,7 +68,7 @@ fi
cd build-debug-$BUILDPATH
cmake -DCMAKE_BUILD_TYPE=Debug -DSTL_VECTOR_CHECKS=ON $OPTIONS ../
cmake -DCMAKE_BUILD_TYPE=Debug -DSTL_DEBUG=ON $OPTIONS ../
#build the unit tests
make unittests
......
......@@ -10,6 +10,10 @@ export PATH
OPTIONS=""
OPTIONS="${OPTIONS} -DGTEST_LIBRARY=${HOME}/sw/gtest-1.7.0/lib/libgtest.a"
OPTIONS="${OPTIONS} -DGTEST_INCLUDE_DIR=${HOME}/sw/gtest-1.7.0/include/"
OPTIONS="${OPTIONS} -DGTEST_MAIN_LIBRARY=${HOME}/sw/gtest-1.7.0/lib/libgtest_main.a"
if [ "$LANGUAGE" == "C++98" ]; then
echo "Building with C++98";
elif [ "$LANGUAGE" == "C++11" ]; then
......@@ -28,7 +32,7 @@ fi
cd build-release
cmake -DCMAKE_BUILD_TYPE=Release -DSTL_VECTOR_CHECKS=ON $OPTIONS ../
cmake -DCMAKE_BUILD_TYPE=Release $OPTIONS ../
#build it
make
......@@ -58,7 +62,7 @@ fi
cd build-debug
cmake -DCMAKE_BUILD_TYPE=Debug -DSTL_VECTOR_CHECKS=ON $OPTIONS ../
cmake -DCMAKE_BUILD_TYPE=Debug $OPTIONS ../
#build it
make
......
cmake_minimum_required(VERSION 3.1.0 FATAL_ERROR)
set(CMAKE_CXX_STANDARD 11)
cmake_minimum_required(VERSION 3.12 FATAL_ERROR)
cmake_policy(VERSION 3.12.0)
if("${PROJECT_NAME}" STREQUAL "")
message("Setting project name to OpenVolumeMesh")
project (OpenVolumeMesh)
set(CMAKE_MACOSX_RPATH 1)
project (OpenVolumeMesh
VERSION 2.1.0
LANGUAGES CXX
HOMEPAGE_URL https://openvolumemesh.org/
)
endif()
# add our macro directory to cmake search path
set (CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
set (CMAKE_DEBUG_POSTFIX "d")
#list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
# Enable bigobj on MSVC Windows debug mode
if ( MSVC )
add_compile_options("$<IF:$<CXX_COMPILER_ID:MSVC>,$<$<CONFIG:DEBUG>:/bigobj>,>")
if( ${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_CURRENT_SOURCE_DIR} )
set(OVM_STANDALONE_BUILD TRUE)
else()
set(OVM_STANDALONE_BUILD FALSE)
endif()
if (WIN32)
add_definitions( -D_USE_MATH_DEFINES -DNOMINMAX )
endif ()
# include our cmake files
include (ACGCommon)
acg_get_version ()
include (ACGOutput)
set(OVM_ENABLE_APPLICATIONS ${OVM_STANDALONE_BUILD} CACHE BOOL "Build OpenVolumeMesh applications")
set(OVM_ENABLE_UNITTESTS ${OVM_STANDALONE_BUILD} CACHE BOOL "Build OpenVolumeMesh unit tests")
set(OVM_ENABLE_EXAMPLES ${OVM_STANDALONE_BUILD} CACHE BOOL "Build OpenVolumeMesh examples")
set(OVM_BUILD_DOCUMENTATION ${OVM_STANDALONE_BUILD} CACHE BOOL "Build OpenVolumeMesh documentation")
set(OVM_CXX_STANDARD 11 CACHE STRING "C++ standard version to use")
set_property(CACHE OVM_CXX_STANDARD PROPERTY STRINGS 11 14 17 20)
if (OVM_STANDALONE_BUILD)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/Build/bin")
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/Build/lib")
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/Build/lib")
set(OVM_TARGET_PREFIX "")
enable_testing()
option(STL_DEBUG "Enable STL debug checks. Warning: This must be consistent across the whole build! Not compatible with the libc++ shipped with Apple XCode as of 2019." OFF)
if (STL_DEBUG)
# We do not know which STL will be used, defining both is the easist way.
# https://libcxx.llvm.org/docs/UsingLibcxx.html#libc-configuration-macros
# https://libcxx.llvm.org/docs/DesignDocs/DebugMode.html#using-debug-mode
add_definitions(-D_LIBCPP_DEBUG=1)
# https://gcc.gnu.org/onlinedocs/libstdc%2B%2B/manual/debug_mode_using.html
add_definitions(-D_GLIBCXX_DEBUG=1)
add_definitions(-D_GLIBCXX_DEBUG_PEDANTIC=1)
endif()
else()
# OVM_TARGET_PREFIX is prepended to targets with generic names,
# i.e., "doc", "unittests"
set(OVM_TARGET_PREFIX "OVM_")
endif()
# ========================================================================
# Call the subdirectories with the projects
# ========================================================================
set (CMAKE_DEBUG_POSTFIX "d")
add_subdirectory (src)
# Only add examples and doc to build target if OpenVolumeMesh
# is not built as external library only
if(${PROJECT_NAME} MATCHES "OpenVolumeMesh")
add_subdirectory (examples)
add_subdirectory (documentation)
if (OVM_ENABLE_EXAMPLES)
add_subdirectory(examples)
endif()
if (OVM_BUILD_DOCUMENTATION)
add_subdirectory(documentation)
endif()
# ========================================================================
# Bundle generation (Targets exist, now configure them)
# ========================================================================
#export(PACKAGE OpenVolumeMesh)
# display results
acg_print_configure_header (OPENVOLUMEMESH "OpenVolumeMesh")
#list(REMOVE_AT CMAKE_MODULE_PATH -1)
VERSION=2.0.0
MAJOR=2
MINOR=0
PATCH=0
ID=OPENVOLUMEMESH
if (EXISTS ${CMAKE_SOURCE_DIR}/${CMAKE_PROJECT_NAME}.cmake)
include (${CMAKE_SOURCE_DIR}/${CMAKE_PROJECT_NAME}.cmake)
endif ()
# prevent build in source directory
if ("${CMAKE_BINARY_DIR}" STREQUAL "${CMAKE_SOURCE_DIR}")
message (SEND_ERROR "Building in the source directory is not supported.")
message (FATAL_ERROR "Please remove the created \"CMakeCache.txt\" file, the \"CMakeFiles\" directory and create a build directory and call \"${CMAKE_COMMAND} <path to the sources>\".")
endif ("${CMAKE_BINARY_DIR}" STREQUAL "${CMAKE_SOURCE_DIR}")
# allow only Debug and Release builds
set (CMAKE_CONFIGURATION_TYPES "Debug;Release" CACHE STRING "")
mark_as_advanced (CMAKE_CONFIGURATION_TYPES)
# set Debus as default build target
if (NOT CMAKE_BUILD_TYPE)
set (CMAKE_BUILD_TYPE Debug CACHE STRING
"Choose the type of build, options are: Debug, Release."
FORCE)
endif ()
# create our output directroy
if (NOT EXISTS ${CMAKE_BINARY_DIR}/Build)
file (MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/Build)
endif ()
# read version from file
macro (acg_get_version)
if (EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/${ARGN}/VERSION")
file (READ "${CMAKE_CURRENT_SOURCE_DIR}/${ARGN}/VERSION" _file)
else ()
file (READ "${CMAKE_CURRENT_SOURCE_DIR}/VERSION" _file)
endif ()
string (
REGEX REPLACE
"^.*ID=([^\n]*).*$" "\\1"
_id ${_file}
)
string (
REGEX REPLACE
"^.*VERSION=([^\n]*).*$" "\\1"
_version ${_file}
)
string (
REGEX REPLACE
"^.*MAJOR=([^\n]*).*$" "\\1"
_major ${_file}
)
string (
REGEX REPLACE
"^.*MINOR=([^\n]*).*$" "\\1"
_minor ${_file}
)
string (
REGEX REPLACE
"^.*PATCH=([^\n]*).*$" "\\1"
_patch ${_file}
)
set (${_id}_VERSION ${_version})
set (${_id}_VERSION_MAJOR ${_major})
set (${_id}_VERSION_MINOR ${_minor})
set (${_id}_VERSION_PATCH ${_patch})
endmacro ()
# set directory structures for the different platforms
if (CMAKE_HOST_SYSTEM_NAME MATCHES Windows)
set (ACG_PROJECT_DATADIR ".")
set (ACG_PROJECT_LIBDIR "lib")
set (ACG_PROJECT_BINDIR ".")
set (ACG_PROJECT_PLUGINDIR "Plugins")
if (NOT EXISTS ${CMAKE_BINARY_DIR}/Build/${ACG_PROJECT_LIBDIR})
file (MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/Build/${ACG_PROJECT_LIBDIR})
endif ()
elseif (APPLE)
set (ACG_PROJECT_DATADIR "share/${CMAKE_PROJECT_NAME}")
set (ACG_PROJECT_LIBDIR "lib${LIB_SUFFIX}")
set (CMAKE_LIBRARY_OUTPUT_DIR "${CMAKE_BINARY_DIR}/Build/${ACG_PROJECT_LIBDIR}")
set (ACG_PROJECT_PLUGINDIR "${ACG_PROJECT_LIBDIR}/plugins")
set (ACG_PROJECT_BINDIR "bin")
else ()
set (ACG_PROJECT_DATADIR "share/${CMAKE_PROJECT_NAME}")
set (ACG_PROJECT_LIBDIR "lib${LIB_SUFFIX}")
set (ACG_PROJECT_PLUGINDIR "${ACG_PROJECT_LIBDIR}/plugins")
set (ACG_PROJECT_BINDIR "bin")
endif ()
if( NOT APPLE )
# check 64 bit
if( CMAKE_SIZEOF_VOID_P MATCHES 4 )
set( HAVE_64_BIT 0 )
else( CMAKE_SIZEOF_VOID_P MATCHES 4 )
set( HAVE_64_BIT 1 )
endif( CMAKE_SIZEOF_VOID_P MATCHES 4 )
endif ( NOT APPLE )
# allow a project to modify the directories
if (COMMAND acg_modify_project_dirs)
acg_modify_project_dirs ()
endif ()
if (NOT EXISTS ${CMAKE_BINARY_DIR}/Build/${ACG_PROJECT_DATADIR})
file (MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/Build/${ACG_PROJECT_DATADIR})
endif ()
# sets default build properties
macro (acg_set_target_props target)
if (WIN32)
set_target_properties (
${target} PROPERTIES
BUILD_WITH_INSTALL_RPATH 1
SKIP_BUILD_RPATH 0
)
elseif (APPLE AND NOT ACG_PROJECT_MACOS_BUNDLE)
if (NOT (CMAKE_MAJOR_VERSION LESS 3) )
# save rpath
set_target_properties (
${target} PROPERTIES
INSTALL_RPATH "@executable_path/../${ACG_PROJECT_LIBDIR}"
MACOSX_RPATH 1
#BUILD_WITH_INSTALL_RPATH 1
SKIP_BUILD_RPATH 0
)
else()
# save rpath via install name dir
set_target_properties (
${target} PROPERTIES
INSTALL_NAME_DIR "@executable_path/../${ACG_PROJECT_LIBDIR}"
#BUILD_WITH_INSTALL_RPATH 1
SKIP_BUILD_RPATH 0
)
endif(NOT (CMAKE_MAJOR_VERSION LESS 3) )
elseif (NOT APPLE)
set_target_properties (
${target} PROPERTIES
INSTALL_RPATH "$ORIGIN/../${ACG_PROJECT_LIBDIR}"
BUILD_WITH_INSTALL_RPATH 1
SKIP_BUILD_RPATH 0
RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/Build/${ACG_PROJECT_BINDIR}"
LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/Build/${ACG_PROJECT_LIBDIR}"
)
endif ()
endmacro ()
include (AddFileDependencies)
include (ACGCompiler)
# define INCLUDE_TEMPLATES for everything we build
add_definitions (-DINCLUDE_TEMPLATES)
# unsets the given variable
macro (acg_unset var)
set (${var} "" CACHE INTERNAL "")
endmacro ()
# sets the given variable
macro (acg_set var value)
set (${var} ${value} CACHE INTERNAL "")
endmacro ()
# test for OpenMP
macro (acg_openmp)
if (NOT OPENMP_NOTFOUND)
find_package(OpenMP)
if (OPENMP_FOUND)
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}")
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS}")
add_definitions(-DUSE_OPENMP)
else ()
set (OPENMP_NOTFOUND 1)
endif()
endif ()
endmacro ()
# test for FTGL
macro (acg_ftgl)
find_package (Freetype)
if (FREETYPE_FOUND)
find_package (FTGL)
if (FTGL_FOUND)
add_definitions (-DUSE_FTGL)
include_directories (${FTGL_INCLUDE_DIR} ${FREETYPE_INCLUDE_DIR_freetype2})
set (FTGL_LIBS ${FREETYPE_LIBRARIES} ${FTGL_LIBRARIES})
endif ()
endif ()
endmacro ()
# append all files with extension "ext" in the "dirs" directories to "ret"
# excludes all files starting with a '.' (dot)
macro (acg_append_files ret ext)
foreach (_dir ${ARGN})
file (GLOB _files "${_dir}/${ext}")
foreach (_file ${_files})
get_filename_component (_filename ${_file} NAME)
if (_filename MATCHES "^[.]")
list (REMOVE_ITEM _files ${_file})
endif ()
endforeach ()
list (APPEND ${ret} ${_files})
endforeach ()
endmacro ()
# append all files with extension "ext" in the "dirs" directories and its subdirectories to "ret"
# excludes all files starting with a '.' (dot)
macro (acg_append_files_recursive ret ext)
foreach (_dir ${ARGN})
file (GLOB_RECURSE _files "${_dir}/${ext}")
foreach (_file ${_files})
get_filename_component (_filename ${_file} NAME)
if (_filename MATCHES "^[.]")
list (REMOVE_ITEM _files ${_file})
endif ()
endforeach ()
list (APPEND ${ret} ${_files})
endforeach ()
endmacro ()
# get all files in directory, but ignore svn
macro (acg_get_files_in_dir ret dir)
file (GLOB_RECURSE __files RELATIVE "${dir}" "${dir}/*")
foreach (_file ${__files})
if ( (NOT _file MATCHES ".*svn.*") AND (NOT _file MATCHES ".DS_Store") )
list (APPEND ${ret} "${_file}")
endif ()
endforeach ()
endmacro ()
# copy the whole directory without svn files
function (acg_copy_after_build target src dst)
acg_unset (_files)
acg_get_files_in_dir (_files ${src})
foreach (_file ${_files})
add_custom_command(TARGET ${target} POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_if_different "${src}/${_file}" "${dst}/${_file}"
)
endforeach ()
endfunction ()
# install the whole directory without svn files
function (acg_install_dir src dst)
acg_unset (_files)
acg_get_files_in_dir (_files ${src})
foreach (_file ${_files})
get_filename_component (_file_PATH ${_file} PATH)
install(FILES "${src}/${_file}"
DESTINATION "${dst}/${_file_PATH}"
)
endforeach ()
endfunction ()
# extended version of add_executable that also copies output to out Build directory
function (acg_add_executable _target)
add_executable (${_target} ${ARGN})
# set common target properties defined in common.cmake
acg_set_target_props (${_target})
if (WIN32 OR (APPLE AND NOT ACG_PROJECT_MACOS_BUNDLE))
add_custom_command (TARGET ${_target} POST_BUILD
COMMAND ${CMAKE_COMMAND} -E
copy_if_different
$<TARGET_FILE:${_target}>
${CMAKE_BINARY_DIR}/Build/${ACG_PROJECT_BINDIR}/$<TARGET_FILE_NAME:${_target}>)
endif (WIN32 OR (APPLE AND NOT ACG_PROJECT_MACOS_BUNDLE))
if (NOT ACG_PROJECT_MACOS_BUNDLE OR NOT APPLE)
install (TARGETS ${_target} DESTINATION ${ACG_PROJECT_BINDIR})
endif ()
endfunction ()
# extended version of add_library that also copies output to out Build directory
function (acg_add_library _target _libtype)
if (${_libtype} STREQUAL SHAREDANDSTATIC)
set (_type SHARED)
if (NOT WIN32 OR MINGW)
set (_and_static 1)
else ()
set (_and_static 0)
endif ()
else ()
set (_type ${_libtype})
set (_and_static 0)
endif ()
add_library (${_target} ${_type} ${ARGN} )
# set common target properties defined in common.cmake
acg_set_target_props (${_target})
if (_and_static)
add_library (${_target}Static STATIC ${ARGN})
# set common target properties defined in common.cmake
acg_set_target_props (${_target}Static)
set_target_properties(${_target}Static PROPERTIES OUTPUT_NAME ${_target})
if (NOT APPLE)
set_target_properties (${_target}Static PROPERTIES
LIBRARY_OUTPUT_DIRECTORY "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}"
)
endif ()
endif ()
if ( (WIN32 AND MSVC) OR (APPLE AND NOT ACG_PROJECT_MACOS_BUNDLE))
if (${_type} STREQUAL SHARED)
add_custom_command (TARGET ${_target} POST_BUILD
COMMAND ${CMAKE_COMMAND} -E
copy_if_different
$<TARGET_FILE:${_target}>
${CMAKE_BINARY_DIR}/Build/${ACG_PROJECT_LIBDIR}/$<TARGET_FILE_NAME:${_target}>)
add_custom_command (TARGET ${_target} POST_BUILD
COMMAND ${CMAKE_COMMAND} -E
copy_if_different
$<TARGET_LINKER_FILE:${_target}>
${CMAKE_BINARY_DIR}/Build/${ACG_PROJECT_LIBDIR}/$<TARGET_LINKER_FILE_NAME:${_target}>)
elseif (${_type} STREQUAL MODULE)
if (NOT EXISTS ${CMAKE_BINARY_DIR}/Build/${ACG_PROJECT_PLUGINDIR})
file (MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/Build/${ACG_PROJECT_PLUGINDIR})
endif ()
add_custom_command (TARGET ${_target} POST_BUILD
COMMAND ${CMAKE_COMMAND} -E
copy_if_different
$<TARGET_FILE:${_target}>
${CMAKE_BINARY_DIR}/Build/${ACG_PROJECT_PLUGINDIR}/$<TARGET_FILE_NAME:${_target}>)
elseif (${_type} STREQUAL STATIC)
add_custom_command (TARGET ${_target} POST_BUILD
COMMAND ${CMAKE_COMMAND} -E
copy_if_different
$<TARGET_FILE:${_target}>
${CMAKE_BINARY_DIR}/Build/${ACG_PROJECT_LIBDIR}/$<TARGET_FILE_NAME:${_target}>)
endif()
# make an extra copy for windows into the binary directory
if (${_type} STREQUAL SHARED AND WIN32)
add_custom_command (TARGET ${_target} POST_BUILD
COMMAND ${CMAKE_COMMAND} -E
copy_if_different
$<TARGET_FILE:${_target}>
${CMAKE_BINARY_DIR}/Build/${ACG_PROJECT_BINDIR}/$<TARGET_FILE_NAME:${_target}>)
endif ()
endif( (WIN32 AND MSVC) OR (APPLE AND NOT ACG_PROJECT_MACOS_BUNDLE))
if (_and_static)
add_custom_command (TARGET ${_target}Static POST_BUILD
COMMAND ${CMAKE_COMMAND} -E
copy_if_different
$<TARGET_FILE:${_target}Static>
${CMAKE_BINARY_DIR}/Build/${ACG_PROJECT_LIBDIR}/$<TARGET_FILE_NAME:${_target}Static>)
endif ()
# Block installation of libraries by setting ACG_NO_LIBRARY_INSTALL
if ( NOT ACG_NO_LIBRARY_INSTALL )
if (NOT ACG_PROJECT_MACOS_BUNDLE OR NOT APPLE)
if (${_type} STREQUAL SHARED OR ${_type} STREQUAL STATIC )
install (TARGETS ${_target}
RUNTIME DESTINATION ${ACG_PROJECT_BINDIR}
LIBRARY DESTINATION ${ACG_PROJECT_LIBDIR}
ARCHIVE DESTINATION ${ACG_PROJECT_LIBDIR})