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

Alembic 1.7.12 fails to build if 1.7.11 is installed #259

Closed
danfe opened this issue Apr 3, 2020 · 1 comment
Closed

Alembic 1.7.12 fails to build if 1.7.11 is installed #259

danfe opened this issue Apr 3, 2020 · 1 comment
Assignees

Comments

@danfe
Copy link

danfe commented Apr 3, 2020

alembic-1.7.12/lib/Alembic/Abc/ArchiveInfo.cpp:66:29: error: use of undeclared identifier 'kDCCFPSKey'
     oDCCFPS = atof( md.get( kDCCFPSKey ).c_str() );

It happens because system-wide include directories are being injected into the global CMake state and thus take precedence over target's include directories (which is actually not even needed because they are already correctly added as TARGET_INCLUDE_DIRECTORIES). Consider the following patch. May also apply to ${Boost_INCLUDE_DIRS}. (See also: #223)

--- CMakeLists.txt.orig
+++ CMakeLists.txt
@@ -228,14 +225,18 @@ ENDIF()
 
 # IlmBase
 INCLUDE("./cmake/AlembicIlmBase.cmake")
-INCLUDE_DIRECTORIES(${ALEMBIC_ILMBASE_INCLUDE_DIRECTORY})
+# XXX: do not pollute global state: include directories correctly added
+# via TARGET_INCLUDE_DIRECTORIES in the `lib/Alembic/CMakeLists.txt'
+#INCLUDE_DIRECTORIES(${ALEMBIC_ILMBASE_INCLUDE_DIRECTORY})
 
 # HDF5
 IF (USE_HDF5)
     FIND_PACKAGE(ZLIB REQUIRED)
     SET(ALEMBIC_WITH_HDF5 "1")
     INCLUDE("./cmake/AlembicHDF5.cmake")
-    INCLUDE_DIRECTORIES(${HDF5_INCLUDE_DIRS})
+    # XXX: do not pollute global state: include directories correctly added
+    # via TARGET_INCLUDE_DIRECTORIES in the `lib/Alembic/CMakeLists.txt'
+    #INCLUDE_DIRECTORIES(${HDF5_INCLUDE_DIRS})
     SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DH5_USE_18_API")
 ENDIF()
 
--- lib/Alembic/AbcCoreHDF5/Tests/CMakeLists.txt.orig
+++ lib/Alembic/AbcCoreHDF5/Tests/CMakeLists.txt
@@ -33,7 +33,8 @@
 ##
 ##-*****************************************************************************
 
-INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/lib ${PROJECT_BINARY_DIR}/lib)
+INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/lib ${PROJECT_BINARY_DIR}/lib
+    ${HDF5_INCLUDE_DIRS})
 
 SET(CXX_FILES
     ArchiveTests.cpp
@lamiller0 lamiller0 self-assigned this Apr 4, 2020
lamiller0 added a commit to lamiller0/alembic that referenced this issue May 2, 2020
… gets injected

in the global CMake state) in the top CMake since we have
TARGET_INCLUDED_DIRECTORIES in the library itself.
@lamiller0 lamiller0 mentioned this issue Jul 11, 2020
@lamiller0
Copy link
Contributor

Looks like we should also remove it here:

https://github.com/alembic/alembic/blob/master/lib/Alembic/CMakeLists.txt#L61

Thanks for the heads up from:

lamiller0@00797cc#commitcomment-40540999

Qlex42 pushed a commit to dlrd/alembic that referenced this issue Sep 20, 2022
… gets injected

in the global CMake state) in the top CMake since we have
TARGET_INCLUDED_DIRECTORIES in the library itself.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants