Commit d32542b7 authored by Jan Möbius's avatar Jan Möbius

Dennis:

Updated cmake files



git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@6312 383ad7c9-94d9-4d36-a494-682f7c89f535
parent 4899e6e6
......@@ -5,7 +5,7 @@ macro (acg_modify_project_dirs)
if (WIN32)
add_definitions(
-D_USE_MATH_DEFINES -DNOMINMAX
-DOPENFLIPPER_APPDIR=".."
-DOPENFLIPPER_APPDIR="."
-DOPENFLIPPER_PLUGINDIR="${ACG_PROJECT_PLUGINDIR}"
-DOPENFLIPPER_DATADIR="${ACG_PROJECT_DATADIR}"
)
......
......@@ -98,12 +98,12 @@ if (WIN32)
if (EXISTS ${CMAKE_SOURCE_DIR}/WIN)
file (GLOB _files "${CMAKE_SOURCE_DIR}/WIN/DLLs/DLLs 32 debug/*.dll")
install(FILES ${_files}
DESTINATION ${ACG_PROJECT_LIBDIR}
DESTINATION ${ACG_PROJECT_BINDIR}
CONFIGURATIONS Debug
)
file (GLOB _files "${CMAKE_SOURCE_DIR}/WIN/DLLs/DLLs 32 release/*.dll")
install (FILES ${_files}
DESTINATION ${ACG_PROJECT_LIBDIR}
DESTINATION ${ACG_PROJECT_BINDIR}
CONFIGURATIONS Release
)
endif ()
......@@ -114,7 +114,15 @@ elseif (APPLE)
endif ()
# has to be last
include (InstallRequiredSystemLibraries)
if (WIN32)
set (CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_SKIP "true")
include (InstallRequiredSystemLibraries)
install (PROGRAMS ${CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS} DESTINATION ${ACG_PROJECT_BINDIR})
else ()
include (InstallRequiredSystemLibraries)
endif ()
include (CPack)
if (NOT WIN32 AND NOT APPLE)
......
......@@ -57,11 +57,11 @@ endmacro ()
# set directory structures for the different platforms
if (WIN32)
set (ACG_PROJECT_DATADIR ".")
set (ACG_PROJECT_LIBDIR "bin")
set (ACG_PROJECT_BINDIR "bin")
set (ACG_PROJECT_LIBDIR "lib")
set (ACG_PROJECT_BINDIR ".")
set (ACG_PROJECT_PLUGINDIR "Plugins")
if (NOT EXISTS ${CMAKE_BINARY_DIR}/Build/${ACG_PROJECT_BINDIR})
file (MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/Build/${ACG_PROJECT_BINDIR})
if (NOT EXISTS ${CMAKE_BINARY_DIR}/Build/${ACG_PROJECT_LIBDIR})
file (MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/Build/${ACG_PROJECT_LIBDIR})
endif ()
else ()
set (ACG_PROJECT_DATADIR "share/${CMAKE_PROJECT_NAME}")
......@@ -342,7 +342,7 @@ function (acg_add_library _target _type)
COMMAND ${CMAKE_COMMAND} -E
copy_if_different
${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/${_target}.dll
${CMAKE_BINARY_DIR}/Build/${ACG_PROJECT_LIBDIR}/${_target}.dll)
${CMAKE_BINARY_DIR}/Build/${ACG_PROJECT_BINDIR}/${_target}.dll)
elseif (${_type} STREQUAL MODULE)
if (NOT EXISTS ${CMAKE_BINARY_DIR}/Build/${ACG_PROJECT_PLUGINDIR})
file (MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/Build/${ACG_PROJECT_PLUGINDIR})
......@@ -353,27 +353,37 @@ function (acg_add_library _target _type)
${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/${_target}.dll
${CMAKE_BINARY_DIR}/Build/${ACG_PROJECT_PLUGINDIR}/${_target}.dll)
endif ()
if (${_type} STREQUAL SHARED OR ${_type} STREQUAL STATIC)
add_custom_command (TARGET ${_target} POST_BUILD
COMMAND ${CMAKE_COMMAND} -E
copy_if_different
${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/${_target}.lib
${CMAKE_BINARY_DIR}/Build/${ACG_PROJECT_LIBDIR}/${_target}.lib)
endif ()
elseif (APPLE AND NOT ACG_PROJECT_MACOS_BUNDLE)
if (${_type} STREQUAL SHARED)
add_custom_command (TARGET ${target} POST_BUILD
add_custom_command (TARGET ${_target} POST_BUILD
COMMAND ${CMAKE_COMMAND} -E
copy_if_different
${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/${_target}.dylib
${CMAKE_BINARY_DIR}/Build/${ACG_PROJECT_LIBDIR}/${_target}.dylib)
${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/lib${_target}.dylib
${CMAKE_BINARY_DIR}/Build/${ACG_PROJECT_LIBDIR}/lib${_target}.dylib)
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
add_custom_command (TARGET ${_target} POST_BUILD
COMMAND ${CMAKE_COMMAND} -E
copy_if_different
${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/${_target}.so
${CMAKE_BINARY_DIR}/Build/${ACG_PROJECT_PLUGINDIR}/${_target}.so)
${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/lib${_target}.so
${CMAKE_BINARY_DIR}/Build/${ACG_PROJECT_PLUGINDIR}/lib${_target}.so)
endif ()
endif ()
if (NOT ACG_PROJECT_BUNDLE OR NOT APPLE)
if (${_type} STREQUAL SHARED)
install (TARGETS ${_target} DESTINATION ${ACG_PROJECT_LIBDIR})
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})
elseif (${_type} STREQUAL MODULE)
install (TARGETS ${_target} DESTINATION ${ACG_PROJECT_PLUGINDIR})
endif ()
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment