2010-05-12 01:44:00 +08:00
|
|
|
# ----------------------------------------------------------------------------
|
|
|
|
# CMake file for zlib. See root CMakeLists.txt
|
|
|
|
#
|
|
|
|
# ----------------------------------------------------------------------------
|
2010-12-05 09:19:36 +08:00
|
|
|
PROJECT(zlib)
|
2010-05-12 01:44:00 +08:00
|
|
|
|
|
|
|
# List of C++ files:
|
|
|
|
|
2011-04-26 23:46:15 +08:00
|
|
|
include_directories("${CMAKE_CURRENT_SOURCE_DIR}")
|
2010-05-12 01:44:00 +08:00
|
|
|
|
|
|
|
file(GLOB lib_srcs *.c)
|
|
|
|
file(GLOB lib_hdrs *.h)
|
|
|
|
|
2010-12-05 09:19:36 +08:00
|
|
|
set(the_target "zlib")
|
2010-05-12 01:44:00 +08:00
|
|
|
|
2011-04-26 23:46:15 +08:00
|
|
|
add_library(${the_target} STATIC ${lib_srcs} ${lib_hdrs})
|
2010-05-12 01:44:00 +08: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}"
|
|
|
|
ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/3rdparty/lib"
|
|
|
|
)
|
2010-09-22 10:01:54 +08:00
|
|
|
|
2011-05-17 17:40:06 +08:00
|
|
|
if(ENABLE_SOLUTION_FOLDERS)
|
2011-05-11 21:37:20 +08:00
|
|
|
set_target_properties(${the_target} PROPERTIES FOLDER "3rdparty")
|
|
|
|
endif()
|
|
|
|
|
2010-12-05 07:02:36 +08:00
|
|
|
if(NOT BUILD_SHARED_LIBS)
|
|
|
|
install(TARGETS ${the_target}
|
2010-12-05 10:10:59 +08:00
|
|
|
ARCHIVE DESTINATION share/opencv/3rdparty/lib COMPONENT main)
|
2010-12-05 07:02:36 +08:00
|
|
|
endif()
|