mirror of
https://github.com/microsoft/vcpkg.git
synced 2024-11-29 02:08:59 +08:00
050e71d01d
* [various ports] remove references to CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS * [alac,benchmark,capnproto] Fix check_linkage call * [fastlz] Fix SHA512 * [coroutine] Fix dynamic build * [folly] Find double-conversion * [gamma] Use vcpkg_from_github * [librsync] Enable static builds * [netcdf-cxx4] Fix SHA512 * [octomap] Fix static build * [tidy-html5] Fix static build * [various ports] remove custom messages for shared/static builds, modernize some scripts in the meantime * [folly] Use ras0219's fix for link paths * [octomap] Fix exported targets * [uvatlas] Set tool download SHA512 * [duktape+python2] fix portfile to call configure with correct python version, manage python2 also outside win32 * [suitesparse] osx fix * [gtkmm] Call vcpkg_check_linkage after including vcpkg functions * [duktape] Resolve conflicts * [duktape] FIxed typo in Python paths * [wangle] Find zlib * [openssl-uwp] Fix SHA512 * [glib] Allow static builds on non-Windows * [suitesparse] Fix build on Windows * [multiple ports] Bump CONTROL version * [multiple ports] Fix description indent * [directxtk] Fix CONTROL file * [bde,duktape,qpid-proton] Build packages with python2 installed * [binn] remove CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS * [gdal,live555,uriparser] Fix regressions * [live555] Update to 2019.04.24
109 lines
3.6 KiB
CMake
109 lines
3.6 KiB
CMake
cmake_minimum_required(VERSION 3.11)
|
|
|
|
project(Osi LANGUAGES C CXX)
|
|
|
|
set(PROJECT_VERSION 0.107.9)
|
|
set(PROJECT_VERSION_MAJOR 0)
|
|
set(PROJECT_VERSION_MINOR 107)
|
|
set(PROJECT_VERSION_PATCH 9)
|
|
|
|
set(CMAKE_CXX_STANDARD 14)
|
|
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/bin)
|
|
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/lib)
|
|
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/lib)
|
|
set(CMAKE_MODULE_PATH "${CMAKE_MODULE_PATH};${CMAKE_CURRENT_SOURCE_DIR}/cmake")
|
|
|
|
if(MSVC)
|
|
set(
|
|
CMAKE_CXX_FLAGS
|
|
"${CMAKE_CXX_FLAGS} /bigobj /MP /wd4996 /wd4819 /wd4251 /wd4267 /wd4244 /wd4275"
|
|
)
|
|
endif(MSVC)
|
|
if(APPLE)
|
|
set(
|
|
CMAKE_CXX_FLAGS
|
|
"${CMAKE_CXX_FLAGS} -Wno-inconsistent-missing-override -Wno-unused-command-line-argument -Wno-unused-result -Wno-exceptions"
|
|
)
|
|
set(CMAKE_OSX_DEPLOYMENT_TARGET "10.9"
|
|
CACHE STRING "Minimum OS X deployment version")
|
|
endif(APPLE)
|
|
|
|
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
|
|
|
|
# options
|
|
option(BUILD_SHARED_LIBS "" ON)
|
|
|
|
#
|
|
# Introduce variables: * CMAKE_INSTALL_LIBDIR * CMAKE_INSTALL_BINDIR
|
|
include(GNUInstallDirs)
|
|
|
|
# Include module with fuction 'write_basic_package_version_file'
|
|
include(CMakePackageConfigHelpers)
|
|
|
|
# Layout. This works for all platforms: * <prefix>/lib*/cmake/<PROJECT-NAME> *
|
|
# <prefix>/lib*/ * <prefix>/include/
|
|
set(config_install_dir "${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}")
|
|
set(generated_dir "${CMAKE_CURRENT_BINARY_DIR}/generated")
|
|
# Configuration
|
|
set(version_config "${generated_dir}/${PROJECT_NAME}ConfigVersion.cmake")
|
|
set(project_config "${generated_dir}/${PROJECT_NAME}Config.cmake")
|
|
set(TARGETS_EXPORT_NAME "${PROJECT_NAME}Targets")
|
|
set(namespace "Coin::")
|
|
|
|
# Packages
|
|
find_package(CoinUtils REQUIRED)
|
|
|
|
# Add sources
|
|
include_directories(Osi/src/Osi)
|
|
|
|
file(GLOB OSI_SOURCES Osi/src/Osi/*.hpp Osi/src/Osi/*.cpp)
|
|
|
|
add_library(${PROJECT_NAME} ${OSI_SOURCES})
|
|
|
|
target_include_directories(${PROJECT_NAME}
|
|
PUBLIC $<INSTALL_INTERFACE:include/coin>)
|
|
target_compile_definitions(${PROJECT_NAME}
|
|
PUBLIC
|
|
$<INSTALL_INTERFACE:-DHAVE_CMATH>
|
|
$<INSTALL_INTERFACE:-D_CRT_SECURE_NO_WARNINGS>)
|
|
target_link_libraries(${PROJECT_NAME} PRIVATE Coin::CoinUtils)
|
|
|
|
install(TARGETS ${PROJECT_NAME}
|
|
EXPORT "${TARGETS_EXPORT_NAME}"
|
|
LIBRARY DESTINATION lib
|
|
ARCHIVE DESTINATION lib
|
|
RUNTIME DESTINATION bin
|
|
INCLUDES
|
|
DESTINATION include)
|
|
|
|
install(DIRECTORY Osi/src/Osi/
|
|
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/coin
|
|
FILES_MATCHING
|
|
PATTERN "*.h"
|
|
PATTERN "*.hpp"
|
|
PATTERN "config_default.h" EXCLUDE)
|
|
|
|
#
|
|
# Install Libraries
|
|
#
|
|
# Configure '<PROJECT-NAME>ConfigVersion.cmake' Use: * PROJECT_VERSION
|
|
write_basic_package_version_file("${version_config}"
|
|
COMPATIBILITY SameMajorVersion)
|
|
|
|
# Configure '<PROJECT-NAME>Config.cmake' Use variables: * TARGETS_EXPORT_NAME *
|
|
# PROJECT_NAME
|
|
configure_package_config_file("Config.cmake.in"
|
|
"${project_config}"
|
|
INSTALL_DESTINATION
|
|
"${config_install_dir}")
|
|
|
|
# Config * <prefix>/lib/cmake/Foo/FooConfig.cmake *
|
|
# <prefix>/lib/cmake/Foo/FooConfigVersion.cmake
|
|
install(FILES "${project_config}" "${version_config}"
|
|
DESTINATION "${config_install_dir}")
|
|
|
|
# Config * <prefix>/lib/cmake/Foo/FooTargets.cmake
|
|
install(EXPORT "${TARGETS_EXPORT_NAME}"
|
|
NAMESPACE "${namespace}"
|
|
DESTINATION "${config_install_dir}")
|