aboutsummaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorkinichiro <kinichiro.inoguchi@gmail.com>2018-10-05 22:59:44 +0900
committerkinichiro <kinichiro.inoguchi@gmail.com>2018-10-05 22:59:44 +0900
commit0b8343ace3a854fcb2d7bed850847db54841d6cf (patch)
treead401ecf9878a28af13eb3d1cecc442d009a5263 /CMakeLists.txt
parentf819a2bce7a708147df16b5bef21ccaadf7b9913 (diff)
downloadportable-0b8343ace3a854fcb2d7bed850847db54841d6cf.tar.gz
portable-0b8343ace3a854fcb2d7bed850847db54841d6cf.tar.bz2
portable-0b8343ace3a854fcb2d7bed850847db54841d6cf.zip
Fix cmake to generate proper Libs.private in .pc files
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt13
1 files changed, 7 insertions, 6 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 27cd8da..8fde8cf 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -55,7 +55,7 @@ if(CMAKE_SYSTEM_NAME MATCHES "Linux")
55 add_definitions(-D_BSD_SOURCE) 55 add_definitions(-D_BSD_SOURCE)
56 add_definitions(-D_POSIX_SOURCE) 56 add_definitions(-D_POSIX_SOURCE)
57 add_definitions(-D_GNU_SOURCE) 57 add_definitions(-D_GNU_SOURCE)
58 set(PLATFORM_LDADD ${PLATFORM_LDADD} pthread) 58 set(PLATFORM_LIBS ${PLATFORM_LIBS} pthread)
59endif() 59endif()
60 60
61if(CMAKE_SYSTEM_NAME MATCHES "MINGW") 61if(CMAKE_SYSTEM_NAME MATCHES "MINGW")
@@ -74,7 +74,7 @@ if(CMAKE_SYSTEM_NAME MATCHES "HP-UX")
74 set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g -O2 +DD64 +Otype_safety=off") 74 set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g -O2 +DD64 +Otype_safety=off")
75 endif() 75 endif()
76 set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -D_XOPEN_SOURCE=600 -D__STRICT_ALIGNMENT") 76 set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -D_XOPEN_SOURCE=600 -D__STRICT_ALIGNMENT")
77 set(PLATFORM_LDADD ${PLATFORM_LDADD} pthread) 77 set(PLATFORM_LIBS ${PLATFORM_LIBS} pthread)
78endif() 78endif()
79 79
80if(CMAKE_SYSTEM_NAME MATCHES "SunOS") 80if(CMAKE_SYSTEM_NAME MATCHES "SunOS")
@@ -83,7 +83,7 @@ if(CMAKE_SYSTEM_NAME MATCHES "SunOS")
83 set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -D_XOPEN_SOURCE=600") 83 set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -D_XOPEN_SOURCE=600")
84 set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DBSD_COMP") 84 set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DBSD_COMP")
85 set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fpic") 85 set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fpic")
86 set(PLATFORM_LDADD ${PLATFORM_LDADD} nsl socket) 86 set(PLATFORM_LIBS ${PLATFORM_LIBS} nsl socket)
87endif() 87endif()
88 88
89add_definitions(-DLIBRESSL_INTERNAL) 89add_definitions(-DLIBRESSL_INTERNAL)
@@ -104,7 +104,7 @@ if(WIN32)
104 add_definitions(-D_REENTRANT -D_POSIX_THREAD_SAFE_FUNCTIONS) 104 add_definitions(-D_REENTRANT -D_POSIX_THREAD_SAFE_FUNCTIONS)
105 add_definitions(-DWIN32_LEAN_AND_MEAN -D_WIN32_WINNT=0x0600) 105 add_definitions(-DWIN32_LEAN_AND_MEAN -D_WIN32_WINNT=0x0600)
106 add_definitions(-DCPPFLAGS -DOPENSSL_NO_SPEED -DNO_SYSLOG -DNO_CRYPT) 106 add_definitions(-DCPPFLAGS -DOPENSSL_NO_SPEED -DNO_SYSLOG -DNO_CRYPT)
107 set(PLATFORM_LDADD ${PLATFORM_LDADD} ws2_32) 107 set(PLATFORM_LIBS ${PLATFORM_LIBS} ws2_32)
108endif() 108endif()
109 109
110if(MSVC) 110if(MSVC)
@@ -270,7 +270,7 @@ if(CMAKE_SYSTEM_NAME MATCHES "Linux")
270 # Check if we need -lrt to get clock_gettime on Linux 270 # Check if we need -lrt to get clock_gettime on Linux
271 check_library_exists(rt clock_gettime "time.h" HAVE_CLOCK_GETTIME) 271 check_library_exists(rt clock_gettime "time.h" HAVE_CLOCK_GETTIME)
272 if (HAVE_CLOCK_GETTIME) 272 if (HAVE_CLOCK_GETTIME)
273 set(PLATFORM_LDADD ${PLATFORM_LDADD} rt) 273 set(PLATFORM_LIBS ${PLATFORM_LIBS} rt)
274 endif() 274 endif()
275else() 275else()
276 # Otherwise, simply check if it exists 276 # Otherwise, simply check if it exists
@@ -289,7 +289,7 @@ if(SIZEOF_TIME_T STREQUAL "4")
289endif() 289endif()
290add_definitions(-DSIZEOF_TIME_T=${SIZEOF_TIME_T}) 290add_definitions(-DSIZEOF_TIME_T=${SIZEOF_TIME_T})
291 291
292set(OPENSSL_LIBS tls ssl crypto ${PLATFORM_LDADD}) 292set(OPENSSL_LIBS tls ssl crypto ${PLATFORM_LIBS})
293 293
294add_subdirectory(crypto) 294add_subdirectory(crypto)
295add_subdirectory(ssl) 295add_subdirectory(ssl)
@@ -312,6 +312,7 @@ if(NOT MSVC)
312 set(exec_prefix \${prefix}) 312 set(exec_prefix \${prefix})
313 set(libdir \${exec_prefix}/${CMAKE_INSTALL_LIBDIR}) 313 set(libdir \${exec_prefix}/${CMAKE_INSTALL_LIBDIR})
314 set(includedir \${prefix}/include) 314 set(includedir \${prefix}/include)
315 string(REGEX REPLACE ";" " -l" PLATFORM_LDADD ";${PLATFORM_LIBS}")
315 file(STRINGS "VERSION" VERSION LIMIT_COUNT 1) 316 file(STRINGS "VERSION" VERSION LIMIT_COUNT 1)
316 file(GLOB OPENSSL_PKGCONFIGS "*.pc.in") 317 file(GLOB OPENSSL_PKGCONFIGS "*.pc.in")
317 foreach(file ${OPENSSL_PKGCONFIGS}) 318 foreach(file ${OPENSSL_PKGCONFIGS})