mirror of
https://github.com/microsoft/vcpkg.git
synced 2024-11-30 19:21:37 +08:00
1550b9e71b
* [many ports] Upgrades 2019.07.11 * Re-generate patches and fix build errors. * [manyport]Fix build errors. * Fix avro-c and console-bridge failures, revert curl and tesseract * fix botan failure * Fix build errors and undo some ports upgrades. * [aws-c-common,chipmunk,cxxopts,grpc]Fix build errors * Fix build errors. * [angle]Undo upgrade changes. * [directxtk]Fix UWP build error (#7233) * Revert leptonica since it cause tesseract failed * Revert jsonnet * [google-cloud-cpp] Disable parallel configure due to source directory writes * [many ports] Undo undesired changes * [bitsery] Fix indentation * [avro-c][aws-c-common][graphite2] Convert line endings to minimize PR diff * fix console-bridge and remove usockets unused patch * update ogre patch * [many ports] Revert unneeded changes w.r.t. master. Add missing write to console-bridge. * [console-bridge] Fix export macro * [avro-c] Revert upgrade; split to #7875 * [avro-c] Complete previous revert
100 lines
3.1 KiB
Diff
100 lines
3.1 KiB
Diff
diff --git a/CMakeLists.txt b/CMakeLists.txt
|
|
index c708153..0e004da 100644
|
|
--- a/CMakeLists.txt
|
|
+++ b/CMakeLists.txt
|
|
@@ -60,10 +60,11 @@ include(GNUInstallDirs)
|
|
include(CTest)
|
|
include(FindThreads)
|
|
|
|
+find_package(ZLIB REQUIRED)
|
|
+if (0)
|
|
# Use pkg-config to create a PkgConfig::Ptex_ZLIB imported target
|
|
find_package(PkgConfig REQUIRED)
|
|
pkg_checK_modules(Ptex_ZLIB REQUIRED zlib IMPORTED_TARGET)
|
|
-
|
|
enable_testing()
|
|
|
|
if (NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
|
|
@@ -77,6 +78,7 @@ if (NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
|
|
set(CMAKE_BUILD_TYPE "Release" CACHE STRING "type of build" FORCE)
|
|
endif ()
|
|
endif ()
|
|
+endif()
|
|
|
|
if (NOT WIN32)
|
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -pedantic")
|
|
@@ -99,7 +101,9 @@ endif ()
|
|
include_directories(src/ptex)
|
|
|
|
add_subdirectory(src/ptex)
|
|
+if (0)
|
|
add_subdirectory(src/utils)
|
|
add_subdirectory(src/tests)
|
|
add_subdirectory(src/doc)
|
|
+endif()
|
|
add_subdirectory(src/build)
|
|
diff --git a/src/ptex/CMakeLists.txt b/src/ptex/CMakeLists.txt
|
|
index ba3a3cc..1619ff1 100644
|
|
--- a/src/ptex/CMakeLists.txt
|
|
+++ b/src/ptex/CMakeLists.txt
|
|
@@ -1,6 +1,8 @@
|
|
-if (WIN32)
|
|
- add_definitions(/DPTEX_EXPORTS)
|
|
-endif (WIN32)
|
|
+if (BUILD_SHARED_LIBS)
|
|
+ add_definitions(-DPTEX_EXPORTS)
|
|
+else ()
|
|
+ add_definitions(-DPTEX_STATIC)
|
|
+endif ()
|
|
|
|
configure_file(PtexVersion.h.in
|
|
${CMAKE_CURRENT_SOURCE_DIR}/PtexVersion.h @ONLY)
|
|
@@ -18,29 +20,35 @@ set(SRCS
|
|
PtexWriter.cpp)
|
|
|
|
if(PTEX_BUILD_STATIC_LIBS)
|
|
- add_library(Ptex_static STATIC ${SRCS})
|
|
- set_target_properties(Ptex_static PROPERTIES OUTPUT_NAME Ptex)
|
|
- target_include_directories(Ptex_static
|
|
+ add_library(Ptex STATIC ${SRCS})
|
|
+ target_include_directories(Ptex
|
|
PUBLIC
|
|
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
|
|
PRIVATE
|
|
${CMAKE_CURRENT_SOURCE_DIR})
|
|
- target_link_libraries(Ptex_static
|
|
- PUBLIC ${CMAKE_THREAD_LIBS_INIT} PkgConfig::Ptex_ZLIB)
|
|
- install(TARGETS Ptex_static EXPORT Ptex DESTINATION ${CMAKE_INSTALL_LIBDIR})
|
|
+ target_link_libraries(Ptex
|
|
+ PUBLIC ${CMAKE_THREAD_LIBS_INIT} ZLIB::ZLIB)
|
|
+ install(TARGETS Ptex EXPORT Ptex
|
|
+ RUNTIME DESTINATION bin
|
|
+ LIBRARY DESTINATION lib
|
|
+ ARCHIVE DESTINATION lib
|
|
+ )
|
|
endif()
|
|
|
|
if(PTEX_BUILD_SHARED_LIBS)
|
|
- add_library(Ptex_dynamic SHARED ${SRCS})
|
|
- set_target_properties(Ptex_dynamic PROPERTIES OUTPUT_NAME Ptex)
|
|
- target_include_directories(Ptex_dynamic
|
|
+ add_library(Ptex SHARED ${SRCS})
|
|
+ target_include_directories(Ptex
|
|
PUBLIC
|
|
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
|
|
PRIVATE
|
|
${CMAKE_CURRENT_SOURCE_DIR})
|
|
- target_link_libraries(Ptex_dynamic
|
|
- PUBLIC ${CMAKE_THREAD_LIBS_INIT} PkgConfig::Ptex_ZLIB)
|
|
- install(TARGETS Ptex_dynamic EXPORT Ptex DESTINATION ${CMAKE_INSTALL_LIBDIR})
|
|
+ target_link_libraries(Ptex
|
|
+ PUBLIC ${CMAKE_THREAD_LIBS_INIT} ZLIB::ZLIB)
|
|
+ install(TARGETS Ptex EXPORT Ptex
|
|
+ RUNTIME DESTINATION bin
|
|
+ LIBRARY DESTINATION lib
|
|
+ ARCHIVE DESTINATION lib
|
|
+ )
|
|
endif()
|
|
|
|
install(FILES
|