Commit 1c939748 authored by saubatn's avatar saubatn

UPDATED : Add the "D" suffix for all libraries compiled in Debug mode.

UPDATED : Add the "-debug" suffix for all executables compiled in Debug mode.
UPDATED : Debug and Release builds in VS are now in the build/bin directory (no more subfolders).

git-svn-id: svn+ssh://scm.forge.imag.fr/var/lib/gforge/chroot/scmrepos/svn/camitk/trunk/camitk@726 ec899d31-69d1-42ba-9299-647d76f65fb3
parent a7424ca5
......@@ -42,6 +42,25 @@ include(CamiTKPackaging)
# enables to specify which target to launch to MSVC
include(CreateLaunchers)
# Eeach library compiled in Debug mode are suffixed with an D
set(CMAKE_DEBUG_POSTFIX "D" CACHE TYPE STRING)
# By default, validate all projects are build in the build/bin directory (no subfolders).
# Note that, subfolders for actions / components are added later.
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CAMITK_BIN_DIR})
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CAMITK_BIN_DIR})
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CAMITK_BIN_DIR})
# Remove the Debug, Release subfolders in build/bin, natively created with Visual Studio
if ( ${CMAKE_GENERATOR} MATCHES "Visual Studio") # MSVC compiler
foreach( OUTPUTCONFIG ${CMAKE_CONFIGURATION_TYPES} )
string( TOUPPER ${OUTPUTCONFIG} OUTPUTCONFIG )
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_${OUTPUTCONFIG} ${CAMITK_BIN_DIR} CACHE TYPE STRING)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY_${OUTPUTCONFIG} ${CAMITK_BIN_DIR} CACHE TYPE STRING)
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY_${OUTPUTCONFIG} ${CAMITK_BIN_DIR} CACHE TYPE STRING)
endforeach( OUTPUTCONFIG CMAKE_CONFIGURATION_TYPES )
endif(${CMAKE_GENERATOR} MATCHES "Visual Studio")
# Create the Xml data for Project.xml description, fyi store in the global variable CAMITK_XML_PROJECT_DESCRIPTION
camitk_sub_project_init()
......
......@@ -378,12 +378,28 @@ macro(camitk_extension)
endif()
set(${TYPE_EXTENSION_CMAKE}_TARGET_NAME ${TYPE_EXTENSION}-${${TYPE_EXTENSION_CMAKE}_OUTPUT_NAME})
message(STATUS "Building extension ${${TYPE_EXTENSION_CMAKE}_TARGET_NAME}")
# actions are compiled as shared object
# extensions are compiled as shared object
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${TYPE_EXTENSION}s)
# extension are compiled as shared object (for dll plateform put it in BIN)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${TYPE_EXTENSION}s)
# Be sure to build in the bin folder with MinGW (no subfolder allowed, except actions / componennts ones).
if ( ${CMAKE_GENERATOR} MATCHES "MinGW") # MinGW compiler
set( CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CAMITK_BIN_DIR}/${TYPE_EXTENSION}s)
set( CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CAMITK_BIN_DIR}/${TYPE_EXTENSION}s)
set( CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CAMITK_BIN_DIR}/${TYPE_EXTENSION}s)
endif(${CMAKE_GENERATOR} MATCHES "MinGW")
# Remove the subdirectories Debug and Release of the bin folder in Visual Studio
if ( ${CMAKE_GENERATOR} MATCHES "Visual Studio") # MSVC compiler
foreach( OUTPUTCONFIG ${CMAKE_CONFIGURATION_TYPES} )
string( TOUPPER ${OUTPUTCONFIG} OUTPUTCONFIG )
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_${OUTPUTCONFIG} ${CAMITK_BIN_DIR}/${TYPE_EXTENSION}s)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY_${OUTPUTCONFIG} ${CAMITK_BIN_DIR}/${TYPE_EXTENSION}s)
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY_${OUTPUTCONFIG} ${CAMITK_BIN_DIR}/${TYPE_EXTENSION}s)
endforeach( OUTPUTCONFIG CMAKE_CONFIGURATION_TYPES )
endif(${CMAKE_GENERATOR} MATCHES "Visual Studio")
# include directories
include_directories(${CAMITK_INCLUDE_DIRECTORIES})
......@@ -913,6 +929,7 @@ macro(application_extension)
message(WARNING "Warning: ${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt: application_extension macro option NEEDS_TOOL is deprecated, please use NEEDS_CEP_LIBRARIES instead..")
set(CEP_LIBRARIES ${CEP_LIBRARIES} ${${APPLICATION_NAME_CMAKE}_NEEDS_TOOL})
endif()
# check the option
if(${APPLICATION_NAME_CMAKE}_NEEDS_CEP_LIBRARIES)
foreach(CEP_LIBRARIES_NEEDED ${${APPLICATION_NAME_CMAKE}_NEEDS_CEP_LIBRARIES})
......@@ -1013,6 +1030,7 @@ macro(application_extension)
# target properties
set_target_properties(${APPLICATION_TARGET_NAME}
PROPERTIES OUTPUT_NAME camitk-${APPLICATION_NAME}
DEBUG_POSTFIX "-debug"
)
# CEP library dependencies
......
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