-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
39 lines (29 loc) · 1.05 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
# ----------------------------------------------------------------------------
# CMake file for libpng. See root CMakeLists.txt
#
# ----------------------------------------------------------------------------
project(libpng)
# List of C++ files:
include_directories("${CMAKE_CURRENT_SOURCE_DIR}")
if(ZLIB_FOUND)
include_directories(${ZLIB_INCLUDE_DIR})
else()
include_directories("${CMAKE_CURRENT_SOURCE_DIR}/../zlib")
endif()
file(GLOB lib_srcs *.c)
file(GLOB lib_hdrs *.h)
# ----------------------------------------------------------------------------------
# Define the library target:
# ----------------------------------------------------------------------------------
set(the_target "png")
add_library(${the_target} STATIC ${lib_srcs} ${lib_hdrs})
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()
install(TARGETS ${the_target} EXPORT png-exports DESTINATION lib)
install(FILES ${lib_hdrs} DESTINATION include)