From 6851f05292acfe551b503f5ef43a2ac2c35c596f Mon Sep 17 00:00:00 2001 From: Andy Galasso Date: Sat, 4 Jan 2025 17:13:39 -0500 Subject: [PATCH 1/4] PlayerOne cameras: update to SDK version V3.7.1 (#1278) * PlayerOne cameras: update to SDK version V3.7.1 * Merge prior work on PlayerOne cameras with Ethan's * format source files with clang-format * tested on Mac and Windows * Linux: install the soname symlinks for playerone shared lib --- CMakeLists.txt | 18 +- build/unpack_playerone_sdk | 72 ++++++ cameras/PlayerOneCamera.lib | Bin 13960 -> 0 bytes .../{ => playerone/include}/PlayerOneCamera.h | 0 .../linux/arm32/libPlayerOneCamera.so | 0 .../linux/arm32/libPlayerOneCamera.so.3 | 0 .../linux/arm32/libPlayerOneCamera.so.3.7 | 0 .../linux/arm32/libPlayerOneCamera.so.3.7.1 | Bin .../linux/arm64/libPlayerOneCamera.so | 0 .../linux/arm64/libPlayerOneCamera.so.3 | 0 .../linux/arm64/libPlayerOneCamera.so.3.7 | 0 .../linux/arm64/libPlayerOneCamera.so.3.7.1 | Bin .../linux/x64/libPlayerOneCamera.so | 0 .../linux/x64/libPlayerOneCamera.so.3 | 0 .../linux/x64/libPlayerOneCamera.so.3.7 | 0 .../linux/x64/libPlayerOneCamera.so.3.7.1 | Bin .../linux/x86/libPlayerOneCamera.so | 0 .../linux/x86/libPlayerOneCamera.so.3 | 0 .../linux/x86/libPlayerOneCamera.so.3.7 | 0 .../linux/x86/libPlayerOneCamera.so.3.7.1 | Bin .../mac/libPlayerOneCamera.dylib} | Bin .../playerone/win}/PlayerOneCamera.dll | Bin 520392 -> 520392 bytes cameras/playerone/win/PlayerOneCamera.lib | Bin 0 -> 13960 bytes .../poalibs/mac/libPlayerOneCamera.3.7.dylib | 1 - .../poalibs/mac/libPlayerOneCamera.3.dylib | 1 - cameras/poalibs/mac/libPlayerOneCamera.dylib | 1 - src/{cam_poa.cpp => cam_playerone.cpp} | 216 +++++++++--------- src/cam_playerone.h | 45 ++++ src/cam_poa.h | 45 ---- src/camera.cpp | 22 +- src/cameras.h | 14 +- thirdparty/thirdparty.cmake | 75 +++--- 32 files changed, 298 insertions(+), 212 deletions(-) create mode 100755 build/unpack_playerone_sdk delete mode 100644 cameras/PlayerOneCamera.lib rename cameras/{ => playerone/include}/PlayerOneCamera.h (100%) rename cameras/{poalibs => playerone}/linux/arm32/libPlayerOneCamera.so (100%) rename cameras/{poalibs => playerone}/linux/arm32/libPlayerOneCamera.so.3 (100%) rename cameras/{poalibs => playerone}/linux/arm32/libPlayerOneCamera.so.3.7 (100%) rename cameras/{poalibs => playerone}/linux/arm32/libPlayerOneCamera.so.3.7.1 (100%) mode change 100644 => 100755 rename cameras/{poalibs => playerone}/linux/arm64/libPlayerOneCamera.so (100%) rename cameras/{poalibs => playerone}/linux/arm64/libPlayerOneCamera.so.3 (100%) rename cameras/{poalibs => playerone}/linux/arm64/libPlayerOneCamera.so.3.7 (100%) rename cameras/{poalibs => playerone}/linux/arm64/libPlayerOneCamera.so.3.7.1 (100%) mode change 100644 => 100755 rename cameras/{poalibs => playerone}/linux/x64/libPlayerOneCamera.so (100%) rename cameras/{poalibs => playerone}/linux/x64/libPlayerOneCamera.so.3 (100%) rename cameras/{poalibs => playerone}/linux/x64/libPlayerOneCamera.so.3.7 (100%) rename cameras/{poalibs => playerone}/linux/x64/libPlayerOneCamera.so.3.7.1 (100%) mode change 100644 => 100755 rename cameras/{poalibs => playerone}/linux/x86/libPlayerOneCamera.so (100%) rename cameras/{poalibs => playerone}/linux/x86/libPlayerOneCamera.so.3 (100%) rename cameras/{poalibs => playerone}/linux/x86/libPlayerOneCamera.so.3.7 (100%) rename cameras/{poalibs => playerone}/linux/x86/libPlayerOneCamera.so.3.7.1 (100%) mode change 100644 => 100755 rename cameras/{poalibs/mac/libPlayerOneCamera.3.7.1.dylib => playerone/mac/libPlayerOneCamera.dylib} (100%) mode change 100644 => 100755 rename {WinLibs => cameras/playerone/win}/PlayerOneCamera.dll (99%) mode change 100644 => 100755 create mode 100644 cameras/playerone/win/PlayerOneCamera.lib delete mode 120000 cameras/poalibs/mac/libPlayerOneCamera.3.7.dylib delete mode 120000 cameras/poalibs/mac/libPlayerOneCamera.3.dylib delete mode 120000 cameras/poalibs/mac/libPlayerOneCamera.dylib rename src/{cam_poa.cpp => cam_playerone.cpp} (85%) create mode 100644 src/cam_playerone.h delete mode 100644 src/cam_poa.h diff --git a/CMakeLists.txt b/CMakeLists.txt index 67595f64..a7390f2f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -200,8 +200,8 @@ set(cam_SRC ${phd_src_dir}/cam_openssag.h ${phd_src_dir}/cam_OSPL130.cpp ${phd_src_dir}/cam_OSPL130.h - ${phd_src_dir}/cam_poa.cpp - ${phd_src_dir}/cam_poa.h + ${phd_src_dir}/cam_playerone.cpp + ${phd_src_dir}/cam_playerone.h ${phd_src_dir}/cam_qguide.cpp ${phd_src_dir}/cam_qguide.h ${phd_src_dir}/cam_qhy.cpp @@ -725,6 +725,20 @@ if(APPLE) ) endif() + if(playerone) + set_source_files_properties(${playerone} PROPERTIES MACOSX_PACKAGE_LOCATION Frameworks) + add_custom_command( + TARGET phd2 + POST_BUILD + COMMAND install_name_tool -change libPlayerOneCamera.3.dylib + @executable_path/../Frameworks/libPlayerOneCamera.dylib $ + COMMAND install_name_tool -change @loader_path/libusb-1.0.0.dylib + @executable_path/../Frameworks/libusb_openphd.dylib + $/../Frameworks/libPlayerOneCamera.dylib + COMMENT "Updating dylib path for libPlayerOneCamera.dylib" + ) + endif() + add_custom_command( TARGET phd2 POST_BUILD diff --git a/build/unpack_playerone_sdk b/build/unpack_playerone_sdk new file mode 100755 index 00000000..f5ba84e3 --- /dev/null +++ b/build/unpack_playerone_sdk @@ -0,0 +1,72 @@ +#!/usr/bin/env bash + +# usage: unpack_playerone_sdk \ +# PlayerOne_Camera_SDK_MacOS_V3.6.3.tar.gz \ +# PlayerOne_Camera_SDK_Windows_V3.6.3.zip \ +# PlayerOne_Camera_SDK_Linux_V3.6.3.tar.gz + +die () { + echo "Error: $*" >&2 + exit 1 +} + +# === main === + +SCRIPT_DIR=$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" &> /dev/null && pwd) +SCRIPT_NAME=${BASH_SOURCE[0]##*/} + +set -x +set -e +set -o pipefail + +linux= +mac= +win= + +for file in "$@"; do + case $file in + *PlayerOne*_Linux_*) linux=$file ;; + *PlayerOne*_MacOS_*) mac=$file ;; + *PlayerOne*_Windows_*) win=$file ;; + esac +done + +if [[ ! -f $linux || ! -f $mac || ! -f $win ]]; then + echo "usage: $SCRIPT_NAME LINUX_SDK MAC_SDK WINDOWS_SDK" >&2 + exit 1 +fi + +top=$(cd "$SCRIPT_DIR" && git rev-parse --show-toplevel) +dest=$top/cameras/playerone + +TMP=$(mktemp -d) +trap 'rm -rf "$TMP"' EXIT + +# linux + include +tar xf "$linux" -C "$TMP" +( + cd "$TMP"/*_Linux_* + install -d -m 0755 "$dest"/include/ "$dest"/linux + install -m 0644 include/PlayerOneCamera.h "$dest"/include/ + cd lib + # include shared lib symlinks + tar cf - . | tar xf - -C "$dest"/linux +) + +# mac +tar xf "$mac" -C "$TMP" +( + cd "$TMP"/*_MacOS_* + install -d -m 0755 "$dest"/mac + install -m 0755 lib/libPlayerOneCamera.dylib "$dest"/mac/ +) + +# windows +mkdir "$TMP/win" +unzip -d "$TMP/win" "$win" +( + cd "$TMP"/win + install -d -m 0755 "$dest"/win + install -m 0644 lib/x86/PlayerOneCamera.lib "$dest"/win/ + install -m 0755 lib/x86/PlayerOneCamera.dll "$dest"/win/ +) diff --git a/cameras/PlayerOneCamera.lib b/cameras/PlayerOneCamera.lib deleted file mode 100644 index 44609d497daed26975f238e78f788f2fe2836e4e..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 13960 zcmcgy&2Jn<7Jp7)lQkijBtXcQ#~+F9*zxyFVrjLC?a9X|jy=jaEC&>461SZJ&-AEg ztc~};UN~@wxFR7AoRKzv0f(%FIG{a5NQ<h5|~UEOg@XrNcRQ2vZ_;dF}PJgB@PG6cSTrA}0bpB-UIXyR5kU#Hs6Ol`Fe1Yi1 zBchXE6ZO6?Dfc6hpuP=B7akJ{8v9bx=`kWfgUgcopArcgSduhxgh){T9Z3VZkAVWt*#ZXR2FZQ%Bw54*2-Je9miW~IE&S~<5g*GZTa@nQe2V#ZfHuq)$6yH zZ>$yPSLbQ1yfS~yX-hkc?slUMW3_s7%_iWwWzTIoUc2VBYz4T~UTR^dR7@`^HBfq` z=`^B-hIQji=#(0@pb^X{XF_Lj%WbJ13k_-9pssFXqqfv8h*E6G+|pa_KF{Yt>w1ZE(KStQ2op zH8~%eXtDG!Yd0CV#+CNu>?~{D70peb9a?j@9Ix#D)$vS&Odxe{R^M}qRqs7rQE{PF zYT*+-W2otDX{}hUTzA{$+QZccp3{2ZZmsKfZStt(BGglh#uZSu==zl{R~QoGagBwY zg<88_ZQ3-IOxEX0qk3=4L4BDrhJ>+&<#MG6AAm|bTg%(^ds=_ngeW7N21KjEe5uZ- zTTBvaV|W&}H#RiuzA_U)H<}7p|AOg%wR~+JvyW9jK`u*{T9xf))Aib`UTt&JEEkue z6uM*8+Z3)x_6mcFizG^tKB{Jjr2h5odJSz^b?SW3pv?tY@?9bqT;8BNS6kPj!Y2U!S8SI`?q1Dt20C&;{8-a z%0oooPZ9Ot`)z!GnumUY=m*#v}HP5qgpSKqu%hy+nuT73!wbbe0Bakml$Zoub$22=!2bhNzFuP%mAg zlXQ^A=m5>oEWJ#_be_iP0!`6t^adTJS80@Tbdmb$IK4?-wC}m%?e}AIGdfLJg3ojh za`MF;x)%6LCCSoP9G8S{Ia++X4feSa6?X_TmRK}f#2lFR?Zg6AX+8`>q-t{bVc8#d zu_H^Xd<_Q&C_ex)BS#)6`3fuwM1T0KiW$24VW1ysOE9YkLuq3#7Mv)e3eS6r6U123 zq+&;*5{k$Dm|wvlRzykToE6(fjkDTrb_H0C!Uez5(U%A*LTPO8$MUdlsVEImY$KO; z^c@hY+L(pkY=}ZuG(-_2It@w7TF?O{)xTjI;(ZIXShVO5y$bk+@iq_j<0t>!rwCLS zulbrNxVL#6B}@xdQ~(m`V>WRg#QB;hiVJjq6qhH(kh@G%B&8z)Kc(TB=WR4fx)|=W z;w6-npW)+r%zwp&p%>#4n=j*X&7*Mv_iH9!J5q3==Hs|Pt(q7&;k+0wshGZ8SaEi= zyfjg2oX5Q(FU6Olou7L8j2|oFgnQ4(K+K2g5*9{B0yvg%qmA?8 z2Q}tfxw_TE8VWH#%jL}5a<*mmgkCi^O+tY&O(J%Dnn0v{F^9EI1866WCPcb-R>l&u zH_TH%Gaox)g#ORW^oJ?`+}&;?*E_zxwM7$=T;2yf%U*suAKW3_?Oy8IPow{OVe@1c zqIX2wc)G^doqOAxgBAHnRKkx(;YaYkOg#(ZwRPl(260}H&oR9I4fi+SauCCvI4`D?~@rcUqqp%Au zRLSb?`cZSLB=Ep&q*W} z@lu!Yc7uLv5BdQ*kBDtPN8!8; zGIMLE?X5*}2(B+^ZHO2h7CM0(xgMjfNE^YuOJw~h(h=0?HeR1mNRVMGiBS1L#|E2u zWD5y18HqFG!wg*Q9A$&gI?DNr_E8p#_JD~lPH8sK>}^h%%}7WB(`YkGP}#t( zY{u+D0uvERBDR0T>;%60uaEdV>o)P_0oDeaxzE!)$V&`Yo{w#inR_~AlnU?dT zVp*{-CSZ%`?d4=_cDC7j>I`neekmfq*A#A)k+6Yg?dP;z@^u5#&z9LhJKDo<7^p#(r8BrGF~M;I*H7Yf1hp__ zk3>c=u5X&CVUDOX$O(Ieh(=B@WHVD~1J69O5~2|i>x%o$;2w(QLH8Q<6hl=vPn|$b zJ3pPap~@Vt4Lb8$Dx{od&e*X16tN9D>jt2Pdrz~y2ncJKXlYvI0JAk>B3y@iU zd(ScZLQIuD?+j*&zv>S$d3L@ts42ZW5TLT;e@8IWV!FWq)4W@-0cV}VX;IZ#j;n4i zY_Qp9aDrzRS&wr8E^_+8#fS|ub4ydAiy;#c*Df8wOo^n1Ii|YQvB75U-9o~;!N2z4 zzj5T=gWk2>8FdCfp|3^eqX{cRH3U2FB@p)K2OVAjw#g6Mz1OJ z>w%CDe>c!!ekevoj^^CX{HtG9>g?h kJK&5$)^2$_(c-l8{cMP<-63}bHN{8eBUE-nZ3FH8Kl9Z)?*IS* diff --git a/cameras/PlayerOneCamera.h b/cameras/playerone/include/PlayerOneCamera.h similarity index 100% rename from cameras/PlayerOneCamera.h rename to cameras/playerone/include/PlayerOneCamera.h diff --git a/cameras/poalibs/linux/arm32/libPlayerOneCamera.so b/cameras/playerone/linux/arm32/libPlayerOneCamera.so similarity index 100% rename from cameras/poalibs/linux/arm32/libPlayerOneCamera.so rename to cameras/playerone/linux/arm32/libPlayerOneCamera.so diff --git a/cameras/poalibs/linux/arm32/libPlayerOneCamera.so.3 b/cameras/playerone/linux/arm32/libPlayerOneCamera.so.3 similarity index 100% rename from cameras/poalibs/linux/arm32/libPlayerOneCamera.so.3 rename to cameras/playerone/linux/arm32/libPlayerOneCamera.so.3 diff --git a/cameras/poalibs/linux/arm32/libPlayerOneCamera.so.3.7 b/cameras/playerone/linux/arm32/libPlayerOneCamera.so.3.7 similarity index 100% rename from cameras/poalibs/linux/arm32/libPlayerOneCamera.so.3.7 rename to cameras/playerone/linux/arm32/libPlayerOneCamera.so.3.7 diff --git a/cameras/poalibs/linux/arm32/libPlayerOneCamera.so.3.7.1 b/cameras/playerone/linux/arm32/libPlayerOneCamera.so.3.7.1 old mode 100644 new mode 100755 similarity index 100% rename from cameras/poalibs/linux/arm32/libPlayerOneCamera.so.3.7.1 rename to cameras/playerone/linux/arm32/libPlayerOneCamera.so.3.7.1 diff --git a/cameras/poalibs/linux/arm64/libPlayerOneCamera.so b/cameras/playerone/linux/arm64/libPlayerOneCamera.so similarity index 100% rename from cameras/poalibs/linux/arm64/libPlayerOneCamera.so rename to cameras/playerone/linux/arm64/libPlayerOneCamera.so diff --git a/cameras/poalibs/linux/arm64/libPlayerOneCamera.so.3 b/cameras/playerone/linux/arm64/libPlayerOneCamera.so.3 similarity index 100% rename from cameras/poalibs/linux/arm64/libPlayerOneCamera.so.3 rename to cameras/playerone/linux/arm64/libPlayerOneCamera.so.3 diff --git a/cameras/poalibs/linux/arm64/libPlayerOneCamera.so.3.7 b/cameras/playerone/linux/arm64/libPlayerOneCamera.so.3.7 similarity index 100% rename from cameras/poalibs/linux/arm64/libPlayerOneCamera.so.3.7 rename to cameras/playerone/linux/arm64/libPlayerOneCamera.so.3.7 diff --git a/cameras/poalibs/linux/arm64/libPlayerOneCamera.so.3.7.1 b/cameras/playerone/linux/arm64/libPlayerOneCamera.so.3.7.1 old mode 100644 new mode 100755 similarity index 100% rename from cameras/poalibs/linux/arm64/libPlayerOneCamera.so.3.7.1 rename to cameras/playerone/linux/arm64/libPlayerOneCamera.so.3.7.1 diff --git a/cameras/poalibs/linux/x64/libPlayerOneCamera.so b/cameras/playerone/linux/x64/libPlayerOneCamera.so similarity index 100% rename from cameras/poalibs/linux/x64/libPlayerOneCamera.so rename to cameras/playerone/linux/x64/libPlayerOneCamera.so diff --git a/cameras/poalibs/linux/x64/libPlayerOneCamera.so.3 b/cameras/playerone/linux/x64/libPlayerOneCamera.so.3 similarity index 100% rename from cameras/poalibs/linux/x64/libPlayerOneCamera.so.3 rename to cameras/playerone/linux/x64/libPlayerOneCamera.so.3 diff --git a/cameras/poalibs/linux/x64/libPlayerOneCamera.so.3.7 b/cameras/playerone/linux/x64/libPlayerOneCamera.so.3.7 similarity index 100% rename from cameras/poalibs/linux/x64/libPlayerOneCamera.so.3.7 rename to cameras/playerone/linux/x64/libPlayerOneCamera.so.3.7 diff --git a/cameras/poalibs/linux/x64/libPlayerOneCamera.so.3.7.1 b/cameras/playerone/linux/x64/libPlayerOneCamera.so.3.7.1 old mode 100644 new mode 100755 similarity index 100% rename from cameras/poalibs/linux/x64/libPlayerOneCamera.so.3.7.1 rename to cameras/playerone/linux/x64/libPlayerOneCamera.so.3.7.1 diff --git a/cameras/poalibs/linux/x86/libPlayerOneCamera.so b/cameras/playerone/linux/x86/libPlayerOneCamera.so similarity index 100% rename from cameras/poalibs/linux/x86/libPlayerOneCamera.so rename to cameras/playerone/linux/x86/libPlayerOneCamera.so diff --git a/cameras/poalibs/linux/x86/libPlayerOneCamera.so.3 b/cameras/playerone/linux/x86/libPlayerOneCamera.so.3 similarity index 100% rename from cameras/poalibs/linux/x86/libPlayerOneCamera.so.3 rename to cameras/playerone/linux/x86/libPlayerOneCamera.so.3 diff --git a/cameras/poalibs/linux/x86/libPlayerOneCamera.so.3.7 b/cameras/playerone/linux/x86/libPlayerOneCamera.so.3.7 similarity index 100% rename from cameras/poalibs/linux/x86/libPlayerOneCamera.so.3.7 rename to cameras/playerone/linux/x86/libPlayerOneCamera.so.3.7 diff --git a/cameras/poalibs/linux/x86/libPlayerOneCamera.so.3.7.1 b/cameras/playerone/linux/x86/libPlayerOneCamera.so.3.7.1 old mode 100644 new mode 100755 similarity index 100% rename from cameras/poalibs/linux/x86/libPlayerOneCamera.so.3.7.1 rename to cameras/playerone/linux/x86/libPlayerOneCamera.so.3.7.1 diff --git a/cameras/poalibs/mac/libPlayerOneCamera.3.7.1.dylib b/cameras/playerone/mac/libPlayerOneCamera.dylib old mode 100644 new mode 100755 similarity index 100% rename from cameras/poalibs/mac/libPlayerOneCamera.3.7.1.dylib rename to cameras/playerone/mac/libPlayerOneCamera.dylib diff --git a/WinLibs/PlayerOneCamera.dll b/cameras/playerone/win/PlayerOneCamera.dll old mode 100644 new mode 100755 similarity index 99% rename from WinLibs/PlayerOneCamera.dll rename to cameras/playerone/win/PlayerOneCamera.dll index 30155e9651d597f008262d396056816d39652140..dc14e106f37c9dcffbc722e089dc258a25eda7db GIT binary patch delta 1487 zcmV;=1u*)^;UCE1AFv<+13WfJlOq950wDu~asjt;0RiuA0qKWgZvls5Zvuy6Zv%&7 zZv?kuZv~!J0Wr4$#RX%z13WfJw`YC^%~u0FHb}QO)&`%92>}2H00RI300Fn(Vh14s z0Wr4$WCw=<0Wr6UWe0*(6txBkDuzgg_YDCD0-%C6rZ9pwqL&}K2T~wWyJE(Ptn?N4 zbLbZ9uX-dj#nT$URrH0WBvFAl4vS&8k-7(q8wI2=f*PQgA=U@VAOL05@M$-c1_c2+ z)cofS*@$BHHs*et!lA<0FHtmG*_R8~2YG)C>r21I0#}jEHQFg{S3|ZQOZO8666kkD zKjfTi81~?oH@HHd^)Ax39%)LlPg-LeQYHby`y}tND>N$V#lx^g4=&J zGJ7+%EE?t|6i0OET%w*HojbcVQfy1t(FF4=&qEEgMUJXW>n-WhT=BOG_GMJUTR>?K zU~S4t7Oy9X{CXSa(#tSJ_M|6SkP^2LQ7krvfDkPYJUja z&oGNV&ugg#8_nVWl(HKmh!uAeKRDmKo1grOG?yL`Gh@6C;%)(X-e8+O&0l{i=7CCU zlDmbn5X$OUX~^= zmA*=FUg8g7%;Nl*j*s=F?Ktl%3BuS&;-G#n2K4x84*g}(^t|tOmr}`2k zq^+LB9Zz^S-NNHvibC#Ex&K@*2Udikf)_b3f)_Og3M&Qy1Ob9K0|Nmuf)^z)f)^nM z2`Yw2hW8Bt2Lhmi7ZNan7Y+ge12GRU4F(BdhDZTr0|WvA1pqL21`8^NNQUB+^G%+zUI50UfIWaJ|K-ve+6A3XgI50UfIWaJo7w!i?Ac4TS zBCc`n53plZ(lqaDy>k>jbA)q@7}|(dQxIkx{g-y`2TXsmb7Y`Y2C3Z^lurnv-eTjg z^9#1wx&R*GbQ3Mj0$wMUjM6Se(dgZ!mmm58tuAv~Y6PY^w`|E&o4t4Y-cH|yp;ySx z!%yH927ZaZh?2dPTaxdEJ-L(>jAgP&p4`mvkc$N@5dzzE<#ea%;L&Er0ZM_1`(YtY zlk>e|U}}GJRsOoI3NC-iRf;Gn}w^)wdNo@X*ta66y$7w4^-O;rmQiIq3A~l^v4s67-%8_*XMRi&|3(Q5?SIy5qkrK pl~u)EI<{G00RI3006h&Vh14s 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 literal 0 HcmV?d00001 diff --git a/cameras/poalibs/mac/libPlayerOneCamera.3.7.dylib b/cameras/poalibs/mac/libPlayerOneCamera.3.7.dylib deleted file mode 120000 index c9376696..00000000 --- a/cameras/poalibs/mac/libPlayerOneCamera.3.7.dylib +++ /dev/null @@ -1 +0,0 @@ -libPlayerOneCamera.3.7.1.dylib \ No newline at end of file diff --git a/cameras/poalibs/mac/libPlayerOneCamera.3.dylib b/cameras/poalibs/mac/libPlayerOneCamera.3.dylib deleted file mode 120000 index c9376696..00000000 --- a/cameras/poalibs/mac/libPlayerOneCamera.3.dylib +++ /dev/null @@ -1 +0,0 @@ -libPlayerOneCamera.3.7.1.dylib \ No newline at end of file diff --git a/cameras/poalibs/mac/libPlayerOneCamera.dylib b/cameras/poalibs/mac/libPlayerOneCamera.dylib deleted file mode 120000 index c9376696..00000000 --- a/cameras/poalibs/mac/libPlayerOneCamera.dylib +++ /dev/null @@ -1 +0,0 @@ -libPlayerOneCamera.3.7.1.dylib \ No newline at end of file diff --git a/src/cam_poa.cpp b/src/cam_playerone.cpp similarity index 85% rename from src/cam_poa.cpp rename to src/cam_playerone.cpp index 85e34bcd..16142b56 100644 --- a/src/cam_poa.cpp +++ b/src/cam_playerone.cpp @@ -1,53 +1,53 @@ /* -* cam_poa.cpp -* PHD Guiding -* -* Created by Ethan Chappel based on cam_zwo.cpp -* Copyright (c) 2024 PHD2 Developers -* All rights reserved. -* -* This source code is distributed under the following "BSD" license -* Redistribution and use in source and binary forms, with or without -* modification, are permitted provided that the following conditions are met: -* Redistributions of source code must retain the above copyright notice, -* this list of conditions and the following disclaimer. -* Redistributions in binary form must reproduce the above copyright notice, -* this list of conditions and the following disclaimer in the -* documentation and/or other materials provided with the distribution. -* Neither the name of openphdguiding.org nor the names of its -* contributors may be used to endorse or promote products derived from -* this software without specific prior written permission. -* -* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE -* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -* POSSIBILITY OF SUCH DAMAGE. -* -*/ + * cam_playerone.cpp - Player One Astronomy (POA) camera support + * PHD Guiding + * + * Created by Ethan Chappel based on cam_zwo.cpp + * Copyright (c) 2024 PHD2 Developers + * All rights reserved. + * + * This source code is distributed under the following "BSD" license + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of openphdguiding.org nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + */ #include "phd.h" -#ifdef POA_CAMERA +#ifdef PLAYERONE_CAMERA -#include "cam_poa.h" -#include "cameras/PlayerOneCamera.h" +# include "cam_playerone.h" +# include "PlayerOneCamera.h" -#ifdef __WINDOWS__ +# ifdef __WINDOWS__ -#ifdef OS_WINDOWS +# ifdef OS_WINDOWS // troubleshooting with the libusb definitions -# undef OS_WINDOWS -#endif +# undef OS_WINDOWS +# endif -# include -# include -#endif +# include +# include +# endif enum CaptureMode { @@ -55,14 +55,14 @@ enum CaptureMode CM_VIDEO, }; -class CameraPOA : public GuideCamera +class POACamera : public GuideCamera { wxRect m_maxSize; wxRect m_frame; unsigned short m_prevBinning; void *m_buffer; size_t m_buffer_size; - wxByte m_bpp; // bits per pixel: 8 or 16 + wxByte m_bpp; // bits per pixel: 8 or 16 CaptureMode m_mode; bool m_capturing; int m_cameraId; @@ -73,8 +73,8 @@ class CameraPOA : public GuideCamera double m_devicePixelSize; public: - CameraPOA(); - ~CameraPOA(); + POACamera(); + ~POACamera(); bool CanSelectCamera() const override { return true; } bool EnumCameras(wxArrayString& names, wxArrayString& ids) override; @@ -110,35 +110,34 @@ class CameraPOA : public GuideCamera POAErrors SetConfig(int nCameraID, POAConfig confID, POABool isEnable); }; -CameraPOA::CameraPOA() : m_buffer(nullptr) +POACamera::POACamera() : m_buffer(nullptr) { Name = _T("Player One Camera"); PropertyDialogType = PROPDLG_WHEN_DISCONNECTED; Connected = false; m_hasGuideOutput = true; HasSubframes = true; - HasGainControl = true; // workaround: ok to set to false later, but brain dialog will crash if we start false then change to true later when the camera is connected + HasGainControl = true; // workaround: ok to set to false later, but brain dialog will crash if we start false then change to + // true later when the camera is connected m_defaultGainPct = GuideCamera::GetDefaultCameraGain(); int value = pConfig->Profile.GetInt("/camera/POA/bpp", 8); m_bpp = value == 8 ? 8 : 16; } -CameraPOA::~CameraPOA() +POACamera::~POACamera() { ::free(m_buffer); } -wxByte CameraPOA::BitsPerPixel() +wxByte POACamera::BitsPerPixel() { return m_bpp; } -inline wxSize CameraPOA::BinnedFrameSize(unsigned int binning) +inline wxSize POACamera::BinnedFrameSize(unsigned int binning) { // Player One cameras require width % 4 == 0 and height % 2 == 0 - return wxSize( - (m_maxSize.x / binning) & ~(4U - 1), - (m_maxSize.y / binning) & ~(2U - 1)); + return wxSize((m_maxSize.x / binning) & ~(4U - 1), (m_maxSize.y / binning) & ~(2U - 1)); } struct POACameraDlg : public wxDialog @@ -148,8 +147,7 @@ struct POACameraDlg : public wxDialog POACameraDlg(); }; -POACameraDlg::POACameraDlg() - : wxDialog(wxGetApp().GetTopWindow(), wxID_ANY, _("Player One Camera Properties")) +POACameraDlg::POACameraDlg() : wxDialog(wxGetApp().GetTopWindow(), wxID_ANY, _("Player One Camera Properties")) { SetSizeHints(wxDefaultSize, wxDefaultSize); @@ -164,7 +162,7 @@ POACameraDlg::POACameraDlg() wxStdDialogButtonSizer *sdbSizer2 = new wxStdDialogButtonSizer(); wxButton *sdbSizer2OK = new wxButton(this, wxID_OK); - wxButton* sdbSizer2Cancel = new wxButton(this, wxID_CANCEL); + wxButton *sdbSizer2Cancel = new wxButton(this, wxID_CANCEL); sdbSizer2->AddButton(sdbSizer2OK); sdbSizer2->AddButton(sdbSizer2Cancel); sdbSizer2->Realize(); @@ -177,7 +175,7 @@ POACameraDlg::POACameraDlg() Centre(wxBOTH); } -void CameraPOA::ShowPropertyDialog() +void POACamera::ShowPropertyDialog() { POACameraDlg dlg; int value = pConfig->Profile.GetInt("/camera/POA/bpp", m_bpp); @@ -202,14 +200,14 @@ inline static int gain_pct(int minval, int maxval, int val) return (val - minval) * 100 / (maxval - minval); } -#ifdef __WINDOWS__ +# ifdef __WINDOWS__ -#if !defined(FACILITY_VISUALCPP) -# define FACILITY_VISUALCPP ((LONG)0x6d) -#endif -#ifndef VcppException -# define VcppException(sev,err) ((sev) | ((FACILITY_VISUALCPP)<<16) | (err)) -#endif +# if !defined(FACILITY_VISUALCPP) +# define FACILITY_VISUALCPP ((LONG) 0x6d) +# endif +# ifndef VcppException +# define VcppException(sev, err) ((sev) | ((FACILITY_VISUALCPP) << 16) | (err)) +# endif static LONG WINAPI DelayLoadDllExceptionFilter(PEXCEPTION_POINTERS pExcPointers, wxString *err) { @@ -218,7 +216,8 @@ static LONG WINAPI DelayLoadDllExceptionFilter(PEXCEPTION_POINTERS pExcPointers, switch (pExcPointers->ExceptionRecord->ExceptionCode) { - case VcppException(ERROR_SEVERITY_ERROR, ERROR_MOD_NOT_FOUND): { + case VcppException(ERROR_SEVERITY_ERROR, ERROR_MOD_NOT_FOUND): + { *err = wxString::Format(_("Could not load DLL %s"), pdli->szDll); break; } @@ -241,23 +240,25 @@ static LONG WINAPI DelayLoadDllExceptionFilter(PEXCEPTION_POINTERS pExcPointers, static bool DoTryLoadDll(wxString *err) { - __try { + __try + { POAGetCameraCount(); return true; } - __except (DelayLoadDllExceptionFilter(GetExceptionInformation(), err)) { + __except (DelayLoadDllExceptionFilter(GetExceptionInformation(), err)) + { return false; } } -#else // __WINDOWS__ +# else // __WINDOWS__ static bool DoTryLoadDll(wxString *err) { return true; } -#endif // __WINDOWS__ +# endif // __WINDOWS__ static bool TryLoadDll(wxString *err) { @@ -275,7 +276,7 @@ static bool TryLoadDll(wxString *err) return true; } -bool CameraPOA::EnumCameras(wxArrayString& names, wxArrayString& ids) +bool POACamera::EnumCameras(wxArrayString& names, wxArrayString& ids) { wxString err; if (!TryLoadDll(&err)) @@ -386,7 +387,7 @@ static int FindCamera(const wxString& camId, wxString *err) return -1; } -bool CameraPOA::Connect(const wxString& camId) +bool POACamera::Connect(const wxString& camId) { wxString err; if (!TryLoadDll(&err)) @@ -530,7 +531,6 @@ bool CameraPOA::Connect(const wxString& camId) break; } } - } if (HasGainControl) @@ -569,7 +569,7 @@ bool CameraPOA::Connect(const wxString& camId) return false; } -void CameraPOA::StopCapture() +void POACamera::StopCapture() { if (m_capturing) { @@ -579,14 +579,14 @@ void CameraPOA::StopCapture() } } -bool CameraPOA::StopExposure() +bool POACamera::StopExposure() { Debug.Write("Player One: stopexposure\n"); POAStopExposure(m_cameraId); return true; } -bool CameraPOA::Disconnect() +bool POACamera::Disconnect() { StopCapture(); POACloseCamera(m_cameraId); @@ -599,7 +599,7 @@ bool CameraPOA::Disconnect() return false; } -bool CameraPOA::GetDevicePixelSize(double *devPixelSize) +bool POACamera::GetDevicePixelSize(double *devPixelSize) { if (!Connected) return true; @@ -608,22 +608,22 @@ bool CameraPOA::GetDevicePixelSize(double *devPixelSize) return false; } -int CameraPOA::GetDefaultCameraGain() +int POACamera::GetDefaultCameraGain() { return m_defaultGainPct; } -bool CameraPOA::SetCoolerOn(bool on) +bool POACamera::SetCoolerOn(bool on) { - return (SetConfig(m_cameraId, POA_COOLER, on ? (long)1 : (long)0, POA_FALSE) != POA_OK); + return SetConfig(m_cameraId, POA_COOLER, on ? (long) 1 : (long) 0, POA_FALSE) != POA_OK; } -bool CameraPOA::SetCoolerSetpoint(double temperature) +bool POACamera::SetCoolerSetpoint(double temperature) { - return (SetConfig(m_cameraId, POA_TARGET_TEMP, temperature, POA_FALSE) != POA_OK); + return SetConfig(m_cameraId, POA_TARGET_TEMP, temperature, POA_FALSE) != POA_OK; } -bool CameraPOA::GetCoolerStatus(bool *on, double *setpoint, double *power, double *temperature) +bool POACamera::GetCoolerStatus(bool *on, double *setpoint, double *power, double *temperature) { POAErrors r; long value; @@ -660,7 +660,7 @@ bool CameraPOA::GetCoolerStatus(bool *on, double *setpoint, double *power, doubl return false; } -bool CameraPOA::GetSensorTemperature(double *temperature) +bool POACamera::GetSensorTemperature(double *temperature) { POAErrors r; long value; @@ -688,7 +688,10 @@ inline static int round_up(int v, int m) static void flush_buffered_image(int cameraId, void *buf, size_t size) { - enum { NUM_IMAGE_BUFFERS = 2 }; // camera has 2 internal frame buffers + enum + { + NUM_IMAGE_BUFFERS = 2 + }; // camera has 2 internal frame buffers // clear buffered frames if any @@ -702,7 +705,7 @@ static void flush_buffered_image(int cameraId, void *buf, size_t size) } } -bool CameraPOA::Capture(int duration, usImage& img, int options, const wxRect& subframe) +bool POACamera::Capture(int duration, usImage& img, int options, const wxRect& subframe) { bool binning_change = false; if (Binning != m_prevBinning) @@ -746,8 +749,7 @@ bool CameraPOA::Capture(int duration, usImage& img, int options, const wxRect& s long exposureUS = duration * 1000; POABool tmp; long cur_exp; - if (GetConfig(m_cameraId, POA_EXPOSURE, &cur_exp, &tmp) == POA_OK && - cur_exp != exposureUS) + if (GetConfig(m_cameraId, POA_EXPOSURE, &cur_exp, &tmp) == POA_OK && cur_exp != exposureUS) { Debug.Write(wxString::Format("Player One: set CONTROL_EXPOSURE %d\n", exposureUS)); SetConfig(m_cameraId, POA_EXPOSURE, exposureUS, POA_FALSE); @@ -755,8 +757,7 @@ bool CameraPOA::Capture(int duration, usImage& img, int options, const wxRect& s long new_gain = cam_gain(m_minGain, m_maxGain, GuideCameraGain); long cur_gain; - if (GetConfig(m_cameraId, POA_GAIN, &cur_gain, &tmp) == POA_OK && - new_gain != cur_gain) + if (GetConfig(m_cameraId, POA_GAIN, &cur_gain, &tmp) == POA_OK && new_gain != cur_gain) { Debug.Write(wxString::Format("Player One: set CONTROL_GAIN %d%% %d\n", GuideCameraGain, new_gain)); SetConfig(m_cameraId, POA_GAIN, new_gain, POA_FALSE); @@ -768,7 +769,8 @@ bool CameraPOA::Capture(int duration, usImage& img, int options, const wxRect& s if (size_change || pos_change) { m_frame = frame; - Debug.Write(wxString::Format("Player One: frame (%d,%d)+(%d,%d)\n", m_frame.x, m_frame.y, m_frame.width, m_frame.height)); + Debug.Write( + wxString::Format("Player One: frame (%d,%d)+(%d,%d)\n", m_frame.x, m_frame.y, m_frame.width, m_frame.height)); } if (size_change || binning_change) @@ -781,7 +783,8 @@ bool CameraPOA::Capture(int duration, usImage& img, int options, const wxRect& s status = POASetImageSize(m_cameraId, frame.GetWidth(), frame.GetHeight()); if (status != POA_OK) - Debug.Write(wxString::Format("Player One: setImageSize(%d,%d) => %d\n", frame.GetWidth(), frame.GetHeight(), status)); + Debug.Write( + wxString::Format("Player One: setImageSize(%d,%d) => %d\n", frame.GetWidth(), frame.GetHeight(), status)); } if (pos_change) @@ -793,8 +796,7 @@ bool CameraPOA::Capture(int duration, usImage& img, int options, const wxRect& s int poll = wxMin(duration, 100); - unsigned char *const buffer = - m_bpp == 16 && !useSubframe ? (unsigned char *) img.ImageData : (unsigned char *) m_buffer; + unsigned char *const buffer = m_bpp == 16 && !useSubframe ? (unsigned char *) img.ImageData : (unsigned char *) m_buffer; if (m_mode == CM_VIDEO) { @@ -845,7 +847,8 @@ bool CameraPOA::Capture(int duration, usImage& img, int options, const wxRect& s POAStartExposure(m_cameraId, POA_TRUE); - CameraWatchdog watchdog(duration, duration + GetTimeoutMs() + 10000); // total timeout is 2 * duration + 15s (typically) + CameraWatchdog watchdog(duration, + duration + GetTimeoutMs() + 10000); // total timeout is 2 * duration + 15s (typically) if (duration > 100) { @@ -976,7 +979,7 @@ inline static POAConfig GetPOADirection(int direction) } } -bool CameraPOA::ST4PulseGuideScope(int direction, int duration) +bool POACamera::ST4PulseGuideScope(int direction, int duration) { POAConfig d = GetPOADirection(direction); SetConfig(m_cameraId, d, POA_TRUE); @@ -986,7 +989,7 @@ bool CameraPOA::ST4PulseGuideScope(int direction, int duration) return false; } -void CameraPOA::ClearGuidePort() +void POACamera::ClearGuidePort() { SetConfig(m_cameraId, POA_GUIDE_NORTH, POA_FALSE); SetConfig(m_cameraId, POA_GUIDE_SOUTH, POA_FALSE); @@ -994,11 +997,10 @@ void CameraPOA::ClearGuidePort() SetConfig(m_cameraId, POA_GUIDE_WEST, POA_FALSE); } - // Functions from Player One ConvFuncs.h // Get the current value of POAConfig with POAValueType is VAL_INT, eg: POA_EXPOSURE, POA_GAIN -POAErrors CameraPOA::GetConfig(int nCameraID, POAConfig confID, long *pValue, POABool *pIsAuto) +POAErrors POACamera::GetConfig(int nCameraID, POAConfig confID, long *pValue, POABool *pIsAuto) { POAValueType pConfValueType; POAErrors error = POAGetConfigValueType(confID, &pConfValueType); @@ -1026,7 +1028,7 @@ POAErrors CameraPOA::GetConfig(int nCameraID, POAConfig confID, long *pValue, PO } // Get the current value of POAConfig with POAValueType is VAL_FLOAT, eg: POA_TEMPERATURE, POA_EGAIN -POAErrors CameraPOA::GetConfig(int nCameraID, POAConfig confID, double *pValue, POABool *pIsAuto) +POAErrors POACamera::GetConfig(int nCameraID, POAConfig confID, double *pValue, POABool *pIsAuto) { POAValueType pConfValueType; POAErrors error = POAGetConfigValueType(confID, &pConfValueType); @@ -1054,7 +1056,7 @@ POAErrors CameraPOA::GetConfig(int nCameraID, POAConfig confID, double *pValue, } // Get the current value of POAConfig with POAValueType is VAL_BOOL, eg: POA_COOLER, POA_PIXEL_BIN_SUM -POAErrors CameraPOA::GetConfig(int nCameraID, POAConfig confID, POABool *pIsEnable) +POAErrors POACamera::GetConfig(int nCameraID, POAConfig confID, POABool *pIsEnable) { POAValueType pConfValueType; POAErrors error = POAGetConfigValueType(confID, &pConfValueType); @@ -1083,7 +1085,7 @@ POAErrors CameraPOA::GetConfig(int nCameraID, POAConfig confID, POABool *pIsEnab } // Set the POAConfig value, the POAValueType of POAConfig is VAL_INT, eg: POA_TARGET_TEMP, POA_OFFSET -POAErrors CameraPOA::SetConfig(int nCameraID, POAConfig confID, long nValue, POABool isAuto) +POAErrors POACamera::SetConfig(int nCameraID, POAConfig confID, long nValue, POABool isAuto) { POAValueType pConfValueType; POAErrors error = POAGetConfigValueType(confID, &pConfValueType); @@ -1107,7 +1109,7 @@ POAErrors CameraPOA::SetConfig(int nCameraID, POAConfig confID, long nValue, POA // Set the POAConfig value, the POAValueType of POAConfig is VAL_FLOAT, Note: currently, there is no POAConfig which // POAValueType is VAL_FLOAT needs to be set -POAErrors CameraPOA::SetConfig(int nCameraID, POAConfig confID, double fValue, POABool isAuto) +POAErrors POACamera::SetConfig(int nCameraID, POAConfig confID, double fValue, POABool isAuto) { POAValueType pConfValueType; POAErrors error = POAGetConfigValueType(confID, &pConfValueType); @@ -1130,7 +1132,7 @@ POAErrors CameraPOA::SetConfig(int nCameraID, POAConfig confID, double fValue, P } // Set the POAConfig value, the POAValueType of POAConfig is VAL_BOOL, eg: POA_HARDWARE_BIN, POA_GUIDE_NORTH -POAErrors CameraPOA::SetConfig(int nCameraID, POAConfig confID, POABool isEnable) +POAErrors POACamera::SetConfig(int nCameraID, POAConfig confID, POABool isEnable) { POAValueType pConfValueType; POAErrors error = POAGetConfigValueType(confID, &pConfValueType); @@ -1152,9 +1154,9 @@ POAErrors CameraPOA::SetConfig(int nCameraID, POAConfig confID, POABool isEnable return POASetConfig(nCameraID, confID, confValue, POA_FALSE); } -GuideCamera *POACameraFactory::MakePOACamera() +GuideCamera *PlayerOneCameraFactory::MakePlayerOneCamera() { - return new CameraPOA(); + return new POACamera(); } -#endif // POA_CAMERA +#endif // CAMERA_PLAYERONE diff --git a/src/cam_playerone.h b/src/cam_playerone.h new file mode 100644 index 00000000..a81b49ee --- /dev/null +++ b/src/cam_playerone.h @@ -0,0 +1,45 @@ +/* + * cam_playerone.h + * PHD Guiding + * + * Created by Ethan Chappel based on cam_zwo.h + * Copyright (c) 2024 PHD2 Developers + * All rights reserved. + * + * This source code is distributed under the following "BSD" license + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of openphdguiding.org nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + */ +#ifndef CAM_PLAYERONE_INCLUDED +#define CAM_PLAYERONE_INCLUDED + +class GuideCamera; + +class PlayerOneCameraFactory +{ +public: + static GuideCamera *MakePlayerOneCamera(); +}; + +#endif diff --git a/src/cam_poa.h b/src/cam_poa.h deleted file mode 100644 index 4a4c4b23..00000000 --- a/src/cam_poa.h +++ /dev/null @@ -1,45 +0,0 @@ -/* -* cam_poa.h -* PHD Guiding -* -* Created by Ethan Chappel based on cam_zwo.h -* Copyright (c) 2024 PHD2 Developers -* All rights reserved. -* -* This source code is distributed under the following "BSD" license -* Redistribution and use in source and binary forms, with or without -* modification, are permitted provided that the following conditions are met: -* Redistributions of source code must retain the above copyright notice, -* this list of conditions and the following disclaimer. -* Redistributions in binary form must reproduce the above copyright notice, -* this list of conditions and the following disclaimer in the -* documentation and/or other materials provided with the distribution. -* Neither the name of openphdguiding.org nor the names of its -* contributors may be used to endorse or promote products derived from -* this software without specific prior written permission. -* -* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE -* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -* POSSIBILITY OF SUCH DAMAGE. -* -*/ -#ifndef CAM_POA_H_INCLUDED -#define CAM_POA_H_INCLUDED - -class GuideCamera; - -class POACameraFactory -{ -public: - static GuideCamera *MakePOACamera(); -}; - -#endif diff --git a/src/camera.cpp b/src/camera.cpp index db90a7da..cef67d45 100644 --- a/src/camera.cpp +++ b/src/camera.cpp @@ -78,6 +78,10 @@ wxSize UNDEFINED_FRAME_SIZE = wxSize(0, 0); # include "cam_qhy5.h" #endif +#if defined(PLAYERONE_CAMERA) +# include "cam_playerone.h" +#endif + #if defined(QHY_CAMERA) # include "cam_qhy.h" #endif @@ -90,10 +94,6 @@ wxSize UNDEFINED_FRAME_SIZE = wxSize(0, 0); # include "cam_zwo.h" #endif -#if defined(POA_CAMERA) -# include "cam_poa.h" -#endif - #if defined(TOUPTEK_CAMERA) # include "cam_touptek.h" #endif @@ -306,6 +306,9 @@ wxArrayString GuideCamera::GuideCameraList() #if defined(MORAVIAN_CAMERA) CameraList.Add(_T("Moravian Camera")); #endif +#if defined(PLAYERONE_CAMERA) + CameraList.Add(_T("Player One Camera")); +#endif #if defined(CAM_QHY5) CameraList.Add(_T("QHY 5")); #endif @@ -319,9 +322,6 @@ wxArrayString GuideCamera::GuideCameraList() #if defined(ZWO_ASI) CameraList.Add(_T("ZWO ASI Camera")); #endif -#if defined(POA_CAMERA) - CameraList.Add(_T("Player One Camera")); -#endif #if defined(TOUPTEK_CAMERA) CameraList.Add(_T("ToupTek Camera")); CameraList.Add(_T("Omegon Pro Camera")); @@ -454,6 +454,10 @@ GuideCamera *GuideCamera::Factory(const wxString& choice) pReturn->Name = _T("MagZero MZ-5"); } #endif +#if defined(PLAYERONE_CAMERA) + else if (choice == _T("Player One Camera")) + pReturn = PlayerOneCameraFactory::MakePlayerOneCamera(); +#endif #if defined(QHY_CAMERA) else if (choice == _T("QHY Camera")) pReturn = QHYCameraFactory::MakeQHYCamera(); @@ -468,10 +472,6 @@ GuideCamera *GuideCamera::Factory(const wxString& choice) else if (choice == _T("ZWO ASI Camera")) pReturn = ZWOCameraFactory::MakeZWOCamera(); #endif -#if defined(POA_CAMERA) - else if (choice == _T("Player One Camera")) - pReturn = POACameraFactory::MakePOACamera(); -#endif #if defined(TOUPTEK_CAMERA) else if (choice == _T("ToupTek Camera") || choice == _T("Omegon Pro Camera")) { diff --git a/src/cameras.h b/src/cameras.h index 103fcf9e..d8496164 100644 --- a/src/cameras.h +++ b/src/cameras.h @@ -56,7 +56,7 @@ # define OGMA_CAMERA # define OPENCV_CAMERA # define ORION_DSCI -# define POA_CAMERA +# define PLAYERONE_CAMERA # define QGUIDE # define QHY_CAMERA # define SBIG @@ -91,6 +91,9 @@ # ifdef HAVE_OPENSSAG_CAMERA # define OPENSSAG_CAMERA # endif +# ifdef HAVE_PLAYERONE_CAMERA +# define PLAYERONE_CAMERA +# endif # ifdef HAVE_QHY_CAMERA # define QHY_CAMERA # endif @@ -107,9 +110,6 @@ # ifdef HAVE_ZWO_CAMERA # define ZWO_ASI # endif -# ifdef HAVE_POA_CAMERA -# define POA_CAMERA -# endif # ifdef HAVE_SVB_CAMERA # define SVB_CAMERA # endif @@ -122,6 +122,9 @@ # ifdef HAVE_OGMA_CAMERA # define OGMA_CAMERA # endif +# ifdef HAVE_PLAYERONE_CAMERA +# define PLAYERONE_CAMERA +# endif # ifdef HAVE_QHY_CAMERA # define QHY_CAMERA # endif @@ -129,9 +132,6 @@ # ifdef HAVE_ZWO_CAMERA # define ZWO_ASI # endif -# ifdef HAVE_POA_CAMERA -# define POA_CAMERA -# endif # ifdef HAVE_TOUPTEK_CAMERA # define TOUPTEK_CAMERA # endif diff --git a/thirdparty/thirdparty.cmake b/thirdparty/thirdparty.cmake index 130b9a5a..eb29a72e 100644 --- a/thirdparty/thirdparty.cmake +++ b/thirdparty/thirdparty.cmake @@ -756,11 +756,6 @@ if(WIN32) set(PHD_LINK_EXTERNAL ${PHD_LINK_EXTERNAL} ${PHD_PROJECT_ROOT_DIR}/cameras/ASICamera2.lib) set(PHD_COPY_EXTERNAL_ALL ${PHD_COPY_EXTERNAL_ALL} ${PHD_PROJECT_ROOT_DIR}/WinLibs/ASICamera2.dll) - # Player One cameras - set(PHD_LINK_EXTERNAL ${PHD_LINK_EXTERNAL} ${PHD_PROJECT_ROOT_DIR}/cameras/PlayerOneCamera.lib) - set(PHD_COPY_EXTERNAL_ALL ${PHD_COPY_EXTERNAL_ALL} ${PHD_PROJECT_ROOT_DIR}/WinLibs/PlayerOneCamera.dll) - - # ToupTek cameras set(PHD_LINK_EXTERNAL ${PHD_LINK_EXTERNAL} ${PHD_PROJECT_ROOT_DIR}/cameras/toupcam.lib) set(PHD_COPY_EXTERNAL_ALL ${PHD_COPY_EXTERNAL_ALL} ${PHD_PROJECT_ROOT_DIR}/WinLibs/toupcam.dll) @@ -816,6 +811,11 @@ if(WIN32) set(PHD_COPY_EXTERNAL_ALL ${PHD_COPY_EXTERNAL_ALL} ${PHD_PROJECT_ROOT_DIR}/cameras/moravian/win/lib/gXusb.dll) include_directories(${PHD_PROJECT_ROOT_DIR}/cameras/moravian/include) + # Player One cameras + set(PHD_LINK_EXTERNAL ${PHD_LINK_EXTERNAL} ${PHD_PROJECT_ROOT_DIR}/cameras/playerone/win/PlayerOneCamera.lib) + set(PHD_COPY_EXTERNAL_ALL ${PHD_COPY_EXTERNAL_ALL} ${PHD_PROJECT_ROOT_DIR}/cameras/playerone/win/PlayerOneCamera.dll) + include_directories(${PHD_PROJECT_ROOT_DIR}/cameras/playerone/include) + set(PHD_COPY_EXTERNAL_ALL ${PHD_COPY_EXTERNAL_ALL} ${PHD_PROJECT_ROOT_DIR}/WinLibs/msvcr120.dll) set(PHD_COPY_EXTERNAL_ALL ${PHD_COPY_EXTERNAL_ALL} ${PHD_PROJECT_ROOT_DIR}/WinLibs/msvcp140.dll) set(PHD_COPY_EXTERNAL_ALL ${PHD_COPY_EXTERNAL_ALL} ${PHD_PROJECT_ROOT_DIR}/WinLibs/vcomp140.dll) @@ -895,16 +895,6 @@ if(APPLE) set(PHD_LINK_EXTERNAL ${PHD_LINK_EXTERNAL} ${asiCamera2}) set(phd2_OSX_FRAMEWORKS ${phd2_OSX_FRAMEWORKS} ${asiCamera2}) - find_library( poaCamera - NAMES PlayerOneCamera - PATHS ${PHD_PROJECT_ROOT_DIR}/cameras/poalibs/mac) - if(NOT poaCamera) - message(FATAL_ERROR "Cannot find the poaCamera drivers") - endif() - add_definitions(-DHAVE_POA_CAMERA=1) - set(PHD_LINK_EXTERNAL ${PHD_LINK_EXTERNAL} ${poaCamera}) - set(phd2_OSX_FRAMEWORKS ${phd2_OSX_FRAMEWORKS} ${poaCamera}) - find_library( SVBCameraSDK NAMES SVBCameraSDK PATHS ${PHD_PROJECT_ROOT_DIR}/cameras/svblibs/mac/x64) @@ -973,6 +963,17 @@ if(APPLE) add_definitions(-DHAVE_OPENSSAG_CAMERA=1) set_property(TARGET OpenSSAG PROPERTY FOLDER "Thirdparty/") + find_library( playerone + NAMES PlayerOneCamera + PATHS ${PHD_PROJECT_ROOT_DIR}/cameras/playerone/mac) + if(NOT playerone) + message(FATAL_ERROR "Cannot find the playerone SDK lib") + endif() + include_directories(${PHD_PROJECT_ROOT_DIR}/cameras/playerone/include) + list(APPEND PHD_LINK_EXTERNAL ${playerone}) + add_definitions(-DHAVE_PLAYERONE_CAMERA=1) + list(APPEND phd2_OSX_FRAMEWORKS ${playerone}) + endif() # APPLE @@ -996,36 +997,36 @@ if(UNIX AND NOT APPLE) if (CMAKE_SYSTEM_PROCESSOR MATCHES "^armv6(.*)") set(zwoarch "armv6") set(qhyarch "arm32") - set(poaarch "arm32") set(toupcam_arch "armel") set(svbony_arch "armv6") + set(playerone_arch arm32) elseif (CMAKE_SYSTEM_PROCESSOR MATCHES "^armv7(.*)|arm64|aarch64|^armv8(.*)") if(CMAKE_SIZEOF_VOID_P EQUAL 8) set(zwoarch "armv8") set(qhyarch "arm64") - set(poaarch "arm64") set(toupcam_arch "arm64") set(svbony_arch "armv8") + set(playerone_arch arm64) else() set(zwoarch "armv7") - set(poaarch "arm32") set(qhyarch "arm32") set(toupcam_arch "armhf") set(svbony_arch "armv7") + set(playerone_arch arm32) endif() elseif (CMAKE_SYSTEM_PROCESSOR MATCHES "x86|X86|amd64|AMD64|i.86") if(CMAKE_SIZEOF_VOID_P EQUAL 8) set(zwoarch "x64") - set(poaarch "x64") set(qhyarch "x86_64") set(toupcam_arch "x64") set(svbony_arch "x64") + set(playerone_arch x64) else() set(zwoarch "x86") - set(poaarch "x86") set(qhyarch "x86_32") # no longer distributed by QHY set(toupcam_arch "x86") set(svbony_arch "x86") + set(playerone_arch x86) endif() else() message(FATAL_ERROR "unknown system architecture") @@ -1036,11 +1037,6 @@ if(UNIX AND NOT APPLE) PATHS ${PHD_PROJECT_ROOT_DIR}/cameras ) - find_path(POA_INCLUDE_DIR PlayerOneCamera.h - NO_DEFAULT_PATHS - PATHS ${PHD_PROJECT_ROOT_DIR}/cameras - ) - # The binary libraries below do not support FreeBSD, ignore them # when building for FreeBSD. if (NOT ${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD") @@ -1056,18 +1052,6 @@ if(UNIX AND NOT APPLE) add_definitions(-DHAVE_ZWO_CAMERA=1) set(PHD_LINK_EXTERNAL ${PHD_LINK_EXTERNAL} ${asiCamera2}) - find_library(poaCamera - NAMES PlayerOneCamera - NO_DEFAULT_PATHS - PATHS ${PHD_PROJECT_ROOT_DIR}/cameras/poalibs/linux/${poaarch}) - - if(NOT poaCamera) - message(FATAL_ERROR "Cannot find the poaCamera drivers") - endif() - message(STATUS "Found PlayerOneCamera lib ${poaCamera}") - add_definitions(-DHAVE_POA_CAMERA=1) - set(PHD_LINK_EXTERNAL ${PHD_LINK_EXTERNAL} ${poaCamera}) - find_library(toupcam NAMES toupcam NO_DEFAULT_PATHS @@ -1120,6 +1104,23 @@ if(UNIX AND NOT APPLE) endif() set(PHD_LINK_EXTERNAL ${PHD_LINK_EXTERNAL} ${qhylib}) endif() + + find_library( playerone + NAMES PlayerOneCamera + NO_DEFAULT_PATHS + PATHS ${PHD_PROJECT_ROOT_DIR}/cameras/playerone/linux/${playerone_arch}) + + if(NOT playerone) + message(FATAL_ERROR "Cannot find the PlayerOneCamera SDK lib") + endif() + message(STATUS "Found PlayerOneCamera SDK lib ${playerone}") + include_directories(${PHD_PROJECT_ROOT_DIR}/cameras/playerone/include) + add_definitions(-DHAVE_PLAYERONE_CAMERA=1) + list(APPEND PHD_LINK_EXTERNAL ${playerone}) + # install the .so and symlinks + file(GLOB playerone_so_files "${playerone}*") + list(APPEND PHD_INSTALL_LIBS ${playerone_so_files}) + endif(NOT ${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD") find_program(LSB_RELEASE_EXEC lsb_release) From d7f590970a45cff6c13a65c756650cd4ab9b2284 Mon Sep 17 00:00:00 2001 From: Andy Galasso Date: Sat, 4 Jan 2025 17:16:26 -0500 Subject: [PATCH 2/4] Add Ethan to list of contributors (#1279) --- src/about_dialog.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/about_dialog.cpp b/src/about_dialog.cpp index 7f2c615d..ff328bde 100644 --- a/src/about_dialog.cpp +++ b/src/about_dialog.cpp @@ -187,7 +187,7 @@ AboutDialog::AboutDialog() "Kirill M. Skorobogatov" "Lars Berntzon" "Dale Ghent" - "" + "Ethan Chappel" "" "
" "
" From c194aa7d0788b9cacb741e11ded3f0632132ea5a Mon Sep 17 00:00:00 2001 From: Andy Galasso Date: Sat, 4 Jan 2025 17:27:24 -0500 Subject: [PATCH 3/4] Windows build: improvement to DLL copying (#1282) Copy the Windows DLL with a single call to `cmake -E` rather than one call per DLL. This slightly speeds up the build for a better experience in iterative developement on Windows. Also moves the DLL copying to POST_BUILD rather then PRE_BUILD as there's no point in copying the DLLs if there's going to be a compile error during iterative development. --- CMakeLists.txt | 46 +++++++++++++++- thirdparty/thirdparty.cmake | 106 ------------------------------------ 2 files changed, 43 insertions(+), 109 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index a7390f2f..71402eae 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -780,10 +780,50 @@ elseif(WIN32) target_include_directories(phd2 PRIVATE "C:/Program Files (x86)/Visual Leak Detector/include") - # Delayed load for all DLLs below in the original project. Now using delay load only for the necessary stuff - #sbigudrv.dll;ICFilterContainer.dll;TIS_DShowLib09.dll;TIS_UDSHL09_vc9.dll;FCApi.dll;OSPL130RT.dll;DLCWB.dll;cfitsio.dll;CMOSDll.dll;DSCI.dll;inpout32.dll;ShoestringGPUSB_DLL.dll;ShoestringLXUSB_DLL.dll;SXUSB.dll;AsiCamera.dll;%(DelayLoadDLLs) + # copy DLL files into the output directory - copy_dependency_with_config(phd2 PHD_COPY_EXTERNAL_ALL PHD_COPY_EXTERNAL_DBG PHD_COPY_EXTERNAL_REL) + set(_copyfiles_dbg ${PHD_COPY_EXTERNAL_ALL} ${PHD_COPY_EXTERNAL_DBG}) + set(_copyfiles_rel ${PHD_COPY_EXTERNAL_ALL} ${PHD_COPY_EXTERNAL_REL}) + foreach(_file IN LISTS _copyfiles_dbg _copyfiles_rel) + if(NOT EXISTS ${_file}) + message(FATAL_ERROR "Dependency ${_file} does not exist") + endif() + endforeach() + foreach(_config dbg rel) + set(_realpaths_${_config}) + foreach(_file ${_copyfiles_${_config}}) + get_filename_component(_realpath ${_file} REALPATH) + list(APPEND _realpaths_${_config} ${_realpath}) + endforeach() + list(REMOVE_DUPLICATES _realpaths_${_config}) + endforeach() + unset(_file) + unset(_config) + + add_custom_command( + TARGET phd2 + POST_BUILD + COMMAND ${CMAKE_COMMAND} -E + $<$:copy_if_different> + $<$>:true> + ${_realpaths_dbg} + $/. + COMMAND_EXPAND_LISTS VERBATIM + COMMENT "$<$:Copy debug libs to output folder>" + ) + add_custom_command( + TARGET phd2 + POST_BUILD + COMMAND ${CMAKE_COMMAND} -E + $<$:copy_if_different> + $<$>:true> + ${_realpaths_rel} + $/. + COMMAND_EXPAND_LISTS VERBATIM + COMMENT "$<$:Copy release libs to output folder>" + ) + unset(_realpaths_dbg) + unset(_realpaths_rel) ## ######################### ## Unix diff --git a/thirdparty/thirdparty.cmake b/thirdparty/thirdparty.cmake index eb29a72e..ac61991e 100644 --- a/thirdparty/thirdparty.cmake +++ b/thirdparty/thirdparty.cmake @@ -93,112 +93,6 @@ if(WIN32) include_directories(${VCPKG_INCLUDE}) endif() -# -# copies the dependency files into the target output directory -# -macro(copy_dependency_with_config target_name dependency_list_all dependency_list_dbg dependency_list_release) - - - set(dependency_list_dbg_with_all ${${dependency_list_dbg}} ${${dependency_list_all}}) - set(dependency_list_dbg_with_all_cleaned) - foreach(_element ${dependency_list_dbg_with_all}) - if(NOT EXISTS ${_element}) - message(FATAL_ERROR "Dependency ${_element} does not exist") - endif() - #message(STATUS "copyX ${_element}") - get_filename_component(_element1 ${_element} REALPATH) - set(dependency_list_dbg_with_all_cleaned ${dependency_list_dbg_with_all_cleaned} ${_element1}) - unset(_element1) - endforeach() - - list(REMOVE_DUPLICATES dependency_list_dbg_with_all_cleaned) - set(dependency_list_dbg_with_all ${dependency_list_dbg_with_all_cleaned}) - unset(dependency_list_dbg_with_all_cleaned) - unset(_element) - - foreach(_element ${dependency_list_dbg_with_all}) - get_filename_component(_element_name ${_element} NAME) - add_custom_command( - TARGET ${target_name} - PRE_BUILD - COMMAND ${CMAKE_COMMAND} -E - $<$:echo> - $<$:"Copy ${_element_name} to $/."> - $<$>:echo_append> - $<$>:"."> - COMMAND ${CMAKE_COMMAND} -E - $<$:copy_if_different> - $<$:${_element}> - $<$:$/.> - $<$>:echo_append> - $<$>:""> - COMMENT "Copy ${target_name} dependencies into the output folder") - - - - #message(STATUS "copy ${_element_name}") - # add_custom_command( - # TARGET ${target_name} - # PRE_BUILD - # COMMAND ${CMAKE_COMMAND} -E echo Copy ${_element_name} into $/. - - # COMMAND ${CMAKE_COMMAND} -E $<$:copy_if_different>$<$>:echo> ${_element} $/. - # COMMENT "Copy ${target_name} dependencies into the output folder") - - unset(_element_name) - endforeach() - unset(dependency_list_dbg_with_all) - unset(_element) - - - set(dependency_list_release_with_all ${${dependency_list_release}} ${${dependency_list_all}}) - set(dependency_list_release_with_all_cleaned) - foreach(_element ${dependency_list_release_with_all}) - if(NOT EXISTS ${_element}) - message(FATAL_ERROR "Dependency ${_element} does not exist") - endif() - get_filename_component(_element1 ${_element} REALPATH) - set(dependency_list_release_with_all_cleaned ${dependency_list_release_with_all_cleaned} ${_element1}) - unset(_element1) - endforeach() - list(REMOVE_DUPLICATES dependency_list_release_with_all_cleaned) - set(dependency_list_release_with_all ${dependency_list_release_with_all_cleaned}) - unset(dependency_list_release_with_all_cleaned) - unset(_element) - - foreach(_element ${dependency_list_release_with_all}) - get_filename_component(_element_name ${_element} NAME) - add_custom_command( - TARGET ${target_name} - PRE_BUILD - COMMAND ${CMAKE_COMMAND} -E - $<$:echo> #$<$>:echo> ${_element} $/. - $<$:"Copy ${_element_name} to $/."> - $<$>:echo_append> - $<$>:"."> - COMMAND ${CMAKE_COMMAND} -E - $<$:copy_if_different> - $<$:${_element}> - $<$:$/.> - $<$>:echo_append> - $<$>:""> - COMMENT "Copy ${target_name} dependencies into the output folder") - unset(_element_name) - endforeach() - unset(dependency_list_release_with_all) - unset(_element) - - # we can also use this thing to install external stuff - #install( FILES ${dependency_name_debug} - # DESTINATION bin - # CONFIGURATIONS Debug) - #install( FILES ${dependency_name_non_debug} - # DESTINATION bin - # CONFIGURATIONS Release) - - -endmacro(copy_dependency_with_config) - if(APPLE) find_library(quicktimeFramework QuickTime) find_library(iokitFramework IOKit) From b3a0b597b3eb23aab03b38b6e4e684f14ec5204c Mon Sep 17 00:00:00 2001 From: Andy Galasso Date: Sat, 4 Jan 2025 17:30:16 -0500 Subject: [PATCH 4/4] build system: cmake code simplification (#1283) Replace `set(list ${list} value...)` with `list(APPEND list value...)`. --- CMakeLists.txt | 62 +++----- thirdparty/thirdparty.cmake | 296 +++++++++++++++++------------------- 2 files changed, 160 insertions(+), 198 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 71402eae..9eafba4e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -240,8 +240,7 @@ set(cam_SRC # windows specific cameras if(WIN32) - set(cam_SRC - ${cam_SRC} + list(APPEND cam_SRC ${phd_src_dir}/cam_LEParallelWebcam.cpp ${phd_src_dir}/cam_LEParallelWebcam.h ${phd_src_dir}/cam_LESerialWebcam.cpp @@ -256,15 +255,12 @@ if(WIN32) ${PHD_PROJECT_ROOT_DIR}/cameras/ArtemisHSCAPI.cpp ) elseif(UNIX AND (NOT APPLE)) - set(cam_SRC - ${cam_SRC} + list(APPEND cam_SRC ${phd_src_dir}/cam_qhy5.h ${phd_src_dir}/cam_qhy5.cpp ) elseif(APPLE) - set(cam_SRC - ${cam_SRC} - ) + # nothing else to add for Mac endif() source_group(Cameras FILES ${cam_SRC}) @@ -341,9 +337,6 @@ set(guiding_SRC ) source_group(Guiding FILES ${guiding_SRC}) - - -# it would ease if files are organised in an alphabetical order set(phd2_SRC ${phd_src_dir}/about_dialog.cpp ${phd_src_dir}/about_dialog.h @@ -455,8 +448,6 @@ set(phd2_SRC ${phd_src_dir}/rotator_indi.cpp ${phd_src_dir}/rotator_indi.h - ### - ${phd_src_dir}/runinbg.cpp ${phd_src_dir}/runinbg.h @@ -500,9 +491,7 @@ set(phd2_SRC ) if (WIN32) - set(phd2_SRC - ${phd2_SRC} - + list(APPEND phd2_SRC # windows-only sources ${phd_src_dir}/parallelports.h ${phd_src_dir}/parallelport.h @@ -513,7 +502,7 @@ if (WIN32) ${phd_src_dir}/comdispatch.h ${phd_src_dir}/comdispatch.cpp - ) + ) endif() source_group(src FILES ${phd2_SRC}) @@ -529,15 +518,14 @@ foreach(current_locale IN LISTS all_locales) get_filename_component(message_file_ext ${current_file} EXT) if(("${message_file_ext}" STREQUAL ".mo") OR ("${message_file_ext}" STREQUAL ".zip")) # message(STATUS "Harhar ${message_file_ext} / ${current_file}") - set(phd2_SRC ${phd2_SRC} ${current_file}) + list(APPEND phd2_SRC ${current_file}) endif() endforeach() endforeach() # for all locales - -MACRO(ADD_MSVC_PRECOMPILED_HEADER PrecompiledHeader PrecompiledSource SourcesVar) - IF(MSVC) +macro(ADD_MSVC_PRECOMPILED_HEADER PrecompiledHeader PrecompiledSource SourcesVar) + if(MSVC) GET_FILENAME_COMPONENT(PrecompiledBasename ${PrecompiledHeader} NAME_WE) SET(PrecompiledBinary "\$(IntDir)/${PrecompiledBasename}.pch") SET(Sources ${${SourcesVar}}) @@ -551,23 +539,22 @@ MACRO(ADD_MSVC_PRECOMPILED_HEADER PrecompiledHeader PrecompiledSource SourcesVar # Add precompiled header to SourcesVar LIST(APPEND ${SourcesVar} ${PrecompiledSource}) - ENDIF() -ENDMACRO(ADD_MSVC_PRECOMPILED_HEADER) + endif() +endmacro(ADD_MSVC_PRECOMPILED_HEADER) ## ######################### ## OSX if(APPLE) # bundle definitions - # please edit the copyrights set(MACOSX_BUNDLE_BUNDLE_NAME PHD2 ) set(MACOSX_BUNDLE_GUI_IDENTIFIER "org.openphdguiding.phd2" ) set(MACOSX_BUNDLE_ICON_FILE PHD_OSX_icon.icns ) - set(MACOSX_BUNDLE_INFO_STRING "${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}, Copyright 2010-2020 openphdguiding.org" ) + set(MACOSX_BUNDLE_INFO_STRING "${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}, Copyright 2010-2025 openphdguiding.org" ) set(MACOSX_BUNDLE_SHORT_VERSION_STRING "${VERSION_MAJOR}.${VERSION_MINOR}" ) set(MACOSX_BUNDLE_LONG_VERSION_STRING "${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}" ) set(MACOSX_BUNDLE_BUNDLE_VERSION "${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}" ) - set(MACOSX_BUNDLE_COPYRIGHT "(C) 2010-2020 openphdguiding.org" ) + set(MACOSX_BUNDLE_COPYRIGHT "(C) 2010-2025 openphdguiding.org" ) # main target add_executable( @@ -760,7 +747,7 @@ elseif(WIN32) ADD_MSVC_PRECOMPILED_HEADER("phd.h" "src/precompiled_header.cpp" phd2_WIN_SRC) # resource file, some VC do not like the options provided by the precompiled headers - set(phd2_WIN_SRC ${phd2_WIN_SRC} ${PHD_PROJECT_ROOT_DIR}/phd.rc) + list(APPEND phd2_WIN_SRC ${PHD_PROJECT_ROOT_DIR}/phd.rc) source_group(src FILES precompiled_header.cpp) link_directories("C:/Program Files (x86)/Visual Leak Detector/lib/win32") @@ -768,7 +755,7 @@ elseif(WIN32) phd2 WIN32 ${phd2_WIN_SRC} - ) + ) set_target_properties( phd2 @@ -776,7 +763,7 @@ elseif(WIN32) OUTPUT_NAME phd2 # lower case on Win32 LINK_FLAGS "/DELAYLOAD:sbigudrv.dll /NODEFAULTLIB:libcmt.lib" # /NODEFAULTLIB:libcmtd.lib LINK_FLAGS_DEBUG "/NODEFAULTLIB:libcmtd.lib /NODEFAULTLIB:msvcrt.lib" - ) + ) target_include_directories(phd2 PRIVATE "C:/Program Files (x86)/Visual Leak Detector/include") @@ -829,14 +816,13 @@ elseif(WIN32) ## Unix elseif(UNIX) - # should be linux there add_executable( - phd2 - ${scopes_SRC} - ${cam_SRC} - ${guiding_SRC} - ${phd2_SRC} - ) + phd2 + ${scopes_SRC} + ${cam_SRC} + ${guiding_SRC} + ${phd2_SRC} + ) find_package( OpenCV REQUIRED ) @@ -846,7 +832,7 @@ elseif(UNIX) phd2 PROPERTIES OUTPUT_NAME phd2.bin - ) + ) else() message(FATAL_ERROR "Unsupported platform") @@ -877,8 +863,6 @@ target_link_libraries(phd2 MPIIS_GP GPGuider # GP Guider ${PHD_LINK_EXTERNAL}) - - ################################################################ # # documentation + translation @@ -995,7 +979,6 @@ if(WIN32) endforeach() # for all locales endif() - ## Linux bundling of documentation + translation if(UNIX AND NOT APPLE) @@ -1038,7 +1021,6 @@ if(UNIX AND NOT APPLE) endforeach() endif() - ################################################################ # # Installation and packaging diff --git a/thirdparty/thirdparty.cmake b/thirdparty/thirdparty.cmake index ac61991e..faa25077 100644 --- a/thirdparty/thirdparty.cmake +++ b/thirdparty/thirdparty.cmake @@ -36,14 +36,8 @@ if(NOT EXISTS ${thirdparties_deflate_directory}) file(MAKE_DIRECTORY ${thirdparties_deflate_directory}) endif() - - # custom cmake packages, should have lower priority than the ones bundled with cmake -set(CMAKE_MODULE_PATH - ${CMAKE_MODULE_PATH} - ${CMAKE_SOURCE_DIR}/cmake_modules/ ) - - +list(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake_modules/ ) # these variables allow to specify to which the main project will link and # to potentially copy some resources to the output directory of the main project. @@ -105,30 +99,30 @@ if(APPLE) find_library(coreFoundationFramework CoreFoundation) endif() +############################################# # # external rules common to all platforms # ############################################# - ############################################## # cfitsio if(WIN32) include_directories(${VCPKG_INCLUDE}/cfitsio) - set(PHD_LINK_EXTERNAL_DEBUG ${PHD_LINK_EXTERNAL_DEBUG} + list(APPEND PHD_LINK_EXTERNAL_DEBUG ${VCPKG_DEBUG_LIB}/cfitsio.lib ${VCPKG_DEBUG_LIB}/zlibd.lib ) - set(PHD_LINK_EXTERNAL_RELEASE ${PHD_LINK_EXTERNAL_RELEASE} + list(APPEND PHD_LINK_EXTERNAL_RELEASE ${VCPKG_RELEASE_LIB}/cfitsio.lib ${VCPKG_RELEASE_LIB}/zlib.lib ) - set(PHD_COPY_EXTERNAL_DBG ${PHD_COPY_EXTERNAL_DBG} + list(APPEND PHD_COPY_EXTERNAL_DBG ${VCPKG_DEBUG_BIN}/cfitsio.dll ${VCPKG_DEBUG_BIN}/zlibd1.dll ) - set(PHD_COPY_EXTERNAL_REL ${PHD_COPY_EXTERNAL_REL} + list(APPEND PHD_COPY_EXTERNAL_REL ${VCPKG_RELEASE_BIN}/cfitsio.dll ${VCPKG_RELEASE_BIN}/zlib1.dll ) @@ -142,12 +136,10 @@ else() find_package(CFITSIO REQUIRED) endif() include_directories(${CFITSIO_INCLUDE_DIR}) - set(PHD_LINK_EXTERNAL ${PHD_LINK_EXTERNAL} ${CFITSIO_LIBRARIES}) + list(APPEND PHD_LINK_EXTERNAL ${CFITSIO_LIBRARIES}) message(STATUS "Using system's CFITSIO.") endif() - - ############################################## # VidCapture @@ -155,7 +147,7 @@ if(WIN32) set(libvidcap_root ${thirdparty_dir}/VidCapture) - # copied and adapted from the CMakeLists.txt of cftsio project. The + # copied and adapted from the CMakeLists.txt of cfitsio project. The # sources of the project are left untouched file(GLOB VIDCAP_H_FILES "${libvidcap_root}/Source/CVCommon/*.h" "${libvidcap_root}/Source/VidCapture/*.h") @@ -174,7 +166,7 @@ if(WIN32) ) foreach(_src_file IN LISTS VIDCAP_SRC_FILES) - set(VIDCAP_SRC_FILES_rooted "${VIDCAP_SRC_FILES_rooted}" ${libvidcap_root}/${_src_file}) + list(APPEND VIDCAP_SRC_FILES_rooted ${libvidcap_root}/${_src_file}) endforeach() add_library(VidCapture STATIC ${VIDCAP_H_FILES} ${VIDCAP_SRC_FILES_rooted}) @@ -192,13 +184,10 @@ if(WIN32) # indicating the link and include directives to the main project. # already done by the directive target_include_directories(vidcap PUBLIC # include_directories(${libvidcap_root}) - set(PHD_LINK_EXTERNAL ${PHD_LINK_EXTERNAL} VidCapture) + list(APPEND PHD_LINK_EXTERNAL VidCapture) endif() - - - ############################################# # libusb: linux / apple @@ -230,7 +219,7 @@ if(NOT WIN32) # platform dependent files if(APPLE) - set(libUSB_SRC ${libUSB_SRC} + list(APPEND libUSB_SRC # platform specific configuration file ${thirdparty_dir}/include/${LIBUSB} @@ -249,7 +238,7 @@ if(NOT WIN32) # need to build a dynamic libusb since the ZWO SDK requires libusb set(LIBUSB_static FALSE) elseif(WIN32) - set(libUSB_SRC ${libUSB_SRC} + list(APPEND libUSB_SRC # platform specific configuration files ${libusb_root}/msvc/stdint.h @@ -278,21 +267,17 @@ if(NOT WIN32) # It requires "sudo apt-get install libusb-1.0-0-dev" if(USE_SYSTEM_LIBUSB) pkg_check_modules(USB_pkg libusb-1.0) - if(0) - message(FATAL_ERROR "libUSB not detected") - else() - include_directories(${USB_pkg_INCLUDE_DIRS}) - set(PHD_LINK_EXTERNAL ${PHD_LINK_EXTERNAL} ${USB_pkg_LIBRARIES}) - set(USB_build FALSE) - set(usb_openphd ${USB_pkg_LIBRARIES}) - message(STATUS "Using system's libUSB.") - endif() + include_directories(${USB_pkg_INCLUDE_DIRS}) + list(APPEND PHD_LINK_EXTERNAL ${USB_pkg_LIBRARIES}) + set(USB_build FALSE) + set(usb_openphd ${USB_pkg_LIBRARIES}) + message(STATUS "Using system's libUSB.") else(USE_SYSTEM_LIBUSB) # in case the library is not installed on the system (as I have on my machines) # try by building the library ourselves - set(libUSB_SRC ${libUSB_SRC} + list(APPEND libUSB_SRC # platform specific configuration file ${thirdparty_dir}/include/${LIBUSB} @@ -343,7 +328,7 @@ if(NOT WIN32) else() target_compile_definitions(usb_openphd PRIVATE LIBUSB_DESCRIBE "") endif() - set(PHD_LINK_EXTERNAL ${PHD_LINK_EXTERNAL} usb_openphd) + list(APPEND PHD_LINK_EXTERNAL usb_openphd) endif() endif() # NOT WIN32 @@ -353,16 +338,16 @@ endif() # NOT WIN32 ############################################# if(WIN32) - set(PHD_LINK_EXTERNAL_DEBUG ${PHD_LINK_EXTERNAL_DEBUG} + list(APPEND PHD_LINK_EXTERNAL_DEBUG ${VCPKG_DEBUG_LIB}/libcurl-d.lib ) - set(PHD_LINK_EXTERNAL_RELEASE ${PHD_LINK_EXTERNAL_RELEASE} + list(APPEND PHD_LINK_EXTERNAL_RELEASE ${VCPKG_RELEASE_LIB}/libcurl.lib ) - set(PHD_COPY_EXTERNAL_DBG ${PHD_COPY_EXTERNAL_DBG} + list(APPEND PHD_COPY_EXTERNAL_DBG ${VCPKG_DEBUG_BIN}/libcurl-d.dll ) - set(PHD_COPY_EXTERNAL_REL ${PHD_COPY_EXTERNAL_REL} + list(APPEND PHD_COPY_EXTERNAL_REL ${VCPKG_RELEASE_BIN}/libcurl.dll ) else() @@ -381,7 +366,7 @@ else() endif() message(STATUS "using libcurl ${CURL_LIBRARIES}") include_directories(${CURL_INCLUDE_DIRS}) - set(PHD_LINK_EXTERNAL ${PHD_LINK_EXTERNAL} ${CURL_LIBRARIES}) + list(APPEND PHD_LINK_EXTERNAL ${CURL_LIBRARIES}) endif() ############################################# @@ -395,9 +380,8 @@ else() message(STATUS "Using system's Eigen3.") endif() - ############################################# -# Google test, easily built +# Google test # https://github.com/google/googletest/tree/main/googletest#incorporating-into-an-existing-cmake-project if(USE_SYSTEM_GTEST) @@ -414,7 +398,6 @@ else() FetchContent_MakeAvailable(googletest) endif() - ############################################# # wxWidgets # @@ -439,7 +422,6 @@ if(WIN32) set(wxWidgets_USE_UNICODE OFF) find_package(wxWidgets REQUIRED COMPONENTS propgrid base core aui adv html net) include(${wxWidgets_USE_FILE}) - #message(${wxWidgets_USE_FILE}) elseif(${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD") if(NOT DEFINED wxWidgets_PREFIX_DIRECTORY) @@ -476,16 +458,11 @@ else() find_package(wxWidgets REQUIRED COMPONENTS aui core base adv html net) if(NOT wxWidgets_FOUND) - message(FATAL_ERROR "WxWidget cannot be found. Please use wx-config prefix") + message(FATAL_ERROR "wxWidgets cannot be found. Please use wx-config prefix") endif() - #if(APPLE) - # set(PHD_LINK_EXTERNAL ${PHD_LINK_EXTERNAL} wx_osx_cocoau_aui-3.0) - #endif() - #message("wxLibraries ${wxWidgets_LIBRARIES}") endif() -set(PHD_LINK_EXTERNAL ${PHD_LINK_EXTERNAL} ${wxWidgets_LIBRARIES}) - +list(APPEND PHD_LINK_EXTERNAL ${wxWidgets_LIBRARIES}) ############################################# # @@ -496,17 +473,17 @@ set(PHD_LINK_EXTERNAL ${PHD_LINK_EXTERNAL} ${wxWidgets_LIBRARIES}) if(USE_SYSTEM_LIBINDI) message(STATUS "Using system's libindi") find_package(INDI 2.0.0 REQUIRED) - set(PHD_LINK_EXTERNAL ${PHD_LINK_EXTERNAL} ${INDI_CLIENT_LIBRARIES}) + list(APPEND PHD_LINK_EXTERNAL ${INDI_CLIENT_LIBRARIES}) find_package(ZLIB REQUIRED) - set(PHD_LINK_EXTERNAL ${PHD_LINK_EXTERNAL} ${ZLIB_LIBRARIES}) + list(APPEND PHD_LINK_EXTERNAL ${ZLIB_LIBRARIES}) find_package(Nova REQUIRED) add_definitions("-DLIBNOVA") include_directories(${NOVA_INCLUDE_DIR}) - set(PHD_LINK_EXTERNAL ${PHD_LINK_EXTERNAL} ${NOVA_LIBRARIES}) + list(APPEND PHD_LINK_EXTERNAL ${NOVA_LIBRARIES}) else() - Include(ExternalProject) + include(ExternalProject) set(indi_INSTALL_DIR ${CMAKE_BINARY_DIR}/libindi) ExternalProject_Add( indi @@ -526,16 +503,16 @@ else() ) include_directories(${indi_INSTALL_DIR}/include) if (WIN32) - set(PHD_LINK_EXTERNAL ${PHD_LINK_EXTERNAL} ${indi_INSTALL_DIR}/lib/indiclient.lib) + list(APPEND PHD_LINK_EXTERNAL ${indi_INSTALL_DIR}/lib/indiclient.lib) else() - set(PHD_LINK_EXTERNAL ${PHD_LINK_EXTERNAL} ${indi_INSTALL_DIR}/lib/libindiclient.a) + list(APPEND PHD_LINK_EXTERNAL ${indi_INSTALL_DIR}/lib/libindiclient.a) if(APPLE) # MacOS must use a static libnova to avoid introducing a homebrew or macports dylib dependency find_library(LIBNOVA REQUIRED NAMES libnova.a PATHS /usr/local/lib) - set(PHD_LINK_EXTERNAL ${PHD_LINK_EXTERNAL} ${LIBNOVA}) + list(APPEND PHD_LINK_EXTERNAL ${LIBNOVA}) else() find_library(LIBNOVA REQUIRED NAMES nova) - set(PHD_LINK_EXTERNAL ${PHD_LINK_EXTERNAL} ${LIBNOVA} z) + list(APPEND PHD_LINK_EXTERNAL ${LIBNOVA} z) endif() ## Define LIBNOVA when building Indi from source. add_definitions("-DLIBNOVA") @@ -546,7 +523,6 @@ else() # list(APPEND PHD_EXTERNAL_PROJECT_DEPENDENCIES indi) endif() - ############################################# # # Windows specific dependencies @@ -575,21 +551,21 @@ if(WIN32) endif() include_directories(${VCPKG_INCLUDE}/opencv2) - set(PHD_LINK_EXTERNAL_DEBUG ${PHD_LINK_EXTERNAL_DEBUG} + list(APPEND PHD_LINK_EXTERNAL_DEBUG ${VCPKG_DEBUG_LIB}/opencv_imgproc4d.lib ${VCPKG_DEBUG_LIB}/opencv_highgui4d.lib ${VCPKG_DEBUG_LIB}/opencv_core4d.lib ${VCPKG_DEBUG_LIB}/opencv_videoio4d.lib ${VCPKG_DEBUG_LIB}/opencv_imgcodecs4d.lib ) - set(PHD_LINK_EXTERNAL_RELEASE ${PHD_LINK_EXTERNAL_RELEASE} + list(APPEND PHD_LINK_EXTERNAL_RELEASE ${VCPKG_RELEASE_LIB}/opencv_imgproc4.lib ${VCPKG_RELEASE_LIB}/opencv_highgui4.lib ${VCPKG_RELEASE_LIB}/opencv_core4.lib ${VCPKG_RELEASE_LIB}/opencv_videoio4.lib ${VCPKG_RELEASE_LIB}/opencv_imgcodecs4.lib ) - set(PHD_COPY_EXTERNAL_DBG ${PHD_COPY_EXTERNAL_DBG} + list(APPEND PHD_COPY_EXTERNAL_DBG ${VCPKG_DEBUG_BIN}/opencv_imgproc4d.dll ${VCPKG_DEBUG_BIN}/opencv_highgui4d.dll ${VCPKG_DEBUG_BIN}/opencv_core4d.dll @@ -603,7 +579,7 @@ if(WIN32) ${VCPKG_DEBUG_BIN}/libwebpdecoder.dll ${VCPKG_DEBUG_BIN}/libsharpyuv.dll ) - set(PHD_COPY_EXTERNAL_REL ${PHD_COPY_EXTERNAL_REL} + list(APPEND PHD_COPY_EXTERNAL_REL ${VCPKG_RELEASE_BIN}/opencv_imgproc4.dll ${VCPKG_RELEASE_BIN}/opencv_highgui4.dll ${VCPKG_RELEASE_BIN}/opencv_core4.dll @@ -638,92 +614,101 @@ endif() # Various camera libraries if(WIN32) # Video for Windows, directshow and windows media - set(PHD_LINK_EXTERNAL ${PHD_LINK_EXTERNAL} vfw32.lib Strmiids.lib Quartz.lib winmm.lib) + list(APPEND PHD_LINK_EXTERNAL + vfw32.lib + Strmiids.lib + Quartz.lib + winmm.lib + ) # gpusb - set(PHD_LINK_EXTERNAL ${PHD_LINK_EXTERNAL} ${PHD_PROJECT_ROOT_DIR}/cameras/ShoestringGPUSB_DLL.lib) - set(PHD_COPY_EXTERNAL_ALL ${PHD_COPY_EXTERNAL_ALL} ${PHD_PROJECT_ROOT_DIR}/WinLibs/ShoestringGPUSB_DLL.dll) - set(PHD_LINK_EXTERNAL ${PHD_LINK_EXTERNAL} ${PHD_PROJECT_ROOT_DIR}/cameras/ShoestringLXUSB_DLL.lib) - set(PHD_COPY_EXTERNAL_ALL ${PHD_COPY_EXTERNAL_ALL} ${PHD_PROJECT_ROOT_DIR}/WinLibs/ShoestringLXUSB_DLL.dll) + list(APPEND PHD_LINK_EXTERNAL ${PHD_PROJECT_ROOT_DIR}/cameras/ShoestringGPUSB_DLL.lib) + list(APPEND PHD_COPY_EXTERNAL_ALL ${PHD_PROJECT_ROOT_DIR}/WinLibs/ShoestringGPUSB_DLL.dll) + list(APPEND PHD_LINK_EXTERNAL ${PHD_PROJECT_ROOT_DIR}/cameras/ShoestringLXUSB_DLL.lib) + list(APPEND PHD_COPY_EXTERNAL_ALL ${PHD_PROJECT_ROOT_DIR}/WinLibs/ShoestringLXUSB_DLL.dll) # ASI cameras - set(PHD_LINK_EXTERNAL ${PHD_LINK_EXTERNAL} ${PHD_PROJECT_ROOT_DIR}/cameras/ASICamera2.lib) - set(PHD_COPY_EXTERNAL_ALL ${PHD_COPY_EXTERNAL_ALL} ${PHD_PROJECT_ROOT_DIR}/WinLibs/ASICamera2.dll) + list(APPEND PHD_LINK_EXTERNAL ${PHD_PROJECT_ROOT_DIR}/cameras/ASICamera2.lib) + list(APPEND PHD_COPY_EXTERNAL_ALL ${PHD_PROJECT_ROOT_DIR}/WinLibs/ASICamera2.dll) # ToupTek cameras - set(PHD_LINK_EXTERNAL ${PHD_LINK_EXTERNAL} ${PHD_PROJECT_ROOT_DIR}/cameras/toupcam.lib) - set(PHD_COPY_EXTERNAL_ALL ${PHD_COPY_EXTERNAL_ALL} ${PHD_PROJECT_ROOT_DIR}/WinLibs/toupcam.dll) + list(APPEND PHD_LINK_EXTERNAL ${PHD_PROJECT_ROOT_DIR}/cameras/toupcam.lib) + list(APPEND PHD_COPY_EXTERNAL_ALL ${PHD_PROJECT_ROOT_DIR}/WinLibs/toupcam.dll) # QHY cameras - set(PHD_LINK_EXTERNAL ${PHD_LINK_EXTERNAL} ${PHD_PROJECT_ROOT_DIR}/cameras/qhyccd.lib) - set(PHD_COPY_EXTERNAL_ALL ${PHD_COPY_EXTERNAL_ALL} ${PHD_PROJECT_ROOT_DIR}/WinLibs/qhyccd.dll) - set(PHD_COPY_EXTERNAL_ALL ${PHD_COPY_EXTERNAL_ALL} ${PHD_PROJECT_ROOT_DIR}/WinLibs/tbb.dll) + list(APPEND PHD_LINK_EXTERNAL ${PHD_PROJECT_ROOT_DIR}/cameras/qhyccd.lib) + list(APPEND PHD_COPY_EXTERNAL_ALL ${PHD_PROJECT_ROOT_DIR}/WinLibs/qhyccd.dll) + list(APPEND PHD_COPY_EXTERNAL_ALL ${PHD_PROJECT_ROOT_DIR}/WinLibs/tbb.dll) # altair cameras - set(PHD_COPY_EXTERNAL_ALL ${PHD_COPY_EXTERNAL_ALL} ${PHD_PROJECT_ROOT_DIR}/WinLibs/altaircam.dll) - set(PHD_COPY_EXTERNAL_ALL ${PHD_COPY_EXTERNAL_ALL} ${PHD_PROJECT_ROOT_DIR}/WinLibs/AltairCam_legacy.dll) + list(APPEND PHD_COPY_EXTERNAL_ALL ${PHD_PROJECT_ROOT_DIR}/WinLibs/altaircam.dll) + list(APPEND PHD_COPY_EXTERNAL_ALL ${PHD_PROJECT_ROOT_DIR}/WinLibs/AltairCam_legacy.dll) # SBIGUDrv add_definitions(-DHAVE_SBIG_CAMERA=1) - set(PHD_LINK_EXTERNAL ${PHD_LINK_EXTERNAL} ${PHD_PROJECT_ROOT_DIR}/cameras/SBIGUDrv.lib) - #set(PHD_COPY_EXTERNAL_ALL ${PHD_COPY_EXTERNAL_ALL} ${PHD_PROJECT_ROOT_DIR}/WinLibs/SBIGUDrv.dll) # this is delay load, the dll does not exist in the sources + list(APPEND PHD_LINK_EXTERNAL ${PHD_PROJECT_ROOT_DIR}/cameras/SBIGUDrv.lib) + #list(APPEND PHD_COPY_EXTERNAL_ALL ${PHD_PROJECT_ROOT_DIR}/WinLibs/SBIGUDrv.dll) # this is delay load, the dll does not exist in the sources # DICAMSDK - set(PHD_LINK_EXTERNAL ${PHD_LINK_EXTERNAL} ${PHD_PROJECT_ROOT_DIR}/cameras/DICAMSDK.lib) - set(PHD_COPY_EXTERNAL_ALL ${PHD_COPY_EXTERNAL_ALL} ${PHD_PROJECT_ROOT_DIR}/WinLibs/DICAMSDK.dll) + list(APPEND PHD_LINK_EXTERNAL ${PHD_PROJECT_ROOT_DIR}/cameras/DICAMSDK.lib) + list(APPEND PHD_COPY_EXTERNAL_ALL ${PHD_PROJECT_ROOT_DIR}/WinLibs/DICAMSDK.dll) # SXUSB - set(PHD_LINK_EXTERNAL ${PHD_LINK_EXTERNAL} ${PHD_PROJECT_ROOT_DIR}/cameras/SXUSB.lib) - set(PHD_COPY_EXTERNAL_ALL ${PHD_COPY_EXTERNAL_ALL} ${PHD_PROJECT_ROOT_DIR}/WinLibs/SXUSB.dll) + list(APPEND PHD_LINK_EXTERNAL ${PHD_PROJECT_ROOT_DIR}/cameras/SXUSB.lib) + list(APPEND PHD_COPY_EXTERNAL_ALL ${PHD_PROJECT_ROOT_DIR}/WinLibs/SXUSB.dll) # astroDLL - #set(PHD_LINK_EXTERNAL ${PHD_LINK_EXTERNAL} ${PHD_PROJECT_ROOT_DIR}/cameras/astroDLLQHY5V.lib) - set(PHD_COPY_EXTERNAL_ALL ${PHD_COPY_EXTERNAL_ALL} ${PHD_PROJECT_ROOT_DIR}/WinLibs/astroDLLGeneric.dll) - set(PHD_COPY_EXTERNAL_ALL ${PHD_COPY_EXTERNAL_ALL} ${PHD_PROJECT_ROOT_DIR}/WinLibs/astroDLLQHY5V.dll) - set(PHD_COPY_EXTERNAL_ALL ${PHD_COPY_EXTERNAL_ALL} ${PHD_PROJECT_ROOT_DIR}/WinLibs/astroDLLsspiag.dll) + #list(APPEND PHD_LINK_EXTERNAL ${PHD_PROJECT_ROOT_DIR}/cameras/astroDLLQHY5V.lib) + list(APPEND PHD_COPY_EXTERNAL_ALL + ${PHD_PROJECT_ROOT_DIR}/WinLibs/astroDLLGeneric.dll + ${PHD_PROJECT_ROOT_DIR}/WinLibs/astroDLLQHY5V.dll + ${PHD_PROJECT_ROOT_DIR}/WinLibs/astroDLLsspiag.dll + ) # CMOSDLL - set(PHD_LINK_EXTERNAL ${PHD_LINK_EXTERNAL} ${PHD_PROJECT_ROOT_DIR}/cameras/CMOSDLL.lib) - set(PHD_COPY_EXTERNAL_ALL ${PHD_COPY_EXTERNAL_ALL} ${PHD_PROJECT_ROOT_DIR}/WinLibs/CMOSDLL.dll) + list(APPEND PHD_LINK_EXTERNAL ${PHD_PROJECT_ROOT_DIR}/cameras/CMOSDLL.lib) + list(APPEND PHD_COPY_EXTERNAL_ALL ${PHD_PROJECT_ROOT_DIR}/WinLibs/CMOSDLL.dll) # inpout32 ? - set(PHD_LINK_EXTERNAL ${PHD_LINK_EXTERNAL} ${PHD_PROJECT_ROOT_DIR}/cameras/inpout32.lib) - set(PHD_COPY_EXTERNAL_ALL ${PHD_COPY_EXTERNAL_ALL} ${PHD_PROJECT_ROOT_DIR}/WinLibs/inpout32.dll) + list(APPEND PHD_LINK_EXTERNAL ${PHD_PROJECT_ROOT_DIR}/cameras/inpout32.lib) + list(APPEND PHD_COPY_EXTERNAL_ALL ${PHD_PROJECT_ROOT_DIR}/WinLibs/inpout32.dll) # some other that are explicitly loaded at runtime - set(PHD_COPY_EXTERNAL_ALL ${PHD_COPY_EXTERNAL_ALL} ${PHD_PROJECT_ROOT_DIR}/WinLibs/SSPIAGCAM.dll) - set(PHD_COPY_EXTERNAL_ALL ${PHD_COPY_EXTERNAL_ALL} ${PHD_PROJECT_ROOT_DIR}/WinLibs/SSPIAGUSB_WIN.dll) + list(APPEND PHD_COPY_EXTERNAL_ALL + ${PHD_PROJECT_ROOT_DIR}/WinLibs/SSPIAGCAM.dll + ${PHD_PROJECT_ROOT_DIR}/WinLibs/SSPIAGUSB_WIN.dll + ) # SVB cameras - set(PHD_LINK_EXTERNAL ${PHD_LINK_EXTERNAL} ${PHD_PROJECT_ROOT_DIR}/cameras/SVBCameraSDK.lib) - set(PHD_COPY_EXTERNAL_ALL ${PHD_COPY_EXTERNAL_ALL} ${PHD_PROJECT_ROOT_DIR}/WinLibs/SVBCameraSDK.dll) + list(APPEND PHD_LINK_EXTERNAL ${PHD_PROJECT_ROOT_DIR}/cameras/SVBCameraSDK.lib) + list(APPEND PHD_COPY_EXTERNAL_ALL ${PHD_PROJECT_ROOT_DIR}/WinLibs/SVBCameraSDK.dll) # Moravian gX-driver cameras -# set(PHD_LINK_EXTERNAL ${PHD_LINK_EXTERNAL} ${PHD_PROJECT_ROOT_DIR}/cameras/moravian/win/lib/gXeth.lib) - set(PHD_LINK_EXTERNAL ${PHD_LINK_EXTERNAL} ${PHD_PROJECT_ROOT_DIR}/cameras/moravian/win/lib/gXusb.lib) -# set(PHD_COPY_EXTERNAL_ALL ${PHD_COPY_EXTERNAL_ALL} ${PHD_PROJECT_ROOT_DIR}/cameras/moravian/win/lib/gXeth.dll) - set(PHD_COPY_EXTERNAL_ALL ${PHD_COPY_EXTERNAL_ALL} ${PHD_PROJECT_ROOT_DIR}/cameras/moravian/win/lib/gXusb.dll) + list(APPEND PHD_LINK_EXTERNAL + # ${PHD_PROJECT_ROOT_DIR}/cameras/moravian/win/lib/gXeth.lib + ${PHD_PROJECT_ROOT_DIR}/cameras/moravian/win/lib/gXusb.lib + ) + list(APPEND PHD_COPY_EXTERNAL_ALL + # ${PHD_PROJECT_ROOT_DIR}/cameras/moravian/win/lib/gXeth.dll + ${PHD_PROJECT_ROOT_DIR}/cameras/moravian/win/lib/gXusb.dll + ) include_directories(${PHD_PROJECT_ROOT_DIR}/cameras/moravian/include) # Player One cameras - set(PHD_LINK_EXTERNAL ${PHD_LINK_EXTERNAL} ${PHD_PROJECT_ROOT_DIR}/cameras/playerone/win/PlayerOneCamera.lib) - set(PHD_COPY_EXTERNAL_ALL ${PHD_COPY_EXTERNAL_ALL} ${PHD_PROJECT_ROOT_DIR}/cameras/playerone/win/PlayerOneCamera.dll) + list(APPEND PHD_LINK_EXTERNAL ${PHD_PROJECT_ROOT_DIR}/cameras/playerone/win/PlayerOneCamera.lib) + list(APPEND PHD_COPY_EXTERNAL_ALL ${PHD_PROJECT_ROOT_DIR}/cameras/playerone/win/PlayerOneCamera.dll) include_directories(${PHD_PROJECT_ROOT_DIR}/cameras/playerone/include) - set(PHD_COPY_EXTERNAL_ALL ${PHD_COPY_EXTERNAL_ALL} ${PHD_PROJECT_ROOT_DIR}/WinLibs/msvcr120.dll) - set(PHD_COPY_EXTERNAL_ALL ${PHD_COPY_EXTERNAL_ALL} ${PHD_PROJECT_ROOT_DIR}/WinLibs/msvcp140.dll) - set(PHD_COPY_EXTERNAL_ALL ${PHD_COPY_EXTERNAL_ALL} ${PHD_PROJECT_ROOT_DIR}/WinLibs/vcomp140.dll) - set(PHD_COPY_EXTERNAL_ALL ${PHD_COPY_EXTERNAL_ALL} ${PHD_PROJECT_ROOT_DIR}/WinLibs/vcruntime140.dll) - set(PHD_COPY_EXTERNAL_ALL ${PHD_COPY_EXTERNAL_ALL} ${PHD_PROJECT_ROOT_DIR}/WinLibs/concrt140.dll) - - # ASCOM - # disabled since not used in the SLN - #find_package(ASCOM_INTERFACE REQUIRED) - #include_directories(${ASCOM_INTERFACE_DIR}) + list(APPEND PHD_COPY_EXTERNAL_ALL + ${PHD_PROJECT_ROOT_DIR}/WinLibs/msvcr120.dll + ${PHD_PROJECT_ROOT_DIR}/WinLibs/msvcp140.dll + ${PHD_PROJECT_ROOT_DIR}/WinLibs/vcomp140.dll + ${PHD_PROJECT_ROOT_DIR}/WinLibs/vcruntime140.dll + ${PHD_PROJECT_ROOT_DIR}/WinLibs/concrt140.dll + ) endif() - ############################################# # SBIG specific dependencies if installed part of system ############################################# @@ -749,7 +734,10 @@ if(SBIG_SYSTEM AND UNIX) find_library(SBIGUDRV_LIBRARIES NAMES sbigudrv) include_directories(${SBIG_INCLUDE_DIR}) - set(PHD_LINK_EXTERNAL ${PHD_LINK_EXTERNAL} SBIG sbigudrv) + list(APPEND PHD_LINK_EXTERNAL + SBIG + sbigudrv + ) endif() @@ -759,11 +747,19 @@ endif() # ############################################# if(APPLE) - set(PHD_LINK_EXTERNAL ${PHD_LINK_EXTERNAL} ${QuickTime} ${IOKit} ${Carbon} ${Cocoa} ${System} ${Webkit} ${AudioToolbox} ${OpenGL}) + list(APPEND PHD_LINK_EXTERNAL + ${QuickTime} + ${IOKit} + ${Carbon} + ${Cocoa} + ${System} + ${Webkit} + ${AudioToolbox} + ${OpenGL} + ) find_path(CARBON_INCLUDE_DIR Carbon.h) - ############################################# # Camera frameworks # @@ -776,8 +772,8 @@ if(APPLE) endif() include_directories(${sbigudFramework}) add_definitions(-DHAVE_SBIG_CAMERA=1) - set(PHD_LINK_EXTERNAL ${PHD_LINK_EXTERNAL} ${sbigudFramework}) - set(phd2_OSX_FRAMEWORKS ${phd2_OSX_FRAMEWORKS} ${sbigudFramework}) + list(APPEND PHD_LINK_EXTERNAL ${sbigudFramework}) + list(APPEND phd2_OSX_FRAMEWORKS ${sbigudFramework}) find_library( asiCamera2 NAMES ASICamera2 @@ -786,8 +782,8 @@ if(APPLE) message(FATAL_ERROR "Cannot find the asiCamera2 drivers") endif() add_definitions(-DHAVE_ZWO_CAMERA=1) - set(PHD_LINK_EXTERNAL ${PHD_LINK_EXTERNAL} ${asiCamera2}) - set(phd2_OSX_FRAMEWORKS ${phd2_OSX_FRAMEWORKS} ${asiCamera2}) + list(APPEND PHD_LINK_EXTERNAL ${asiCamera2}) + list(APPEND phd2_OSX_FRAMEWORKS ${asiCamera2}) find_library( SVBCameraSDK NAMES SVBCameraSDK @@ -798,8 +794,8 @@ if(APPLE) if(SVBCameraSDK) add_definitions(-DHAVE_SVB_CAMERA=1) - set(PHD_LINK_EXTERNAL ${PHD_LINK_EXTERNAL} ${SVBCameraSDK}) - set(phd2_OSX_FRAMEWORKS ${phd2_OSX_FRAMEWORKS} ${SVBCameraSDK}) + list(APPEND PHD_LINK_EXTERNAL ${SVBCameraSDK}) + list(APPEND phd2_OSX_FRAMEWORKS ${SVBCameraSDK}) endif() find_library( qhylib @@ -809,8 +805,8 @@ if(APPLE) message(FATAL_ERROR "Cannot find the qhy SDK libs") endif() add_definitions(-DHAVE_QHY_CAMERA=1) - set(PHD_LINK_EXTERNAL ${PHD_LINK_EXTERNAL} ${qhylib}) - set(phd2_OSX_FRAMEWORKS ${phd2_OSX_FRAMEWORKS} ${qhylib}) + list(APPEND PHD_LINK_EXTERNAL ${qhylib}) + list(APPEND phd2_OSX_FRAMEWORKS ${qhylib}) find_library( toupcam NAMES toupcam @@ -818,9 +814,9 @@ if(APPLE) if(NOT toupcam) message(FATAL_ERROR "Cannot find the toupcam drivers") endif() - set(PHD_LINK_EXTERNAL ${PHD_LINK_EXTERNAL} ${toupcam}) + list(APPEND PHD_LINK_EXTERNAL ${toupcam}) add_definitions(-DHAVE_TOUPTEK_CAMERA=1) - set(phd2_OSX_FRAMEWORKS ${phd2_OSX_FRAMEWORKS} ${toupcam}) + list(APPEND phd2_OSX_FRAMEWORKS ${toupcam}) find_library( ogmacam NAMES ogmacam @@ -828,18 +824,9 @@ if(APPLE) if(NOT ogmacam) message(FATAL_ERROR "Cannot find the ogmacam drivers") endif() - set(PHD_LINK_EXTERNAL ${PHD_LINK_EXTERNAL} ${ogmacam}) + list(APPEND PHD_LINK_EXTERNAL ${ogmacam}) add_definitions(-DHAVE_OGMA_CAMERA=1) - set(phd2_OSX_FRAMEWORKS ${phd2_OSX_FRAMEWORKS} ${ogmacam}) - - ### does not work on x64 - #find_library( openssag - # NAMES openssag - # PATHS ${PHD_PROJECT_ROOT_DIR}/cameras ) - #if(NOT openssag) - # message(FATAL_ERROR "Cannot find the openssag drivers") - #endif() - #set(PHD_LINK_EXTERNAL ${PHD_LINK_EXTERNAL} ${openssag}) + list(APPEND phd2_OSX_FRAMEWORKS ${ogmacam}) set(LIBOPENSSAG openssag) set(libopenssag_dir ${thirdparty_dir}/${LIBOPENSSAG}/src) @@ -850,10 +837,10 @@ if(APPLE) ${libopenssag_dir}/openssag_priv.h ${libopenssag_dir}/openssag.cpp ${libopenssag_dir}/openssag.h - ) + ) add_library(OpenSSAG ${libOPENSSAG_SRC}) target_include_directories(OpenSSAG PRIVATE ${thirdparty_dir}/${LIBOPENSSAG}/src) - set(PHD_LINK_EXTERNAL ${PHD_LINK_EXTERNAL} OpenSSAG) + list(APPEND PHD_LINK_EXTERNAL OpenSSAG) add_definitions(-DHAVE_OPENSSAG_CAMERA=1) set_property(TARGET OpenSSAG PROPERTY FOLDER "Thirdparty/") @@ -870,11 +857,6 @@ if(APPLE) endif() # APPLE - - - - - ############################################# # # Unix/Linux specific dependencies @@ -944,7 +926,7 @@ if(UNIX AND NOT APPLE) endif() message(STATUS "Found ASICamera2 lib ${asiCamera2}") add_definitions(-DHAVE_ZWO_CAMERA=1) - set(PHD_LINK_EXTERNAL ${PHD_LINK_EXTERNAL} ${asiCamera2}) + list(APPEND PHD_LINK_EXTERNAL ${asiCamera2}) find_library(toupcam NAMES toupcam @@ -956,8 +938,8 @@ if(UNIX AND NOT APPLE) endif() message(STATUS "Found toupcam lib ${toupcam}") add_definitions(-DHAVE_TOUPTEK_CAMERA=1) - set(PHD_LINK_EXTERNAL ${PHD_LINK_EXTERNAL} ${toupcam}) - set(PHD_INSTALL_LIBS ${PHD_INSTALL_LIBS} ${toupcam}) + list(APPEND PHD_LINK_EXTERNAL ${toupcam}) + list(APPEND PHD_INSTALL_LIBS ${toupcam}) find_library(ogmacam NAMES ogmacam @@ -969,21 +951,20 @@ if(UNIX AND NOT APPLE) endif() message(STATUS "Found ogmacam lib ${ogmacam}") add_definitions(-DHAVE_OGMA_CAMERA=1) - set(PHD_LINK_EXTERNAL ${PHD_LINK_EXTERNAL} ${ogmacam}) - set(PHD_INSTALL_LIBS ${PHD_INSTALL_LIBS} ${ogmacam}) + list(APPEND PHD_LINK_EXTERNAL ${ogmacam}) + list(APPEND PHD_INSTALL_LIBS ${ogmacam}) find_library(SVBCameraSDK NAMES SVBCameraSDK NO_DEFAULT_PATHS PATHS ${PHD_PROJECT_ROOT_DIR}/cameras/svblibs/linux/${svbony_arch}) - if(NOT SVBCameraSDK) message(FATAL_ERROR "Cannot find the SVBCameraSDK drivers") endif() message(STATUS "Found SVBCameraSDK lib ${SVBCameraSDK}") add_definitions(-DHAVE_SVB_CAMERA=1) - set(PHD_LINK_EXTERNAL ${PHD_LINK_EXTERNAL} ${SVBCameraSDK}) - set(PHD_INSTALL_LIBS ${PHD_INSTALL_LIBS} ${SVBCameraSDK}) + list(APPEND PHD_LINK_EXTERNAL ${SVBCameraSDK}) + list(APPEND PHD_INSTALL_LIBS ${SVBCameraSDK}) if(IS_DIRECTORY ${PHD_PROJECT_ROOT_DIR}/cameras/qhyccdlibs/linux/${qhyarch}) add_definitions(-DHAVE_QHY_CAMERA=1) @@ -996,7 +977,7 @@ if(UNIX AND NOT APPLE) if(NOT qhylib) message(FATAL_ERROR "Cannot find the qhy SDK libs") endif() - set(PHD_LINK_EXTERNAL ${PHD_LINK_EXTERNAL} ${qhylib}) + list(APPEND PHD_LINK_EXTERNAL ${qhylib}) endif() find_library( playerone @@ -1045,18 +1026,18 @@ if(UNIX AND NOT APPLE) ${libopenssag_dir}/openssag_priv.h ${libopenssag_dir}/openssag.cpp ${libopenssag_dir}/openssag.h - ) + ) add_library(OpenSSAG ${libOPENSSAG_SRC}) target_include_directories(OpenSSAG PRIVATE ${thirdparty_dir}/${LIBOPENSSAG}/src) add_definitions(-DHAVE_OPENSSAG_CAMERA=1) - set(PHD_LINK_EXTERNAL ${PHD_LINK_EXTERNAL} OpenSSAG) + list(APPEND PHD_LINK_EXTERNAL OpenSSAG) set_property(TARGET OpenSSAG PROPERTY FOLDER "Thirdparty/") endif() # OPENSOURCE_ONLY # math library is needed, and should be one of the last things to link to here find_library(mathlib NAMES m) - set(PHD_LINK_EXTERNAL ${PHD_LINK_EXTERNAL} ${mathlib}) + list(APPEND PHD_LINK_EXTERNAL ${mathlib}) endif() @@ -1070,10 +1051,10 @@ elseif(UNIX OR APPLE) add_definitions(-DHAVE_SXV_CAMERA=1) set(SXV_PLATFORM_SRC ${PHD_PROJECT_ROOT_DIR}/cameras/SXMacLib.h - ${PHD_PROJECT_ROOT_DIR}/cameras/SXMacLib.c) + ${PHD_PROJECT_ROOT_DIR}/cameras/SXMacLib.c + ) endif() - ############################################# # KwiqGuider ############################################# @@ -1090,7 +1071,6 @@ if(APPLE) ) endif() - ############################################# # # gettext and msgmerge tools for documentation/internationalization