From aa703c38fa543ec9e8c4fee66d1547172352ca7e Mon Sep 17 00:00:00 2001 From: Ashwin Bhat Date: Tue, 15 Aug 2023 11:19:18 -0700 Subject: [PATCH 1/5] Version information for MaterialX dlls --- cmake/modules/MaterialXVersion.rc.in | 34 +++++++++++++++++++++++ source/MaterialXCore/CMakeLists.txt | 24 ++++++++++------ source/MaterialXFormat/CMakeLists.txt | 24 ++++++++++------ source/MaterialXGenGlsl/CMakeLists.txt | 23 +++++++++------ source/MaterialXGenMdl/CMakeLists.txt | 23 +++++++++------ source/MaterialXGenMsl/CMakeLists.txt | 23 +++++++++------ source/MaterialXGenOsl/CMakeLists.txt | 23 +++++++++------ source/MaterialXGenShader/CMakeLists.txt | 23 +++++++++------ source/MaterialXRender/CMakeLists.txt | 24 ++++++++++------ source/MaterialXRenderGlsl/CMakeLists.txt | 31 +++++++++++++-------- source/MaterialXRenderHw/CMakeLists.txt | 27 +++++++++++------- source/MaterialXRenderMsl/CMakeLists.txt | 21 +++++++------- source/MaterialXRenderOsl/CMakeLists.txt | 23 +++++++++------ 13 files changed, 217 insertions(+), 106 deletions(-) create mode 100644 cmake/modules/MaterialXVersion.rc.in diff --git a/cmake/modules/MaterialXVersion.rc.in b/cmake/modules/MaterialXVersion.rc.in new file mode 100644 index 0000000000..5fc8707983 --- /dev/null +++ b/cmake/modules/MaterialXVersion.rc.in @@ -0,0 +1,34 @@ + +#define MATERIALX_FILEVERSION @MATERIALX_MAJOR_VERSION@,@MATERIALX_MINOR_VERSION@,@MATERIALX_BUILD_VERSION@,0 +#define MATERIALX_FILEVERSION_STR "@MATERIALX_MAJOR_VERSION@,@MATERIALX_MINOR_VERSION@,@MATERIALX_BUILD_VERSION@,0\0" +#define MATERIALX_FILENAME_STR "@MATERIALX_MODULE_NAME@.dll\0" + +1 VERSIONINFO + FILEVERSION MATERIALX_FILEVERSION + PRODUCTVERSION MATERIALX_FILEVERSION + FILEFLAGSMASK 0x3fL +#ifdef _DEBUG + FILEFLAGS 0x1L +#else + FILEFLAGS 0x0L +#endif + FILEOS 0x4L + FILETYPE 0x1L + FILESUBTYPE 0x0L +BEGIN + BLOCK "StringFileInfo" + BEGIN + BLOCK "040904b0" + BEGIN + VALUE "FileVersion", MATERIALX_FILEVERSION_STR + VALUE "LegalCopyright", "Apache License 2.0\0" + VALUE "OriginalFilename", MATERIALX_FILENAME_STR + VALUE "ProductName", "MaterialX\0" + VALUE "ProductVersion", MATERIALX_FILEVERSION_STR + END + END + BLOCK "VarFileInfo" + BEGIN + VALUE "Translation", 0x409, 1200 + END +END \ No newline at end of file diff --git a/source/MaterialXCore/CMakeLists.txt b/source/MaterialXCore/CMakeLists.txt index 37edf7929a..068685c967 100644 --- a/source/MaterialXCore/CMakeLists.txt +++ b/source/MaterialXCore/CMakeLists.txt @@ -1,25 +1,31 @@ +set(MATERIALX_MODULE_NAME MaterialXCore) configure_file(${CMAKE_CURRENT_SOURCE_DIR}/Generated.h.in ${CMAKE_CURRENT_BINARY_DIR}/Generated.h) file(GLOB materialx_source "${CMAKE_CURRENT_SOURCE_DIR}/*.cpp") file(GLOB materialx_headers "${CMAKE_CURRENT_SOURCE_DIR}/*.h" "${CMAKE_CURRENT_BINARY_DIR}/*.h") - -add_library(MaterialXCore ${materialx_source} ${materialx_headers}) +add_library(${MATERIALX_MODULE_NAME} ${materialx_source} ${materialx_headers}) add_definitions(-DMATERIALX_CORE_EXPORTS) +# Create version resource +if(MATERIALX_BUILD_SHARED_LIBS AND MSVC) + configure_file(${CMAKE_SOURCE_DIR}/cmake/modules/MaterialXVersion.rc.in ${CMAKE_CURRENT_BINARY_DIR}/version.rc) + target_sources(${MATERIALX_MODULE_NAME} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/version.rc) +endif() + set_target_properties( - MaterialXCore PROPERTIES - OUTPUT_NAME MaterialXCore${MATERIALX_LIBNAME_SUFFIX} + ${MATERIALX_MODULE_NAME} PROPERTIES + OUTPUT_NAME ${MATERIALX_MODULE_NAME}${MATERIALX_LIBNAME_SUFFIX} COMPILE_FLAGS "${EXTERNAL_COMPILE_FLAGS}" LINK_FLAGS "${EXTERNAL_LINK_FLAGS}" VERSION "${MATERIALX_LIBRARY_VERSION}" SOVERSION "${MATERIALX_MAJOR_VERSION}") target_link_libraries( - MaterialXCore + ${MATERIALX_MODULE_NAME} ${CMAKE_DL_LIBS}) -target_include_directories(MaterialXCore +target_include_directories(${MATERIALX_MODULE_NAME} PUBLIC $ $ @@ -27,14 +33,14 @@ target_include_directories(MaterialXCore PRIVATE ${EXTERNAL_INCLUDE_DIRS}) -install(TARGETS MaterialXCore +install(TARGETS ${MATERIALX_MODULE_NAME} EXPORT MaterialX ARCHIVE DESTINATION ${MATERIALX_INSTALL_LIB_PATH} LIBRARY DESTINATION ${MATERIALX_INSTALL_LIB_PATH} RUNTIME DESTINATION bin) install(FILES ${materialx_headers} - DESTINATION ${MATERIALX_INSTALL_INCLUDE_PATH}/MaterialXCore/) + DESTINATION ${MATERIALX_INSTALL_INCLUDE_PATH}/${MATERIALX_MODULE_NAME}/) -install(FILES "${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_BUILD_TYPE}/MaterialXCore.pdb" +install(FILES "${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_BUILD_TYPE}/${MATERIALX_MODULE_NAME}.pdb" DESTINATION "${MATERIALX_INSTALL_LIB_PATH}/" OPTIONAL) diff --git a/source/MaterialXFormat/CMakeLists.txt b/source/MaterialXFormat/CMakeLists.txt index 940ef9662c..e8d4575b21 100644 --- a/source/MaterialXFormat/CMakeLists.txt +++ b/source/MaterialXFormat/CMakeLists.txt @@ -1,16 +1,22 @@ +set(MATERIALX_MODULE_NAME MaterialXFormat) file(GLOB_RECURSE materialx_source "${CMAKE_CURRENT_SOURCE_DIR}/*.cpp") file(GLOB_RECURSE materialx_headers "${CMAKE_CURRENT_SOURCE_DIR}/*.h*") assign_source_group("Source Files" ${materialx_source}) assign_source_group("Header Files" ${materialx_headers}) - -add_library(MaterialXFormat ${materialx_source} ${materialx_headers}) +add_library(${MATERIALX_MODULE_NAME} ${materialx_source} ${materialx_headers}) add_definitions(-DMATERIALX_FORMAT_EXPORTS) +# Create version resource +if(MATERIALX_BUILD_SHARED_LIBS AND MSVC) + configure_file(${CMAKE_SOURCE_DIR}/cmake/modules/MaterialXVersion.rc.in ${CMAKE_CURRENT_BINARY_DIR}/version.rc) + target_sources(${MATERIALX_MODULE_NAME} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/version.rc) +endif() + set_target_properties( - MaterialXFormat PROPERTIES - OUTPUT_NAME MaterialXFormat${MATERIALX_LIBNAME_SUFFIX} + ${MATERIALX_MODULE_NAME} PROPERTIES + OUTPUT_NAME ${MATERIALX_MODULE_NAME}${MATERIALX_LIBNAME_SUFFIX} COMPILE_FLAGS "${EXTERNAL_COMPILE_FLAGS}" LINK_FLAGS "${EXTERNAL_LINK_FLAGS}" INSTALL_RPATH "${MATERIALX_SAME_DIR_RPATH}" @@ -18,26 +24,26 @@ set_target_properties( SOVERSION "${MATERIALX_MAJOR_VERSION}") target_link_libraries( - MaterialXFormat + ${MATERIALX_MODULE_NAME} MaterialXCore ${CMAKE_DL_LIBS}) -target_include_directories(MaterialXFormat +target_include_directories(${MATERIALX_MODULE_NAME} PUBLIC $ $ PRIVATE ${EXTERNAL_INCLUDE_DIRS}) -install(TARGETS MaterialXFormat +install(TARGETS ${MATERIALX_MODULE_NAME} EXPORT MaterialX ARCHIVE DESTINATION ${MATERIALX_INSTALL_LIB_PATH} LIBRARY DESTINATION ${MATERIALX_INSTALL_LIB_PATH} RUNTIME DESTINATION bin) install(DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/" - DESTINATION ${MATERIALX_INSTALL_INCLUDE_PATH}/MaterialXFormat/ MESSAGE_NEVER + DESTINATION ${MATERIALX_INSTALL_INCLUDE_PATH}/${MATERIALX_MODULE_NAME}/ MESSAGE_NEVER FILES_MATCHING PATTERN "*.h*") -install(FILES "${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_BUILD_TYPE}/MaterialXFormat.pdb" +install(FILES "${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_BUILD_TYPE}/${MATERIALX_MODULE_NAME}.pdb" DESTINATION "${MATERIALX_INSTALL_LIB_PATH}/" OPTIONAL) diff --git a/source/MaterialXGenGlsl/CMakeLists.txt b/source/MaterialXGenGlsl/CMakeLists.txt index 2ddcb5475c..a1d8056849 100644 --- a/source/MaterialXGenGlsl/CMakeLists.txt +++ b/source/MaterialXGenGlsl/CMakeLists.txt @@ -1,16 +1,23 @@ +set(MATERIALX_MODULE_NAME MaterialXGenGlsl) file(GLOB_RECURSE materialx_source "${CMAKE_CURRENT_SOURCE_DIR}/*.cpp") file(GLOB_RECURSE materialx_headers "${CMAKE_CURRENT_SOURCE_DIR}/*.h*") assign_source_group("Source Files" ${materialx_source}) assign_source_group("Header Files" ${materialx_headers}) -add_library(MaterialXGenGlsl ${materialx_source} ${materialx_headers}) +add_library(${MATERIALX_MODULE_NAME} ${materialx_source} ${materialx_headers}) add_definitions(-DMATERIALX_GENGLSL_EXPORTS) +# Create version resource +if(MATERIALX_BUILD_SHARED_LIBS AND MSVC) + configure_file(${CMAKE_SOURCE_DIR}/cmake/modules/MaterialXVersion.rc.in ${CMAKE_CURRENT_BINARY_DIR}/version.rc) + target_sources(${MATERIALX_MODULE_NAME} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/version.rc) +endif() + set_target_properties( - MaterialXGenGlsl PROPERTIES - OUTPUT_NAME MaterialXGenGlsl${MATERIALX_LIBNAME_SUFFIX} + ${MATERIALX_MODULE_NAME} PROPERTIES + OUTPUT_NAME ${MATERIALX_MODULE_NAME}${MATERIALX_LIBNAME_SUFFIX} COMPILE_FLAGS "${EXTERNAL_COMPILE_FLAGS}" LINK_FLAGS "${EXTERNAL_LINK_FLAGS}" INSTALL_RPATH "${MATERIALX_SAME_DIR_RPATH}" @@ -18,27 +25,27 @@ set_target_properties( SOVERSION "${MATERIALX_MAJOR_VERSION}") target_link_libraries( - MaterialXGenGlsl + ${MATERIALX_MODULE_NAME} MaterialXGenShader MaterialXCore ${CMAKE_DL_LIBS}) -target_include_directories(MaterialXGenGlsl +target_include_directories(${MATERIALX_MODULE_NAME} PUBLIC $ $ PRIVATE ${EXTERNAL_INCLUDE_DIRS}) -install(TARGETS MaterialXGenGlsl +install(TARGETS ${MATERIALX_MODULE_NAME} EXPORT MaterialX ARCHIVE DESTINATION ${MATERIALX_INSTALL_LIB_PATH} LIBRARY DESTINATION ${MATERIALX_INSTALL_LIB_PATH} RUNTIME DESTINATION bin) install(DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/" - DESTINATION ${MATERIALX_INSTALL_INCLUDE_PATH}/MaterialXGenGlsl/ MESSAGE_NEVER + DESTINATION ${MATERIALX_INSTALL_INCLUDE_PATH}/${MATERIALX_MODULE_NAME}/ MESSAGE_NEVER FILES_MATCHING PATTERN "*.h*") -install(FILES "${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_BUILD_TYPE}/MaterialXGenGlsl.pdb" +install(FILES "${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_BUILD_TYPE}/${MATERIALX_MODULE_NAME}.pdb" DESTINATION "${MATERIALX_INSTALL_LIB_PATH}/" OPTIONAL) diff --git a/source/MaterialXGenMdl/CMakeLists.txt b/source/MaterialXGenMdl/CMakeLists.txt index b73e674b7f..831f925f1f 100644 --- a/source/MaterialXGenMdl/CMakeLists.txt +++ b/source/MaterialXGenMdl/CMakeLists.txt @@ -1,16 +1,23 @@ +set(MATERIALX_MODULE_NAME MaterialXGenMdl) file(GLOB_RECURSE materialx_source "${CMAKE_CURRENT_SOURCE_DIR}/*.cpp") file(GLOB_RECURSE materialx_headers "${CMAKE_CURRENT_SOURCE_DIR}/*.h*") assign_source_group("Source Files" ${materialx_source}) assign_source_group("Header Files" ${materialx_headers}) -add_library(MaterialXGenMdl ${materialx_source} ${materialx_headers}) +add_library(${MATERIALX_MODULE_NAME} ${materialx_source} ${materialx_headers}) add_definitions(-DMATERIALX_GENMDL_EXPORTS) +# Create version resource +if(MATERIALX_BUILD_SHARED_LIBS AND MSVC) + configure_file(${CMAKE_SOURCE_DIR}/cmake/modules/MaterialXVersion.rc.in ${CMAKE_CURRENT_BINARY_DIR}/version.rc) + target_sources(${MATERIALX_MODULE_NAME} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/version.rc) +endif() + set_target_properties( - MaterialXGenMdl PROPERTIES - OUTPUT_NAME MaterialXGenMdl${MATERIALX_LIBNAME_SUFFIX} + ${MATERIALX_MODULE_NAME} PROPERTIES + OUTPUT_NAME ${MATERIALX_MODULE_NAME}${MATERIALX_LIBNAME_SUFFIX} COMPILE_FLAGS "${EXTERNAL_COMPILE_FLAGS}" LINK_FLAGS "${EXTERNAL_LINK_FLAGS}" INSTALL_RPATH "${MATERIALX_SAME_DIR_RPATH}" @@ -18,30 +25,30 @@ set_target_properties( SOVERSION "${MATERIALX_MAJOR_VERSION}") target_link_libraries( - MaterialXGenMdl + ${MATERIALX_MODULE_NAME} MaterialXGenShader MaterialXCore ${CMAKE_DL_LIBS}) -target_include_directories(MaterialXGenMdl +target_include_directories(${MATERIALX_MODULE_NAME} PUBLIC $ $ PRIVATE ${EXTERNAL_INCLUDE_DIRS}) -install(TARGETS MaterialXGenMdl +install(TARGETS ${MATERIALX_MODULE_NAME} EXPORT MaterialX ARCHIVE DESTINATION ${MATERIALX_INSTALL_LIB_PATH} LIBRARY DESTINATION ${MATERIALX_INSTALL_LIB_PATH} RUNTIME DESTINATION bin) install(DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/" - DESTINATION ${MATERIALX_INSTALL_INCLUDE_PATH}/MaterialXGenMdl/ MESSAGE_NEVER + DESTINATION ${MATERIALX_INSTALL_INCLUDE_PATH}/${MATERIALX_MODULE_NAME}/ MESSAGE_NEVER FILES_MATCHING PATTERN "*.h*") install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/mdl DESTINATION "${MATERIALX_INSTALL_MDL_MODULE_PATH}") -install(FILES "${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_BUILD_TYPE}/MaterialXGenMdl.pdb" +install(FILES "${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_BUILD_TYPE}/${MATERIALX_MODULE_NAME}.pdb" DESTINATION "${MATERIALX_INSTALL_LIB_PATH}/" OPTIONAL) diff --git a/source/MaterialXGenMsl/CMakeLists.txt b/source/MaterialXGenMsl/CMakeLists.txt index 31d2599531..5b7e42e70e 100644 --- a/source/MaterialXGenMsl/CMakeLists.txt +++ b/source/MaterialXGenMsl/CMakeLists.txt @@ -1,16 +1,23 @@ +set(MATERIALX_MODULE_NAME MaterialXGenMsl) file(GLOB_RECURSE materialx_source "${CMAKE_CURRENT_SOURCE_DIR}/*.cpp") file(GLOB_RECURSE materialx_headers "${CMAKE_CURRENT_SOURCE_DIR}/*.h*") assign_source_group("Source Files" ${materialx_source}) assign_source_group("Header Files" ${materialx_headers}) -add_library(MaterialXGenMsl ${materialx_source} ${materialx_headers}) +add_library(${MATERIALX_MODULE_NAME} ${materialx_source} ${materialx_headers}) add_definitions(-DMATERIALX_GENMSL_EXPORTS) +# Create version resource +if(MATERIALX_BUILD_SHARED_LIBS AND MSVC) + configure_file(${CMAKE_SOURCE_DIR}/cmake/modules/MaterialXVersion.rc.in ${CMAKE_CURRENT_BINARY_DIR}/version.rc) + target_sources(${MATERIALX_MODULE_NAME} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/version.rc) +endif() + set_target_properties( - MaterialXGenMsl PROPERTIES - OUTPUT_NAME MaterialXGenMsl${MATERIALX_LIBNAME_SUFFIX} + ${MATERIALX_MODULE_NAME} PROPERTIES + OUTPUT_NAME ${MATERIALX_MODULE_NAME}${MATERIALX_LIBNAME_SUFFIX} COMPILE_FLAGS "${EXTERNAL_COMPILE_FLAGS}" LINK_FLAGS "${EXTERNAL_LINK_FLAGS}" INSTALL_RPATH "${MATERIALX_SAME_DIR_RPATH}" @@ -18,27 +25,27 @@ set_target_properties( SOVERSION "${MATERIALX_MAJOR_VERSION}") target_link_libraries( - MaterialXGenMsl + ${MATERIALX_MODULE_NAME} MaterialXGenShader MaterialXCore ${CMAKE_DL_LIBS}) -target_include_directories(MaterialXGenMsl +target_include_directories(${MATERIALX_MODULE_NAME} PUBLIC $ $ PRIVATE ${EXTERNAL_INCLUDE_DIRS}) -install(TARGETS MaterialXGenMsl +install(TARGETS ${MATERIALX_MODULE_NAME} EXPORT MaterialX ARCHIVE DESTINATION ${MATERIALX_INSTALL_LIB_PATH} LIBRARY DESTINATION ${MATERIALX_INSTALL_LIB_PATH} RUNTIME DESTINATION bin) install(DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/" - DESTINATION ${MATERIALX_INSTALL_INCLUDE_PATH}/MaterialXGenMsl/ MESSAGE_NEVER + DESTINATION ${MATERIALX_INSTALL_INCLUDE_PATH}/${MATERIALX_MODULE_NAME}/ MESSAGE_NEVER FILES_MATCHING PATTERN "*.h*") -install(FILES "${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_BUILD_TYPE}/MaterialXGenMsl.pdb" +install(FILES "${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_BUILD_TYPE}/${MATERIALX_MODULE_NAME}.pdb" DESTINATION "${MATERIALX_INSTALL_LIB_PATH}/" OPTIONAL) diff --git a/source/MaterialXGenOsl/CMakeLists.txt b/source/MaterialXGenOsl/CMakeLists.txt index 03e30de0c1..50d0ad7db2 100644 --- a/source/MaterialXGenOsl/CMakeLists.txt +++ b/source/MaterialXGenOsl/CMakeLists.txt @@ -1,16 +1,23 @@ +set(MATERIALX_MODULE_NAME MaterialXGenOsl) file(GLOB_RECURSE materialx_source "${CMAKE_CURRENT_SOURCE_DIR}/*.cpp") file(GLOB_RECURSE materialx_headers "${CMAKE_CURRENT_SOURCE_DIR}/*.h*") assign_source_group("Source Files" ${materialx_source}) assign_source_group("Header Files" ${materialx_headers}) -add_library(MaterialXGenOsl ${materialx_source} ${materialx_headers}) +add_library(${MATERIALX_MODULE_NAME} ${materialx_source} ${materialx_headers}) add_definitions(-DMATERIALX_GENOSL_EXPORTS) +# Create version resource +if(MATERIALX_BUILD_SHARED_LIBS AND MSVC) + configure_file(${CMAKE_SOURCE_DIR}/cmake/modules/MaterialXVersion.rc.in ${CMAKE_CURRENT_BINARY_DIR}/version.rc) + target_sources(${MATERIALX_MODULE_NAME} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/version.rc) +endif() + set_target_properties( - MaterialXGenOsl PROPERTIES - OUTPUT_NAME MaterialXGenOsl${MATERIALX_LIBNAME_SUFFIX} + ${MATERIALX_MODULE_NAME} PROPERTIES + OUTPUT_NAME ${MATERIALX_MODULE_NAME}${MATERIALX_LIBNAME_SUFFIX} COMPILE_FLAGS "${EXTERNAL_COMPILE_FLAGS}" LINK_FLAGS "${EXTERNAL_LINK_FLAGS}" INSTALL_RPATH "${MATERIALX_SAME_DIR_RPATH}" @@ -18,28 +25,28 @@ set_target_properties( SOVERSION "${MATERIALX_MAJOR_VERSION}") target_link_libraries( - MaterialXGenOsl + ${MATERIALX_MODULE_NAME} MaterialXGenShader MaterialXCore ${CMAKE_DL_LIBS}) -target_include_directories(MaterialXGenOsl +target_include_directories(${MATERIALX_MODULE_NAME} PUBLIC $ $ PRIVATE ${EXTERNAL_INCLUDE_DIRS}) -install(TARGETS MaterialXGenOsl +install(TARGETS ${MATERIALX_MODULE_NAME} EXPORT MaterialX ARCHIVE DESTINATION ${MATERIALX_INSTALL_LIB_PATH} LIBRARY DESTINATION ${MATERIALX_INSTALL_LIB_PATH} RUNTIME DESTINATION bin) install(DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/" - DESTINATION ${MATERIALX_INSTALL_INCLUDE_PATH}/MaterialXGenOsl/ MESSAGE_NEVER + DESTINATION ${MATERIALX_INSTALL_INCLUDE_PATH}/${MATERIALX_MODULE_NAME}/ MESSAGE_NEVER FILES_MATCHING PATTERN "*.h*") -install(FILES "${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_BUILD_TYPE}/MaterialXGenOsl.pdb" +install(FILES "${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_BUILD_TYPE}/${MATERIALX_MODULE_NAME}.pdb" DESTINATION "${MATERIALX_INSTALL_LIB_PATH}/" OPTIONAL) diff --git a/source/MaterialXGenShader/CMakeLists.txt b/source/MaterialXGenShader/CMakeLists.txt index 231dda6e5c..a683329d66 100644 --- a/source/MaterialXGenShader/CMakeLists.txt +++ b/source/MaterialXGenShader/CMakeLists.txt @@ -1,16 +1,23 @@ +set(MATERIALX_MODULE_NAME MaterialXGenShader) file(GLOB_RECURSE materialx_source "${CMAKE_CURRENT_SOURCE_DIR}/*.cpp") file(GLOB_RECURSE materialx_headers "${CMAKE_CURRENT_SOURCE_DIR}/*.h*") assign_source_group("Source Files" ${materialx_source}) assign_source_group("Header Files" ${materialx_headers}) -add_library(MaterialXGenShader ${materialx_source} ${materialx_headers}) +add_library(${MATERIALX_MODULE_NAME} ${materialx_source} ${materialx_headers}) add_definitions(-DMATERIALX_GENSHADER_EXPORTS) +# Create version resource +if(MATERIALX_BUILD_SHARED_LIBS AND MSVC) + configure_file(${CMAKE_SOURCE_DIR}/cmake/modules/MaterialXVersion.rc.in ${CMAKE_CURRENT_BINARY_DIR}/version.rc) + target_sources(${MATERIALX_MODULE_NAME} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/version.rc) +endif() + set_target_properties( - MaterialXGenShader PROPERTIES - OUTPUT_NAME MaterialXGenShader${MATERIALX_LIBNAME_SUFFIX} + ${MATERIALX_MODULE_NAME} PROPERTIES + OUTPUT_NAME ${MATERIALX_MODULE_NAME}${MATERIALX_LIBNAME_SUFFIX} COMPILE_FLAGS "${EXTERNAL_COMPILE_FLAGS}" LINK_FLAGS "${EXTERNAL_LINK_FLAGS}" INSTALL_RPATH "${MATERIALX_SAME_DIR_RPATH}" @@ -18,29 +25,29 @@ set_target_properties( SOVERSION "${MATERIALX_MAJOR_VERSION}") target_link_libraries( - MaterialXGenShader + ${MATERIALX_MODULE_NAME} MaterialXCore MaterialXFormat ${CMAKE_DL_LIBS}) -target_include_directories(MaterialXGenShader +target_include_directories(${MATERIALX_MODULE_NAME} PUBLIC $ $ PRIVATE ${EXTERNAL_INCLUDE_DIRS}) -install(TARGETS MaterialXGenShader +install(TARGETS ${MATERIALX_MODULE_NAME} EXPORT MaterialX ARCHIVE DESTINATION ${MATERIALX_INSTALL_LIB_PATH} LIBRARY DESTINATION ${MATERIALX_INSTALL_LIB_PATH} RUNTIME DESTINATION bin) install(DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/" - DESTINATION ${MATERIALX_INSTALL_INCLUDE_PATH}/MaterialXGenShader/ MESSAGE_NEVER + DESTINATION ${MATERIALX_INSTALL_INCLUDE_PATH}/${MATERIALX_MODULE_NAME}/ MESSAGE_NEVER FILES_MATCHING PATTERN "*.h*") -install(FILES "${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_BUILD_TYPE}/MaterialXGenShader.pdb" +install(FILES "${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_BUILD_TYPE}/${MATERIALX_MODULE_NAME}.pdb" DESTINATION "${MATERIALX_INSTALL_LIB_PATH}/" OPTIONAL) install(DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/../../resources" diff --git a/source/MaterialXRender/CMakeLists.txt b/source/MaterialXRender/CMakeLists.txt index d0a50232cd..eb054303c5 100644 --- a/source/MaterialXRender/CMakeLists.txt +++ b/source/MaterialXRender/CMakeLists.txt @@ -1,3 +1,5 @@ +set(MATERIALX_MODULE_NAME MaterialXRender) + include_directories( ${EXTERNAL_INCLUDE_DIRS} ${CMAKE_CURRENT_SOURCE_DIR}/../) @@ -18,12 +20,18 @@ if(UNIX) add_compile_options(-Wno-unused-function) endif() -add_library(MaterialXRender ${materialx_source} ${materialx_headers} ${materialx_inlined}) +add_library(${MATERIALX_MODULE_NAME} ${materialx_source} ${materialx_headers} ${materialx_inlined}) add_definitions(-DMATERIALX_RENDER_EXPORTS) +# Create version resource +if(MATERIALX_BUILD_SHARED_LIBS AND MSVC) + configure_file(${CMAKE_SOURCE_DIR}/cmake/modules/MaterialXVersion.rc.in ${CMAKE_CURRENT_BINARY_DIR}/version.rc) + target_sources(${MATERIALX_MODULE_NAME} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/version.rc) +endif() + target_link_libraries( - MaterialXRender + ${MATERIALX_MODULE_NAME} MaterialXGenShader ${CMAKE_DL_LIBS}) @@ -33,7 +41,7 @@ if(MATERIALX_BUILD_OIIO) find_package(OpenImageIO REQUIRED) if(OPENIMAGEIO_FOUND) include_directories(${OPENIMAGEIO_INCLUDE_DIR}) - target_link_libraries(MaterialXRender ${OPENIMAGEIO_LIBRARIES}) + target_link_libraries(${MATERIALX_MODULE_NAME} ${OPENIMAGEIO_LIBRARIES}) # Also needed by MaterialXTest: set(OPENIMAGEIO_FOUND "${OPENIMAGEIO_FOUND}" PARENT_SCOPE) set(OPENIMAGEIO_INCLUDE_DIR "${OPENIMAGEIO_INCLUDE_DIR}" PARENT_SCOPE) @@ -44,25 +52,25 @@ if(MATERIALX_BUILD_OIIO) endif() set_target_properties( - MaterialXRender PROPERTIES - OUTPUT_NAME MaterialXRender${MATERIALX_LIBNAME_SUFFIX} + ${MATERIALX_MODULE_NAME} PROPERTIES + OUTPUT_NAME ${MATERIALX_MODULE_NAME}${MATERIALX_LIBNAME_SUFFIX} COMPILE_FLAGS "${EXTERNAL_COMPILE_FLAGS}" LINK_FLAGS "${EXTERNAL_LINK_FLAGS}" INSTALL_RPATH "${MATERIALX_SAME_DIR_RPATH}" VERSION "${MATERIALX_LIBRARY_VERSION}" SOVERSION "${MATERIALX_MAJOR_VERSION}") -install(TARGETS MaterialXRender +install(TARGETS ${MATERIALX_MODULE_NAME} EXPORT MaterialX ARCHIVE DESTINATION ${MATERIALX_INSTALL_LIB_PATH} LIBRARY DESTINATION ${MATERIALX_INSTALL_LIB_PATH} RUNTIME DESTINATION bin) install(DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/" - DESTINATION ${MATERIALX_INSTALL_INCLUDE_PATH}/MaterialXRender/ MESSAGE_NEVER + DESTINATION ${MATERIALX_INSTALL_INCLUDE_PATH}/${MATERIALX_MODULE_NAME}/ MESSAGE_NEVER FILES_MATCHING PATTERN "*.h*" PATTERN "*.inl") -install(FILES "${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_BUILD_TYPE}/MaterialXRender.pdb" +install(FILES "${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_BUILD_TYPE}/${MATERIALX_MODULE_NAME}.pdb" DESTINATION "${MATERIALX_INSTALL_LIB_PATH}/" OPTIONAL) diff --git a/source/MaterialXRenderGlsl/CMakeLists.txt b/source/MaterialXRenderGlsl/CMakeLists.txt index ddab96c318..5b74f15d60 100644 --- a/source/MaterialXRenderGlsl/CMakeLists.txt +++ b/source/MaterialXRenderGlsl/CMakeLists.txt @@ -1,3 +1,4 @@ +set(MATERIALX_MODULE_NAME MaterialXRenderGlsl) file(GLOB_RECURSE materialx_source "${CMAKE_CURRENT_SOURCE_DIR}/*.c*") file(GLOB_RECURSE materialx_headers "${CMAKE_CURRENT_SOURCE_DIR}/*.h*") @@ -34,12 +35,18 @@ if(CMAKE_CXX_COMPILER_ID MATCHES "Clang") add_compile_options(-Wno-deprecated-declarations) endif() -add_library(MaterialXRenderGlsl ${materialx_source} ${materialx_headers}) +add_library(${MATERIALX_MODULE_NAME} ${materialx_source} ${materialx_headers}) add_definitions(-DMATERIALX_RENDERGLSL_EXPORTS) +# Create version resource +if(MATERIALX_BUILD_SHARED_LIBS AND MSVC) + configure_file(${CMAKE_SOURCE_DIR}/cmake/modules/MaterialXVersion.rc.in ${CMAKE_CURRENT_BINARY_DIR}/version.rc) + target_sources(${MATERIALX_MODULE_NAME} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/version.rc) +endif() + if(MATERIALX_BUILD_SHARED_LIBS) - target_compile_definitions(MaterialXRenderGlsl PUBLIC GLAD_GLAPI_EXPORT PRIVATE GLAD_GLAPI_EXPORT_BUILD) + target_compile_definitions(${MATERIALX_MODULE_NAME} PUBLIC GLAD_GLAPI_EXPORT PRIVATE GLAD_GLAPI_EXPORT_BUILD) endif() set(COMMON_LIBRARIES @@ -50,19 +57,19 @@ set(COMMON_LIBRARIES if(WIN32) if(MSVC) target_link_libraries( - MaterialXRenderGlsl + ${MATERIALX_MODULE_NAME} ${COMMON_LIBRARIES} Opengl32) elseif(MINGW) target_link_libraries( - MaterialXRenderGlsl + ${MATERIALX_MODULE_NAME} ${COMMON_LIBRARIES} Opengl32 gdi32) endif() elseif(APPLE) target_link_libraries( - MaterialXRenderGlsl + ${MATERIALX_MODULE_NAME} ${COMMON_LIBRARIES} ${OPENGL_LIBRARIES} "-framework Foundation" @@ -70,7 +77,7 @@ elseif(APPLE) "-framework Metal") elseif(UNIX) target_link_libraries( - MaterialXRenderGlsl + ${MATERIALX_MODULE_NAME} ${COMMON_LIBRARIES} ${OPENGL_LIBRARIES} ${X11_LIBRARIES} @@ -78,30 +85,30 @@ elseif(UNIX) endif() set_target_properties( - MaterialXRenderGlsl PROPERTIES - OUTPUT_NAME MaterialXRenderGlsl${MATERIALX_LIBNAME_SUFFIX} + ${MATERIALX_MODULE_NAME} PROPERTIES + OUTPUT_NAME ${MATERIALX_MODULE_NAME}${MATERIALX_LIBNAME_SUFFIX} COMPILE_FLAGS "${EXTERNAL_COMPILE_FLAGS}" LINK_FLAGS "${EXTERNAL_LINK_FLAGS}" INSTALL_RPATH "${MATERIALX_SAME_DIR_RPATH}" VERSION "${MATERIALX_LIBRARY_VERSION}" SOVERSION "${MATERIALX_MAJOR_VERSION}") -target_include_directories(MaterialXRenderGlsl +target_include_directories(${MATERIALX_MODULE_NAME} PUBLIC $ $ PRIVATE ${EXTERNAL_INCLUDE_DIRS}) -install(TARGETS MaterialXRenderGlsl +install(TARGETS ${MATERIALX_MODULE_NAME} EXPORT MaterialX ARCHIVE DESTINATION ${MATERIALX_INSTALL_LIB_PATH} LIBRARY DESTINATION ${MATERIALX_INSTALL_LIB_PATH} RUNTIME DESTINATION bin) install(DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/" - DESTINATION ${MATERIALX_INSTALL_INCLUDE_PATH}/MaterialXRenderGlsl/ MESSAGE_NEVER + DESTINATION ${MATERIALX_INSTALL_INCLUDE_PATH}/${MATERIALX_MODULE_NAME}/ MESSAGE_NEVER FILES_MATCHING PATTERN "*.h*") -install(FILES "${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_BUILD_TYPE}/MaterialXRenderGlsl.pdb" +install(FILES "${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_BUILD_TYPE}/${MATERIALX_MODULE_NAME}.pdb" DESTINATION "${MATERIALX_INSTALL_LIB_PATH}/" OPTIONAL) diff --git a/source/MaterialXRenderHw/CMakeLists.txt b/source/MaterialXRenderHw/CMakeLists.txt index 85ef13c55c..925af186d5 100644 --- a/source/MaterialXRenderHw/CMakeLists.txt +++ b/source/MaterialXRenderHw/CMakeLists.txt @@ -1,3 +1,4 @@ +set(MATERIALX_MODULE_NAME MaterialXRenderHw) file(GLOB materialx_source "${CMAKE_CURRENT_SOURCE_DIR}/*.cpp") file(GLOB materialx_headers "${CMAKE_CURRENT_SOURCE_DIR}/*.h*") @@ -20,18 +21,24 @@ endif() assign_source_group("Source Files" ${materialx_source}) assign_source_group("Header Files" ${materialx_headers}) -add_library(MaterialXRenderHw ${materialx_source} ${materialx_headers}) +add_library(${MATERIALX_MODULE_NAME} ${materialx_source} ${materialx_headers}) add_definitions(-DMATERIALX_RENDERHW_EXPORTS) +# Create version resource +if(MATERIALX_BUILD_SHARED_LIBS AND MSVC) + configure_file(${CMAKE_SOURCE_DIR}/cmake/modules/MaterialXVersion.rc.in ${CMAKE_CURRENT_BINARY_DIR}/version.rc) + target_sources(${MATERIALX_MODULE_NAME} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/version.rc) +endif() + if(MSVC) target_link_libraries( - MaterialXRenderHw + ${MATERIALX_MODULE_NAME} MaterialXRender ${CMAKE_DL_LIBS}) elseif(APPLE) target_link_libraries( - MaterialXRenderHw + ${MATERIALX_MODULE_NAME} MaterialXRender ${CMAKE_DL_LIBS} "-framework Foundation" @@ -39,7 +46,7 @@ elseif(APPLE) "-framework Metal") elseif(UNIX) target_link_libraries( - MaterialXRenderHw + ${MATERIALX_MODULE_NAME} MaterialXRender ${CMAKE_DL_LIBS} ${X11_LIBRARIES} @@ -47,30 +54,30 @@ elseif(UNIX) endif() set_target_properties( - MaterialXRenderHw PROPERTIES - OUTPUT_NAME MaterialXRenderHw${MATERIALX_LIBNAME_SUFFIX} + ${MATERIALX_MODULE_NAME} PROPERTIES + OUTPUT_NAME ${MATERIALX_MODULE_NAME}${MATERIALX_LIBNAME_SUFFIX} COMPILE_FLAGS "${EXTERNAL_COMPILE_FLAGS}" LINK_FLAGS "${EXTERNAL_LINK_FLAGS}" INSTALL_RPATH "${MATERIALX_SAME_DIR_RPATH}" VERSION "${MATERIALX_LIBRARY_VERSION}" SOVERSION "${MATERIALX_MAJOR_VERSION}") -target_include_directories(MaterialXRenderHw +target_include_directories(${MATERIALX_MODULE_NAME} PUBLIC $ $ PRIVATE ${EXTERNAL_INCLUDE_DIRS}) -install(TARGETS MaterialXRenderHw +install(TARGETS ${MATERIALX_MODULE_NAME} EXPORT MaterialX ARCHIVE DESTINATION ${MATERIALX_INSTALL_LIB_PATH} LIBRARY DESTINATION ${MATERIALX_INSTALL_LIB_PATH} RUNTIME DESTINATION bin) install(DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/" - DESTINATION ${MATERIALX_INSTALL_INCLUDE_PATH}/MaterialXRenderHw/ MESSAGE_NEVER + DESTINATION ${MATERIALX_INSTALL_INCLUDE_PATH}/${MATERIALX_MODULE_NAME}/ MESSAGE_NEVER FILES_MATCHING PATTERN "*.h*") -install(FILES "${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_BUILD_TYPE}/MaterialXRenderHw.pdb" +install(FILES "${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_BUILD_TYPE}/${MATERIALX_MODULE_NAME}.pdb" DESTINATION "${MATERIALX_INSTALL_LIB_PATH}/" OPTIONAL) diff --git a/source/MaterialXRenderMsl/CMakeLists.txt b/source/MaterialXRenderMsl/CMakeLists.txt index 5ad50ea2cc..2ca9c8c242 100644 --- a/source/MaterialXRenderMsl/CMakeLists.txt +++ b/source/MaterialXRenderMsl/CMakeLists.txt @@ -1,3 +1,4 @@ +set(MATERIALX_MODULE_NAME MaterialXRenderMsl) file(GLOB_RECURSE materialx_source "${CMAKE_CURRENT_SOURCE_DIR}/*.m*") file(GLOB_RECURSE materialx_headers "${CMAKE_CURRENT_SOURCE_DIR}/*.h*") @@ -34,7 +35,7 @@ if(CMAKE_CXX_COMPILER_ID MATCHES "Clang") add_compile_options(-Wno-deprecated-declarations) endif() -add_library(MaterialXRenderMsl ${materialx_source} ${materialx_headers}) +add_library(${MATERIALX_MODULE_NAME} ${materialx_source} ${materialx_headers}) add_definitions(-DMATERIALX_RENDERMSL_EXPORTS) @@ -45,12 +46,12 @@ set(COMMON_LIBRARIES if(MSVC) target_link_libraries( - MaterialXRenderMsl + ${MATERIALX_MODULE_NAME} ${COMMON_LIBRARIES} Opengl32) elseif(APPLE) target_link_libraries( - MaterialXRenderMsl + ${MATERIALX_MODULE_NAME} ${COMMON_LIBRARIES} ${OPENGL_LIBRARIES} "-framework Foundation" @@ -58,7 +59,7 @@ elseif(APPLE) "-framework Metal") elseif(UNIX) target_link_libraries( - MaterialXRenderMsl + ${MATERIALX_MODULE_NAME} ${COMMON_LIBRARIES} ${OPENGL_LIBRARIES} ${X11_LIBRARIES} @@ -66,29 +67,29 @@ elseif(UNIX) endif() set_target_properties( - MaterialXRenderMsl PROPERTIES - OUTPUT_NAME MaterialXRenderMsl${MATERIALX_LIBNAME_SUFFIX} + ${MATERIALX_MODULE_NAME} PROPERTIES + OUTPUT_NAME ${MATERIALX_MODULE_NAME}${MATERIALX_LIBNAME_SUFFIX} COMPILE_FLAGS "${EXTERNAL_COMPILE_FLAGS}" LINK_FLAGS "${EXTERNAL_LINK_FLAGS}" VERSION "${MATERIALX_LIBRARY_VERSION}" SOVERSION "${MATERIALX_MAJOR_VERSION}") -target_include_directories(MaterialXRenderMsl +target_include_directories(${MATERIALX_MODULE_NAME} PUBLIC $ $ PRIVATE ${EXTERNAL_INCLUDE_DIRS}) -install(TARGETS MaterialXRenderMsl +install(TARGETS ${MATERIALX_MODULE_NAME} EXPORT MaterialX ARCHIVE DESTINATION ${MATERIALX_INSTALL_LIB_PATH} LIBRARY DESTINATION ${MATERIALX_INSTALL_LIB_PATH} RUNTIME DESTINATION bin) install(DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/" - DESTINATION ${MATERIALX_INSTALL_INCLUDE_PATH}/MaterialXRenderMsl/ MESSAGE_NEVER + DESTINATION ${MATERIALX_INSTALL_INCLUDE_PATH}/${MATERIALX_MODULE_NAME}/ MESSAGE_NEVER FILES_MATCHING PATTERN "*.h*") -install(FILES "${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_BUILD_TYPE}/MaterialXRenderMsl.pdb" +install(FILES "${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_BUILD_TYPE}/${MATERIALX_MODULE_NAME}.pdb" DESTINATION "${MATERIALX_INSTALL_LIB_PATH}/" OPTIONAL) diff --git a/source/MaterialXRenderOsl/CMakeLists.txt b/source/MaterialXRenderOsl/CMakeLists.txt index a4ffa81235..3c30b583a6 100644 --- a/source/MaterialXRenderOsl/CMakeLists.txt +++ b/source/MaterialXRenderOsl/CMakeLists.txt @@ -1,16 +1,23 @@ +set(MATERIALX_MODULE_NAME MaterialXRenderOsl) file(GLOB_RECURSE materialx_source "${CMAKE_CURRENT_SOURCE_DIR}/*.cpp") file(GLOB_RECURSE materialx_headers "${CMAKE_CURRENT_SOURCE_DIR}/*.h*") assign_source_group("Source Files" ${materialx_source}) assign_source_group("Header Files" ${materialx_headers}) -add_library(MaterialXRenderOsl ${materialx_source} ${materialx_headers}) +add_library(${MATERIALX_MODULE_NAME} ${materialx_source} ${materialx_headers}) add_definitions(-DMATERIALX_RENDEROSL_EXPORTS) +# Create version resource +if(MATERIALX_BUILD_SHARED_LIBS AND MSVC) + configure_file(${CMAKE_SOURCE_DIR}/cmake/modules/MaterialXVersion.rc.in ${CMAKE_CURRENT_BINARY_DIR}/version.rc) + target_sources(${MATERIALX_MODULE_NAME} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/version.rc) +endif() + set_target_properties( - MaterialXRenderOsl PROPERTIES - OUTPUT_NAME MaterialXRenderOsl${MATERIALX_LIBNAME_SUFFIX} + ${MATERIALX_MODULE_NAME} PROPERTIES + OUTPUT_NAME ${MATERIALX_MODULE_NAME}${MATERIALX_LIBNAME_SUFFIX} COMPILE_FLAGS "${EXTERNAL_COMPILE_FLAGS}" LINK_FLAGS "${EXTERNAL_LINK_FLAGS}" INSTALL_RPATH "${MATERIALX_SAME_DIR_RPATH}" @@ -18,26 +25,26 @@ set_target_properties( SOVERSION "${MATERIALX_MAJOR_VERSION}") target_link_libraries( - MaterialXRenderOsl + ${MATERIALX_MODULE_NAME} MaterialXRender ${CMAKE_DL_LIBS}) -target_include_directories(MaterialXRenderOsl +target_include_directories(${MATERIALX_MODULE_NAME} PUBLIC $ $ PRIVATE ${EXTERNAL_INCLUDE_DIRS}) -install(TARGETS MaterialXRenderOsl +install(TARGETS ${MATERIALX_MODULE_NAME} EXPORT MaterialX ARCHIVE DESTINATION ${MATERIALX_INSTALL_LIB_PATH} LIBRARY DESTINATION ${MATERIALX_INSTALL_LIB_PATH} RUNTIME DESTINATION bin) install(DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/" - DESTINATION ${MATERIALX_INSTALL_INCLUDE_PATH}/MaterialXRenderOsl/ MESSAGE_NEVER + DESTINATION ${MATERIALX_INSTALL_INCLUDE_PATH}/${MATERIALX_MODULE_NAME}/ MESSAGE_NEVER FILES_MATCHING PATTERN "*.h*") -install(FILES "${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_BUILD_TYPE}/MaterialXRenderOsl.pdb" +install(FILES "${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_BUILD_TYPE}/${MATERIALX_MODULE_NAME}.pdb" DESTINATION "${MATERIALX_INSTALL_LIB_PATH}/" OPTIONAL) From cbcfea04ff47c3085c45584fd0ac046d02e6af31 Mon Sep 17 00:00:00 2001 From: Ashwin Bhat Date: Tue, 15 Aug 2023 11:25:57 -0700 Subject: [PATCH 2/5] Fix empty lines --- source/MaterialXCore/CMakeLists.txt | 1 + source/MaterialXFormat/CMakeLists.txt | 1 + 2 files changed, 2 insertions(+) diff --git a/source/MaterialXCore/CMakeLists.txt b/source/MaterialXCore/CMakeLists.txt index 068685c967..e26db42a48 100644 --- a/source/MaterialXCore/CMakeLists.txt +++ b/source/MaterialXCore/CMakeLists.txt @@ -3,6 +3,7 @@ configure_file(${CMAKE_CURRENT_SOURCE_DIR}/Generated.h.in ${CMAKE_CURRENT_BINARY file(GLOB materialx_source "${CMAKE_CURRENT_SOURCE_DIR}/*.cpp") file(GLOB materialx_headers "${CMAKE_CURRENT_SOURCE_DIR}/*.h" "${CMAKE_CURRENT_BINARY_DIR}/*.h") + add_library(${MATERIALX_MODULE_NAME} ${materialx_source} ${materialx_headers}) add_definitions(-DMATERIALX_CORE_EXPORTS) diff --git a/source/MaterialXFormat/CMakeLists.txt b/source/MaterialXFormat/CMakeLists.txt index e8d4575b21..867f9f2276 100644 --- a/source/MaterialXFormat/CMakeLists.txt +++ b/source/MaterialXFormat/CMakeLists.txt @@ -4,6 +4,7 @@ file(GLOB_RECURSE materialx_headers "${CMAKE_CURRENT_SOURCE_DIR}/*.h*") assign_source_group("Source Files" ${materialx_source}) assign_source_group("Header Files" ${materialx_headers}) + add_library(${MATERIALX_MODULE_NAME} ${materialx_source} ${materialx_headers}) add_definitions(-DMATERIALX_FORMAT_EXPORTS) From f6324d3482054d8d897dd2d1d44375b7df1e9d75 Mon Sep 17 00:00:00 2001 From: Ashwin Bhat Date: Tue, 15 Aug 2023 11:47:52 -0700 Subject: [PATCH 3/5] Fix code page, and version string --- cmake/modules/MaterialXVersion.rc.in | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cmake/modules/MaterialXVersion.rc.in b/cmake/modules/MaterialXVersion.rc.in index 5fc8707983..6408137e7d 100644 --- a/cmake/modules/MaterialXVersion.rc.in +++ b/cmake/modules/MaterialXVersion.rc.in @@ -1,6 +1,6 @@ #define MATERIALX_FILEVERSION @MATERIALX_MAJOR_VERSION@,@MATERIALX_MINOR_VERSION@,@MATERIALX_BUILD_VERSION@,0 -#define MATERIALX_FILEVERSION_STR "@MATERIALX_MAJOR_VERSION@,@MATERIALX_MINOR_VERSION@,@MATERIALX_BUILD_VERSION@,0\0" +#define MATERIALX_FILEVERSION_STR "@MATERIALX_MAJOR_VERSION@.@MATERIALX_MINOR_VERSION@.@MATERIALX_BUILD_VERSION@.0\0" #define MATERIALX_FILENAME_STR "@MATERIALX_MODULE_NAME@.dll\0" 1 VERSIONINFO @@ -18,7 +18,7 @@ BEGIN BLOCK "StringFileInfo" BEGIN - BLOCK "040904b0" + BLOCK "040904E4" BEGIN VALUE "FileVersion", MATERIALX_FILEVERSION_STR VALUE "LegalCopyright", "Apache License 2.0\0" @@ -29,6 +29,6 @@ BEGIN END BLOCK "VarFileInfo" BEGIN - VALUE "Translation", 0x409, 1200 + VALUE "Translation", 0x409, 1252 END END \ No newline at end of file From d549a5da171c8a326a7158f38c83a33461733db3 Mon Sep 17 00:00:00 2001 From: Jonathan Stone Date: Tue, 15 Aug 2023 20:40:27 -0700 Subject: [PATCH 4/5] Add ending newline --- cmake/modules/MaterialXVersion.rc.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake/modules/MaterialXVersion.rc.in b/cmake/modules/MaterialXVersion.rc.in index 6408137e7d..989fbb8e55 100644 --- a/cmake/modules/MaterialXVersion.rc.in +++ b/cmake/modules/MaterialXVersion.rc.in @@ -31,4 +31,4 @@ BEGIN BEGIN VALUE "Translation", 0x409, 1252 END -END \ No newline at end of file +END From c0bdc7423dfafd4d0782459e39b5b1e62d8be196 Mon Sep 17 00:00:00 2001 From: Ashwin Bhat Date: Thu, 17 Aug 2023 12:44:56 -0700 Subject: [PATCH 5/5] Minor cleanup --- source/MaterialXCore/CMakeLists.txt | 1 + source/MaterialXFormat/CMakeLists.txt | 1 + source/MaterialXGenGlsl/CMakeLists.txt | 1 + source/MaterialXGenMdl/CMakeLists.txt | 1 + source/MaterialXGenMsl/CMakeLists.txt | 1 + source/MaterialXGenOsl/CMakeLists.txt | 1 + source/MaterialXGenShader/CMakeLists.txt | 1 + source/MaterialXRenderGlsl/CMakeLists.txt | 1 + source/MaterialXRenderHw/CMakeLists.txt | 1 + source/MaterialXRenderMsl/CMakeLists.txt | 1 + source/MaterialXRenderOsl/CMakeLists.txt | 1 + 11 files changed, 11 insertions(+) diff --git a/source/MaterialXCore/CMakeLists.txt b/source/MaterialXCore/CMakeLists.txt index e26db42a48..675c42c5de 100644 --- a/source/MaterialXCore/CMakeLists.txt +++ b/source/MaterialXCore/CMakeLists.txt @@ -1,4 +1,5 @@ set(MATERIALX_MODULE_NAME MaterialXCore) + configure_file(${CMAKE_CURRENT_SOURCE_DIR}/Generated.h.in ${CMAKE_CURRENT_BINARY_DIR}/Generated.h) file(GLOB materialx_source "${CMAKE_CURRENT_SOURCE_DIR}/*.cpp") diff --git a/source/MaterialXFormat/CMakeLists.txt b/source/MaterialXFormat/CMakeLists.txt index 867f9f2276..6b6d3ae9c3 100644 --- a/source/MaterialXFormat/CMakeLists.txt +++ b/source/MaterialXFormat/CMakeLists.txt @@ -1,4 +1,5 @@ set(MATERIALX_MODULE_NAME MaterialXFormat) + file(GLOB_RECURSE materialx_source "${CMAKE_CURRENT_SOURCE_DIR}/*.cpp") file(GLOB_RECURSE materialx_headers "${CMAKE_CURRENT_SOURCE_DIR}/*.h*") diff --git a/source/MaterialXGenGlsl/CMakeLists.txt b/source/MaterialXGenGlsl/CMakeLists.txt index a1d8056849..58ff8a45ba 100644 --- a/source/MaterialXGenGlsl/CMakeLists.txt +++ b/source/MaterialXGenGlsl/CMakeLists.txt @@ -1,4 +1,5 @@ set(MATERIALX_MODULE_NAME MaterialXGenGlsl) + file(GLOB_RECURSE materialx_source "${CMAKE_CURRENT_SOURCE_DIR}/*.cpp") file(GLOB_RECURSE materialx_headers "${CMAKE_CURRENT_SOURCE_DIR}/*.h*") diff --git a/source/MaterialXGenMdl/CMakeLists.txt b/source/MaterialXGenMdl/CMakeLists.txt index 831f925f1f..04dc2e76b4 100644 --- a/source/MaterialXGenMdl/CMakeLists.txt +++ b/source/MaterialXGenMdl/CMakeLists.txt @@ -1,4 +1,5 @@ set(MATERIALX_MODULE_NAME MaterialXGenMdl) + file(GLOB_RECURSE materialx_source "${CMAKE_CURRENT_SOURCE_DIR}/*.cpp") file(GLOB_RECURSE materialx_headers "${CMAKE_CURRENT_SOURCE_DIR}/*.h*") diff --git a/source/MaterialXGenMsl/CMakeLists.txt b/source/MaterialXGenMsl/CMakeLists.txt index 5b7e42e70e..d8ba092ee8 100644 --- a/source/MaterialXGenMsl/CMakeLists.txt +++ b/source/MaterialXGenMsl/CMakeLists.txt @@ -1,4 +1,5 @@ set(MATERIALX_MODULE_NAME MaterialXGenMsl) + file(GLOB_RECURSE materialx_source "${CMAKE_CURRENT_SOURCE_DIR}/*.cpp") file(GLOB_RECURSE materialx_headers "${CMAKE_CURRENT_SOURCE_DIR}/*.h*") diff --git a/source/MaterialXGenOsl/CMakeLists.txt b/source/MaterialXGenOsl/CMakeLists.txt index 50d0ad7db2..24bd0043d9 100644 --- a/source/MaterialXGenOsl/CMakeLists.txt +++ b/source/MaterialXGenOsl/CMakeLists.txt @@ -1,4 +1,5 @@ set(MATERIALX_MODULE_NAME MaterialXGenOsl) + file(GLOB_RECURSE materialx_source "${CMAKE_CURRENT_SOURCE_DIR}/*.cpp") file(GLOB_RECURSE materialx_headers "${CMAKE_CURRENT_SOURCE_DIR}/*.h*") diff --git a/source/MaterialXGenShader/CMakeLists.txt b/source/MaterialXGenShader/CMakeLists.txt index a683329d66..0a16049f25 100644 --- a/source/MaterialXGenShader/CMakeLists.txt +++ b/source/MaterialXGenShader/CMakeLists.txt @@ -1,4 +1,5 @@ set(MATERIALX_MODULE_NAME MaterialXGenShader) + file(GLOB_RECURSE materialx_source "${CMAKE_CURRENT_SOURCE_DIR}/*.cpp") file(GLOB_RECURSE materialx_headers "${CMAKE_CURRENT_SOURCE_DIR}/*.h*") diff --git a/source/MaterialXRenderGlsl/CMakeLists.txt b/source/MaterialXRenderGlsl/CMakeLists.txt index 5b74f15d60..971c356bd0 100644 --- a/source/MaterialXRenderGlsl/CMakeLists.txt +++ b/source/MaterialXRenderGlsl/CMakeLists.txt @@ -1,4 +1,5 @@ set(MATERIALX_MODULE_NAME MaterialXRenderGlsl) + file(GLOB_RECURSE materialx_source "${CMAKE_CURRENT_SOURCE_DIR}/*.c*") file(GLOB_RECURSE materialx_headers "${CMAKE_CURRENT_SOURCE_DIR}/*.h*") diff --git a/source/MaterialXRenderHw/CMakeLists.txt b/source/MaterialXRenderHw/CMakeLists.txt index 925af186d5..07210b12fa 100644 --- a/source/MaterialXRenderHw/CMakeLists.txt +++ b/source/MaterialXRenderHw/CMakeLists.txt @@ -1,4 +1,5 @@ set(MATERIALX_MODULE_NAME MaterialXRenderHw) + file(GLOB materialx_source "${CMAKE_CURRENT_SOURCE_DIR}/*.cpp") file(GLOB materialx_headers "${CMAKE_CURRENT_SOURCE_DIR}/*.h*") diff --git a/source/MaterialXRenderMsl/CMakeLists.txt b/source/MaterialXRenderMsl/CMakeLists.txt index 2ca9c8c242..173a9e9bae 100644 --- a/source/MaterialXRenderMsl/CMakeLists.txt +++ b/source/MaterialXRenderMsl/CMakeLists.txt @@ -1,4 +1,5 @@ set(MATERIALX_MODULE_NAME MaterialXRenderMsl) + file(GLOB_RECURSE materialx_source "${CMAKE_CURRENT_SOURCE_DIR}/*.m*") file(GLOB_RECURSE materialx_headers "${CMAKE_CURRENT_SOURCE_DIR}/*.h*") diff --git a/source/MaterialXRenderOsl/CMakeLists.txt b/source/MaterialXRenderOsl/CMakeLists.txt index 3c30b583a6..d4e5dbf151 100644 --- a/source/MaterialXRenderOsl/CMakeLists.txt +++ b/source/MaterialXRenderOsl/CMakeLists.txt @@ -1,4 +1,5 @@ set(MATERIALX_MODULE_NAME MaterialXRenderOsl) + file(GLOB_RECURSE materialx_source "${CMAKE_CURRENT_SOURCE_DIR}/*.cpp") file(GLOB_RECURSE materialx_headers "${CMAKE_CURRENT_SOURCE_DIR}/*.h*")