2010-05-11 19:44:00 +02:00
|
|
|
# ----------------------------------------------------------------------------
|
|
|
|
# CMake file for zlib. See root CMakeLists.txt
|
|
|
|
#
|
|
|
|
# ----------------------------------------------------------------------------
|
2010-12-05 02:19:36 +01:00
|
|
|
PROJECT(zlib)
|
2010-05-11 19:44:00 +02:00
|
|
|
|
|
|
|
# List of C++ files:
|
|
|
|
|
2011-04-26 17:46:15 +02:00
|
|
|
include_directories("${CMAKE_CURRENT_SOURCE_DIR}")
|
2010-05-11 19:44:00 +02:00
|
|
|
|
|
|
|
file(GLOB lib_srcs *.c)
|
|
|
|
file(GLOB lib_hdrs *.h)
|
|
|
|
|
2010-12-05 02:19:36 +01:00
|
|
|
set(the_target "zlib")
|
2010-05-11 19:44:00 +02:00
|
|
|
|
2011-04-26 17:46:15 +02:00
|
|
|
add_library(${the_target} STATIC ${lib_srcs} ${lib_hdrs})
|
2010-05-11 19:44:00 +02:00
|
|
|
|
|
|
|
if(MSVC)
|
|
|
|
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /W3")
|
|
|
|
endif()
|
|
|
|
|
|
|
|
if(UNIX)
|
|
|
|
if(CMAKE_COMPILER_IS_GNUCXX OR CV_ICC)
|
|
|
|
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIC")
|
|
|
|
endif()
|
|
|
|
endif()
|
|
|
|
|
|
|
|
set_target_properties(${the_target}
|
|
|
|
PROPERTIES
|
|
|
|
OUTPUT_NAME "${the_target}"
|
|
|
|
DEBUG_POSTFIX "${OPENCV_DEBUG_POSTFIX}"
|
2011-06-24 17:40:27 +02:00
|
|
|
ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/3rdparty/${OPENCV_LIB_INSTALL_PATH}"
|
2010-05-11 19:44:00 +02:00
|
|
|
)
|
2010-09-22 04:01:54 +02:00
|
|
|
|
2011-05-17 11:40:06 +02:00
|
|
|
if(ENABLE_SOLUTION_FOLDERS)
|
2011-05-11 15:37:20 +02:00
|
|
|
set_target_properties(${the_target} PROPERTIES FOLDER "3rdparty")
|
|
|
|
endif()
|
|
|
|
|
2010-12-05 00:02:36 +01:00
|
|
|
if(NOT BUILD_SHARED_LIBS)
|
|
|
|
install(TARGETS ${the_target}
|
2011-06-27 15:59:03 +02:00
|
|
|
ARCHIVE DESTINATION share/OpenCV/3rdparty/${OPENCV_LIB_INSTALL_PATH} COMPONENT main)
|
2010-12-05 00:02:36 +01:00
|
|
|
endif()
|