Fixed output paths for some libraries and executables.

Added option to force disable precompiled headers.
This commit is contained in:
Andrey Kamaev 2011-04-30 10:42:33 +00:00
parent c122b7e114
commit 41f5e8e3d8
6 changed files with 24 additions and 8 deletions

View File

@ -230,6 +230,12 @@ endif()
include(OpenCVPCHSupport.cmake REQUIRED)
include(OpenCVModule.cmake REQUIRED)
if(PCHSupport_FOUND)
SET(USE_PRECOMPILED_HEADERS ON CACHE BOOL "Use precompiled headers")
else()
SET(USE_PRECOMPILED_HEADERS OFF CACHE BOOL "Use precompiled headers" FORCE)
endif()
if(UNIX)
include(OpenCVFindPkgConfig.cmake OPTIONAL)
include(CheckFunctionExists)

View File

@ -46,7 +46,7 @@ macro(define_opencv_module name)
INSTALL_NAME_DIR "${CMAKE_INSTALL_PREFIX}/lib"
)
if(PCHSupport_FOUND)
if(PCHSupport_FOUND AND USE_PRECOMPILED_HEADERS)
set(pch_header ${CMAKE_CURRENT_SOURCE_DIR}/src/precomp.hpp)
if(${CMAKE_GENERATOR} MATCHES "Visual*" OR ${CMAKE_GENERATOR} MATCHES "Xcode*")
if(${CMAKE_GENERATOR} MATCHES "Visual*")
@ -110,7 +110,7 @@ macro(define_opencv_module name)
add_executable(${the_target} ${test_srcs} ${test_hdrs})
if(PCHSupport_FOUND)
if(PCHSupport_FOUND AND USE_PRECOMPILED_HEADERS)
set(pch_header ${CMAKE_CURRENT_SOURCE_DIR}/test/test_precomp.hpp)
if(${CMAKE_GENERATOR} MATCHES "Visual*" OR ${CMAKE_GENERATOR} MATCHES "Xcode*")
if(${CMAKE_GENERATOR} MATCHES "Visual*")

View File

@ -34,11 +34,6 @@ ELSE()
ENDIF()
ENDIF(CMAKE_COMPILER_IS_GNUCXX)
#if (ANDROID)
#SET(PCHSupport_FOUND FALSE)
#endif()
MACRO(_PCH_GET_COMPILE_FLAGS _out_compile_flags)
@ -213,6 +208,12 @@ MACRO(ADD_PRECOMPILED_HEADER _targetName _input)
ELSE(${_targetType} STREQUAL SHARED_LIBRARY)
ADD_LIBRARY(${_targetName}_pch_dephelp STATIC ${_pch_dephelp_cxx})
ENDIF(${_targetType} STREQUAL SHARED_LIBRARY)
set_target_properties(${_targetName}_pch_dephelp PROPERTIES
DEBUG_POSTFIX "${OPENCV_DEBUG_POSTFIX}"
ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib/"
)
FILE(MAKE_DIRECTORY ${_outdir})

View File

@ -38,6 +38,12 @@ set(cvhaartraining_lib_src
)
add_library(opencv_haartraining_engine STATIC ${cvhaartraining_lib_src})
set_target_properties(opencv_haartraining_engine PROPERTIES
DEBUG_POSTFIX "${OPENCV_DEBUG_POSTFIX}"
ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib/"
RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin/"
INSTALL_NAME_DIR "${CMAKE_INSTALL_PREFIX}/lib"
)
if(NOT ANDROID)
# -----------------------------------------------------------

View File

@ -252,7 +252,7 @@ endif()
add_library(${the_target} ${lib_srcs} ${highgui_hdrs} ${grfmt_hdrs} ${highgui_ext_hdrs})
if(PCHSupport_FOUND)
if(PCHSupport_FOUND AND USE_PRECOMPILED_HEADERS)
set(pch_header ${CMAKE_CURRENT_SOURCE_DIR}/src/precomp.hpp)
if(${CMAKE_GENERATOR} MATCHES "Visual*" OR ${CMAKE_GENERATOR} MATCHES "Xcode*")
if(${CMAKE_GENERATOR} MATCHES "Visual*")

View File

@ -30,6 +30,9 @@ add_executable(${the_target} ${traincascade_files})
add_dependencies(${the_target} ${traincascade_libs})
set_target_properties(${the_target} PROPERTIES
DEBUG_POSTFIX "${OPENCV_DEBUG_POSTFIX}"
ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib/"
RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin/"
INSTALL_NAME_DIR "${CMAKE_INSTALL_PREFIX}/lib"
OUTPUT_NAME "opencv_traincascade")
target_link_libraries(${the_target} ${traincascade_libs})