-
Notifications
You must be signed in to change notification settings - Fork 16
Rework #14
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
base: master
Are you sure you want to change the base?
Rework #14
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -48,35 +48,20 @@ cmake_minimum_required (VERSION 2.6) | |
| project (AcesContainer) | ||
|
|
||
| include (GenerateExportHeader) | ||
| include (GNUInstallDirs) | ||
|
|
||
| set( AcesContainer_MAJOR_VERSION 1 ) | ||
| set( AcesContainer_MINOR_VERSION 0 ) | ||
| set( AcesContainer_PATCH_VERSION 2 ) | ||
| set( AcesContainer_VERSION ${AcesContainer_MAJOR_VERSION}.${AcesContainer_MINOR_VERSION}.${AcesContainer_PATCH_VERSION} ) | ||
|
|
||
| set( INSTALL_LIB_DIR lib CACHE PATH "Install directory for libraries" ) | ||
| set( INSTALL_INCLUDE_DIR include CACHE PATH "Install directory for public header files" ) | ||
|
|
||
|
|
||
| if(APPLE) | ||
| set( CMAKE_MACOSX_RPATH 1 ) | ||
| endif() | ||
|
|
||
| if( WIN32 AND NOT CYGWIN ) | ||
| set(DEF_INSTALL_CMAKE_DIR CMake) | ||
| set ( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W0" ) | ||
| else() | ||
| set(DEF_INSTALL_CMAKE_DIR lib/CMake/AcesContainer) | ||
| endif() | ||
| set(INSTALL_CMAKE_DIR ${DEF_INSTALL_CMAKE_DIR} CACHE PATH "Install directory for project CMake files" ) | ||
|
|
||
| ## convert install paths to absolute | ||
| foreach( p LIB INCLUDE CMAKE ) | ||
| set( var INSTALL_${p}_DIR ) | ||
| if( NOT IS_ABSOLUTE "${${var}}" ) | ||
| set( ${var} "${CMAKE_INSTALL_PREFIX}/${${var}}" ) | ||
| endif() | ||
| endforeach() | ||
|
|
||
| OPTION (BUILD_SHARED_LIBS "Build Shared Libraries" ON) | ||
| IF ( BUILD_SHARED_LIBS ) | ||
|
|
@@ -103,7 +88,13 @@ GENERATE_EXPORT_HEADER( AcesContainer | |
| STATIC_DEFINE AcesContainer_BUILT_AS_STATIC | ||
| ) | ||
|
|
||
| install (TARGETS AcesContainer EXPORT AcesContainerTargets DESTINATION ${INSTALL_LIB_DIR}) | ||
| # Set the build version (VERSION) and the API version (SOVERSION) | ||
| set_target_properties(AcesContainer | ||
| PROPERTIES | ||
| VERSION ${AcesContainer_VERSION} | ||
| SOVERSION ${AcesContainer_MAJOR_VERSION}) | ||
|
|
||
| install (TARGETS AcesContainer EXPORT AcesContainerTargets DESTINATION ${CMAKE_INSTALL_LIBDIR}) | ||
| install (FILES | ||
| aces_errors.h | ||
| aces_genericWriter.h | ||
|
|
@@ -118,14 +109,14 @@ install (FILES | |
| aces_types.h | ||
| aces_writeattributes.h | ||
| DESTINATION | ||
| ${INSTALL_INCLUDE_DIR}/aces | ||
| ${CMAKE_INSTALL_INCLUDEDIR}/aces | ||
| ) | ||
|
|
||
|
|
||
| find_package( PkgConfig ) | ||
| if ( PKG_CONFIG_FOUND ) | ||
| configure_file(config/AcesContainer.pc.in "${PROJECT_BINARY_DIR}/AcesContainer.pc" @ONLY) | ||
| install( FILES "${PROJECT_BINARY_DIR}/AcesContainer.pc" DESTINATION lib/pkgconfig COMPONENT dev ) | ||
| install( FILES "${PROJECT_BINARY_DIR}/AcesContainer.pc" DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig COMPONENT dev ) | ||
| endif() | ||
|
Comment on lines
116
to
120
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Btw, no need to depend on PkgConfig here - just doing string substitution w/ CMake built-in configure_file() command, no pkgconf commands are actually used...
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If PkgConfig isn't found, then the $_libdir/pkgconfig "system directory" will likely not exist (when installed as system lib). This effectively makes pkgconf optional, which I think it is. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't think anything prevents you from installing the $_libdir/pkgconfig/.pc files even if the directory doesn't exist... (The only exception might be if you're building the library w/ and for MSVC; all other platforms can use it.) One is providing this file as convenience for clients of this library at all times - pkgconf is indeed optional for them (they choose what build system and library dependency handling they use), but nothing stops you providing .pc files (and equivalent .cmake config files for that matter) at all times. Most distro packages do, without checking for pkgconf (or cmake). There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Actually, it makes sense to just install always, even MSVC (i.e. vcpkg) supports it. |
||
|
|
||
| include_directories( | ||
|
|
@@ -143,10 +134,6 @@ export(TARGETS AcesContainer | |
| export(PACKAGE AcesContainer) | ||
| # export(PACKAGE AcesContainer_lib) | ||
|
|
||
| # Create the FooBarConfig.cmake and FooBarConfigVersion files | ||
| file(RELATIVE_PATH REL_INCLUDE_DIR "${INSTALL_CMAKE_DIR}" | ||
| "${INSTALL_INCLUDE_DIR}") | ||
|
|
||
| # ... for the build tree | ||
| set(CONF_INCLUDE_DIRS "${PROJECT_SOURCE_DIR}" "${PROJECT_BINARY_DIR}") | ||
| set(CONF_LIB_DIRS "${PROJECT_BINARY_DIR}") | ||
|
|
@@ -166,10 +153,10 @@ configure_file(config/AcesContainerConfigVersion.cmake.in | |
| install(FILES | ||
| "${PROJECT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/AcesContainerConfig.cmake" | ||
| "${PROJECT_BINARY_DIR}/AcesContainerConfigVersion.cmake" | ||
| DESTINATION "${INSTALL_CMAKE_DIR}" COMPONENT dev) | ||
| DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake" COMPONENT dev) | ||
|
|
||
| # Install the export set for use with the install-tree | ||
| install(EXPORT AcesContainerTargets DESTINATION | ||
| "${INSTALL_CMAKE_DIR}" COMPONENT dev) | ||
| "${CMAKE_INSTALL_LIBDIR}/cmake" COMPONENT dev) | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -45,9 +45,9 @@ | |
| # A.M.P.A.S., WHETHER DISCLOSED OR UNDISCLOSED. | ||
|
|
||
| prefix=@CMAKE_INSTALL_PREFIX@ | ||
| libdir=@INSTALL_LIB_DIR@ | ||
| includedir=@INSTALL_INCLUDE_DIR@ | ||
| AcesContainer_includedir=@INSTALL_INCLUDE_DIR@/aces | ||
| libdir=@CMAKE_INSTALL_LIBDIR@ | ||
| includedir=@CMAKE_INSTALL_INCLUDEDIR@ | ||
| AcesContainer_includedir=@CMAKE_INSTALL_INCLUDEDIR@/aces | ||
|
Comment on lines
+48
to
+50
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. These should be
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks for review.
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Well, I might have miss-understood. (there is already a prefix ). Point is cmake doesn't pass variable relative to other variable. So if one ever one choose to use a custom layout, it should still work. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hm, not sure there is... The current template It needs to be So the template should be I also suggest getting rid of |
||
|
|
||
| Name: AcesContainer | ||
| Description: A library containing an implementation of ACES Image Container File | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On Windows, need to make sure binary artifacts (DLL) is installed into
binwhile import library inlib. This is done by defining RUNTIME, ARCHIVE, and LIBRARY destinations: https://cmake.org/cmake/help/latest/command/install.html#installing-targetsUh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I Can change that, but I won't be able to test.
As I undertstood, I need to have:
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes! I plan to test your changes for a MINGW build and will let you know how it goes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, I have a flight tonight so after Easter I will try to add commit to fix theses issue. Hopefully next week.