Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove all references to "IlmBase" #929

Merged
merged 2 commits into from
Feb 24, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# Copyright Contributors to the OpenEXR Project.

# We require this to get object library link library support
if(OPENEXR_BUILD_BOTH_STATIC_SHARED OR ILMBASE_BUILD_BOTH_STATIC_SHARED)
if(OPENEXR_BUILD_BOTH_STATIC_SHARED)
if (${CMAKE_VERSION} VERSION_LESS "3.12.0")
message(FATAL_ERROR "CMake 3.12 or newer is required for object library support when building both static and shared libraries")
endif()
Expand Down
62 changes: 19 additions & 43 deletions INSTALL.md
Original file line number Diff line number Diff line change
Expand Up @@ -129,10 +129,7 @@ these options.

If you are interested in controlling custom namespace declarations or
similar options, you are encouraged to look at the ``CMakeLists.txt``
infrastructure. In particular, there has been an attempt to centralize
the settings into a common place to more easily see all of them in a
text editor. For IlmBase, this is config/IlmBaseSetup.cmake inside the
IlmBase tree. For OpenEXR, the settings will similarly be found in
infrastructure. The settings can be found in
``cmake/OpenEXRSetup.cmake``. As per usual, these settings can also be
seen and/or edited using any of the various gui editors for working
with cmake such as ``ccmake``, ``cmake-gui``, as well as some of the
Expand Down Expand Up @@ -199,70 +196,49 @@ You can customize these options three ways:

### Library Naming Options:

* **ILMBASE\_LIB\_SUFFIX**

Append the given string to the end of all the IlmBase libraries. Default is ``-<major>_<minor>`` version string. Please see the section on library names

* **OPENEXR\_LIB\_SUFFIX**

Append the given string to the end of all the OpenEXR libraries. Default is ``-<major>_<minor>`` version string. Please see the section on library names

### Namespace Options:

* **ILMBASE\_IEX\_NAMESPACE**

Public namespace alias for Iex. Default is ``Iex``.

* **ILMBASE\_ILMTHREAD\_NAMESPACE**

Public namespace alias for IlmThread. Default is ``IlmThread``.

* **ILMBASE\_IMATH\_NAMESPACE**
* **OPENEXR\_IMF\_NAMESPACE**

Public namespace alias for Imath. Default is ``Imath``.
Public namespace alias for OpenEXR. Default is ``Imf``.

* **ILMBASE\_INTERNAL\_IEX\_NAMESPACE**
* **OPENEXR\_INTERNAL\_IMF\_NAMESPACE**

Real namespace for Iex that will end up in compiled symbols. Default is ``Iex\_<major>\_<minor>``.
Real namespace for OpenEXR that will end up in compiled symbols. Default is ``Imf\_<major>\_<minor>``.

* **ILMBASE\_INTERNAL\_ILMTHREAD\_NAMESPACE**
* **OPENEXR\_NAMESPACE\_CUSTOM**

Real namespace for IlmThread that will end up in compiled symbols. Default is ``IlmThread\_<major>\_<minor>``.
Whether the namespace has been customized (so external users know)

* **ILMBASE\_INTERNAL\_IMATH\_NAMESPACE**

Real namespace for Imath that will end up in compiled symbols. Default is ``Imath\_<major>\_<minor>``.

* **ILMBASE\_NAMESPACE\_CUSTOM**

Whether the namespace has been customized (so external users know)
* **IEX\_NAMESPACE**

* **OPENEXR\_IMF\_NAMESPACE**

Public namespace alias for Imath. Default is ``Imf``.
Public namespace alias for Iex. Default is ``Iex``.

* **OPENEXR\_INTERNAL\_IMF\_NAMESPACE**
* **IEX\_INTERNAL\_NAMESPACE**

Real namespace for Imath that will end up in compiled symbols. Default is ``Imf\_<major>\_<minor>``.
Real namespace for Iex that will end up in compiled symbols. Default is ``Iex\_<major>\_<minor>``.

* **OPENEXR\_NAMESPACE\_CUSTOM**
* **IEX\_NAMESPACE\_CUSTOM**

Whether the namespace has been customized (so external users know)

### Linting Options:

These linting options are experimental, and primarily for developer-only use at this time.
* **ILMTHREAD\_NAMESPACE**

* **ILMBASE\_USE\_CLANG\_TIDY**

Enable clang-tidy for IlmBase libraries, if it is available. Default is OFF.
Public namespace alias for IlmThread. Default is ``IlmThread``.

* **OPENEXR\_USE\_CLANG\_TIDY**
* **ILMTHREAD\_INTERNAL\_NAMESPACE**

Enable clang-tidy for OpenEXR libraries, if it is available. Default is OFF.

### Testing Options:
Real namespace for IlmThread that will end up in compiled symbols. Default is ``IlmThread\_<major>\_<minor>``.

* **ILMTHREAD\_NAMESPACE\_CUSTOM**

Whether the namespace has been customized (so external users know)

* **BUILD\_TESTING**

Expand Down
60 changes: 35 additions & 25 deletions cmake/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -69,40 +69,40 @@ install(
)

###################################################
####### IlmBaseConfig.h and IlmBaseConfigInternal.h
####### IexConfig.h and IexConfigInternal.h

check_include_files(ucontext.h ILMBASE_HAVE_UCONTEXT_H)
if(ILMBASE_HAVE_UCONTEXT_H)
# TODO: remove this once we cleanly have ILMBASE_ prefix on all #defines
check_include_files(ucontext.h IEX_HAVE_UCONTEXT_H)
if(IEX_HAVE_UCONTEXT_H)
# TODO: remove this once we cleanly have IEX_ prefix on all #defines
set(HAVE_UCONTEXT_H ON)
check_struct_has_member("struct _libc_fpstate" mxcsr ucontext.h ILMBASE_HAVE_CONTROL_REGISTER_SUPPORT)
if(NOT ILMBASE_HAVE_CONTROL_REGISTER_SUPPORT)
check_include_files(asm/sigcontext.h ILMBASE_HAVE_SIGCONTEXT_H)
if(ILMBASE_HAVE_SIGCONTEXT_H)
check_struct_has_member("struct _fpstate" mxcsr asm/sigcontext.h ILMBASE_HAVE_SIGCONTEXT_CONTROL_REGISTER_SUPPORT)
check_struct_has_member("struct _libc_fpstate" mxcsr ucontext.h IEX_HAVE_CONTROL_REGISTER_SUPPORT)
if(NOT IEX_HAVE_CONTROL_REGISTER_SUPPORT)
check_include_files(asm/sigcontext.h IEX_HAVE_SIGCONTEXT_H)
if(IEX_HAVE_SIGCONTEXT_H)
check_struct_has_member("struct _fpstate" mxcsr asm/sigcontext.h IEX_HAVE_SIGCONTEXT_CONTROL_REGISTER_SUPPORT)
endif()
endif()
endif()

###check_include_files(pthread.h ILMBASE_HAVE_PTHREAD)
###check_include_files(pthread.h ILMTHREAD_HAVE_PTHREAD)
if(OPENEXR_ENABLE_THREADING AND Threads_FOUND)
set(ILMBASE_THREADING_ENABLED ON)
set(ILMTHREAD_THREADING_ENABLED ON)
if(CMAKE_HAVE_PTHREAD_H OR CMAKE_USE_PTHREADS_INIT OR CMAKE_HP_PTHREAD_INIT)
set(ILMBASE_HAVE_PTHREAD ON)
set(ILMTHREAD_HAVE_PTHREAD ON)
endif()

# we have threads, but do we have posix semaphores for sem_init?
# should be in pthreads
if(NOT (APPLE OR (WIN32 AND (NOT MINGW))))
if(MINGW)
check_include_files("pthread_unistd.h;semaphore.h" ILMBASE_HAVE_SEMAPHORE_H)
check_include_files("pthread_unistd.h;semaphore.h" ILMTHREAD_HAVE_SEMAPHORE_H)
else()
check_include_files(semaphore.h ILMBASE_HAVE_SEMAPHORE_H)
check_include_files(semaphore.h ILMTHREAD_HAVE_SEMAPHORE_H)
endif()
if(ILMBASE_HAVE_SEMAPHORE_H AND ILMBASE_HAVE_PTHREAD)
if(ILMTHREAD_HAVE_SEMAPHORE_H AND ILMTHREAD_HAVE_PTHREAD)
# should just be in libc, so no need for check_library_exists
set(CMAKE_REQUIRED_FLAGS ${CMAKE_THREAD_LIBS_INIT})
check_library_exists(pthread sem_init "" ILMBASE_HAVE_POSIX_SEMAPHORES)
check_library_exists(pthread sem_init "" ILMTHREAD_HAVE_POSIX_SEMAPHORES)
set(CMAKE_REQUIRED_FLAGS)
endif()
endif()
Expand All @@ -112,16 +112,18 @@ if (OPENEXR_ENABLE_LARGE_STACK)
set(OPENEXR_HAVE_LARGE_STACK ON)
endif()

configure_file(IlmBaseConfig.h.in ${CMAKE_CURRENT_BINARY_DIR}/IlmBaseConfig.h)
configure_file(IlmBaseConfigInternal.h.in ${CMAKE_CURRENT_BINARY_DIR}/IlmBaseConfigInternal.h)
configure_file(IexConfig.h.in ${CMAKE_CURRENT_BINARY_DIR}/IexConfig.h)
configure_file(IexConfigInternal.h.in ${CMAKE_CURRENT_BINARY_DIR}/IexConfigInternal.h)
configure_file(IlmThreadConfig.h.in ${CMAKE_CURRENT_BINARY_DIR}/IlmThreadConfig.h)

###################################################
####### Install public config headers

install(
FILES
${CMAKE_CURRENT_BINARY_DIR}/OpenEXRConfig.h
${CMAKE_CURRENT_BINARY_DIR}/IlmBaseConfig.h
${CMAKE_CURRENT_BINARY_DIR}/IexConfig.h
${CMAKE_CURRENT_BINARY_DIR}/IlmThreadConfig.h
DESTINATION
${CMAKE_INSTALL_INCLUDEDIR}/${OPENEXR_OUTPUT_SUBDIR}
)
Expand All @@ -138,14 +140,23 @@ target_include_directories(OpenEXRConfig INTERFACE
install(TARGETS OpenEXRConfig EXPORT ${PROJECT_NAME})
add_library(${PROJECT_NAME}::Config ALIAS OpenEXRConfig)

add_library(IlmBaseConfig INTERFACE)
target_include_directories(IlmBaseConfig INTERFACE
add_library(IexConfig INTERFACE)
target_include_directories(IexConfig INTERFACE
$<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}>
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/${ILMBASE_OUTPUT_SUBDIR}>)
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/${OPENEXR_OUTPUT_SUBDIR}>)

install(TARGETS IexConfig EXPORT ${PROJECT_NAME})
add_library(${PROJECT_NAME}::Config ALIAS IexConfig)

add_library(IlmThreadConfig INTERFACE)
target_include_directories(IlmThreadConfig INTERFACE
$<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}>
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/${OPENEXR_OUTPUT_SUBDIR}>)

install(TARGETS IlmBaseConfig EXPORT ${PROJECT_NAME})
add_library(${PROJECT_NAME}::Config ALIAS IlmBaseConfig)
install(TARGETS IlmThreadConfig EXPORT ${PROJECT_NAME})
add_library(${PROJECT_NAME}::Config ALIAS IlmThreadConfig)

###################################################
####### Install pkg-config files if requested
Expand Down Expand Up @@ -177,7 +188,6 @@ if(OPENEXR_INSTALL_PKG_CONFIG)
)
endfunction()
openexr_pkg_config_help(OpenEXR.pc.in)
openexr_pkg_config_help(IlmBase.pc.in)
else()
message(STATUS "-- pkg-config generation disabled")
endif()
Expand Down
28 changes: 28 additions & 0 deletions cmake/IexConfig.h.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
// SPDX-License-Identifier: BSD-3-Clause
// Copyright Contributors to the OpenEXR Project.

// This file is auto-generated by the cmake configure step

#ifndef INCLUDED_IEX_CONFIG_H
#define INCLUDED_IEX_CONFIG_H 1

#pragma once

//
//
// C++ namespace configuration / options

//
// Current internal library namepace name
//
#define IEX_INTERNAL_NAMESPACE_CUSTOM @IEX_NAMESPACE_CUSTOM@
#define IEX_INTERNAL_NAMESPACE @IEX_INTERNAL_NAMESPACE@

//
// Current public user namepace name
//

#define IEX_NAMESPACE_CUSTOM @IEX_NAMESPACE_CUSTOM@
#define IEX_NAMESPACE @IEX_NAMESPACE@

#endif // INCLUDED_IEX_CONFIG_H
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@
// Dealing with FPEs
//
#cmakedefine HAVE_UCONTEXT_H 1
#cmakedefine ILMBASE_HAVE_CONTROL_REGISTER_SUPPORT 1
#cmakedefine ILMBASE_HAVE_SIGCONTEXT_CONTROL_REGISTER_SUPPORT 1
#cmakedefine IEX_HAVE_CONTROL_REGISTER_SUPPORT 1
#cmakedefine IEX_HAVE_SIGCONTEXT_CONTROL_REGISTER_SUPPORT 1
17 changes: 0 additions & 17 deletions cmake/IlmBase.pc.in

This file was deleted.

58 changes: 0 additions & 58 deletions cmake/IlmBaseConfig.h.in

This file was deleted.

43 changes: 43 additions & 0 deletions cmake/IlmThreadConfig.h.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
// SPDX-License-Identifier: BSD-3-Clause
// Copyright Contributors to the OpenEXR Project.

// This file is auto-generated by the cmake configure step

#ifndef INCLUDED_ILMTHREAD_CONFIG_H
#define INCLUDED_ILMTHREAD_CONFIG_H 1

#pragma once

//
//
// C++ namespace configuration / options

#cmakedefine01 ILMTHREAD_THREADING_ENABLED
#cmakedefine01 ILMTHREAD_HAVE_POSIX_SEMAPHORES

//
// Current internal library namepace name
//
#define ILMTHREAD_INTERNAL_NAMESPACE_CUSTOM @ILMTHREAD_NAMESPACE_CUSTOM@
#define ILMTHREAD_INTERNAL_NAMESPACE @ILMTHREAD_INTERNAL_NAMESPACE@

//
// Current public user namepace name
//

#define ILMTHREAD_NAMESPACE_CUSTOM @ILMTHREAD_NAMESPACE_CUSTOM@
#define ILMTHREAD_NAMESPACE @ILMTHREAD_NAMESPACE@

#if defined(__cplusplus) && (__cplusplus >= 201402L)
# define ILMTHREAD_DEPRECATED(msg) [[deprecated(msg)]]
#endif

#ifndef ILMTHREAD_DEPRECATED
# ifdef _MSC_VER
# define ILMTHREAD_DEPRECATED(msg) __declspec(deprecated(msg))
# else
# define ILMTHREAD_DEPRECATED(msg) __attribute__((deprecated(msg)))
# endif
#endif

#endif // INCLUDED_ILMTHREAD_CONFIG_H
Loading