Skip to content

Commit

Permalink
Squashed 'externals/coda-oss/' changes from 312e46d..67d6362
Browse files Browse the repository at this point in the history
67d6362 Merge pull request #356 from mdaus/DefaultShortPathsHome
4d4c6e2 Merge pull request #357 from mdaus/CMakeConditionalModules
ea9ec8a Clean up CMake driver changes for merge
6dfa039 Add more configuration options to the CMake build for disabling drivers.
0f47fed Default short_paths to a subdirectory of the user's home for Windows Conan builds.
449a2a6 Fix Python detection for Github Action runners.

git-subtree-dir: externals/coda-oss
git-subtree-split: 67d6362
  • Loading branch information
kdwilhelm committed Apr 29, 2020
1 parent df7acfb commit 1262718
Show file tree
Hide file tree
Showing 16 changed files with 493 additions and 455 deletions.
8 changes: 8 additions & 0 deletions .github/workflows/build_unittest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ jobs:

steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v1
with:
python-version: '3.7'
- name: configure
run: |
ls env:
Expand All @@ -35,6 +39,10 @@ jobs:

steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v1
with:
python-version: '3.7'
- name: configure
run: |
env
Expand Down
4 changes: 4 additions & 0 deletions cmake/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,14 +78,18 @@ These options may be passed in the cmake configure step as `-DOPTION_NAME="optio
|MT_DEFAULT_PINNING|OFF|use affinity-based CPU pinning by default in MT|
|ENABLE_BOOST|OFF|build modules dependent on Boost if enabled|
|ENABLE_PYTHON|ON|build Python modules if enabled|
|ENABLE_JARS|ON|include jars with the install|
|ENABLE_JPEG|ON|build libjpeg driver and modules depending on it|
|ENABLE_J2K|ON|build openjpeg (jpeg2000) driver and modules depending on it|
|ENABLE_PCRE|ON|build PCRE (PERL Compatible Regular Expressions) library and modules dependent on it|
|ENABLE_UUID|ON|build uuid library and modules dependent on it|
|ENABLE_ZIP|ON|build zlib and modules dependent on it|
|PYTHON_VERSION||indicate which version of Python to prefer, e.g. "3" or "3.7"|
|BOOST_HOME||path to existing Boost installation (implies ENABLE_BOOST=ON)|
|PYTHON_HOME||path to existing Python installation (implies ENABLE_PYTHON=ON)|
|JPEG_HOME||path to existing libjpeg installation; if not provided, it will be built from source (implies ENABLE_JPEG=ON)|
|J2K_HOME||path to existing openjpeg installation; if not provided, it will be built from source (implies ENABLE_J2K=ON)|
|PCRE_HOME||path to existing pcre installation; if not provided, it will be built from source (implies ENABLE_PCRE=ON)|
|XML_HOME||path to existing Xerces installation; if not provided, it will be built from source|
|UUID_HOME||path to existing uuid library installation; if not provided, it will be built from source (Linux only)|
|ZIP_HOME||path to existing zlib installation; if not provided, it will be built from source|
10 changes: 8 additions & 2 deletions conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
"""

from conans import ConanFile, CMake, tools
import os
import sys

class CodaOssConan(ConanFile):
name = "coda-oss"
Expand Down Expand Up @@ -42,9 +44,13 @@ class CodaOssConan(ConanFile):
license = "GNU LESSER GENERAL PUBLIC LICENSE Version 3"

# default to short_paths mode (Windows only)
# check .conan/conan.conf in your home directory to make sure the setting
# user_home_short points to a writable location
short_paths = True
# default the short_paths home to ~/.conan_short
# this may be overridden by setting the environment variable
# CONAN_USER_HOME_SHORT or setting user_home_short in ~/.conan/conan.conf
if sys.platform.startswith('win32') and os.getenv("CONAN_USER_HOME_SHORT") is None:
os.environ["CONAN_USER_HOME_SHORT"] = os.path.join(
os.path.expanduser("~"), ".conan_short")

def set_version(self):
git = tools.Git(folder=self.recipe_folder)
Expand Down
4 changes: 2 additions & 2 deletions modules/c++/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@ add_subdirectory("math")
add_subdirectory("mt")
add_subdirectory("logging")
add_subdirectory("xml.lite")
add_subdirectory("net")
add_subdirectory("net.ssl")
add_subdirectory("net") # must be after "re"
add_subdirectory("net.ssl") # must be after "net"
add_subdirectory("plugin")
add_subdirectory("tiff")
add_subdirectory("polygon")
Expand Down
30 changes: 16 additions & 14 deletions modules/c++/net.ssl/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,17 +1,19 @@
set(MODULE_NAME net.ssl)
set(MODULE_DEPS net-c++)
if (TARGET net-c++)
set(MODULE_NAME net.ssl)
set(MODULE_DEPS net-c++)

if (OPENSSL_FOUND)
set(USE_OPENSSL 1)
list(APPEND MODULE_DEPS OpenSSL::SSL OpenSSL::Crypto)
endif()
coda_generate_module_config_header(${MODULE_NAME})
if (OPENSSL_FOUND)
set(USE_OPENSSL 1)
list(APPEND MODULE_DEPS OpenSSL::SSL OpenSSL::Crypto)
endif()
coda_generate_module_config_header(${MODULE_NAME})

coda_add_module(
${MODULE_NAME}
VERSION 1.0
DEPS ${MODULE_DEPS})
coda_add_module(
${MODULE_NAME}
VERSION 1.0
DEPS ${MODULE_DEPS})

coda_add_tests(
MODULE_NAME ${MODULE_NAME}
DIRECTORY "tests")
coda_add_tests(
MODULE_NAME ${MODULE_NAME}
DIRECTORY "tests")
endif()
36 changes: 19 additions & 17 deletions modules/c++/net/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,19 +1,21 @@
set(MODULE_NAME net)
set(MODULE_DEPS logging-c++ re-c++ io-c++ mem-c++)
if (CURL_FOUND)
list(APPEND MODULE_DEPS CURL::libcurl) # From FindCURL
set(NET_CURL_SUPPORT "1")
endif()
coda_generate_module_config_header(${MODULE_NAME})
if (TARGET re-c++)
set(MODULE_NAME net)
set(MODULE_DEPS logging-c++ re-c++ io-c++ mem-c++)
if (CURL_FOUND)
list(APPEND MODULE_DEPS CURL::libcurl) # From FindCURL
set(NET_CURL_SUPPORT "1")
endif()
coda_generate_module_config_header(${MODULE_NAME})

coda_add_module(
${MODULE_NAME}
VERSION 1.0
DEPS ${MODULE_DEPS})
coda_add_module(
${MODULE_NAME}
VERSION 1.0
DEPS ${MODULE_DEPS})

coda_add_tests(
MODULE_NAME ${MODULE_NAME}
DIRECTORY "tests"
FILTER_LIST "AckMulticastSender.cpp" "AckMulticastSubscriber.cpp"
"MulticastSender.cpp" "MulticastSubscriber.cpp"
"SerializableTestClient.cpp")
coda_add_tests(
MODULE_NAME ${MODULE_NAME}
DIRECTORY "tests"
FILTER_LIST "AckMulticastSender.cpp" "AckMulticastSubscriber.cpp"
"MulticastSender.cpp" "MulticastSubscriber.cpp"
"SerializableTestClient.cpp")
endif()
45 changes: 24 additions & 21 deletions modules/c++/re/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,29 +3,32 @@ set(MODULE_DEPS sys-c++)

# Enable to use std::regex instead of PCRE.
set(RE_ENABLE_STD_REGEX OFF CACHE BOOL "use std::regex instead of pcre")
coda_generate_module_config_header(${MODULE_NAME})

if (NOT RE_ENABLE_STD_REGEX)
list(APPEND MODULE_DEPS pcre2)
endif()
if (RE_ENABLE_STD_REGEX OR TARGET pcre2)
coda_generate_module_config_header(${MODULE_NAME})

if (NOT RE_ENABLE_STD_REGEX)
list(APPEND MODULE_DEPS pcre2)
endif()

coda_add_module(
${MODULE_NAME}
VERSION 1.0
DEPS ${MODULE_DEPS})
coda_add_module(
${MODULE_NAME}
VERSION 1.0
DEPS ${MODULE_DEPS})

if (NOT RE_ENABLE_STD_REGEX)
if (NOT BUILD_SHARED_LIBS)
# this definition is required to statically link against pcre2
# see NON_AUTOTOOLS_BUILD, LINKING PROGRAMS IN WINDOWS ENVIRONMENTS section
target_compile_definitions(${MODULE_NAME}-c++ PUBLIC -DPCRE2_STATIC)
if (NOT RE_ENABLE_STD_REGEX)
if (NOT BUILD_SHARED_LIBS)
# this definition is required to statically link against pcre2
# see NON_AUTOTOOLS_BUILD, LINKING PROGRAMS IN WINDOWS ENVIRONMENTS section
target_compile_definitions(${MODULE_NAME}-c++ PUBLIC -DPCRE2_STATIC)
endif()
endif()
endif()

coda_add_tests(
MODULE_NAME ${MODULE_NAME}
DIRECTORY "tests")
coda_add_tests(
MODULE_NAME ${MODULE_NAME}
DIRECTORY "unittests"
UNITTEST)
coda_add_tests(
MODULE_NAME ${MODULE_NAME}
DIRECTORY "tests")
coda_add_tests(
MODULE_NAME ${MODULE_NAME}
DIRECTORY "unittests"
UNITTEST)
endif()
18 changes: 10 additions & 8 deletions modules/c++/unique/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
set(MODULE_NAME unique)
if (UUID_LIB)
set(MODULE_NAME unique)

coda_add_module(
${MODULE_NAME}
VERSION 1.0
DEPS except-c++ ${UUID_LIB})
coda_add_module(
${MODULE_NAME}
VERSION 1.0
DEPS except-c++ ${UUID_LIB})

coda_add_tests(
MODULE_NAME ${MODULE_NAME}
DIRECTORY "tests")
coda_add_tests(
MODULE_NAME ${MODULE_NAME}
DIRECTORY "tests")
endif()
18 changes: 10 additions & 8 deletions modules/c++/zip/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
set(MODULE_NAME zip)
if (TARGET z AND TARGET minizip)
set(MODULE_NAME zip)

coda_add_module(
${MODULE_NAME}
VERSION 1.0
DEPS io-c++ z minizip)
coda_add_module(
${MODULE_NAME}
VERSION 1.0
DEPS io-c++ z minizip)

coda_add_tests(
MODULE_NAME ${MODULE_NAME}
DIRECTORY "tests")
coda_add_tests(
MODULE_NAME ${MODULE_NAME}
DIRECTORY "tests")
endif()
47 changes: 40 additions & 7 deletions modules/drivers/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,11 +1,44 @@
add_subdirectory("boost")
#add_subdirectory("curl") # this is handled in coda_find_system_dependencies
add_subdirectory("j2k")
add_subdirectory("jars")
add_subdirectory("jpeg")
#add_subdirectory("numpy") # this is handled in coda_find_system_dependencies
add_subdirectory("pcre")
add_subdirectory("sql")
add_subdirectory("uuid")
add_subdirectory("xml")
add_subdirectory("zlib")

set(ENABLE_J2K ON CACHE BOOL "enable J2K library")
set(J2K_HOME "" CACHE PATH "path to J2K installation")
if (ENABLE_J2K OR J2K_HOME)
add_subdirectory("j2k")
endif()

set(ENABLE_JARS ON CACHE BOOL "include jars in the install")
if (ENABLE_JARS)
add_subdirectory("jars")
endif()

set(ENABLE_JPEG ON CACHE BOOL "enable use of libjpeg")
set(JPEG_HOME "" CACHE PATH "path to libjpeg installation")
if (ENABLE_JPEG OR JPEG_HOME)
add_subdirectory("jpeg")
endif()

set(ENABLE_PCRE ON CACHE BOOL "enable PCRE library")
set(PCRE_HOME "" CACHE PATH "path to PCRE installation")
if (ENABLE_PCRE OR PCRE_HOME)
add_subdirectory("pcre")
endif()

set(SQL_LAYER "" CACHE STRING "SQL backend [mysql, psql, oracle]")
set(SQL_HOME "" CACHE PATH "Path to SQL installation")
if (SQL_LAYER OR SQL_HOME)
add_subdirectory("sql")
endif()

set(ENABLE_UUID ON CACHE BOOL "enable UUID library")
if (ENABLE_UUID OR UUID_HOME)
add_subdirectory("uuid")
endif()

set(ENABLE_ZIP ON CACHE BOOL "enable zlib")
set(ZIP_HOME "" CACHE PATH "path to pre-existing zlib installation, if not provided zlib will be built")
if (ENABLE_ZIP OR ZIP_HOME)
add_subdirectory("zlib")
endif()
Loading

0 comments on commit 1262718

Please sign in to comment.