Used CMAKE_DEBUG_POSTFIX instead LIB_EXT for library name decoration on debug builds (less intrusive and more flexible)
This commit is contained in:
Mathäus Mendel 2012-12-08 15:54:38 -02:00
Родитель ec84a9a8c6
Коммит e3649153b8
14 изменённых файлов: 20 добавлений и 34 удалений

Просмотреть файл

@ -50,10 +50,10 @@ endif ()
# * MinSizeRel (CMAKE_C_FLAGS_MINSIZEREL or CMAKE_CXX_FLAGS_MINSIZEREL)
if (CMAKE_BUILD_TYPE STREQUAL "Debug")
message(STATUS "Debug output enabled")
set(LIB_EXT "d" CACHE STRING "Set debug library postfix" FORCE)
set(CMAKE_DEBUG_POSTFIX "d" CACHE STRING "Set debug library postfix" FORCE)
else ()
message(STATUS "Optimized output enabled")
set(LIB_EXT "" CACHE STRING "Set debug library postfix" FORCE)
set(CMAKE_DEBUG_POSTFIX "" CACHE STRING "Set debug library postfix" FORCE)
endif ()
option(ENABLE_TESTS

Просмотреть файл

@ -1,5 +1,4 @@
set(LIBNAME "PocoCrypto")
set(LIBNAME "${LIBNAME}${LIB_EXT}")
aux_source_directory(src SRCS)
add_definitions(-D_USRDLL -DCrypto_EXPORTS)
@ -9,12 +8,12 @@ add_library( ${LIBNAME} ${LIB_MODE} ${SRCS} )
set_target_properties( ${LIBNAME} PROPERTIES VERSION ${SHARED_LIBRARY_VERSION} SOVERSION ${SHARED_LIBRARY_VERSION} )
#if(CMAKE_SYSTEM MATCHES "Windows")
# target_link_libraries( ${LIBNAME} PocoFoundation${LIB_EXT} ${LIB_EAY_RELEASE} ${OPENSSL_LIBRARIES} )
# target_link_libraries( ${LIBNAME} PocoFoundation ${LIB_EAY_RELEASE} ${OPENSSL_LIBRARIES} )
#ELSE()
# target_link_libraries( ${LIBNAME} PocoFoundation${LIB_EXT} ${OPENSSL_SSL_LIBRARY} ${OPENSSL_CRYPTO_LIBRARY} )
# target_link_libraries( ${LIBNAME} PocoFoundation ${OPENSSL_SSL_LIBRARY} ${OPENSSL_CRYPTO_LIBRARY} )
#ENDIF()
target_link_libraries( ${LIBNAME} PocoFoundation${LIB_EXT} ${OPENSSL_LIBRARIES} )
target_link_libraries( ${LIBNAME} PocoFoundation ${OPENSSL_LIBRARIES} )
install(
DIRECTORY include/Poco

Просмотреть файл

@ -1,5 +1,4 @@
set(LIBNAME "PocoData")
set(LIBNAME "${LIBNAME}${LIB_EXT}")
set(SRCS "")
aux_source_directory(src SRCS)
@ -13,7 +12,7 @@ add_library( ${LIBNAME} ${LIB_MODE} ${SRCS} )
set_target_properties( ${LIBNAME}
PROPERTIES
VERSION ${SHARED_LIBRARY_VERSION} SOVERSION ${SHARED_LIBRARY_VERSION} )
target_link_libraries( ${LIBNAME} PocoFoundation${LIB_EXT} )
target_link_libraries( ${LIBNAME} PocoFoundation)
install(
DIRECTORY include/Poco

Просмотреть файл

@ -1,5 +1,4 @@
set(LIBNAME "PocoDataMySQL")
set(LIBNAME "${LIBNAME}${LIB_EXT}")
set(SRCS "")
aux_source_directory(src SRCS)
@ -13,7 +12,7 @@ add_library( ${LIBNAME} ${LIB_MODE} ${SRCS} )
set_target_properties( ${LIBNAME}
PROPERTIES
VERSION ${SHARED_LIBRARY_VERSION} SOVERSION ${SHARED_LIBRARY_VERSION} )
target_link_libraries( ${LIBNAME} PocoData${LIB_EXT} PocoFoundation${LIB_EXT} ${MYSQL_LIB})
target_link_libraries( ${LIBNAME} PocoData PocoFoundation ${MYSQL_LIB})
install(
DIRECTORY include/Poco

Просмотреть файл

@ -1,5 +1,4 @@
set(LIBNAME "PocoDataODBC")
set(LIBNAME "${LIBNAME}${LIB_EXT}")
set(SRCS
src/Binder.cpp
@ -26,7 +25,7 @@ add_library( ${LIBNAME} ${LIB_MODE} ${SRCS} )
set_target_properties( ${LIBNAME}
PROPERTIES
VERSION ${SHARED_LIBRARY_VERSION} SOVERSION ${SHARED_LIBRARY_VERSION} )
target_link_libraries( ${LIBNAME} PocoData${LIB_EXT} PocoFoundation${LIB_EXT} ${ODBC_LINK_FLAGS})
target_link_libraries( ${LIBNAME} PocoData PocoFoundation ${ODBC_LINK_FLAGS})
install(
DIRECTORY include/Poco

Просмотреть файл

@ -1,5 +1,4 @@
set(LIBNAME "PocoDataSQLite")
set(LIBNAME "${LIBNAME}${LIB_EXT}")
include_directories( include src )
@ -17,10 +16,10 @@ set(SRCS
if (POCO_UNBUNDLED)
set(DATASQLITELIBS PocoData${LIB_EXT} PocoFoundatio ${LIB_EXT} sqlite3)
set(DATASQLITELIBS PocoData PocoFoundation sqlite3)
else()
set(SRCS ${SRCS} src/sqlite3.c)
set(DATASQLITELIBS PocoData${LIB_EXT} PocoFoundation${LIB_EXT})
set(DATASQLITELIBS PocoData PocoFoundation)
endif()
add_definitions(-DSQLITE_THREADSAFE=1 -DSQLITE_DISABLE_LFS -DSQLITE_OMIT_UTF16 -DSQLITE_OMIT_PROGRESS_CALLBACK -DSQLITE_OMIT_COMPLETE -DSQLITE_OMIT_TCL_VARIABLE -DSQLITE_OMIT_DEPRECATED)

Просмотреть файл

@ -1,7 +1,4 @@
set(LIBNAME "PocoFoundation")
if (CMAKE_BUILD_TYPE MATCHES Debug)
set(LIBNAME "${LIBNAME}d")
endif()
if (WIN32)
# cmake has CMAKE_RC_COMPILER, but no message compiler
@ -54,6 +51,7 @@ set( BASE_SRCS
src/DigestStream.cpp
src/DirectoryIterator.cpp
src/Environment.cpp
src/Error.cpp
src/ErrorHandler.cpp
src/Event.cpp
src/EventArgs.cpp

Просмотреть файл

@ -1,5 +1,4 @@
set(LIBNAME "PocoJSON")
set(LIBNAME "${LIBNAME}${LIB_EXT}")
aux_source_directory(src SRCS)
@ -11,7 +10,7 @@ add_library( ${LIBNAME} ${LIB_MODE} ${SRCS} )
set_target_properties( ${LIBNAME}
PROPERTIES
VERSION ${SHARED_LIBRARY_VERSION} SOVERSION ${SHARED_LIBRARY_VERSION} )
target_link_libraries( ${LIBNAME} PocoFoundation${LIB_EXT})
target_link_libraries( ${LIBNAME} PocoFoundation)
install(
DIRECTORY include/Poco

Просмотреть файл

@ -1,5 +1,4 @@
set(LIBNAME "PocoNet")
set(LIBNAME "${LIBNAME}${LIB_EXT}")
set( BASE_SRCS
src/AbstractHTTPRequestHandler.cpp
@ -102,7 +101,7 @@ set( LIN_SRCS
if(CMAKE_SYSTEM MATCHES "Windows")
set(SRCS ${BASE_SRCS} ${WIN_SRCS})
set(SYSLIBS ${SYSLIBS} ws2_32)
set(SYSLIBS ${SYSLIBS} "ws2_32.lib" "iphlpapi.lib")
else (CMAKE_SYSTEM MATCHES "Windows")
set(SRCS ${BASE_SRCS} ${LIN_SRCS})
endif(CMAKE_SYSTEM MATCHES "Windows")
@ -115,7 +114,7 @@ add_library( ${LIBNAME} ${LIB_MODE} ${SRCS} )
set_target_properties( ${LIBNAME}
PROPERTIES
VERSION ${SHARED_LIBRARY_VERSION} SOVERSION ${SHARED_LIBRARY_VERSION} )
target_link_libraries( ${LIBNAME} PocoFoundation${LIB_EXT} ${SYSLIBS})
target_link_libraries( ${LIBNAME} PocoFoundation ${SYSLIBS})
install(
DIRECTORY include/Poco

Просмотреть файл

@ -1,5 +1,4 @@
set(LIBNAME "PocoNetSSL")
set(LIBNAME "${LIBNAME}${LIB_EXT}")
aux_source_directory(src SRCS)
include_directories( ${OPENSSL_INCLUDE_DIR} )
@ -12,7 +11,7 @@ add_library( ${LIBNAME} ${LIB_MODE} ${SRCS} )
set_target_properties( ${LIBNAME}
PROPERTIES
VERSION ${SHARED_LIBRARY_VERSION} SOVERSION ${SHARED_LIBRARY_VERSION} )
target_link_libraries( ${LIBNAME} PocoCrypto${LIB_EXT} PocoNet${LIB_EXT} PocoUtil${LIB_EXT} PocoFoundation${LIB_EXT} ${OPENSSL_SSL_LIBRARY} ${OPENSSL_CRYPTO_LIBRARY} )
target_link_libraries( ${LIBNAME} PocoCrypto PocoNet PocoUtil PocoFoundation ${OPENSSL_SSL_LIBRARY} ${OPENSSL_CRYPTO_LIBRARY} )
install(
DIRECTORY include/Poco

Просмотреть файл

@ -1,18 +1,17 @@
set(LIBNAME "PocoPDF")
set(LIBNAME "${LIBNAME}${LIB_EXT}")
aux_source_directory(src SRCS)
include_directories(include/Poco/PDF) # zip src
if (NOT POCO_STATIC)
add_definitions(-DJSON_EXPORTS)
add_definitions(-DPDF_EXPORTS)
endif (NOT POCO_STATIC)
add_library( ${LIBNAME} ${LIB_MODE} ${SRCS} )
set_target_properties( ${LIBNAME}
PROPERTIES
VERSION ${SHARED_LIBRARY_VERSION} SOVERSION ${SHARED_LIBRARY_VERSION} )
target_link_libraries( ${LIBNAME} PocoFoundation${LIB_EXT})
target_link_libraries( ${LIBNAME} PocoFoundation)
install(
DIRECTORY include/Poco

Просмотреть файл

@ -1,5 +1,4 @@
set(LIBNAME "PocoUtil")
set(LIBNAME "${LIBNAME}${LIB_EXT}")
set( BASE_SRCS
src/AbstractConfiguration.cpp
@ -48,7 +47,7 @@ add_library( ${LIBNAME} ${LIB_MODE} ${SRCS} )
set_target_properties( ${LIBNAME}
PROPERTIES
VERSION ${SHARED_LIBRARY_VERSION} SOVERSION ${SHARED_LIBRARY_VERSION} )
target_link_libraries( ${LIBNAME} PocoJSON${LIB_EXT} PocoXML${LIB_EXT} PocoFoundation${LIB_EXT})
target_link_libraries( ${LIBNAME} PocoJSON PocoXML PocoFoundation)
install(
DIRECTORY include/Poco

Просмотреть файл

@ -1,5 +1,4 @@
set(LIBNAME "PocoXML")
set(LIBNAME "${LIBNAME}${LIB_EXT}")
aux_source_directory(src SRCS)
@ -9,7 +8,7 @@ add_library( ${LIBNAME} ${LIB_MODE} ${SRCS} )
set_target_properties( ${LIBNAME}
PROPERTIES
VERSION ${SHARED_LIBRARY_VERSION} SOVERSION ${SHARED_LIBRARY_VERSION} )
target_link_libraries( ${LIBNAME} PocoFoundation${LIB_EXT})
target_link_libraries( ${LIBNAME} PocoFoundation)
install(
DIRECTORY include/Poco

Просмотреть файл

@ -1,5 +1,4 @@
set(LIBNAME "PocoZip")
set(LIBNAME "${LIBNAME}${LIB_EXT}")
aux_source_directory(src SRCS)
@ -11,7 +10,7 @@ add_library( ${LIBNAME} ${LIB_MODE} ${SRCS} )
set_target_properties( ${LIBNAME}
PROPERTIES
VERSION ${SHARED_LIBRARY_VERSION} SOVERSION ${SHARED_LIBRARY_VERSION} )
target_link_libraries( ${LIBNAME} PocoUtil${LIB_EXT} PocoXML${LIB_EXT} PocoFoundation${LIB_EXT})
target_link_libraries( ${LIBNAME} PocoUtil PocoXML PocoFoundation)
install(
DIRECTORY include/Poco