├── COPYING ├── LGPL ├── README.md ├── cmake ├── Find3Delight.cmake ├── FindAlembic.cmake ├── FindArnold.cmake ├── FindCortex.cmake ├── FindHoudini.cmake ├── FindILMBase.cmake ├── FindMaya.cmake ├── FindMtoA.cmake ├── FindNuke.cmake ├── FindOpenCL.cmake ├── FindOpenEXR.cmake ├── FindOpenImageIO.cmake ├── FindPRMan.cmake ├── FindQHull.cmake ├── FindTbb.cmake ├── GetBoost.cmake ├── GetCXXCompiler.cmake └── GetPython.cmake └── contrib └── style_guide.md /COPYING: -------------------------------------------------------------------------------- 1 | GNU GENERAL PUBLIC LICENSE 2 | Version 3, 29 June 2007 3 | 4 | Copyright (C) 2007 Free Software Foundation, Inc. 5 | Everyone is permitted to copy and distribute verbatim copies 6 | of this license document, but changing it is not allowed. 7 | 8 | Preamble 9 | 10 | The GNU General Public License is a free, copyleft license for 11 | software and other kinds of works. 12 | 13 | The licenses for most software and other practical works are designed 14 | to take away your freedom to share and change the works. By contrast, 15 | the GNU General Public License is intended to guarantee your freedom to 16 | share and change all versions of a program--to make sure it remains free 17 | software for all its users. We, the Free Software Foundation, use the 18 | GNU General Public License for most of our software; it applies also to 19 | any other work released this way by its authors. You can apply it to 20 | your programs, too. 21 | 22 | When we speak of free software, we are referring to freedom, not 23 | price. Our General Public Licenses are designed to make sure that you 24 | have the freedom to distribute copies of free software (and charge for 25 | them if you wish), that you receive source code or can get it if you 26 | want it, that you can change the software or use pieces of it in new 27 | free programs, and that you know you can do these things. 28 | 29 | To protect your rights, we need to prevent others from denying you 30 | these rights or asking you to surrender the rights. Therefore, you have 31 | certain responsibilities if you distribute copies of the software, or if 32 | you modify it: responsibilities to respect the freedom of others. 33 | 34 | For example, if you distribute copies of such a program, whether 35 | gratis or for a fee, you must pass on to the recipients the same 36 | freedoms that you received. You must make sure that they, too, receive 37 | or can get the source code. And you must show them these terms so they 38 | know their rights. 39 | 40 | Developers that use the GNU GPL protect your rights with two steps: 41 | (1) assert copyright on the software, and (2) offer you this License 42 | giving you legal permission to copy, distribute and/or modify it. 43 | 44 | For the developers' and authors' protection, the GPL clearly explains 45 | that there is no warranty for this free software. For both users' and 46 | authors' sake, the GPL requires that modified versions be marked as 47 | changed, so that their problems will not be attributed erroneously to 48 | authors of previous versions. 49 | 50 | Some devices are designed to deny users access to install or run 51 | modified versions of the software inside them, although the manufacturer 52 | can do so. This is fundamentally incompatible with the aim of 53 | protecting users' freedom to change the software. The systematic 54 | pattern of such abuse occurs in the area of products for individuals to 55 | use, which is precisely where it is most unacceptable. Therefore, we 56 | have designed this version of the GPL to prohibit the practice for those 57 | products. If such problems arise substantially in other domains, we 58 | stand ready to extend this provision to those domains in future versions 59 | of the GPL, as needed to protect the freedom of users. 60 | 61 | Finally, every program is threatened constantly by software patents. 62 | States should not allow patents to restrict development and use of 63 | software on general-purpose computers, but in those that do, we wish to 64 | avoid the special danger that patents applied to a free program could 65 | make it effectively proprietary. To prevent this, the GPL assures that 66 | patents cannot be used to render the program non-free. 67 | 68 | The precise terms and conditions for copying, distribution and 69 | modification follow. 70 | 71 | TERMS AND CONDITIONS 72 | 73 | 0. Definitions. 74 | 75 | "This License" refers to version 3 of the GNU General Public License. 76 | 77 | "Copyright" also means copyright-like laws that apply to other kinds of 78 | works, such as semiconductor masks. 79 | 80 | "The Program" refers to any copyrightable work licensed under this 81 | License. Each licensee is addressed as "you". "Licensees" and 82 | "recipients" may be individuals or organizations. 83 | 84 | To "modify" a work means to copy from or adapt all or part of the work 85 | in a fashion requiring copyright permission, other than the making of an 86 | exact copy. The resulting work is called a "modified version" of the 87 | earlier work or a work "based on" the earlier work. 88 | 89 | A "covered work" means either the unmodified Program or a work based 90 | on the Program. 91 | 92 | To "propagate" a work means to do anything with it that, without 93 | permission, would make you directly or secondarily liable for 94 | infringement under applicable copyright law, except executing it on a 95 | computer or modifying a private copy. Propagation includes copying, 96 | distribution (with or without modification), making available to the 97 | public, and in some countries other activities as well. 98 | 99 | To "convey" a work means any kind of propagation that enables other 100 | parties to make or receive copies. Mere interaction with a user through 101 | a computer network, with no transfer of a copy, is not conveying. 102 | 103 | An interactive user interface displays "Appropriate Legal Notices" 104 | to the extent that it includes a convenient and prominently visible 105 | feature that (1) displays an appropriate copyright notice, and (2) 106 | tells the user that there is no warranty for the work (except to the 107 | extent that warranties are provided), that licensees may convey the 108 | work under this License, and how to view a copy of this License. If 109 | the interface presents a list of user commands or options, such as a 110 | menu, a prominent item in the list meets this criterion. 111 | 112 | 1. Source Code. 113 | 114 | The "source code" for a work means the preferred form of the work 115 | for making modifications to it. "Object code" means any non-source 116 | form of a work. 117 | 118 | A "Standard Interface" means an interface that either is an official 119 | standard defined by a recognized standards body, or, in the case of 120 | interfaces specified for a particular programming language, one that 121 | is widely used among developers working in that language. 122 | 123 | The "System Libraries" of an executable work include anything, other 124 | than the work as a whole, that (a) is included in the normal form of 125 | packaging a Major Component, but which is not part of that Major 126 | Component, and (b) serves only to enable use of the work with that 127 | Major Component, or to implement a Standard Interface for which an 128 | implementation is available to the public in source code form. A 129 | "Major Component", in this context, means a major essential component 130 | (kernel, window system, and so on) of the specific operating system 131 | (if any) on which the executable work runs, or a compiler used to 132 | produce the work, or an object code interpreter used to run it. 133 | 134 | The "Corresponding Source" for a work in object code form means all 135 | the source code needed to generate, install, and (for an executable 136 | work) run the object code and to modify the work, including scripts to 137 | control those activities. However, it does not include the work's 138 | System Libraries, or general-purpose tools or generally available free 139 | programs which are used unmodified in performing those activities but 140 | which are not part of the work. For example, Corresponding Source 141 | includes interface definition files associated with source files for 142 | the work, and the source code for shared libraries and dynamically 143 | linked subprograms that the work is specifically designed to require, 144 | such as by intimate data communication or control flow between those 145 | subprograms and other parts of the work. 146 | 147 | The Corresponding Source need not include anything that users 148 | can regenerate automatically from other parts of the Corresponding 149 | Source. 150 | 151 | The Corresponding Source for a work in source code form is that 152 | same work. 153 | 154 | 2. Basic Permissions. 155 | 156 | All rights granted under this License are granted for the term of 157 | copyright on the Program, and are irrevocable provided the stated 158 | conditions are met. This License explicitly affirms your unlimited 159 | permission to run the unmodified Program. The output from running a 160 | covered work is covered by this License only if the output, given its 161 | content, constitutes a covered work. This License acknowledges your 162 | rights of fair use or other equivalent, as provided by copyright law. 163 | 164 | You may make, run and propagate covered works that you do not 165 | convey, without conditions so long as your license otherwise remains 166 | in force. You may convey covered works to others for the sole purpose 167 | of having them make modifications exclusively for you, or provide you 168 | with facilities for running those works, provided that you comply with 169 | the terms of this License in conveying all material for which you do 170 | not control copyright. Those thus making or running the covered works 171 | for you must do so exclusively on your behalf, under your direction 172 | and control, on terms that prohibit them from making any copies of 173 | your copyrighted material outside their relationship with you. 174 | 175 | Conveying under any other circumstances is permitted solely under 176 | the conditions stated below. Sublicensing is not allowed; section 10 177 | makes it unnecessary. 178 | 179 | 3. Protecting Users' Legal Rights From Anti-Circumvention Law. 180 | 181 | No covered work shall be deemed part of an effective technological 182 | measure under any applicable law fulfilling obligations under article 183 | 11 of the WIPO copyright treaty adopted on 20 December 1996, or 184 | similar laws prohibiting or restricting circumvention of such 185 | measures. 186 | 187 | When you convey a covered work, you waive any legal power to forbid 188 | circumvention of technological measures to the extent such circumvention 189 | is effected by exercising rights under this License with respect to 190 | the covered work, and you disclaim any intention to limit operation or 191 | modification of the work as a means of enforcing, against the work's 192 | users, your or third parties' legal rights to forbid circumvention of 193 | technological measures. 194 | 195 | 4. Conveying Verbatim Copies. 196 | 197 | You may convey verbatim copies of the Program's source code as you 198 | receive it, in any medium, provided that you conspicuously and 199 | appropriately publish on each copy an appropriate copyright notice; 200 | keep intact all notices stating that this License and any 201 | non-permissive terms added in accord with section 7 apply to the code; 202 | keep intact all notices of the absence of any warranty; and give all 203 | recipients a copy of this License along with the Program. 204 | 205 | You may charge any price or no price for each copy that you convey, 206 | and you may offer support or warranty protection for a fee. 207 | 208 | 5. Conveying Modified Source Versions. 209 | 210 | You may convey a work based on the Program, or the modifications to 211 | produce it from the Program, in the form of source code under the 212 | terms of section 4, provided that you also meet all of these conditions: 213 | 214 | a) The work must carry prominent notices stating that you modified 215 | it, and giving a relevant date. 216 | 217 | b) The work must carry prominent notices stating that it is 218 | released under this License and any conditions added under section 219 | 7. This requirement modifies the requirement in section 4 to 220 | "keep intact all notices". 221 | 222 | c) You must license the entire work, as a whole, under this 223 | License to anyone who comes into possession of a copy. This 224 | License will therefore apply, along with any applicable section 7 225 | additional terms, to the whole of the work, and all its parts, 226 | regardless of how they are packaged. This License gives no 227 | permission to license the work in any other way, but it does not 228 | invalidate such permission if you have separately received it. 229 | 230 | d) If the work has interactive user interfaces, each must display 231 | Appropriate Legal Notices; however, if the Program has interactive 232 | interfaces that do not display Appropriate Legal Notices, your 233 | work need not make them do so. 234 | 235 | A compilation of a covered work with other separate and independent 236 | works, which are not by their nature extensions of the covered work, 237 | and which are not combined with it such as to form a larger program, 238 | in or on a volume of a storage or distribution medium, is called an 239 | "aggregate" if the compilation and its resulting copyright are not 240 | used to limit the access or legal rights of the compilation's users 241 | beyond what the individual works permit. Inclusion of a covered work 242 | in an aggregate does not cause this License to apply to the other 243 | parts of the aggregate. 244 | 245 | 6. Conveying Non-Source Forms. 246 | 247 | You may convey a covered work in object code form under the terms 248 | of sections 4 and 5, provided that you also convey the 249 | machine-readable Corresponding Source under the terms of this License, 250 | in one of these ways: 251 | 252 | a) Convey the object code in, or embodied in, a physical product 253 | (including a physical distribution medium), accompanied by the 254 | Corresponding Source fixed on a durable physical medium 255 | customarily used for software interchange. 256 | 257 | b) Convey the object code in, or embodied in, a physical product 258 | (including a physical distribution medium), accompanied by a 259 | written offer, valid for at least three years and valid for as 260 | long as you offer spare parts or customer support for that product 261 | model, to give anyone who possesses the object code either (1) a 262 | copy of the Corresponding Source for all the software in the 263 | product that is covered by this License, on a durable physical 264 | medium customarily used for software interchange, for a price no 265 | more than your reasonable cost of physically performing this 266 | conveying of source, or (2) access to copy the 267 | Corresponding Source from a network server at no charge. 268 | 269 | c) Convey individual copies of the object code with a copy of the 270 | written offer to provide the Corresponding Source. This 271 | alternative is allowed only occasionally and noncommercially, and 272 | only if you received the object code with such an offer, in accord 273 | with subsection 6b. 274 | 275 | d) Convey the object code by offering access from a designated 276 | place (gratis or for a charge), and offer equivalent access to the 277 | Corresponding Source in the same way through the same place at no 278 | further charge. You need not require recipients to copy the 279 | Corresponding Source along with the object code. If the place to 280 | copy the object code is a network server, the Corresponding Source 281 | may be on a different server (operated by you or a third party) 282 | that supports equivalent copying facilities, provided you maintain 283 | clear directions next to the object code saying where to find the 284 | Corresponding Source. Regardless of what server hosts the 285 | Corresponding Source, you remain obligated to ensure that it is 286 | available for as long as needed to satisfy these requirements. 287 | 288 | e) Convey the object code using peer-to-peer transmission, provided 289 | you inform other peers where the object code and Corresponding 290 | Source of the work are being offered to the general public at no 291 | charge under subsection 6d. 292 | 293 | A separable portion of the object code, whose source code is excluded 294 | from the Corresponding Source as a System Library, need not be 295 | included in conveying the object code work. 296 | 297 | A "User Product" is either (1) a "consumer product", which means any 298 | tangible personal property which is normally used for personal, family, 299 | or household purposes, or (2) anything designed or sold for incorporation 300 | into a dwelling. In determining whether a product is a consumer product, 301 | doubtful cases shall be resolved in favor of coverage. For a particular 302 | product received by a particular user, "normally used" refers to a 303 | typical or common use of that class of product, regardless of the status 304 | of the particular user or of the way in which the particular user 305 | actually uses, or expects or is expected to use, the product. A product 306 | is a consumer product regardless of whether the product has substantial 307 | commercial, industrial or non-consumer uses, unless such uses represent 308 | the only significant mode of use of the product. 309 | 310 | "Installation Information" for a User Product means any methods, 311 | procedures, authorization keys, or other information required to install 312 | and execute modified versions of a covered work in that User Product from 313 | a modified version of its Corresponding Source. The information must 314 | suffice to ensure that the continued functioning of the modified object 315 | code is in no case prevented or interfered with solely because 316 | modification has been made. 317 | 318 | If you convey an object code work under this section in, or with, or 319 | specifically for use in, a User Product, and the conveying occurs as 320 | part of a transaction in which the right of possession and use of the 321 | User Product is transferred to the recipient in perpetuity or for a 322 | fixed term (regardless of how the transaction is characterized), the 323 | Corresponding Source conveyed under this section must be accompanied 324 | by the Installation Information. But this requirement does not apply 325 | if neither you nor any third party retains the ability to install 326 | modified object code on the User Product (for example, the work has 327 | been installed in ROM). 328 | 329 | The requirement to provide Installation Information does not include a 330 | requirement to continue to provide support service, warranty, or updates 331 | for a work that has been modified or installed by the recipient, or for 332 | the User Product in which it has been modified or installed. Access to a 333 | network may be denied when the modification itself materially and 334 | adversely affects the operation of the network or violates the rules and 335 | protocols for communication across the network. 336 | 337 | Corresponding Source conveyed, and Installation Information provided, 338 | in accord with this section must be in a format that is publicly 339 | documented (and with an implementation available to the public in 340 | source code form), and must require no special password or key for 341 | unpacking, reading or copying. 342 | 343 | 7. Additional Terms. 344 | 345 | "Additional permissions" are terms that supplement the terms of this 346 | License by making exceptions from one or more of its conditions. 347 | Additional permissions that are applicable to the entire Program shall 348 | be treated as though they were included in this License, to the extent 349 | that they are valid under applicable law. If additional permissions 350 | apply only to part of the Program, that part may be used separately 351 | under those permissions, but the entire Program remains governed by 352 | this License without regard to the additional permissions. 353 | 354 | When you convey a copy of a covered work, you may at your option 355 | remove any additional permissions from that copy, or from any part of 356 | it. (Additional permissions may be written to require their own 357 | removal in certain cases when you modify the work.) You may place 358 | additional permissions on material, added by you to a covered work, 359 | for which you have or can give appropriate copyright permission. 360 | 361 | Notwithstanding any other provision of this License, for material you 362 | add to a covered work, you may (if authorized by the copyright holders of 363 | that material) supplement the terms of this License with terms: 364 | 365 | a) Disclaiming warranty or limiting liability differently from the 366 | terms of sections 15 and 16 of this License; or 367 | 368 | b) Requiring preservation of specified reasonable legal notices or 369 | author attributions in that material or in the Appropriate Legal 370 | Notices displayed by works containing it; or 371 | 372 | c) Prohibiting misrepresentation of the origin of that material, or 373 | requiring that modified versions of such material be marked in 374 | reasonable ways as different from the original version; or 375 | 376 | d) Limiting the use for publicity purposes of names of licensors or 377 | authors of the material; or 378 | 379 | e) Declining to grant rights under trademark law for use of some 380 | trade names, trademarks, or service marks; or 381 | 382 | f) Requiring indemnification of licensors and authors of that 383 | material by anyone who conveys the material (or modified versions of 384 | it) with contractual assumptions of liability to the recipient, for 385 | any liability that these contractual assumptions directly impose on 386 | those licensors and authors. 387 | 388 | All other non-permissive additional terms are considered "further 389 | restrictions" within the meaning of section 10. If the Program as you 390 | received it, or any part of it, contains a notice stating that it is 391 | governed by this License along with a term that is a further 392 | restriction, you may remove that term. If a license document contains 393 | a further restriction but permits relicensing or conveying under this 394 | License, you may add to a covered work material governed by the terms 395 | of that license document, provided that the further restriction does 396 | not survive such relicensing or conveying. 397 | 398 | If you add terms to a covered work in accord with this section, you 399 | must place, in the relevant source files, a statement of the 400 | additional terms that apply to those files, or a notice indicating 401 | where to find the applicable terms. 402 | 403 | Additional terms, permissive or non-permissive, may be stated in the 404 | form of a separately written license, or stated as exceptions; 405 | the above requirements apply either way. 406 | 407 | 8. Termination. 408 | 409 | You may not propagate or modify a covered work except as expressly 410 | provided under this License. Any attempt otherwise to propagate or 411 | modify it is void, and will automatically terminate your rights under 412 | this License (including any patent licenses granted under the third 413 | paragraph of section 11). 414 | 415 | However, if you cease all violation of this License, then your 416 | license from a particular copyright holder is reinstated (a) 417 | provisionally, unless and until the copyright holder explicitly and 418 | finally terminates your license, and (b) permanently, if the copyright 419 | holder fails to notify you of the violation by some reasonable means 420 | prior to 60 days after the cessation. 421 | 422 | Moreover, your license from a particular copyright holder is 423 | reinstated permanently if the copyright holder notifies you of the 424 | violation by some reasonable means, this is the first time you have 425 | received notice of violation of this License (for any work) from that 426 | copyright holder, and you cure the violation prior to 30 days after 427 | your receipt of the notice. 428 | 429 | Termination of your rights under this section does not terminate the 430 | licenses of parties who have received copies or rights from you under 431 | this License. If your rights have been terminated and not permanently 432 | reinstated, you do not qualify to receive new licenses for the same 433 | material under section 10. 434 | 435 | 9. Acceptance Not Required for Having Copies. 436 | 437 | You are not required to accept this License in order to receive or 438 | run a copy of the Program. Ancillary propagation of a covered work 439 | occurring solely as a consequence of using peer-to-peer transmission 440 | to receive a copy likewise does not require acceptance. However, 441 | nothing other than this License grants you permission to propagate or 442 | modify any covered work. These actions infringe copyright if you do 443 | not accept this License. Therefore, by modifying or propagating a 444 | covered work, you indicate your acceptance of this License to do so. 445 | 446 | 10. Automatic Licensing of Downstream Recipients. 447 | 448 | Each time you convey a covered work, the recipient automatically 449 | receives a license from the original licensors, to run, modify and 450 | propagate that work, subject to this License. You are not responsible 451 | for enforcing compliance by third parties with this License. 452 | 453 | An "entity transaction" is a transaction transferring control of an 454 | organization, or substantially all assets of one, or subdividing an 455 | organization, or merging organizations. If propagation of a covered 456 | work results from an entity transaction, each party to that 457 | transaction who receives a copy of the work also receives whatever 458 | licenses to the work the party's predecessor in interest had or could 459 | give under the previous paragraph, plus a right to possession of the 460 | Corresponding Source of the work from the predecessor in interest, if 461 | the predecessor has it or can get it with reasonable efforts. 462 | 463 | You may not impose any further restrictions on the exercise of the 464 | rights granted or affirmed under this License. For example, you may 465 | not impose a license fee, royalty, or other charge for exercise of 466 | rights granted under this License, and you may not initiate litigation 467 | (including a cross-claim or counterclaim in a lawsuit) alleging that 468 | any patent claim is infringed by making, using, selling, offering for 469 | sale, or importing the Program or any portion of it. 470 | 471 | 11. Patents. 472 | 473 | A "contributor" is a copyright holder who authorizes use under this 474 | License of the Program or a work on which the Program is based. The 475 | work thus licensed is called the contributor's "contributor version". 476 | 477 | A contributor's "essential patent claims" are all patent claims 478 | owned or controlled by the contributor, whether already acquired or 479 | hereafter acquired, that would be infringed by some manner, permitted 480 | by this License, of making, using, or selling its contributor version, 481 | but do not include claims that would be infringed only as a 482 | consequence of further modification of the contributor version. For 483 | purposes of this definition, "control" includes the right to grant 484 | patent sublicenses in a manner consistent with the requirements of 485 | this License. 486 | 487 | Each contributor grants you a non-exclusive, worldwide, royalty-free 488 | patent license under the contributor's essential patent claims, to 489 | make, use, sell, offer for sale, import and otherwise run, modify and 490 | propagate the contents of its contributor version. 491 | 492 | In the following three paragraphs, a "patent license" is any express 493 | agreement or commitment, however denominated, not to enforce a patent 494 | (such as an express permission to practice a patent or covenant not to 495 | sue for patent infringement). To "grant" such a patent license to a 496 | party means to make such an agreement or commitment not to enforce a 497 | patent against the party. 498 | 499 | If you convey a covered work, knowingly relying on a patent license, 500 | and the Corresponding Source of the work is not available for anyone 501 | to copy, free of charge and under the terms of this License, through a 502 | publicly available network server or other readily accessible means, 503 | then you must either (1) cause the Corresponding Source to be so 504 | available, or (2) arrange to deprive yourself of the benefit of the 505 | patent license for this particular work, or (3) arrange, in a manner 506 | consistent with the requirements of this License, to extend the patent 507 | license to downstream recipients. "Knowingly relying" means you have 508 | actual knowledge that, but for the patent license, your conveying the 509 | covered work in a country, or your recipient's use of the covered work 510 | in a country, would infringe one or more identifiable patents in that 511 | country that you have reason to believe are valid. 512 | 513 | If, pursuant to or in connection with a single transaction or 514 | arrangement, you convey, or propagate by procuring conveyance of, a 515 | covered work, and grant a patent license to some of the parties 516 | receiving the covered work authorizing them to use, propagate, modify 517 | or convey a specific copy of the covered work, then the patent license 518 | you grant is automatically extended to all recipients of the covered 519 | work and works based on it. 520 | 521 | A patent license is "discriminatory" if it does not include within 522 | the scope of its coverage, prohibits the exercise of, or is 523 | conditioned on the non-exercise of one or more of the rights that are 524 | specifically granted under this License. You may not convey a covered 525 | work if you are a party to an arrangement with a third party that is 526 | in the business of distributing software, under which you make payment 527 | to the third party based on the extent of your activity of conveying 528 | the work, and under which the third party grants, to any of the 529 | parties who would receive the covered work from you, a discriminatory 530 | patent license (a) in connection with copies of the covered work 531 | conveyed by you (or copies made from those copies), or (b) primarily 532 | for and in connection with specific products or compilations that 533 | contain the covered work, unless you entered into that arrangement, 534 | or that patent license was granted, prior to 28 March 2007. 535 | 536 | Nothing in this License shall be construed as excluding or limiting 537 | any implied license or other defenses to infringement that may 538 | otherwise be available to you under applicable patent law. 539 | 540 | 12. No Surrender of Others' Freedom. 541 | 542 | If conditions are imposed on you (whether by court order, agreement or 543 | otherwise) that contradict the conditions of this License, they do not 544 | excuse you from the conditions of this License. If you cannot convey a 545 | covered work so as to satisfy simultaneously your obligations under this 546 | License and any other pertinent obligations, then as a consequence you may 547 | not convey it at all. For example, if you agree to terms that obligate you 548 | to collect a royalty for further conveying from those to whom you convey 549 | the Program, the only way you could satisfy both those terms and this 550 | License would be to refrain entirely from conveying the Program. 551 | 552 | 13. Use with the GNU Affero General Public License. 553 | 554 | Notwithstanding any other provision of this License, you have 555 | permission to link or combine any covered work with a work licensed 556 | under version 3 of the GNU Affero General Public License into a single 557 | combined work, and to convey the resulting work. The terms of this 558 | License will continue to apply to the part which is the covered work, 559 | but the special requirements of the GNU Affero General Public License, 560 | section 13, concerning interaction through a network will apply to the 561 | combination as such. 562 | 563 | 14. Revised Versions of this License. 564 | 565 | The Free Software Foundation may publish revised and/or new versions of 566 | the GNU General Public License from time to time. Such new versions will 567 | be similar in spirit to the present version, but may differ in detail to 568 | address new problems or concerns. 569 | 570 | Each version is given a distinguishing version number. If the 571 | Program specifies that a certain numbered version of the GNU General 572 | Public License "or any later version" applies to it, you have the 573 | option of following the terms and conditions either of that numbered 574 | version or of any later version published by the Free Software 575 | Foundation. If the Program does not specify a version number of the 576 | GNU General Public License, you may choose any version ever published 577 | by the Free Software Foundation. 578 | 579 | If the Program specifies that a proxy can decide which future 580 | versions of the GNU General Public License can be used, that proxy's 581 | public statement of acceptance of a version permanently authorizes you 582 | to choose that version for the Program. 583 | 584 | Later license versions may give you additional or different 585 | permissions. However, no additional obligations are imposed on any 586 | author or copyright holder as a result of your choosing to follow a 587 | later version. 588 | 589 | 15. Disclaimer of Warranty. 590 | 591 | THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY 592 | APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT 593 | HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY 594 | OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, 595 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 596 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM 597 | IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF 598 | ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 599 | 600 | 16. Limitation of Liability. 601 | 602 | IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING 603 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS 604 | THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY 605 | GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE 606 | USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF 607 | DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD 608 | PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), 609 | EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF 610 | SUCH DAMAGES. 611 | 612 | 17. Interpretation of Sections 15 and 16. 613 | 614 | If the disclaimer of warranty and limitation of liability provided 615 | above cannot be given local legal effect according to their terms, 616 | reviewing courts shall apply local law that most closely approximates 617 | an absolute waiver of all civil liability in connection with the 618 | Program, unless a warranty or assumption of liability accompanies a 619 | copy of the Program in return for a fee. 620 | 621 | END OF TERMS AND CONDITIONS 622 | 623 | How to Apply These Terms to Your New Programs 624 | 625 | If you develop a new program, and you want it to be of the greatest 626 | possible use to the public, the best way to achieve this is to make it 627 | free software which everyone can redistribute and change under these terms. 628 | 629 | To do so, attach the following notices to the program. It is safest 630 | to attach them to the start of each source file to most effectively 631 | state the exclusion of warranty; and each file should have at least 632 | the "copyright" line and a pointer to where the full notice is found. 633 | 634 | 635 | Copyright (C) 636 | 637 | This program is free software: you can redistribute it and/or modify 638 | it under the terms of the GNU General Public License as published by 639 | the Free Software Foundation, either version 3 of the License, or 640 | (at your option) any later version. 641 | 642 | This program is distributed in the hope that it will be useful, 643 | but WITHOUT ANY WARRANTY; without even the implied warranty of 644 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 645 | GNU General Public License for more details. 646 | 647 | You should have received a copy of the GNU General Public License 648 | along with this program. If not, see . 649 | 650 | Also add information on how to contact you by electronic and paper mail. 651 | 652 | If the program does terminal interaction, make it output a short 653 | notice like this when it starts in an interactive mode: 654 | 655 | Copyright (C) 656 | This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. 657 | This is free software, and you are welcome to redistribute it 658 | under certain conditions; type `show c' for details. 659 | 660 | The hypothetical commands `show w' and `show c' should show the appropriate 661 | parts of the General Public License. Of course, your program's commands 662 | might be different; for a GUI interface, you would use an "about box". 663 | 664 | You should also get your employer (if you work as a programmer) or school, 665 | if any, to sign a "copyright disclaimer" for the program, if necessary. 666 | For more information on this, and how to apply and follow the GNU GPL, see 667 | . 668 | 669 | The GNU General Public License does not permit incorporating your program 670 | into proprietary programs. If your program is a subroutine library, you 671 | may consider it more useful to permit linking proprietary applications with 672 | the library. If this is what you want to do, use the GNU Lesser General 673 | Public License instead of this License. But first, please read 674 | . 675 | -------------------------------------------------------------------------------- /LGPL: -------------------------------------------------------------------------------- 1 | GNU LESSER GENERAL PUBLIC LICENSE 2 | Version 3, 29 June 2007 3 | 4 | Copyright (C) 2007 Free Software Foundation, Inc. 5 | Everyone is permitted to copy and distribute verbatim copies 6 | of this license document, but changing it is not allowed. 7 | 8 | 9 | This version of the GNU Lesser General Public License incorporates 10 | the terms and conditions of version 3 of the GNU General Public 11 | License, supplemented by the additional permissions listed below. 12 | 13 | 0. Additional Definitions. 14 | 15 | As used herein, "this License" refers to version 3 of the GNU Lesser 16 | General Public License, and the "GNU GPL" refers to version 3 of the GNU 17 | General Public License. 18 | 19 | "The Library" refers to a covered work governed by this License, 20 | other than an Application or a Combined Work as defined below. 21 | 22 | An "Application" is any work that makes use of an interface provided 23 | by the Library, but which is not otherwise based on the Library. 24 | Defining a subclass of a class defined by the Library is deemed a mode 25 | of using an interface provided by the Library. 26 | 27 | A "Combined Work" is a work produced by combining or linking an 28 | Application with the Library. The particular version of the Library 29 | with which the Combined Work was made is also called the "Linked 30 | Version". 31 | 32 | The "Minimal Corresponding Source" for a Combined Work means the 33 | Corresponding Source for the Combined Work, excluding any source code 34 | for portions of the Combined Work that, considered in isolation, are 35 | based on the Application, and not on the Linked Version. 36 | 37 | The "Corresponding Application Code" for a Combined Work means the 38 | object code and/or source code for the Application, including any data 39 | and utility programs needed for reproducing the Combined Work from the 40 | Application, but excluding the System Libraries of the Combined Work. 41 | 42 | 1. Exception to Section 3 of the GNU GPL. 43 | 44 | You may convey a covered work under sections 3 and 4 of this License 45 | without being bound by section 3 of the GNU GPL. 46 | 47 | 2. Conveying Modified Versions. 48 | 49 | If you modify a copy of the Library, and, in your modifications, a 50 | facility refers to a function or data to be supplied by an Application 51 | that uses the facility (other than as an argument passed when the 52 | facility is invoked), then you may convey a copy of the modified 53 | version: 54 | 55 | a) under this License, provided that you make a good faith effort to 56 | ensure that, in the event an Application does not supply the 57 | function or data, the facility still operates, and performs 58 | whatever part of its purpose remains meaningful, or 59 | 60 | b) under the GNU GPL, with none of the additional permissions of 61 | this License applicable to that copy. 62 | 63 | 3. Object Code Incorporating Material from Library Header Files. 64 | 65 | The object code form of an Application may incorporate material from 66 | a header file that is part of the Library. You may convey such object 67 | code under terms of your choice, provided that, if the incorporated 68 | material is not limited to numerical parameters, data structure 69 | layouts and accessors, or small macros, inline functions and templates 70 | (ten or fewer lines in length), you do both of the following: 71 | 72 | a) Give prominent notice with each copy of the object code that the 73 | Library is used in it and that the Library and its use are 74 | covered by this License. 75 | 76 | b) Accompany the object code with a copy of the GNU GPL and this license 77 | document. 78 | 79 | 4. Combined Works. 80 | 81 | You may convey a Combined Work under terms of your choice that, 82 | taken together, effectively do not restrict modification of the 83 | portions of the Library contained in the Combined Work and reverse 84 | engineering for debugging such modifications, if you also do each of 85 | the following: 86 | 87 | a) Give prominent notice with each copy of the Combined Work that 88 | the Library is used in it and that the Library and its use are 89 | covered by this License. 90 | 91 | b) Accompany the Combined Work with a copy of the GNU GPL and this license 92 | document. 93 | 94 | c) For a Combined Work that displays copyright notices during 95 | execution, include the copyright notice for the Library among 96 | these notices, as well as a reference directing the user to the 97 | copies of the GNU GPL and this license document. 98 | 99 | d) Do one of the following: 100 | 101 | 0) Convey the Minimal Corresponding Source under the terms of this 102 | License, and the Corresponding Application Code in a form 103 | suitable for, and under terms that permit, the user to 104 | recombine or relink the Application with a modified version of 105 | the Linked Version to produce a modified Combined Work, in the 106 | manner specified by section 6 of the GNU GPL for conveying 107 | Corresponding Source. 108 | 109 | 1) Use a suitable shared library mechanism for linking with the 110 | Library. A suitable mechanism is one that (a) uses at run time 111 | a copy of the Library already present on the user's computer 112 | system, and (b) will operate properly with a modified version 113 | of the Library that is interface-compatible with the Linked 114 | Version. 115 | 116 | e) Provide Installation Information, but only if you would otherwise 117 | be required to provide such information under section 6 of the 118 | GNU GPL, and only to the extent that such information is 119 | necessary to install and execute a modified version of the 120 | Combined Work produced by recombining or relinking the 121 | Application with a modified version of the Linked Version. (If 122 | you use option 4d0, the Installation Information must accompany 123 | the Minimal Corresponding Source and Corresponding Application 124 | Code. If you use option 4d1, you must provide the Installation 125 | Information in the manner specified by section 6 of the GNU GPL 126 | for conveying Corresponding Source.) 127 | 128 | 5. Combined Libraries. 129 | 130 | You may place library facilities that are a work based on the 131 | Library side by side in a single library together with other library 132 | facilities that are not Applications and are not covered by this 133 | License, and convey such a combined library under terms of your 134 | choice, if you do both of the following: 135 | 136 | a) Accompany the combined library with a copy of the same work based 137 | on the Library, uncombined with any other library facilities, 138 | conveyed under the terms of this License. 139 | 140 | b) Give prominent notice with the combined library that part of it 141 | is a work based on the Library, and explaining where to find the 142 | accompanying uncombined form of the same work. 143 | 144 | 6. Revised Versions of the GNU Lesser General Public License. 145 | 146 | The Free Software Foundation may publish revised and/or new versions 147 | of the GNU Lesser General Public License from time to time. Such new 148 | versions will be similar in spirit to the present version, but may 149 | differ in detail to address new problems or concerns. 150 | 151 | Each version is given a distinguishing version number. If the 152 | Library as you received it specifies that a certain numbered version 153 | of the GNU Lesser General Public License "or any later version" 154 | applies to it, you have the option of following the terms and 155 | conditions either of that published version or of any later version 156 | published by the Free Software Foundation. If the Library as you 157 | received it does not specify a version number of the GNU Lesser 158 | General Public License, you may choose any version of the GNU Lesser 159 | General Public License ever published by the Free Software Foundation. 160 | 161 | If the Library as you received it specifies that a proxy can decide 162 | whether future versions of the GNU Lesser General Public License shall 163 | apply, that proxy's public statement of acceptance of any version is 164 | permanent authorization for you to choose that version for the 165 | Library. 166 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | vfxcmake 2 | ======== 3 | 4 | Cmake Find modules for common vfx software, and general Cmake utility code, licensed under LGPL. 5 | 6 | Please fork this project, improve it, and add new applications! 7 | 8 | 9 | Maya Example 10 | ------------ 11 | 12 | ```cmake 13 | # can optionally specify a version: FIND_PACKAGE( Maya 2012 REQUIRED ) 14 | FIND_PACKAGE( Maya REQUIRED ) 15 | # find a local install of Qt that matches the version required for Maya, as determined above 16 | FIND_PACKAGE( Qt4 ${MAYA_QT_VERSION_SHORT} REQUIRED ) 17 | 18 | # load the Qt tools 19 | INCLUDE( ${QT_USE_FILE} ) 20 | 21 | SET( myplugin_SRCS 22 | ../src/QMyCoreLib.cpp 23 | ) 24 | 25 | SET( myplugin_MOC_HDRS 26 | ../src/QMyCoreLib.h 27 | ) 28 | 29 | # generate the Qt moc files 30 | QT4_WRAP_CPP( myplugin_MOC_SRCS ${myplugin_MOC_HDRS} ) 31 | 32 | # the maya-specific plugin code (w/ initializePlugin, etc) 33 | SET( plugin_SRCS plugin.cpp ) 34 | 35 | INCLUDE_DIRECTORIES( ${PUBLIC_INCLUDE_DIRS} ${myplugin_proj_SOURCE_DIR}/src ${MAYA_INCLUDE_DIR} ) 36 | 37 | # create the plugin 38 | ADD_LIBRARY( myplugin_plugin SHARED 39 | ${plugin_SRCS} 40 | ${myplugin_SRCS} ${myplugin_MOC_SRCS} 41 | ) 42 | 43 | TARGET_LINK_LIBRARIES( myplugin_plugin 44 | ${MAYA_Foundation_LIBRARY} ${MAYA_OpenMaya_LIBRARY} ${MAYA_OpenMayaUI_LIBRARY} 45 | ${QT_LIBRARIES} 46 | ) 47 | 48 | SET_TARGET_PROPERTIES( myplugin_plugin PROPERTIES 49 | OUTPUT_NAME myplugin 50 | CLEAN_DIRECT_OUTPUT 1 51 | ) 52 | 53 | # this is a macro defined in FindMaya that sets up our plugin with standard Maya build settings 54 | MAYA_SET_PLUGIN_PROPERTIES( myplugin_plugin ) 55 | ``` 56 | -------------------------------------------------------------------------------- /cmake/Find3Delight.cmake: -------------------------------------------------------------------------------- 1 | #========== 2 | # 3 | # Copyright (c) 2010, Dan Bethell. 4 | # All rights reserved. 5 | # 6 | # Redistribution and use in source and binary forms, with or without 7 | # modification, are permitted provided that the following conditions are 8 | # met: 9 | # 10 | # * Redistributions of source code must retain the above copyright 11 | # notice, this list of conditions and the following disclaimer. 12 | # 13 | # * Redistributions in binary form must reproduce the above copyright 14 | # notice, this list of conditions and the following disclaimer in the 15 | # documentation and/or other materials provided with the distribution. 16 | # 17 | # * Neither the name of Dan Bethell nor the names of any 18 | # other contributors to this software may be used to endorse or 19 | # promote products derived from this software without specific prior 20 | # written permission. 21 | # 22 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS 23 | # IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 24 | # THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 25 | # PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR 26 | # CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 27 | # EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 28 | # PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 29 | # PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 30 | # LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 31 | # NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 32 | # SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 33 | # 34 | #========== 35 | # 36 | # Variables defined by this module: 37 | # 3Delight_FOUND 38 | # 3Delight_INCLUDE_DIR 39 | # 3Delight_COMPILE_FLAGS 40 | # 3Delight_LIBRARIES 41 | # 3Delight_LIBRARY_DIR 42 | # 43 | # Usage: 44 | # FIND_PACKAGE( 3Delight ) 45 | # FIND_PACKAGE( 3Delight REQUIRED ) 46 | # 47 | # Note: 48 | # You can tell the module where 3Delight is installed by setting 49 | # the 3Delight_INSTALL_PATH (or setting the DELIGHT environment 50 | # variable before calling FIND_PACKAGE. 51 | # 52 | # E.g. 53 | # SET( 3Delight_INSTALL_PATH "/usr/local/3delight-9.0.0/Linux-x86_64" ) 54 | # FIND_PACKAGE( 3Delight REQUIRED ) 55 | # 56 | #========== 57 | 58 | # our includes 59 | find_path( 3Delight_INCLUDE_DIR ri.h 60 | $ENV{DELIGHT}/include 61 | ${3Delight_INSTALL_PATH}/include 62 | ) 63 | 64 | # our compilation flags 65 | SET( 3Delight_COMPILE_FLAGS "-DDELIGHT" ) 66 | 67 | # our library itself 68 | find_library( 3Delight_LIBRARIES 3delight 69 | $ENV{DELIGHT}/lib 70 | ${3Delight_INSTALL_PATH}/lib 71 | ) 72 | 73 | # our library path 74 | get_filename_component( 3Delight_LIBRARY_DIR ${3Delight_LIBRARIES} PATH ) 75 | 76 | # did we find everything? 77 | include( FindPackageHandleStandardArgs ) 78 | FIND_PACKAGE_HANDLE_STANDARD_ARGS( "_3Delight" DEFAULT_MSG 79 | 3Delight_INCLUDE_DIR 80 | 3Delight_COMPILE_FLAGS 81 | 3Delight_LIBRARIES 82 | 3Delight_LIBRARY_DIR 83 | ) 84 | -------------------------------------------------------------------------------- /cmake/FindAlembic.cmake: -------------------------------------------------------------------------------- 1 | # - Find module for the Alembic headers and libraries 2 | # 3 | # Input variables: 4 | # Alembic_ROOT 5 | # Alembic_USE_STATIC_LIBS 6 | # 7 | # Input environment variables: 8 | # ALEMBIC_ROOT 9 | # 10 | # Output variables: 11 | # ALEMBIC_FOUND 12 | # ALEMBIC_INCLUDE_DIRS 13 | # ALEMBIC__LIBRARY 14 | # ALEMBIC_LIBRARIES 15 | # 16 | 17 | # Handle deprecated root hint 18 | if(ALEMBIC_ROOT) 19 | message(WARNING "ALEMBIC_ROOT variable is deprecated. Use Alembic_ROOT instead.") 20 | set(_alembic_ROOT_HINT ${ALEMBIC_ROOT}) 21 | elseif(Alembic_ROOT) 22 | set(_alembic_ROOT_HINT ${Alembic_ROOT}) 23 | elseif(NOT $ENV{ALEMBIC_ROOT} STREQUAL "") 24 | set(_alembic_ROOT_HINT $ENV{ALEMBIC_ROOT}) 25 | endif() 26 | 27 | find_path(ALEMBIC_INCLUDE_DIRS NAMES Alembic/Abc/All.h 28 | HINTS ${_alembic_ROOT_HINT}/include/) 29 | 30 | if(NOT _alembic_ROOT_HINT) 31 | get_filename_component(_alembic_ROOT_HINT ${ALEMBIC_INCLUDE_DIRS} DIRECTORY) 32 | endif() 33 | 34 | # (Static lib search logic taken from FindBoost.cmake) 35 | if(Alembic_USE_STATIC_LIBS) 36 | set(_alembic_ORIG_CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES}) 37 | if(WIN32) 38 | set(CMAKE_FIND_LIBRARY_SUFFIXES .lib .a ${CMAKE_FIND_LIBRARY_SUFFIXES}) 39 | else() 40 | set(CMAKE_FIND_LIBRARY_SUFFIXES .a) 41 | endif() 42 | endif() 43 | 44 | # Determine which libraries must be found (default is all) 45 | # ORDER here is very important to prevent undefined symbols (order taken from Alembic CMakeLists.txt) 46 | set(_alembic_VALID_COMPONENTS 47 | AlembicAbcGeom 48 | AlembicAbcCoreFactory 49 | AlembicAbc 50 | AlembicAbcCoreHDF5 51 | AlembicAbcCoreOgawa 52 | AlembicAbcCoreAbstract 53 | AlembicAbcCollection 54 | AlembicAbcMaterial 55 | AlembicAbcOpenGL 56 | AlembicOgawa 57 | AlembicUtil) 58 | 59 | if(Alembic_FIND_COMPONENTS) 60 | set(_alembic_REQUIRED_LIBS ${Alembic_FIND_COMPONENTS}) 61 | else() 62 | set(_alembic_REQUIRED_LIBS ${_alembic_VALID_COMPONENTS}) 63 | endif() 64 | 65 | # Grab the library paths 66 | set(_alembic_LIB_VARS) 67 | set(ALEMBIC_LIBRARIES) 68 | foreach(_alembic_lib ${_alembic_REQUIRED_LIBS}) 69 | list(FIND _alembic_VALID_COMPONENTS ${_alembic_lib} _alembic_requested_index) 70 | if(_alembic_requested_index EQUAL -1) 71 | if(Alembic_FIND_REQUIRED) 72 | # If they "required" a lib we don't recognize, just abort here 73 | message(FATAL_ERROR "Requested component ${_alembic_lib} is not a recognized Alembic library") 74 | else() 75 | message(WARNING "Requested component '${_alembic_lib}' is not a recognized Alembic library and will be skipped") 76 | endif() 77 | else() 78 | find_library(ALEMBIC_${_alembic_lib}_LIBRARY ${_alembic_lib} 79 | ${_alembic_ROOT_HINT}/lib 80 | ${_alembic_ROOT_HINT}/lib/static 81 | DOC "Alembic ${_alembic_lib} library path") 82 | list(APPEND _alembic_LIB_VARS "ALEMBIC_${_alembic_lib}_LIBRARY") 83 | list(APPEND ALEMBIC_LIBRARIES ${ALEMBIC_${_alembic_lib}_LIBRARY}) 84 | endif() 85 | endforeach() 86 | 87 | # Reset lib search suffix 88 | if(Alembic_USE_STATIC_LIBS) 89 | set(CMAKE_FIND_LIBRARY_SUFFIXES ${_alembic_ORIG_CMAKE_FIND_LIBRARY_SUFFIXES}) 90 | endif() 91 | 92 | # Finalize package search 93 | include(FindPackageHandleStandardArgs) 94 | find_package_handle_standard_args(Alembic 95 | REQUIRED_VARS ${_alembic_LIB_VARS} ALEMBIC_INCLUDE_DIRS ALEMBIC_LIBRARIES) 96 | -------------------------------------------------------------------------------- /cmake/FindArnold.cmake: -------------------------------------------------------------------------------- 1 | # - Arnold finder module 2 | # This module searches for a valid Arnold instalation. 3 | # 4 | # Variables that will be defined: 5 | # ARNOLD_FOUND Defined if a Arnold installation has been detected 6 | # ARNOLD_LIBRARY Path to ai library (for backward compatibility) 7 | # ARNOLD_LIBRARIES Path to ai library 8 | # ARNOLD_INCLUDE_DIR Path to the include directory (for backward compatibility) 9 | # ARNOLD_INCLUDE_DIRS Path to the include directory 10 | # ARNOLD_VERSION Version of arnold 11 | 12 | # Naming convention: 13 | # Local variables of the form _arnold_foo 14 | # Input variables from CMake of the form Arnold_FOO 15 | # Output variables of the form ARNOLD_FOO 16 | # 17 | 18 | find_library(ARNOLD_LIBRARY 19 | NAMES ai 20 | PATHS $ENV{ARNOLD_HOME}/bin 21 | DOC "Arnold library") 22 | 23 | find_path(ARNOLD_INCLUDE_DIR ai.h 24 | PATHS $ENV{ARNOLD_HOME}/include 25 | DOC "Arnold include path") 26 | 27 | set(ARNOLD_LIBRARIES ${ARNOLD_LIBRARY}) 28 | set(ARNOLD_INCLUDE_DIRS ${ARNOLD_INCLUDE_DIR}) 29 | 30 | # get the arnold version from ai_version.h 31 | file(STRINGS ${ARNOLD_INCLUDE_DIR}/ai_version.h _lines 32 | REGEX "^#define AI_VERSION_[A-Z_ 0-9\"]+$" ) 33 | list(LENGTH _lines _linenum) 34 | if (_linenum EQUAL 4) 35 | foreach(_line ${_lines}) 36 | string(REGEX MATCH "[0-9]+" _num ${_line}) 37 | if (NOT DEFINED ARNOLD_VERSION) 38 | set(ARNOLD_VERSION ${_num}) 39 | else() 40 | set(ARNOLD_VERSION "${ARNOLD_VERSION}.${_num}") 41 | endif() 42 | endforeach() 43 | else() 44 | message(WARNING "Could not determine ARNOLD_VERSION") 45 | endif() 46 | 47 | include(FindPackageHandleStandardArgs) 48 | find_package_handle_standard_args(Arnold DEFAULT_MSG 49 | ARNOLD_LIBRARY ARNOLD_INCLUDE_DIR) 50 | -------------------------------------------------------------------------------- /cmake/FindCortex.cmake: -------------------------------------------------------------------------------- 1 | #========== 2 | # 3 | # Copyright (c) 2010, Dan Bethell. 4 | # All rights reserved. 5 | # 6 | # Redistribution and use in source and binary forms, with or without 7 | # modification, are permitted provided that the following conditions are 8 | # met: 9 | # 10 | # * Redistributions of source code must retain the above copyright 11 | # notice, this list of conditions and the following disclaimer. 12 | # 13 | # * Redistributions in binary form must reproduce the above copyright 14 | # notice, this list of conditions and the following disclaimer in the 15 | # documentation and/or other materials provided with the distribution. 16 | # 17 | # * Neither the name of Dan Bethell nor the names of any 18 | # other contributors to this software may be used to endorse or 19 | # promote products derived from this software without specific prior 20 | # written permission. 21 | # 22 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS 23 | # IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 24 | # THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 25 | # PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR 26 | # CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 27 | # EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 28 | # PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 29 | # PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 30 | # LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 31 | # NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 32 | # SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 33 | # 34 | #========== 35 | # 36 | # Variables defined by this module: 37 | # Cortex_FOUND 38 | # Cortex_INCLUDE_DIR 39 | # Cortex_LIBRARIES 40 | # 41 | # Usage: 42 | # FIND_PACKAGE( Cortex ) 43 | # FIND_PACKAGE( Cortex REQUIRED ) 44 | # 45 | # Todo: add support for finding additional components 46 | # (more than just IECore) using a mechanism similar to Boost's 47 | # cmake module. 48 | # 49 | #========== 50 | 51 | # try to find header 52 | find_path( Cortex_INCLUDE_DIR IECore/IECore.h 53 | ${Cortex_INSTALL_PATH}/include 54 | ) 55 | 56 | # try to find libs 57 | find_library( Cortex_LIBRARY IECore 58 | ${Cortex_INSTALL_PATH}/lib 59 | ) 60 | 61 | # did we find everything? 62 | include( FindPackageHandleStandardArgs ) 63 | FIND_PACKAGE_HANDLE_STANDARD_ARGS( "Cortex" DEFAULT_MSG 64 | Cortex_INCLUDE_DIR 65 | Cortex_LIBRARY 66 | ) 67 | -------------------------------------------------------------------------------- /cmake/FindHoudini.cmake: -------------------------------------------------------------------------------- 1 | # 2 | # In: 3 | # HOUDINI_ROOT (alternatively, make sure 'houdini' is on $PATH) 4 | # HOUDINI_DSO_TAG 5 | # 6 | # Out: 7 | # HOUDINI_FOUND 8 | # HOUDINI_VERSION 9 | # HOUDINI_MAJOR_VERSION 10 | # HOUDINI_MINOR_VERSION 11 | # HOUDINI_BUILD_VERSION 12 | # HOUDINI_INCLUDE_DIRS 13 | # HOUDINI_LIBRARY_DIRS 14 | # HOUDINI_DEFINITIONS 15 | # HOUDINI_TOOLKIT_DIR 16 | # 17 | 18 | include(GetCXXCompiler) 19 | 20 | 21 | find_program(HOUDINI_BINARY houdini PATHS ${HOUDINI_ROOT}/bin) 22 | 23 | if(HOUDINI_BINARY STREQUAL "HOUDINI_BINARY-NOTFOUND") 24 | find_program(HOUDINI_BINARY houdini PATHS $ENV{HFS}/bin) 25 | endif() 26 | 27 | 28 | if(HOUDINI_BINARY STREQUAL "HOUDINI_BINARY-NOTFOUND") 29 | set(HOUDINI_FOUND FALSE) 30 | else() 31 | set(HOUDINI_FOUND TRUE) 32 | get_filename_component(HOUDINI_BASE ${HOUDINI_BINARY} PATH) 33 | get_filename_component(HOUDINI_BASE ${HOUDINI_BASE} PATH) 34 | set(HOUDINI_LIBRARY_DIRS ${HOUDINI_BASE}/dsolib) 35 | set(HOUDINI_INCLUDE_DIRS ${HOUDINI_BASE}/toolkit/include) 36 | set(HOUDINI_TOOLKIT_DIR ${HOUDINI_BASE}/toolkit) 37 | 38 | file(READ "${HOUDINI_INCLUDE_DIRS}/UT/UT_Version.h" _HOU_UTVER_CONTENTS) 39 | string(REGEX REPLACE ".*#define UT_MAJOR_VERSION_INT ([0-9]+).*" "\\1" HOUDINI_MAJOR_VERSION "${_HOU_UTVER_CONTENTS}") 40 | string(REGEX REPLACE ".*#define UT_MINOR_VERSION_INT ([0-9]+).*" "\\1" HOUDINI_MINOR_VERSION "${_HOU_UTVER_CONTENTS}") 41 | string(REGEX REPLACE ".*#define UT_BUILD_VERSION_INT ([0-9]+).*" "\\1" HOUDINI_BUILD_VERSION "${_HOU_UTVER_CONTENTS}") 42 | set(HOUDINI_VERSION "${HOUDINI_MAJOR_VERSION}.${HOUDINI_MINOR_VERSION}.${HOUDINI_BUILD_VERSION}") 43 | 44 | set(HOUDINI_DEFINITIONS "") 45 | 46 | # general definitions 47 | list(APPEND HOUDINI_DEFINITIONS -DVERSION="$ENV{HOUDINI_VERSION}") 48 | list(APPEND HOUDINI_DEFINITIONS -DMAKING_DSO) 49 | if(NOT HOUDINI_DSO_TAG) 50 | set(HOUDINI_DSO_TAG "unknown") 51 | endif() 52 | list(APPEND HOUDINI_DEFINITIONS -DUT_DSO_TAGINFO="${HOUDINI_DSO_TAG}") 53 | 54 | GetCXXCompiler(_HOU) 55 | set(_HOU_NEED_SPEC_STORAGE TRUE) 56 | if(_HOU_COMPILER_VERSION) 57 | if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUXX) 58 | if(_HOU_COMPILER_VERSION VERSION_GREATER 4.2) 59 | set(_HOU_NEED_SPEC_STORAGE FALSE) 60 | endif() 61 | endif() 62 | endif() 63 | 64 | if(_HOU_NEED_SPEC_STORAGE) 65 | list(APPEND HOUDINI_DEFINITIONS -DNEED_SPECIALIZATION_STORAGE) 66 | endif() 67 | 68 | # platform-specific definitions 69 | if(APPLE) 70 | # OSX 71 | elseif(WIN32) 72 | # Win32 73 | list(APPEND HOUDINI_DEFINITIONS -DI386) 74 | list(APPEND HOUDINI_DEFINITIONS -DWIN32) 75 | list(APPEND HOUDINI_DEFINITIONS -DSWAP_BITFIELDS) 76 | list(APPEND HOUDINI_DEFINITIONS -DDLLEXPORT=__declspec\(dllexport\)) 77 | list(APPEND HOUDINI_DEFINITIONS -DSESI_LITTLE_ENDIAN) 78 | else() 79 | # Linux common 80 | list(APPEND HOUDINI_DEFINITIONS -DLINUX) 81 | list(APPEND HOUDINI_DEFINITIONS -D_GNU_SOURCE) 82 | list(APPEND HOUDINI_DEFINITIONS -DDLLEXPORT=) 83 | list(APPEND HOUDINI_DEFINITIONS -DSESI_LITTLE_ENDIAN) 84 | list(APPEND HOUDINI_DEFINITIONS -DENABLE_THREADS) 85 | list(APPEND HOUDINI_DEFINITIONS -DUSE_PTHREADS) 86 | list(APPEND HOUDINI_DEFINITIONS -DENABLE_UI_THREADS) 87 | list(APPEND HOUDINI_DEFINITIONS -DGCC3) 88 | list(APPEND HOUDINI_DEFINITIONS -DGCC4) 89 | list(APPEND HOUDINI_DEFINITIONS -Wno-deprecated) 90 | 91 | # Linux 64 bit 92 | list(APPEND HOUDINI_DEFINITIONS -DAMD64) 93 | list(APPEND HOUDINI_DEFINITIONS -DSIZEOF_VOID_P=8) 94 | endif() 95 | endif() 96 | 97 | 98 | if(Houdini_FIND_REQUIRED AND NOT HOUDINI_FOUND) 99 | message(FATAL_ERROR "Could not find houdini") 100 | endif() 101 | 102 | 103 | # 104 | # Copyright 2012, Allan Johns 105 | # 106 | # vfxcmake is free software: you can redistribute it and/or modify 107 | # it under the terms of the GNU Lesser General Public License as published by 108 | # the Free Software Foundation, either version 3 of the License, or 109 | # (at your option) any later version. 110 | # 111 | # vfxcmake is distributed in the hope that it will be useful, 112 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 113 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 114 | # GNU General Public License for more details. 115 | # 116 | # You should have received a copy of the GNU Lesser General Public License 117 | # along with vfxcmake. If not, see . 118 | # 119 | -------------------------------------------------------------------------------- /cmake/FindILMBase.cmake: -------------------------------------------------------------------------------- 1 | # - Find module for the ILMBase headers and libraries 2 | # 3 | # Input variables: 4 | # ILMBase_ROOT 5 | # ILMBase_USE_STATIC_LIBS 6 | # ILMBASE_ROOT (deprecated, use ILMBase_ROOT instead) 7 | # 8 | # Output variables: 9 | # ILMBASE_FOUND 10 | # ILMBASE_VERSION 11 | # ILMBASE_INCLUDE_DIRS 12 | # ILMBASE_LIBRARY_DIRS 13 | # ILMBASE__LIBRARY 14 | # ILMBASE_LIBRARIES 15 | # 16 | 17 | # Handle deprecated root hint 18 | if(ILMBASE_ROOT) 19 | message(WARNING "ILMBASE_ROOT variable is deprecated. Use ILMBase_ROOT instead.") 20 | set(_ilmbase_ROOT_HINT ${ILMBASE_ROOT}) 21 | else() 22 | set(_ilmbase_ROOT_HINT ${ILMBase_ROOT}) 23 | endif() 24 | 25 | find_path(ILMBASE_INCLUDE_DIRS NAMES OpenEXR/IlmBaseConfig.h 26 | HINTS ${_ilmbase_ROOT_HINT}/include/) 27 | 28 | if(NOT _ilmbase_ROOT_HINT) 29 | get_filename_component(_ilmbase_ROOT_HINT ${ILMBASE_INCLUDE_DIRS} DIRECTORY) 30 | endif() 31 | 32 | set(ILMBASE_INCLUDE_DIRS ${ILMBASE_INCLUDE_DIRS} ${ILMBASE_INCLUDE_DIRS}/OpenEXR) 33 | 34 | # (Static lib search logic taken from FindBoost.cmake) 35 | if(ILMBase_USE_STATIC_LIBS) 36 | set(_ilmbase_ORIG_CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES}) 37 | if(WIN32) 38 | set(CMAKE_FIND_LIBRARY_SUFFIXES .lib .a ${CMAKE_FIND_LIBRARY_SUFFIXES}) 39 | else() 40 | set(CMAKE_FIND_LIBRARY_SUFFIXES .a) 41 | endif() 42 | endif() 43 | 44 | # Determine which libraries must be found (default is all) 45 | set(_ilmbase_VALID_COMPONENTS Half Iex IexMath IlmThread Imath) 46 | if(ILMBase_FIND_COMPONENTS) 47 | set(_ilmbase_REQUIRED_LIBS ${ILMBase_FIND_COMPONENTS}) 48 | else() 49 | set(_ilmbase_REQUIRED_LIBS ${_ilmbase_VALID_COMPONENTS}) 50 | endif() 51 | 52 | # Grab the library paths 53 | set(_ilmbase_LIB_VARS) 54 | set(ILMBASE_LIBRARIES) 55 | foreach(_ilmbase_lib ${_ilmbase_REQUIRED_LIBS}) 56 | list(FIND _ilmbase_VALID_COMPONENTS ${_ilmbase_lib} _ilmbase_requested_index) 57 | if(_ilmbase_requested_index EQUAL -1) 58 | if(ILMBase_FIND_REQUIRED) 59 | # If they "required" a lib we don't recognize, just abort here 60 | message(FATAL_ERROR "Requested component ${_ilmbase_lib} is not a recognized ILMBase library") 61 | else() 62 | message(WARNING "Requested component '${_ilmbase_lib}' is not a recognized ILMBase library and will be skipped") 63 | endif() 64 | else() 65 | find_library(ILMBASE_${_ilmbase_lib}_LIBRARY ${_ilmbase_lib} 66 | HINTS ${_ilmbase_ROOT_HINT}/lib 67 | DOC "ILMBase ${_ilmbase_lib} library path") 68 | list(APPEND _ilmbase_LIB_VARS "ILMBASE_${_ilmbase_lib}_LIBRARY") 69 | list(APPEND ILMBASE_LIBRARIES ${ILMBASE_${_ilmbase_lib}_LIBRARY}) 70 | endif() 71 | endforeach() 72 | 73 | # Reset lib search suffix 74 | if(ILMBase_USE_STATIC_LIBS) 75 | set(CMAKE_FIND_LIBRARY_SUFFIXES ${_ilmbase_ORIG_CMAKE_FIND_LIBRARY_SUFFIXES}) 76 | endif() 77 | 78 | get_filename_component(ILMBASE_LIBRARY_DIRS ${ILMBASE_Half_LIBRARY} DIRECTORY) 79 | 80 | file(READ "${ILMBASE_LIBRARY_DIRS}/pkgconfig/IlmBase.pc" _ilmbase_PC_CONTENTS) 81 | string(REGEX REPLACE 82 | ".*Version: ([1-9]+\\.[0-9]+\\.[0-9]+).*" "\\1" 83 | ILMBASE_VERSION "${_ilmbase_PC_CONTENTS}") 84 | 85 | # Finalize package search 86 | include(FindPackageHandleStandardArgs) 87 | find_package_handle_standard_args(ILMBase 88 | REQUIRED_VARS ${_ilmbase_LIB_VARS} ILMBASE_INCLUDE_DIRS ILMBASE_LIBRARY_DIRS ILMBASE_LIBRARIES 89 | VERSION_VAR ILMBASE_VERSION) 90 | 91 | 92 | # 93 | # Copyright 2012, Allan Johns 94 | # 95 | # vfxcmake is free software: you can redistribute it and/or modify 96 | # it under the terms of the GNU Lesser General Public License as published by 97 | # the Free Software Foundation, either version 3 of the License, or 98 | # (at your option) any later version. 99 | # 100 | # vfxcmake is distributed in the hope that it will be useful, 101 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 102 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 103 | # GNU General Public License for more details. 104 | # 105 | # You should have received a copy of the GNU Lesser General Public License 106 | # along with vfxcmake. If not, see . 107 | # 108 | -------------------------------------------------------------------------------- /cmake/FindMaya.cmake: -------------------------------------------------------------------------------- 1 | # - Maya finder module 2 | # This module searches for a valid Maya instalation, including its devkit, 3 | # libraries, executables and related paths (scripts). 4 | # 5 | # Useful environment variables: 6 | # MAYA_LOCATION If defined in the shell environment, the contents 7 | # of this variable will be used as the first search 8 | # path for the Maya installation. 9 | # 10 | # Output variables: 11 | # MAYA_FOUND Defined if a Maya installation has been detected 12 | # MAYA_EXECUTABLE Path to Maya's executable 13 | # MAYA_VERSION Version of Maya determined from MAYA_EXECUTABLE (20xx) 14 | # MAYA_LIBRARIES List of all Maya libraries that are found 15 | # MAYA__FOUND Defined if has been found 16 | # MAYA__LIBRARY Path to library 17 | # MAYA_INCLUDE_DIRS Path to the devkit's include directories 18 | # MAYA_LIBRARY_DIRS Path to the library directory 19 | # MAYA_PLUGIN_SUFFIX File extension for the maya plugin 20 | # MAYA_QT_VERSION_SHORT Version of Qt used by Maya (e.g. 4.7) 21 | # MAYA_QT_VERSION_LONG Full version of Qt used by Maya (e.g. 4.7.1) 22 | # 23 | # Deprecated output variables: 24 | # MAYA_LIBRARY_DIR Superseded by MAYA_LIBRARY_DIRS 25 | # MAYA_INCLUDE_DIR Superseded by MAYA_INCLUDE_DIRS 26 | # 27 | # Macros provided: 28 | # MAYA_SET_PLUGIN_PROPERTIES Passed the target name, this sets up typical 29 | # plugin properties like macro defines, prefixes, 30 | # and suffixes. 31 | # 32 | # Naming conventions: 33 | # Local variables of the form _maya_foo 34 | # Input variables from CMake of the form Maya_FOO 35 | # Output variables of the form MAYA_FOO 36 | # 37 | 38 | # OS variables 39 | SET( _WINDOWS FALSE ) 40 | IF( "${CMAKE_SYSTEM_NAME}" MATCHES "Windows" ) 41 | SET( _WINDOWS TRUE ) 42 | ENDIF() 43 | 44 | SET( _DARWIN FALSE ) 45 | IF( "${CMAKE_SYSTEM_NAME}" MATCHES "Darwin" ) 46 | SET( _DARWIN TRUE ) 47 | IF( ${CMAKE_SYSTEM_VERSION} MATCHES "13." ) 48 | ADD_DEFINITIONS( "-std=c++11" ) 49 | ENDIF() 50 | ENDIF() 51 | 52 | SET( _LINUX FALSE ) 53 | IF( "${CMAKE_SYSTEM_NAME}" MATCHES "Linux" ) 54 | SET( _LINUX TRUE ) 55 | ENDIF() 56 | 57 | 58 | #============================================================================= 59 | # Macros 60 | #============================================================================= 61 | 62 | # Macro for setting up typical plugin properties. These include: 63 | # - OS-specific plugin suffix (.mll, .so, .bundle) 64 | # - Removal of 'lib' prefix on osx/linux 65 | # - OS-specific defines 66 | # - Post-commnad for correcting Qt library linking on osx 67 | # - Windows link flags for exporting initializePlugin/uninitializePlugin 68 | macro(MAYA_SET_PLUGIN_PROPERTIES target) 69 | 70 | if(APPLE) 71 | set(MAYA_EXTENSION ".bundle") 72 | set(MAYA_COMPILE_DEFINITIONS AW_NEW_IOSTREAMS REQUIRE_IOSTREAM _BOOL _DARWIN MAC_PLUGIN 73 | OSMac_ OSMac_MachO OSMacOSX_ CC_GNU_ _LANGUAGE_C_PLUS_PLUS) 74 | set(MAYA_COMPILE_FLAGS 75 | "-fno-gnu-keywords -include ${MAYA_INCLUDE_PATH}/maya/OpenMayaMac.h" ) 76 | 77 | set(MAYA_LINK_FLAGS 78 | #"-dynamic -g -fPIC " 79 | #"-shared -g -fPIC " 80 | "-fno-gnu-keywords -framework System -framework SystemConfiguration -framework CoreServices -framework Carbon -framework Cocoa -framework ApplicationServices -framework Quicktime -framework IOKit -bundle -fPIC -L${ALEMBIC_MAYA_LIB_ROOT} -Wl,-executable_path,${ALEMBIC_MAYA_LIB_ROOT}" ) 81 | 82 | if(QT_LIBRARIES) 83 | set(_changes "") 84 | foreach(_lib ${QT_LIBRARIES}) 85 | if("${_lib}" MATCHES ".*framework.*") 86 | get_filename_component(_shortname ${_lib} NAME) 87 | string(REPLACE ".framework" "" _shortname ${_shortname}) 88 | # FIXME: QT_LIBRARIES does not provide the entire path to the lib. 89 | # it provides /usr/local/qt/4.7.2/lib/QtGui.framework 90 | # but we need /usr/local/qt/4.7.2/lib/QtGui.framework/Versions/4/QtGui 91 | # below is a hack, likely to break on other configurations 92 | set(_changes ${_changes} "-change" "${_lib}/Versions/4/${_shortname}" "@executable_path/${_shortname}") 93 | endif() 94 | endforeach() 95 | 96 | add_custom_command(TARGET ${target} 97 | POST_BUILD 98 | COMMAND install_name_tool ${_changes} $) 99 | endif() 100 | 101 | elseif(WIN32) 102 | set(MAYA_EXTENSION ".mll") 103 | set(MAYA_COMPILE_DEFINITIONS REQUIRE_IOSTREAM _BOOL _AFXDLL _MBCS NT_PLUGIN) 104 | set(MAYA_LINK_FLAGS "/export:initializePlugin /export:uninitializePlugin") 105 | set( MAYA_COMPILE_FLAGS "/MD") 106 | else() 107 | set(MAYA_EXTENSION ".so") 108 | set(MAYA_COMPILE_DEFINITIONS REQUIRE_IOSTREAM _BOOL LINUX _LINUX LINUX_64) 109 | set(MAYA_COMPILE_FLAGS 110 | "-m64 -g -pthread -pipe -fPIC -Wno-deprecated -fno-gnu-keywords" ) 111 | 112 | set(MAYA_LINK_FLAGS 113 | "-shared -m64 -g -pthread -pipe -fPIC -Wno-deprecated -fno-gnu-keywords -Wl,-Bsymbolic" ) 114 | endif() 115 | 116 | set_target_properties( ${target} PROPERTIES 117 | COMPILE_DEFINITIONS "${MAYA_COMPILE_DEFINITIONS}" 118 | COMPILE_FLAGS "${MAYA_COMPILE_FLAGS}" 119 | LINK_FLAGS "${MAYA_LINK_FLAGS}" 120 | PREFIX "" 121 | SUFFIX ${MAYA_EXTENSION} 122 | ) 123 | 124 | endmacro(MAYA_SET_PLUGIN_PROPERTIES) 125 | 126 | 127 | set(_maya_TEST_VERSIONS) 128 | set(_maya_KNOWN_VERSIONS "2008" "2009" "2010" "2011" "2012" "2013" "2014") 129 | 130 | if(APPLE) 131 | set(MAYA_PLUGIN_SUFFIX ".bundle") 132 | elseif(WIN32) 133 | set(MAYA_PLUGIN_SUFFIX ".mll") 134 | else() #LINUX 135 | set(MAYA_PLUGIN_SUFFIX ".so") 136 | endif() 137 | 138 | # generate list of versions to test 139 | if(Maya_FIND_VERSION_EXACT) 140 | list(APPEND _maya_TEST_VERSIONS "${Maya_FIND_VERSION}") 141 | else() 142 | # exact version not requested. we have some wiggle room 143 | if(Maya_FIND_VERSION) 144 | # loop through known versions and find anything >= requested 145 | foreach(version ${_maya_KNOWN_VERSIONS}) 146 | if(NOT "${version}" VERSION_LESS "${Maya_FIND_VERSION}") 147 | list(APPEND _maya_TEST_VERSIONS "${version}") 148 | endif() 149 | endforeach() 150 | else() 151 | # no version specified: test everything 152 | set(_maya_TEST_VERSIONS ${_maya_KNOWN_VERSIONS}) 153 | endif() 154 | endif() 155 | 156 | # create empty list 157 | set(_maya_TEST_PATHS) 158 | 159 | # from version list, generate list of paths to test based on canonical locations 160 | foreach(version ${_maya_TEST_VERSIONS}) 161 | if(APPLE) 162 | list(APPEND _maya_TEST_PATHS "/Applications/Autodesk/maya${version}/Maya.app/Contents") 163 | elseif(WIN32) 164 | set(_maya_TEST_PATHS ${_maya_TEST_PATHS} 165 | "$ENV{PROGRAMFILES}/Autodesk/Maya${version}-x64" 166 | "$ENV{PROGRAMFILES}/Autodesk/Maya${version}" 167 | "C:/Program Files/Autodesk/Maya${version}-x64" 168 | "C:/Program Files/Autodesk/Maya${version}" 169 | "C:/Program Files (x86)/Autodesk/Maya${version}") 170 | else() #Linux 171 | set(_maya_TEST_PATHS ${_maya_TEST_PATHS} 172 | "/usr/autodesk/maya${version}-x64" 173 | "/usr/autodesk/maya${version}") 174 | endif() 175 | endforeach(version) 176 | 177 | # search for maya executable within the MAYA_LOCATION and PATH env vars and test paths 178 | find_program(MAYA_EXECUTABLE maya 179 | PATHS $ENV{MAYA_LOCATION} ${_maya_TEST_PATHS} 180 | PATH_SUFFIXES bin 181 | NO_SYSTEM_ENVIRONMENT_PATH 182 | DOC "Maya's executable path") 183 | 184 | if(MAYA_EXECUTABLE) 185 | # TODO: use GET_FILENAME_COMPONENT here 186 | # derive MAYA_LOCATION from MAYA_EXECUTABLE 187 | string(REGEX REPLACE "/bin/maya.*" "" MAYA_LOCATION "${MAYA_EXECUTABLE}") 188 | 189 | string(REGEX MATCH "20[0-9][0-9]" MAYA_VERSION "${MAYA_LOCATION}") 190 | 191 | if(Maya_FIND_VERSION) 192 | # test that we've found a valid version 193 | list(FIND _maya_TEST_VERSIONS ${MAYA_VERSION} _maya_FOUND_INDEX) 194 | if(${_maya_FOUND_INDEX} EQUAL -1) 195 | message(STATUS "Found Maya version ${MAYA_VERSION}, but requested at least ${Maya_FIND_VERSION}. Re-searching without environment variables...") 196 | set(MAYA_LOCATION NOTFOUND) 197 | # search again, but don't use environment variables 198 | # (these should be only paths we constructed based on requested version) 199 | find_path(MAYA_LOCATION maya 200 | PATHS ${_maya_TEST_PATHS} 201 | PATH_SUFFIXES bin 202 | DOC "Maya's Base Directory" 203 | NO_SYSTEM_ENVIRONMENT_PATH) 204 | set(MAYA_EXECUTABLE "${MAYA_LOCATION}/bin/maya" 205 | CACHE PATH "Maya's executable path") 206 | string(REGEX MATCH "20[0-9][0-9]" MAYA_VERSION "${MAYA_LOCATION}") 207 | #ELSE: error? 208 | endif() 209 | endif() 210 | endif() 211 | 212 | # Qt Versions 213 | if(${MAYA_VERSION} STREQUAL "2011") 214 | set(MAYA_QT_VERSION_SHORT CACHE STRING "4.5") 215 | set(MAYA_QT_VERSION_LONG CACHE STRING "4.5.3") 216 | elseif(${MAYA_VERSION} STREQUAL "2012") 217 | set(MAYA_QT_VERSION_SHORT CACHE STRING "4.7") 218 | set(MAYA_QT_VERSION_LONG CACHE STRING "4.7.1") 219 | elseif(${MAYA_VERSION} STREQUAL "2013") 220 | set(MAYA_QT_VERSION_SHORT CACHE STRING "4.7") 221 | set(MAYA_QT_VERSION_LONG CACHE STRING "4.7.1") 222 | elseif(${MAYA_VERSION} STREQUAL "2014") 223 | set(MAYA_QT_VERSION_SHORT CACHE STRING "4.8") 224 | set(MAYA_QT_VERSION_LONG CACHE STRING "4.8.2") 225 | endif() 226 | 227 | # NOTE: the MAYA_LOCATION environment variable is often misunderstood. On every OS it is expected to point 228 | # directly above bin/maya. Relative paths from $MAYA_LOCATION to include, lib, and devkit directories vary depending on OS. 229 | 230 | # We don't use environment variables below this point to lessen the risk of finding incompatible versions of 231 | # libraries and includes (it could happen with highly non-standard configurations; i.e. maya libs in /usr/local/lib or on 232 | # CMAKE_LIBRARY_PATH, CMAKE_INCLUDE_PATH, CMAKE_PREFIX_PATH). 233 | # - If the maya executable is found in a standard location, or in $MAYA_LOCATION/bin or $PATH, and the 234 | # includes and libs are in standard locations relative to the binary, they will be found 235 | 236 | message(STATUS "Maya location: ${MAYA_LOCATION}") 237 | 238 | find_path(MAYA_INCLUDE_DIRS maya/MFn.h 239 | HINTS ${MAYA_LOCATION} 240 | PATH_SUFFIXES 241 | include # linux and windows 242 | ../../devkit/include # osx 243 | DOC "Maya's include path") 244 | 245 | find_path(MAYA_LIBRARY_DIRS libOpenMaya.dylib libOpenMaya.so OpenMaya.lib 246 | HINTS ${MAYA_LOCATION} 247 | PATH_SUFFIXES 248 | lib # linux and windows 249 | MacOS # osx 250 | DOC "Maya's library path") 251 | 252 | # Set deprecated variables to avoid compatibility breaks 253 | set(MAYA_INCLUDE_DIR ${MAYA_INCLUDE_DIRS}) 254 | set(MAYA_LIBRARY_DIR ${MAYA_LIBRARY_DIRS}) 255 | 256 | 257 | foreach(_maya_lib 258 | OpenMaya 259 | OpenMayaAnim 260 | OpenMayaFX 261 | OpenMayaRender 262 | OpenMayaUI 263 | Image 264 | Foundation 265 | IMFbase 266 | tbb) 267 | # cg 268 | # cgGL 269 | # HINTS is searched before PATHS, so preference is given to MAYA_LOCATION 270 | # (set via MAYA_EXECUTABLE) 271 | if(APPLE) 272 | find_library(MAYA_${_maya_lib}_LIBRARY ${_maya_lib} 273 | HINTS ${MAYA_LOCATION} 274 | PATHS ${_maya_TEST_PATHS} 275 | PATH_SUFFIXES MacOS 276 | # This must be used or else Foundation.framework will be found instead of libFoundation 277 | NO_CMAKE_SYSTEM_PATH 278 | DOC "Maya's ${MAYA_LIB} library path") 279 | else() 280 | find_library(MAYA_${_maya_lib}_LIBRARY ${_maya_lib} 281 | HINTS ${MAYA_LOCATION} 282 | PATHS ${_maya_TEST_PATHS} 283 | PATH_SUFFIXES lib # linux and windows 284 | DOC "Maya's ${MAYA_LIB} library path") 285 | endif() 286 | list(APPEND MAYA_LIBRARIES ${MAYA_${_maya_lib}_LIBRARY}) 287 | endforeach() 288 | 289 | 290 | find_path(MAYA_USER_DIR 291 | NAMES ${MAYA_VERSION}-x64 ${MAYA_VERSION} 292 | PATHS 293 | $ENV{HOME}/Library/Preferences/Autodesk/maya # osx 294 | $ENV{USERPROFILE}/Documents/maya # windows 295 | $ENV{HOME}/maya # linux 296 | DOC "Maya user home directory" 297 | NO_SYSTEM_ENVIRONMENT_PATH) 298 | 299 | # if (Maya_FOUND) 300 | # if (NOT Maya_FIND_QUIETLY) 301 | # message(STATUS "Maya version: ${Maya_MAJOR_VERSION}.${Maya_MINOR_VERSION}.${Maya_SUBMINOR_VERSION}") 302 | # endif() 303 | # if (NOT Maya_FIND_QUIETLY) 304 | # message(STATUS "Found the following Maya libraries:") 305 | # endif() 306 | # foreach(COMPONENT ${Maya_FIND_COMPONENTS}) 307 | # string(TOUPPER ${COMPONENT} UPPERCOMPONENT) 308 | # if(Maya_${UPPERCOMPONENT}_FOUND) 309 | # if(NOT Maya_FIND_QUIETLY) 310 | # message(STATUS " ${COMPONENT}") 311 | # endif() 312 | # set(Maya_LIBRARIES ${Maya_LIBRARIES} ${Maya_${UPPERCOMPONENT}_LIBRARY}) 313 | # endif() 314 | # endforeach() 315 | # else() 316 | # if(Maya_FIND_REQUIRED) 317 | # message(SEND_ERROR "Unable to find the requested Maya libraries.\n${Maya_ERROR_REASON}") 318 | # endif() 319 | # endif() 320 | 321 | # Handles the QUIETLY and REQUIRED arguments and sets MAYA_FOUND to TRUE if 322 | # all passed variables are TRUE 323 | include(FindPackageHandleStandardArgs) 324 | find_package_handle_standard_args(Maya DEFAULT_MSG 325 | MAYA_LIBRARIES MAYA_EXECUTABLE MAYA_INCLUDE_DIRS 326 | MAYA_LIBRARY_DIRS MAYA_VERSION MAYA_PLUGIN_SUFFIX 327 | MAYA_USER_DIR) 328 | 329 | 330 | # 331 | # Copyright 2012, Chad Dombrova 332 | # 333 | # vfxcmake is free software: you can redistribute it and/or modify 334 | # it under the terms of the GNU Lesser General Public License as published by 335 | # the Free Software Foundation, either version 3 of the License, or 336 | # (at your option) any later version. 337 | # 338 | # vfxcmake is distributed in the hope that it will be useful, 339 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 340 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 341 | # GNU General Public License for more details. 342 | # 343 | # You should have received a copy of the GNU Lesser General Public License 344 | # along with vfxcmake. If not, see . 345 | # 346 | -------------------------------------------------------------------------------- /cmake/FindMtoA.cmake: -------------------------------------------------------------------------------- 1 | #-*-cmake-*- 2 | # 3 | # yue.nicholas@gmail.com 4 | # 5 | # This auxiliary CMake file helps in find the MtoA headers and libraries 6 | # 7 | # MTOA_FOUND set if MtoA is found. 8 | # MTOA_INCLUDE_DIR MtoA's include directory 9 | # MTOA_mtoa_api_LIBRARY Full path location of libmtoa_api 10 | # MTOA_LIBRARY Alias for MTOA_mtoa_api_LIBRARY 11 | 12 | find_package(PackageHandleStandardArgs) 13 | 14 | ## 15 | ## Obtain MtoA install location 16 | ## 17 | find_path(MTOA_LOCATION include/render/AOV.h 18 | HINTS ENV MTOA_ROOT 19 | NO_DEFAULT_PATH 20 | NO_SYSTEM_ENVIRONMENT_PATH) 21 | 22 | if(NOT MTOA_LOCATION) 23 | # mtd file lives with the plugin and has consistent cross-platform extension 24 | find_path(_plugin_path mtoa.mtd 25 | HINTS ENV MAYA_PLUG_IN_PATH 26 | NO_DEFAULT_PATH 27 | NO_SYSTEM_ENVIRONMENT_PATH) 28 | if(_plugin_path) 29 | get_filename_component(MTOA_LOCATION ${_plugin_path} PATH) 30 | endif() 31 | endif() 32 | 33 | if(NOT MTOA_LOCATION) 34 | # mtd file lives with the plugin and has consistent cross-platform extension 35 | find_path(_plugin_path mtoa_shaders.mtd 36 | HINTS ENV ARNOLD_PLUGIN_PATH 37 | NO_DEFAULT_PATH 38 | NO_SYSTEM_ENVIRONMENT_PATH) 39 | if(_plugin_path) 40 | get_filename_component(MTOA_LOCATION ${_plugin_path} PATH) 41 | endif() 42 | endif() 43 | 44 | find_package_handle_standard_args(MtoA 45 | REQUIRED_VARS MTOA_LOCATION) 46 | 47 | if(MTOA_FOUND) 48 | set(ORIGINAL_CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES}) 49 | if(WIN32) 50 | elseif(APPLE) 51 | set(MTOA_LIBRARY_DIR "${MTOA_LOCATION}/bin" 52 | CACHE STRING "MtoA library path") 53 | find_library(MTOA_mtoa_api_LIBRARY mtoa_api ${MTOA_LIBRARY_DIR}) 54 | else() # Linux 55 | set(MTOA_LIBRARY_DIR "${MTOA_LOCATION}/bin" 56 | CACHE STRING "MtoA library path") 57 | find_library(MTOA_mtoa_api_LIBRARY mtoa_api ${MTOA_LIBRARY_DIR}) 58 | endif() 59 | set(CMAKE_FIND_LIBRARY_SUFFIXES ${ORIGINAL_CMAKE_FIND_LIBRARY_SUFFIXES}) 60 | set(MTOA_INCLUDE_DIR "${MTOA_LOCATION}/include" 61 | CACHE STRING "MtoA include path") 62 | message(STATUS "MTOA location: ${MTOA_LOCATION}") 63 | message(STATUS "MTOA LIB: ${MTOA_mtoa_api_LIBRARY}") 64 | message(STATUS "MTOA include: ${MTOA_INCLUDE_DIR}") 65 | set(MTOA_LIBRARY ${MTOA_mtoa_api_LIBRARY}) 66 | endif() 67 | -------------------------------------------------------------------------------- /cmake/FindNuke.cmake: -------------------------------------------------------------------------------- 1 | # - CMake find module for Nuke 2 | # 3 | # If requesting a specific release, the Nuke version string must be converted 4 | # to a CMake-compatible version number before being passed to `find_package`. 5 | # This should be done as follows: 6 | # 6.3v8 -> 6.3.8 7 | # 7.0v1b100 -> 7.0.1.100 8 | # 9 | # Input variables: 10 | # Nuke_ROOT 11 | # 12 | # Output variables: 13 | # NUKE_FOUND 14 | # NUKE_EXECUTABLE 15 | # NUKE_INCLUDE_DIRS 16 | # NUKE_LIBRARY_DIRS 17 | # NUKE_LIBRARIES 18 | # NUKE_DDIMAGE_LIBRARY 19 | # NUKE_VERSION_MAJOR 20 | # NUKE_VERSION_MINOR 21 | # NUKE_VERSION_RELEASE 22 | # 23 | # 24 | # Version table (for reference only) 25 | # 5.0v1 5.0v2 26 | # 5.1v1 5.1v2 5.1v3 5.1v4 5.1v5 5.1v6 27 | # 5.2v1 5.2v2 5.2v3 28 | # 6.0v1 6.0v2 6.0v3 6.0v4 6.0v5 6.0v6 6.0v7 29 | # 6.1v1 6.1v2 6.1v3 6.1v4 6.1v5 30 | # 6.2v1 6.2v2 6.2v3 6.2v4 6.2v5 6.2v6 31 | # 6.3v1 6.3v2 6.3v3 6.3v4 6.3v5 6.3v6 6.3v7 6.3v8 6.3v9 32 | # 7.0v1 7.0v2 7.0v3 7.0v4) 33 | 34 | set(_nuke_KNOWN_VERSIONS 5.0 5.1 5.2 6.0 6.1 6.2 6.3 7.0 8.0) 35 | set(_nuke_TEST_VERSIONS) # List of Nuke-style strings (e.g. "7.0v4") 36 | 37 | 38 | # If Nuke_ROOT is set, don't even bother with anything else 39 | if(Nuke_ROOT) 40 | set(_nuke_TEST_PATHS ${Nuke_ROOT}) 41 | else() 42 | # TODO: Macro for duplicated nested loop code? (to generate permutations) 43 | if(Nuke_FIND_VERSION) 44 | if(Nuke_FIND_VERSION_EXACT) 45 | if(Nuke_FIND_VERSION_COUNT LESS 3) 46 | # An "exact" version was requested, but we weren't given a release. 47 | message(SEND_ERROR "'Exact' Nuke version requested, but no release specified. Nuke will not be found.") 48 | endif() 49 | set(_nuke_VERSION_STRING "${Nuke_FIND_VERSION_MAJOR}.${Nuke_FIND_VERSION_MINOR}v${Nuke_FIND_VERSION_PATCH}") 50 | if(Nuke_FIND_VERSION_TWEAK) 51 | # Beta version 52 | set(_nuke_VERSION_STRING "${_nuke_VERSION_STRING}b${Nuke_FIND_VERSION_TWEAK}") 53 | endif() 54 | list(APPEND _nuke_TEST_VERSIONS ${_nuke_VERSION_STRING}) 55 | else() 56 | if(Nuke_FIND_VERSION_COUNT LESS 3) 57 | # Partial version 58 | if(Nuke_FIND_VERSION_COUNT EQUAL 1) 59 | # E.g. 6 60 | set(_nuke_FIND_MAJORMINOR "${Nuke_FIND_VERSION}.0") 61 | set(_nuke_VERSION_PATTERN "^${Nuke_FIND_VERSION}\\.[0-9]$") 62 | # Go for highest 6.x version 63 | list(REVERSE _nuke_KNOWN_VERSIONS) 64 | elseif(Nuke_FIND_VERSION_COUNT EQUAL 2) 65 | # E.g. 6.3 66 | set(_nuke_FIND_MAJORMINOR ${Nuke_FIND_VERSION}) 67 | set(_nuke_VERSION_PATTERN "^${Nuke_FIND_VERSION_MAJOR}\\.${Nuke_FIND_VERSION_MINOR}$") 68 | endif() 69 | 70 | foreach(_known_version ${_nuke_KNOWN_VERSIONS}) 71 | # To avoid the need to keep this module up to date with the full Nuke 72 | # release list, we just build a list of possible releases for the 73 | # MAJOR.MINOR pair (currently using possible release versions v1-v13) 74 | # We don't try and auto-locate beta versions. 75 | string(REGEX MATCH ${_nuke_VERSION_PATTERN} _nuke_VERSION_PREFIX ${_known_version}) 76 | if(_nuke_VERSION_PREFIX) 77 | if(NOT ${_known_version} VERSION_LESS ${_nuke_FIND_MAJORMINOR}) 78 | foreach(_release_num RANGE 13 1 -1) 79 | list(APPEND _nuke_TEST_VERSIONS "${_known_version}v${_release_num}") 80 | endforeach() 81 | endif() 82 | endif() 83 | endforeach() 84 | else() 85 | # Full version or beta 86 | set(_nuke_VERSION_STRING "${Nuke_FIND_VERSION_MAJOR}.${Nuke_FIND_VERSION_MINOR}v${Nuke_FIND_VERSION_PATCH}") 87 | if(Nuke_FIND_VERSION_TWEAK) 88 | # Beta version 89 | set(_nuke_VERSION_STRING "${_nuke_VERSION_STRING}b${Nuke_FIND_VERSION_TWEAK}") 90 | endif() 91 | list(APPEND _nuke_TEST_VERSIONS ${_nuke_VERSION_STRING}) 92 | endif() 93 | endif() 94 | else() 95 | # If we're just grabbing any available version, we want the *highest* one 96 | # we can find, so flip the known versions list. 97 | list(REVERSE _nuke_KNOWN_VERSIONS) 98 | foreach(_known_version ${_nuke_KNOWN_VERSIONS}) 99 | foreach(_release_num RANGE 13 1 -1) 100 | list(APPEND _nuke_TEST_VERSIONS "${_known_version}v${_release_num}") 101 | endforeach() 102 | endforeach() 103 | endif() 104 | 105 | if(APPLE) 106 | set(_nuke_TEMPLATE_PATH "/Applications/Nuke/Nuke.app/Contents/MacOS") 107 | elseif(WIN32) 108 | set(_nuke_TEMPLATE_PATH "C:/Program Files/Nuke") 109 | else() # Linux 110 | set(_nuke_TEMPLATE_PATH "/usr/local/Nuke") 111 | endif() 112 | 113 | foreach(_test_version ${_nuke_TEST_VERSIONS}) 114 | string(REPLACE "" ${_test_version} _test_path ${_nuke_TEMPLATE_PATH}) 115 | list(APPEND _nuke_TEST_PATHS ${_test_path}) 116 | endforeach() 117 | endif() 118 | 119 | 120 | # Base search around DDImage, since its name is unversioned 121 | find_library(NUKE_DDIMAGE_LIBRARY DDImage 122 | PATHS ${_nuke_TEST_PATHS} 123 | DOC "Nuke DDImage library path" 124 | NO_SYSTEM_ENVIRONMENT_PATH) 125 | 126 | # Sanity-check to avoid a bunch of redundant errors. 127 | if(NUKE_DDIMAGE_LIBRARY) 128 | get_filename_component(NUKE_LIBRARY_DIRS ${NUKE_DDIMAGE_LIBRARY} PATH) 129 | 130 | find_path(NUKE_INCLUDE_DIRS DDImage/Op.h "${NUKE_LIBRARY_DIRS}/include") 131 | 132 | # Pull version information from header 133 | # (We could pull the DDImage path apart instead, but this avoids dealing 134 | # with platform-specific naming.) 135 | file(STRINGS "${NUKE_INCLUDE_DIRS}/DDImage/ddImageVersionNumbers.h" _nuke_DDIMAGE_VERSION_H) 136 | string(REGEX REPLACE ".*#define kDDImageVersionMajorNum ([0-9]+).*" "\\1" 137 | NUKE_VERSION_MAJOR ${_nuke_DDIMAGE_VERSION_H}) 138 | string(REGEX REPLACE ".*#define kDDImageVersionMinorNum ([0-9]+).*" "\\1" 139 | NUKE_VERSION_MINOR ${_nuke_DDIMAGE_VERSION_H}) 140 | string(REGEX REPLACE ".*#define kDDImageVersionReleaseNum ([0-9]+).*" "\\1" 141 | NUKE_VERSION_RELEASE ${_nuke_DDIMAGE_VERSION_H}) 142 | 143 | find_program(NUKE_EXECUTABLE 144 | NAMES 145 | Nuke 146 | "Nuke${NUKE_VERSION_MAJOR}.${NUKE_VERSION_MINOR}" 147 | "Nuke${NUKE_VERSION_MAJOR}.${NUKE_VERSION_MINOR}v${NUKE_VERSION_RELEASE}" 148 | PATHS ${NUKE_LIBRARY_DIRS} 149 | NO_SYSTEM_ENVIRONMENT_PATH 150 | DOC "Nuke executable path") 151 | endif() 152 | 153 | # Finalize search 154 | include(FindPackageHandleStandardArgs) 155 | find_package_handle_standard_args(Nuke DEFAULT_MSG 156 | NUKE_DDIMAGE_LIBRARY NUKE_INCLUDE_DIRS NUKE_LIBRARY_DIRS NUKE_EXECUTABLE) 157 | -------------------------------------------------------------------------------- /cmake/FindOpenCL.cmake: -------------------------------------------------------------------------------- 1 | #========== 2 | # 3 | # Copyright (c) 2010, Dan Bethell. 4 | # All rights reserved. 5 | # 6 | # Redistribution and use in source and binary forms, with or without 7 | # modification, are permitted provided that the following conditions are 8 | # met: 9 | # 10 | # * Redistributions of source code must retain the above copyright 11 | # notice, this list of conditions and the following disclaimer. 12 | # 13 | # * Redistributions in binary form must reproduce the above copyright 14 | # notice, this list of conditions and the following disclaimer in the 15 | # documentation and/or other materials provided with the distribution. 16 | # 17 | # * Neither the name of Dan Bethell nor the names of any 18 | # other contributors to this software may be used to endorse or 19 | # promote products derived from this software without specific prior 20 | # written permission. 21 | # 22 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS 23 | # IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 24 | # THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 25 | # PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR 26 | # CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 27 | # EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 28 | # PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 29 | # PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 30 | # LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 31 | # NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 32 | # SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 33 | # 34 | #========== 35 | # 36 | # Variables defined by this module: 37 | # OpenCL_FOUND 38 | # OpenCL_INCLUDE_DIR 39 | # OpenCL_LIBRARIES 40 | # 41 | # Usage: 42 | # FIND_PACKAGE( OpenCL ) 43 | # FIND_PACKAGE( OpenCL REQUIRED ) 44 | # 45 | #========== 46 | 47 | # try to find header 48 | find_path( OpenCL_INCLUDE_DIR CL/cl.h 49 | ${OpenCL_INSTALL_PATH}/include 50 | ) 51 | 52 | # try to find libs 53 | find_library( OpenCL_LIBRARIES OpenCL 54 | ${OpenCL_INSTALL_PATH}/lib 55 | ) 56 | 57 | # did we find everything? 58 | include( FindPackageHandleStandardArgs ) 59 | FIND_PACKAGE_HANDLE_STANDARD_ARGS( "OpenCL" DEFAULT_MSG 60 | OpenCL_LIBRARIES 61 | OpenCL_INCLUDE_DIR 62 | ) 63 | -------------------------------------------------------------------------------- /cmake/FindOpenEXR.cmake: -------------------------------------------------------------------------------- 1 | # - Find module for the OpenEXR headers and libraries 2 | # 3 | # Input variables: 4 | # OpenEXR_ROOT 5 | # OpenEXR_USE_STATIC_LIBS 6 | # 7 | # Output variables: 8 | # OPENEXR_FOUND 9 | # OPENEXR_INCLUDE_DIRS 10 | # OPENEXR__LIBRARY 11 | # OPENEXR_LIBRARIES 12 | # 13 | 14 | # Handle deprecated root hint 15 | if(OPENEXR_ROOT) 16 | message(WARNING "OPENEXR_ROOT variable is deprecated. Use OpenEXR_ROOT instead.") 17 | set(_openexr_ROOT_HINT ${OPENEXR_ROOT}) 18 | elseif(OpenEXR_ROOT) 19 | set(_openexr_ROOT_HINT ${OpenEXR_ROOT}) 20 | elseif(NOT $ENV{OPENEXR_ROOT} STREQUAL "") 21 | set(_openexr_ROOT_HINT $ENV{OPENEXR_ROOT}) 22 | endif() 23 | 24 | find_path(OPENEXR_INCLUDE_DIRS NAMES OpenEXR/ImfArray.h 25 | HINTS ${_openexr_ROOT_HINT}/include/) 26 | 27 | if(NOT _openexr_ROOT_HINT) 28 | get_filename_component(_openexr_ROOT_HINT ${OPENEXR_INCLUDE_DIRS} DIRECTORY) 29 | endif() 30 | 31 | # (Static lib search logic taken from FindBoost.cmake) 32 | if(OpenEXR_USE_STATIC_LIBS) 33 | set(_openexr_ORIG_CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES}) 34 | if(WIN32) 35 | set(CMAKE_FIND_LIBRARY_SUFFIXES .lib .a ${CMAKE_FIND_LIBRARY_SUFFIXES}) 36 | else() 37 | set(CMAKE_FIND_LIBRARY_SUFFIXES .a) 38 | endif() 39 | endif() 40 | 41 | # Determine which libraries must be found (default is all) 42 | set(_openexr_VALID_COMPONENTS 43 | IlmImf) 44 | 45 | if(OpenEXR_FIND_COMPONENTS) 46 | set(_openexr_REQUIRED_LIBS ${OpenEXR_FIND_COMPONENTS}) 47 | else() 48 | set(_openexr_REQUIRED_LIBS ${_openexr_VALID_COMPONENTS}) 49 | endif() 50 | 51 | # Grab the library paths 52 | set(_openexr_LIB_VARS) 53 | set(OPENEXR_LIBRARIES) 54 | foreach(_openexr_lib ${_openexr_REQUIRED_LIBS}) 55 | list(FIND _openexr_VALID_COMPONENTS ${_openexr_lib} _openexr_requested_index) 56 | if(_openexr_requested_index EQUAL -1) 57 | if(OpenEXR_FIND_REQUIRED) 58 | # If they "required" a lib we don't recognize, just abort here 59 | message(FATAL_ERROR "Requested component ${_openexr_lib} is not a recognized OpenEXR library") 60 | else() 61 | message(WARNING "Requested component '${_openexr_lib}' is not a recognized OpenEXR library and will be skipped") 62 | endif() 63 | else() 64 | find_library(OPENEXR_${_openexr_lib}_LIBRARY ${_openexr_lib} 65 | ${_openexr_ROOT_HINT}/lib 66 | ${_openexr_ROOT_HINT}/lib64 67 | DOC "OpenEXR ${_openexr_lib} library path") 68 | list(APPEND _openexr_LIB_VARS "OPENEXR_${_openexr_lib}_LIBRARY") 69 | list(APPEND OPENEXR_LIBRARIES ${OPENEXR_${_openexr_lib}_LIBRARY}) 70 | endif() 71 | endforeach() 72 | 73 | # Reset lib search suffix 74 | if(OpenEXR_USE_STATIC_LIBS) 75 | set(CMAKE_FIND_LIBRARY_SUFFIXES ${_openexr_ORIG_CMAKE_FIND_LIBRARY_SUFFIXES}) 76 | endif() 77 | 78 | # Finalize package search 79 | include(FindPackageHandleStandardArgs) 80 | find_package_handle_standard_args(OpenEXR 81 | REQUIRED_VARS ${_openexr_LIB_VARS} OPENEXR_INCLUDE_DIRS OPENEXR_LIBRARIES) 82 | -------------------------------------------------------------------------------- /cmake/FindOpenImageIO.cmake: -------------------------------------------------------------------------------- 1 | #========== 2 | # 3 | # Copyright (c) 2009, Dan Bethell. 4 | # All rights reserved. 5 | # 6 | # Redistribution and use in source and binary forms, with or without 7 | # modification, are permitted provided that the following conditions are 8 | # met: 9 | # 10 | # * Redistributions of source code must retain the above copyright 11 | # notice, this list of conditions and the following disclaimer. 12 | # 13 | # * Redistributions in binary form must reproduce the above copyright 14 | # notice, this list of conditions and the following disclaimer in the 15 | # documentation and/or other materials provided with the distribution. 16 | # 17 | # * Neither the name of Dan Bethell nor the names of any 18 | # other contributors to this software may be used to endorse or 19 | # promote products derived from this software without specific prior 20 | # written permission. 21 | # 22 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS 23 | # IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 24 | # THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 25 | # PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR 26 | # CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 27 | # EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 28 | # PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 29 | # PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 30 | # LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 31 | # NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 32 | # SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 33 | # 34 | #========== 35 | # 36 | # Input Variables: 37 | # OpenImageIO_USE_STATIC_LIBS 38 | # 39 | # Variables defined by this module: 40 | # OpenImageIO_FOUND 41 | # OpenImageIO_INCLUDE_DIR 42 | # OpenImageIO_LIBRARY 43 | # 44 | # Usage: 45 | # FIND_PACKAGE( OpenImageIO ) 46 | # FIND_PACKAGE( OpenImageIO REQUIRED ) 47 | # 48 | # Note: 49 | # OpenImageIO is often not installed in a system location. 50 | # If this is the case, set the IMAGEIO_PATH envvar or 51 | # OpenImageIO_INSTALL_PATH cmake variable before calling 52 | # FIND_PACKAGE. 53 | # 54 | # E.g. 55 | # SET( OpenImageIO_INSTALL_PATH "/path/to/oiio/dist/linux64" ) 56 | # FIND_PACKAGE( OpenImageIO REQUIRED ) 57 | # 58 | #========== 59 | 60 | # try to find header 61 | find_path( OpenImageIO_INCLUDE_DIR OpenImageIO/imageio.h 62 | $ENV{IMAGEIO_PATH}/include 63 | ${OpenImageIO_INSTALL_PATH}/include 64 | ) 65 | 66 | # Support preference of static libs by adjusting CMAKE_FIND_LIBRARY_SUFFIXES 67 | if( OpenImageIO_USE_STATIC_LIBS ) 68 | set( _oiio_ORIG_CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES}) 69 | if(WIN32) 70 | set(CMAKE_FIND_LIBRARY_SUFFIXES .lib .a ${CMAKE_FIND_LIBRARY_SUFFIXES}) 71 | else() 72 | set(CMAKE_FIND_LIBRARY_SUFFIXES .a ) 73 | endif() 74 | endif() 75 | 76 | # try to find libs 77 | find_library( OpenImageIO_LIBRARY OpenImageIO 78 | $ENV{IMAGEIO_PATH}/lib 79 | $ENV{IMAGEIO_LIBRARY_PATH} 80 | ${OpenImageIO_INSTALL_PATH}/lib 81 | ) 82 | 83 | # Restore the original find library ordering 84 | if( OpenImageIO_USE_STATIC_LIBS ) 85 | set(CMAKE_FIND_LIBRARY_SUFFIXES ${_oiio_ORIG_CMAKE_FIND_LIBRARY_SUFFIXES}) 86 | endif() 87 | 88 | # did we find everything? 89 | include( FindPackageHandleStandardArgs ) 90 | FIND_PACKAGE_HANDLE_STANDARD_ARGS( "OpenImageIO" DEFAULT_MSG 91 | OpenImageIO_INCLUDE_DIR 92 | OpenImageIO_LIBRARY 93 | ) 94 | -------------------------------------------------------------------------------- /cmake/FindPRMan.cmake: -------------------------------------------------------------------------------- 1 | #========== 2 | # 3 | # Copyright (c) 2010, Dan Bethell. 4 | # All rights reserved. 5 | # 6 | # Redistribution and use in source and binary forms, with or without 7 | # modification, are permitted provided that the following conditions are 8 | # met: 9 | # 10 | # * Redistributions of source code must retain the above copyright 11 | # notice, this list of conditions and the following disclaimer. 12 | # 13 | # * Redistributions in binary form must reproduce the above copyright 14 | # notice, this list of conditions and the following disclaimer in the 15 | # documentation and/or other materials provided with the distribution. 16 | # 17 | # * Neither the name of Dan Bethell nor the names of any 18 | # other contributors to this software may be used to endorse or 19 | # promote products derived from this software without specific prior 20 | # written permission. 21 | # 22 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS 23 | # IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 24 | # THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 25 | # PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR 26 | # CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 27 | # EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 28 | # PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 29 | # PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 30 | # LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 31 | # NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 32 | # SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 33 | # 34 | #========== 35 | # 36 | # Variables defined by this module: 37 | # PRMan_FOUND 38 | # PRMan_INCLUDE_DIR 39 | # PRMan_COMPILE_FLAGS 40 | # PRMan_LIBRARIES 41 | # PRMan_LIBRARY_DIR 42 | # 43 | # Usage: 44 | # FIND_PACKAGE( PRMan ) 45 | # FIND_PACKAGE( PRMan REQUIRED ) 46 | # 47 | # Note: 48 | # You can tell the module where PRMan is installed by setting 49 | # the PRMan_INSTALL_PATH (or setting the RMANTREE environment 50 | # variable) before calling FIND_PACKAGE. 51 | # 52 | # E.g. 53 | # SET( PRMan_INSTALL_PATH "/opt/pixar/RenderManProServer-15.0" ) 54 | # FIND_PACKAGE( PRMan REQUIRED ) 55 | # 56 | #========== 57 | 58 | # our includes 59 | find_path( PRMan_INCLUDE_DIR ri.h 60 | $ENV{RMANTREE}/include 61 | ${PRMan_INSTALL_PATH}/include 62 | ) 63 | 64 | # our library itself 65 | find_library( PRMan_LIBRARIES prman 66 | $ENV{RMANTREE}/lib 67 | ${PRMan_INSTALL_PATH}/lib 68 | ) 69 | 70 | # our compilation flags 71 | SET( PRMan_COMPILE_FLAGS "-DPRMAN -fPIC" ) 72 | 73 | # did we find everything? 74 | include( FindPackageHandleStandardArgs ) 75 | FIND_PACKAGE_HANDLE_STANDARD_ARGS( "PRMan" DEFAULT_MSG 76 | PRMan_INCLUDE_DIR 77 | PRMan_LIBRARIES 78 | ) 79 | -------------------------------------------------------------------------------- /cmake/FindQHull.cmake: -------------------------------------------------------------------------------- 1 | # 2 | # In: 3 | # QHULL_ROOT (alternatively, make sure 'qhull' is on $PATH) 4 | # 5 | # Out: 6 | # QHULL_FOUND 7 | # QHULL_VERSION 8 | # QHULL_BINARY 9 | # 10 | # Note: includes, libs not detected yet, add if/when needed. 11 | # 12 | 13 | find_program(QHULL_BINARY qhull PATHS ${QHULL_ROOT}/bin) 14 | 15 | if(QHULL_BINARY STREQUAL "QHULL_BINARY-NOTFOUND") 16 | set(QHULL_FOUND FALSE) 17 | else() 18 | set(QHULL_FOUND TRUE) 19 | execute_process(COMMAND "${QHULL_BINARY}" OUTPUT_VARIABLE _QHULL_OUT) 20 | string(REGEX MATCH "([0-9]+\\.[0-9]+)" QHULL_VERSION "${_QHULL_OUT}") 21 | endif() 22 | 23 | 24 | # 25 | # Copyright 2012, Allan Johns 26 | # 27 | # vfxcmake is free software: you can redistribute it and/or modify 28 | # it under the terms of the GNU Lesser General Public License as published by 29 | # the Free Software Foundation, either version 3 of the License, or 30 | # (at your option) any later version. 31 | # 32 | # vfxcmake is distributed in the hope that it will be useful, 33 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 34 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 35 | # GNU General Public License for more details. 36 | # 37 | # You should have received a copy of the GNU Lesser General Public License 38 | # along with vfxcmake. If not, see . 39 | # 40 | -------------------------------------------------------------------------------- /cmake/FindTbb.cmake: -------------------------------------------------------------------------------- 1 | # 2 | # In: 3 | # TBB_ROOT 4 | # 5 | # Out: 6 | # TBB_FOUND 7 | # TBB_VERSION 8 | # TBB_MAJOR_VERSION 9 | # TBB_MINOR_VERSION 10 | # TBB_INCLUDE_DIRS 11 | # TBB_LIBRARY_DIRS 12 | # 13 | 14 | set(TBB_FOUND FALSE) 15 | unset(TBBROOT CACHE) # so we can be called multiple times 16 | find_path(TBBROOT NAMES include/tbb/tbb.h HINTS ${TBB_ROOT}) 17 | 18 | if(TBBROOT) 19 | set(TBB_INCLUDE_DIRS ${TBBROOT}/include) 20 | set(TBB_LIBRARY_DIRS ${TBBROOT}/lib) 21 | 22 | file(READ "${TBB_INCLUDE_DIRS}/tbb/tbb_stddef.h" _TBB_CONTENTS) 23 | string(REGEX REPLACE ".*#define TBB_VERSION_MAJOR ([0-9]+).*" "\\1" TBB_MAJOR_VERSION "${_TBB_CONTENTS}") 24 | string(REGEX REPLACE ".*#define TBB_VERSION_MINOR ([0-9]+).*" "\\1" TBB_MINOR_VERSION "${_TBB_CONTENTS}") 25 | set(TBB_VERSION "${TBB_MAJOR_VERSION}.${TBB_MINOR_VERSION}") 26 | 27 | set(TBB_FOUND TRUE) 28 | endif() 29 | 30 | if(Tbb_FIND_REQUIRED AND NOT TBB_FOUND) 31 | message(FATAL_ERROR "Could not find tbb") 32 | endif() 33 | 34 | 35 | # 36 | # Copyright 2012, Allan Johns 37 | # 38 | # vfxcmake is free software: you can redistribute it and/or modify 39 | # it under the terms of the GNU Lesser General Public License as published by 40 | # the Free Software Foundation, either version 3 of the License, or 41 | # (at your option) any later version. 42 | # 43 | # vfxcmake is distributed in the hope that it will be useful, 44 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 45 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 46 | # GNU General Public License for more details. 47 | # 48 | # You should have received a copy of the GNU Lesser General Public License 49 | # along with vfxcmake. If not, see . 50 | # 51 | -------------------------------------------------------------------------------- /cmake/GetBoost.cmake: -------------------------------------------------------------------------------- 1 | # 2 | # Wrapper for cmake's native FindBoost that adds some functionality. Don't use cmake's find_package() 3 | # function here - call GetBoost() instead, and pass the args you would have passed to find_package, 4 | # minus the leading 'Boost' argument. 5 | # 6 | # Extra out: 7 | # Boost_NORMALIZED_VERSION: Version in the form X.X.X 8 | # 9 | macro(GetBoost) 10 | # so we can be called multiple times 11 | unset(Boost_INCLUDE_DIR CACHE) 12 | unset(Boost_LIBRARY_DIRS CACHE) 13 | unset(Boost_FOUND) 14 | 15 | set(Boost_DETAILED_FAILURE_MSG 1) 16 | find_package(Boost ${ARGV}) 17 | 18 | if(Boost_FOUND) 19 | set(Boost_NORMALIZED_VERSION ${Boost_MAJOR_VERSION}.${Boost_MINOR_VERSION}.${Boost_SUBMINOR_VERSION}) 20 | endif() 21 | endmacro(GetBoost) 22 | 23 | 24 | # 25 | # Copyright 2012, Allan Johns 26 | # 27 | # vfxcmake is free software: you can redistribute it and/or modify 28 | # it under the terms of the GNU Lesser General Public License as published by 29 | # the Free Software Foundation, either version 3 of the License, or 30 | # (at your option) any later version. 31 | # 32 | # vfxcmake is distributed in the hope that it will be useful, 33 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 34 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 35 | # GNU General Public License for more details. 36 | # 37 | # You should have received a copy of the GNU Lesser General Public License 38 | # along with vfxcmake. If not, see . 39 | # 40 | -------------------------------------------------------------------------------- /cmake/GetCXXCompiler.cmake: -------------------------------------------------------------------------------- 1 | # 2 | # Get information about the C++ compiler. 3 | # 4 | # Out: 5 | # ${_PREFIX}_COMPILER_BINARY 6 | # ${_PREFIX}_COMPILER_VERSION 7 | # 8 | # Any variable that could not be determined will be set to 'FALSE' 9 | # 10 | function(GetCXXCompiler _PREFIX) 11 | set(${_PREFIX}_COMPILER_BINARY ${CMAKE_CXX_COMPILER} PARENT_SCOPE) 12 | set(${_PREFIX}_COMPILER_VERSION FALSE PARENT_SCOPE) 13 | 14 | execute_process(COMMAND ${CMAKE_CXX_COMPILER} ${CMAKE_CXX_COMPILER_ARG1} -dumpversion 15 | OUTPUT_VARIABLE _VER_PROC_OUT RESULT_VARIABLE _PROC_RES ERROR_QUIET) 16 | 17 | if(_PROC_RES) 18 | execute_process(COMMAND ${CMAKE_CXX_COMPILER} ${CMAKE_CXX_COMPILER_ARG1} --version 19 | OUTPUT_VARIABLE _VER_PROC_OUT RESULT_VARIABLE _PROC_RES ERROR_QUIET) 20 | endif() 21 | 22 | if(NOT _PROC_RES) 23 | string(REGEX MATCH "[0-9]+(\\.[0-9]+)*" _COMPILER_VERSION ${_VER_PROC_OUT}) 24 | if(_COMPILER_VERSION) 25 | set(${_PREFIX}_COMPILER_VERSION ${_COMPILER_VERSION} PARENT_SCOPE) 26 | endif() 27 | endif() 28 | endfunction(GetCXXCompiler) 29 | 30 | 31 | 32 | # 33 | # Copyright 2012, Allan Johns 34 | # 35 | # vfxcmake is free software: you can redistribute it and/or modify 36 | # it under the terms of the GNU Lesser General Public License as published by 37 | # the Free Software Foundation, either version 3 of the License, or 38 | # (at your option) any later version. 39 | # 40 | # vfxcmake is distributed in the hope that it will be useful, 41 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 42 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 43 | # GNU General Public License for more details. 44 | # 45 | # You should have received a copy of the GNU Lesser General Public License 46 | # along with vfxcmake. If not, see . 47 | # 48 | 49 | 50 | 51 | -------------------------------------------------------------------------------- /cmake/GetPython.cmake: -------------------------------------------------------------------------------- 1 | # 2 | # Wrapper for cmake's native FindPythonLibs that adds some functionality. Don't use cmake's 3 | # find_package() function here - call GetPython() instead, and pass the args you would have passed 4 | # to find_package, minus the leading 'PythonLibs' argument. 5 | # 6 | # Extra In: 7 | # PYTHON_ROOT: Where to find python. If not supplied, this code will look for a visible python 8 | # binary and work it out from there. If that still fails, we fall back to cmake's FindPythonLibs. 9 | # 10 | # Extra Out: 11 | # PYTHON_FOUND 12 | # PYTHON_VERSION 13 | # PYTHON_VERSION_MAJOR 14 | # PYTHON_VERSION_MINOR 15 | # PYTHON_VERSION_PATCH 16 | # PYTHON_LIBRARY_DIRS 17 | # PYTHON_LIBRARIES 18 | # 19 | 20 | macro(GetPython) 21 | set(PYTHON_FOUND FALSE) 22 | unset(PYROOT CACHE) 23 | unset(_PYROOT_VERIFY CACHE) 24 | unset(PYTHON_INCLUDE_DIR CACHE) 25 | unset(PYTHON_LIBRARY CACHE) 26 | unset(PYTHON_LIBRARIES CACHE) 27 | unset(PYTHON_EXECUTABLE CACHE) 28 | 29 | if(PYTHON_ROOT) 30 | find_path(PYROOT NAMES bin/python HINTS ${PYTHON_ROOT}) 31 | endif() 32 | 33 | if(NOT PYROOT) 34 | find_package(PythonInterp ${ARGV} QUIET) 35 | if(PYTHONINTERP_FOUND) 36 | get_filename_component(PYROOT ${PYTHON_EXECUTABLE} PATH) 37 | get_filename_component(PYROOT ${PYROOT} PATH) 38 | find_path(_PYROOT_VERIFY NAMES bin/python HINTS ${PYROOT}) 39 | if(NOT _PYROOT_VERIFY) 40 | unset(PYROOT) 41 | endif() 42 | endif() 43 | endif() 44 | 45 | if(PYROOT) 46 | execute_process(COMMAND "${PYROOT}/bin/python" --version 47 | ERROR_VARIABLE _VERSION OUTPUT_QUIET ERROR_STRIP_TRAILING_WHITESPACE) 48 | string(REPLACE "Python " "" PYTHON_VERSION "${_VERSION}") 49 | string(REGEX REPLACE "^([0-9]+)\\.[0-9]+\\.[0-9]+.*" "\\1" PYTHON_VERSION_MAJOR "${PYTHON_VERSION}") 50 | string(REGEX REPLACE "^[0-9]+\\.([0-9])+\\.[0-9]+.*" "\\1" PYTHON_VERSION_MINOR "${PYTHON_VERSION}") 51 | string(REGEX REPLACE "^[0-9]+\\.[0-9]+\\.([0-9]+).*" "\\1" PYTHON_VERSION_PATCH "${PYTHON_VERSION}") 52 | 53 | # TODO do more checks here instead of assuming pythonX.X 54 | set(PYNAME "python${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}") 55 | set(PYTHON_INCLUDE_PATH ${PYROOT}/include/${PYNAME}) 56 | set(PYTHON_INCLUDE_DIRS ${PYTHON_INCLUDE_PATH}) 57 | set(PYTHON_LIBRARY_DIRS ${PYROOT}/lib) 58 | set(PYTHON_LIBRARIES ${PYROOT}/lib/lib${PYNAME}.so) 59 | else() 60 | find_package(PythonLibs ${ARGV}) 61 | if(PYTHONLIBS_FOUND) 62 | set(PYTHON_FOUND TRUE) 63 | get_filename_component(PYTHON_LIBRARY_DIRS ${PYTHON_LIBRARIES} PATH) 64 | get_filename_component(PYTHON_LIBRARIES ${PYTHON_LIBRARIES} NAME) 65 | endif() 66 | endif() 67 | endmacro(GetPython) 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | -------------------------------------------------------------------------------- /contrib/style_guide.md: -------------------------------------------------------------------------------- 1 | vfxcmake Style Guide 2 | ==================== 3 | 4 | **By Nathan Rusch** 5 | 6 | This document proposes some conventions for code style within the vfxcmake 7 | project, based mostly on conventions observed in the original modules, with 8 | some minor changes aimed at minimizing clutter. 9 | 10 | Though CMake does not define any syntactic or stylistic conventions for Find 11 | modules, this makes an attempt to adhere to a few de facto conventions that 12 | align with the CMake recommendations and documented examples where possible. 13 | 14 | 15 | Spacing 16 | ------- 17 | - Nested blocks are each indented 4 spaces, in line with Python's PEP-8 style 18 | guide. 19 | 20 | ```cmake 21 | if(APPLE) 22 | message(STATUS "I think this is a Mac") 23 | elseif(WIN32) 24 | message(STATUS "This appears to be Windows") 25 | else() 26 | message(STATUS "I'm going to assume this is Linux") 27 | endif() 28 | ``` 29 | 30 | - Line splitting for command flags and arguments is left to the discretion of 31 | the module author. Hanging indents should be to the next block level. 32 | 33 | ```cmake 34 | find_path(MAYA_INCLUDE_DIRS maya/MFn.h 35 | HINTS ${MAYA_LOCATION} 36 | PATH_SUFFIXES 37 | include # linux and windows 38 | ../../devkit/include # osx 39 | DOC "Maya's include path") 40 | ``` 41 | 42 | - Leading and trailing spaces should be omitted from commands and parenthesized 43 | expressions. 44 | 45 | ```cmake 46 | foreach(version ${_maya_KNOWN_VERSIONS}) 47 | if(NOT "${version}" VERSION_LESS "${Maya_FIND_VERSION}") 48 | list(APPEND _maya_TEST_VERSIONS "${version}") 49 | endif() 50 | endforeach() 51 | ``` 52 | 53 | - Hanging opening or closing parentheses should be avoided. 54 | 55 | 56 | Keywords 57 | -------- 58 | - Keywords for commands (e.g. `find_package`), flow control (e.g. `if`, 59 | `foreach`), or anything else included in the "Commands" section of the CMake 60 | documentation are lower-case. 61 | - Keywords that serve as flags or arguments to commands, comparison operators, 62 | etc. are upper-case (e.g. `STREQUAL`, `APPEND`). 63 | 64 | 65 | Variables 66 | --------- 67 | - Input variables should be prefixed with the 68 | target name cased to match the package name as it is represented in the "Find" 69 | module's filename (e.g. `Maya_FIND_VERSION`). 70 | - Output variables should be prefixed with 71 | the target name in **upper-case** (e.g. `MAYA_FOUND`, `MAYA_LIBRARY_DIRS`). 72 | - Private module variables should begin with an underscore and some 73 | variation the target name, typically in **lower-case** (e.g. `_maya_DEFINES`). 74 | - Path output variable should generally be plural (e.g. `MAYA_INCLUDE_DIRS`) 75 | 76 | Functions and Macros 77 | -------------------- 78 | - Definition termination commands for functions and macros are called with the 79 | name of the function or macro (e.g. `endmacro(MAYA_SET_PLUGIN_PROPERTIES)`). 80 | 81 | 82 | Flow Control 83 | ------------ 84 | - Flow control termination commmands are invoked without the expressions from 85 | the matching start commands (e.g. `endif()`, `endforeach()`). 86 | - Flow control start/end commands should be at the same indent level. 87 | 88 | Documentation 89 | ------------- 90 | 91 | Each `Find*.cmake` file should have a header describing the input and output variables, macros, and environment variables that influence discovery. 92 | 93 | ```cmake 94 | # Input variables: 95 | # Alembic_ROOT 96 | # Alembic_USE_STATIC_LIBS 97 | # 98 | # Input environment variables: 99 | # ALEMBIC_ROOT 100 | # 101 | # Output variables: 102 | # ALEMBIC_FOUND 103 | # ALEMBIC_INCLUDE_DIRS 104 | # ALEMBIC__LIBRARY 105 | # ALEMBIC_LIBRARIES 106 | # 107 | ``` 108 | --------------------------------------------------------------------------------