ACGCommon_update_and_use_SHAREDANDSTATIC_target_and_dont_install_headers_in_bundle
git-svn-id: http://www.openmesh.org/svnrepo/OpenMesh/trunk@166 fdac6126-5c0c-442c-9429-916003d36597
This commit is contained in:
@@ -321,18 +321,43 @@ function (acg_add_executable _target)
|
|||||||
${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/${_target}
|
${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/${_target}
|
||||||
${CMAKE_BINARY_DIR}/Build/${ACG_PROJECT_BINDIR}/${_target})
|
${CMAKE_BINARY_DIR}/Build/${ACG_PROJECT_BINDIR}/${_target})
|
||||||
endif ()
|
endif ()
|
||||||
if (NOT ACG_PROJECT_BUNDLE OR NOT APPLE)
|
if (NOT ACG_PROJECT_MACOS_BUNDLE OR NOT APPLE)
|
||||||
install (TARGETS ${_target} DESTINATION ${ACG_PROJECT_BINDIR})
|
install (TARGETS ${_target} DESTINATION ${ACG_PROJECT_BINDIR})
|
||||||
endif ()
|
endif ()
|
||||||
endfunction ()
|
endfunction ()
|
||||||
|
|
||||||
# extended version of add_library that also copies output to out Build directory
|
# extended version of add_library that also copies output to out Build directory
|
||||||
function (acg_add_library _target _type)
|
function (acg_add_library _target _libtype)
|
||||||
|
|
||||||
|
if (${_libtype} STREQUAL SHAREDANDSTATIC)
|
||||||
|
set (_type SHARED)
|
||||||
|
if (NOT WIN32)
|
||||||
|
set (_and_static 1)
|
||||||
|
else ()
|
||||||
|
set (_and_static 0)
|
||||||
|
endif ()
|
||||||
|
else ()
|
||||||
|
set (_type ${_libtype})
|
||||||
|
set (_and_static 0)
|
||||||
|
endif ()
|
||||||
|
|
||||||
add_library (${_target} ${_type} ${ARGN})
|
add_library (${_target} ${_type} ${ARGN})
|
||||||
|
|
||||||
# set common target properties defined in common.cmake
|
# set common target properties defined in common.cmake
|
||||||
acg_set_target_props (${_target})
|
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)
|
||||||
|
|
||||||
|
if (NOT APPLE)
|
||||||
|
set_target_properties (${_target}Static PROPERTIES
|
||||||
|
LIBRARY_OUTPUT_DIRECTORY "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}")
|
||||||
|
endif ()
|
||||||
|
endif ()
|
||||||
|
|
||||||
if (WIN32)
|
if (WIN32)
|
||||||
# copy exe file to "Build" directory
|
# copy exe file to "Build" directory
|
||||||
# Visual studio will create this file in a subdirectory so we can't use
|
# Visual studio will create this file in a subdirectory so we can't use
|
||||||
@@ -376,9 +401,31 @@ function (acg_add_library _target _type)
|
|||||||
copy_if_different
|
copy_if_different
|
||||||
${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/lib${_target}.so
|
${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/lib${_target}.so
|
||||||
${CMAKE_BINARY_DIR}/Build/${ACG_PROJECT_PLUGINDIR}/lib${_target}.so)
|
${CMAKE_BINARY_DIR}/Build/${ACG_PROJECT_PLUGINDIR}/lib${_target}.so)
|
||||||
|
elseif (${_type} STREQUAL STATIC)
|
||||||
|
add_custom_command (TARGET ${_target} POST_BUILD
|
||||||
|
COMMAND ${CMAKE_COMMAND} -E
|
||||||
|
copy_if_different
|
||||||
|
${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/lib${_target}.a
|
||||||
|
${CMAKE_BINARY_DIR}/Build/${ACG_PROJECT_LIBDIR}/lib${_target}.a)
|
||||||
endif ()
|
endif ()
|
||||||
|
if (_and_static)
|
||||||
|
add_custom_command (TARGET ${_target}Static POST_BUILD
|
||||||
|
COMMAND ${CMAKE_COMMAND} -E
|
||||||
|
copy_if_different
|
||||||
|
${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/lib${_target}Static.a
|
||||||
|
${CMAKE_BINARY_DIR}/Build/${ACG_PROJECT_LIBDIR}/lib${_target}.a)
|
||||||
endif ()
|
endif ()
|
||||||
if (NOT ACG_PROJECT_BUNDLE OR NOT APPLE)
|
|
||||||
|
elseif (NOT APPLE AND _and_static)
|
||||||
|
add_custom_command (TARGET ${_target}Static POST_BUILD
|
||||||
|
COMMAND ${CMAKE_COMMAND} -E
|
||||||
|
copy_if_different
|
||||||
|
${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/lib${_target}Static.a
|
||||||
|
${CMAKE_BINARY_DIR}/Build/${ACG_PROJECT_LIBDIR}/lib${_target}.a)
|
||||||
|
|
||||||
|
endif ()
|
||||||
|
|
||||||
|
if (NOT ACG_PROJECT_MACOS_BUNDLE OR NOT APPLE)
|
||||||
if (${_type} STREQUAL SHARED OR ${_type} STREQUAL STATIC)
|
if (${_type} STREQUAL SHARED OR ${_type} STREQUAL STATIC)
|
||||||
install (TARGETS ${_target}
|
install (TARGETS ${_target}
|
||||||
RUNTIME DESTINATION ${ACG_PROJECT_BINDIR}
|
RUNTIME DESTINATION ${ACG_PROJECT_BINDIR}
|
||||||
|
|||||||
@@ -28,12 +28,13 @@ if (WIN32)
|
|||||||
# OpenMesh has no dll exports so we have to build a static library on windows
|
# OpenMesh has no dll exports so we have to build a static library on windows
|
||||||
acg_add_library (OpenMeshCore STATIC ${sources} ${headers})
|
acg_add_library (OpenMeshCore STATIC ${sources} ${headers})
|
||||||
else ()
|
else ()
|
||||||
acg_add_library (OpenMeshCore SHARED ${sources} ${headers})
|
acg_add_library (OpenMeshCore SHAREDANDSTATIC ${sources} ${headers})
|
||||||
acg_add_library (OpenMeshCores STATIC ${sources} ${headers})
|
|
||||||
endif ()
|
endif ()
|
||||||
|
|
||||||
|
|
||||||
# Install Header Files
|
# Install Header Files
|
||||||
|
|
||||||
|
if (NOT ACG_PROJECT_MACOS_BUNDLE OR NOT APPLE)
|
||||||
install(DIRECTORY .
|
install(DIRECTORY .
|
||||||
DESTINATION include/OpenMesh/Core
|
DESTINATION include/OpenMesh/Core
|
||||||
FILES_MATCHING
|
FILES_MATCHING
|
||||||
@@ -71,5 +72,6 @@ install(DIRECTORY IO/
|
|||||||
PATTERN "exporter" EXCLUDE
|
PATTERN "exporter" EXCLUDE
|
||||||
PATTERN "tmp" EXCLUDE
|
PATTERN "tmp" EXCLUDE
|
||||||
PATTERN "Debian*" EXCLUDE )
|
PATTERN "Debian*" EXCLUDE )
|
||||||
|
endif ()
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -28,12 +28,13 @@ if (WIN32)
|
|||||||
# OpenMesh has no dll exports so we have to build a static library on windows
|
# OpenMesh has no dll exports so we have to build a static library on windows
|
||||||
acg_add_library (OpenMeshTools STATIC ${sources} ${headers})
|
acg_add_library (OpenMeshTools STATIC ${sources} ${headers})
|
||||||
else ()
|
else ()
|
||||||
acg_add_library (OpenMeshTools SHARED ${sources} ${headers})
|
acg_add_library (OpenMeshTools SHAREDANDSTATIC ${sources} ${headers})
|
||||||
acg_add_library (OpenMeshToolss STATIC ${sources} ${headers})
|
|
||||||
endif ()
|
endif ()
|
||||||
|
|
||||||
target_link_libraries (OpenMeshTools OpenMeshCore)
|
target_link_libraries (OpenMeshTools OpenMeshCore)
|
||||||
|
target_link_libraries (OpenMeshToolsStatic OpenMeshCoreStatic)
|
||||||
|
|
||||||
|
if (NOT ACG_PROJECT_MACOS_BUNDLE OR NOT APPLE)
|
||||||
# Install Header Files
|
# Install Header Files
|
||||||
install(DIRECTORY .
|
install(DIRECTORY .
|
||||||
DESTINATION include/OpenMesh/Tools
|
DESTINATION include/OpenMesh/Tools
|
||||||
@@ -55,4 +56,4 @@ install(DIRECTORY .
|
|||||||
PATTERN "tmp" EXCLUDE
|
PATTERN "tmp" EXCLUDE
|
||||||
PATTERN "Templates" EXCLUDE
|
PATTERN "Templates" EXCLUDE
|
||||||
PATTERN "Debian*" EXCLUDE)
|
PATTERN "Debian*" EXCLUDE)
|
||||||
|
endif ()
|
||||||
|
|||||||
Reference in New Issue
Block a user