Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
187 commits
Select commit Hold shift + click to select a range
090fbc3
Updated floorspaceJS with fixes from @manuvarkey on https://github.co…
macumber Apr 27, 2024
cf28737
Merge branch 'develop' of github.com:openstudiocoalition/OpenStudioAp…
macumber Apr 27, 2024
905cc85
Naive copy conanfile.py from OpenStudio and BUILDING.md
jmarrec May 7, 2024
926c050
Use OS 3.8.0-rc2, update conanfile (don't need cli11), update BUILDIN…
jmarrec May 7, 2024
9d7a896
First pass at updating workflow
jmarrec May 7, 2024
71ece1e
Add a lockfile
jmarrec May 7, 2024
44a0098
@manuvarkey has signed the CLA in openstudiocoalition/OpenStudioAppli…
github-actions[bot] May 8, 2024
fc81d7a
mac avoid boost deprecated error + windows call conanbuild.bat to act…
jmarrec May 13, 2024
f8acd6b
Temporary: disable ubuntu and windows which are passing
jmarrec May 13, 2024
036b0f6
Remove CLI11 from cmakelist
jmarrec May 13, 2024
b482f2b
Fixup the CPack issue by using the ARCH we already compute via uname...
jmarrec May 13, 2024
2f6d046
Workaround for mac arm64 where the OS SDK extracted tar.gz has a diff…
jmarrec May 13, 2024
d393559
Workaround 2 for mac arm64 where the OS SDK extracted tar.gz has a di…
jmarrec May 13, 2024
94960f9
Revert "Temporary: disable ubuntu and windows which are passing"
jmarrec May 13, 2024
bbd89b2
debug statement for future ref
jmarrec May 13, 2024
cb44b69
Merge pull request #712 from openstudiocoalition/conan_v2_os_380_rc2
jmarrec May 13, 2024
81d6ee9
Implement org, repo, etc
jmarrec Mar 26, 2024
bfcf310
Updates for SketchUp 2024
macumber May 17, 2024
377c9d3
One more File.exists
jmarrec May 17, 2024
48d1f9d
Fixup looking for system ruby for running tests
jmarrec May 17, 2024
50f155a
Use same major and minor version of Qt as SketchUp
macumber May 18, 2024
2751769
Don't run workflow if PR is draft
macumber May 18, 2024
f0b8a25
Trigger CI when PR is marked ready for review
macumber May 19, 2024
598c17d
Update to official 3.8.0 packages
macumber May 19, 2024
fff53cf
Update resources
macumber May 20, 2024
55cfab6
Update .github/workflows/app_build.yml
jmarrec May 21, 2024
6473833
Unrelated update AboutBox and model_editor fallbacks for Qt6
jmarrec May 23, 2024
d4f56e7
Allow passing QT_VERSION (default 6.5.3) - Update Qt version in about…
jmarrec May 23, 2024
fea6097
#612 - Proof of concept
jmarrec May 23, 2024
66e21e8
Add a new QAction to display additional props and connect it to MainW…
jmarrec May 24, 2024
538a879
Implement Display Additional Properties for Spaces & Facility subtabs
jmarrec May 24, 2024
ea0e03d
Display AdditionalProps for InspectorGadget
jmarrec May 24, 2024
ae7730b
Make Ruby3 compatible
macumber May 25, 2024
b70a120
Try calling automationmodetool
macumber May 25, 2024
d86d19f
Fix some bugs
macumber May 26, 2024
4ef58a9
Merge branch 'sketchup_2024' of github.com:openstudiocoalition/OpenSt…
macumber May 26, 2024
7d30090
clang format
macumber May 26, 2024
addfaf0
Try the gtest/QApplication workaround
macumber May 26, 2024
4e1dee8
Missed this file
macumber May 26, 2024
f35dda7
Apply fix to benchmark as well, remove PathWatcher support for direct…
macumber May 26, 2024
5dea4d3
Clean up documentation
macumber May 26, 2024
427d60d
Clang format
macumber May 26, 2024
03018ef
Move to Qt 6.5.2
macumber May 26, 2024
1157124
Fix ruby test
macumber May 26, 2024
fbe0d12
Merge branch 'sketchup_2024' of github.com:openstudiocoalition/OpenSt…
macumber May 26, 2024
dbaa0c4
Try to fix tests on Ubuntu
macumber May 26, 2024
6e95292
libxcb -> libxcb-icccm4
macumber May 27, 2024
67dac8d
More libxcb
macumber May 27, 2024
4ac00c2
Remove missing packages
macumber May 27, 2024
1d8597a
Use versions that exist
macumber May 27, 2024
3d5fb88
Merge pull request #698 from openstudiocoalition/672_next
jmarrec May 27, 2024
ff6c20e
Temp disable other platforms to get remaining libxcb issues
macumber May 27, 2024
051b028
Add libxcb-shape
macumber May 27, 2024
4cd5ac0
Finally got tests working on Ubuntu
macumber May 27, 2024
808ff08
Merge branch 'develop' into sketchup_2024
macumber May 27, 2024
cf61365
Merge pull request #714 from openstudiocoalition/sketchup_2024
jmarrec May 30, 2024
a9b492b
Update floorspace (#718)
macumber Jun 22, 2024
4564b64
Merge branch 'develop' into 612_displayName
macumber Jun 22, 2024
13edf34
Add CADOBJECTID and DISPLAYNAME to building and thermal zone
macumber Jul 5, 2024
c421d4f
Prevent crash on facility shading tab
macumber Jul 5, 2024
64121ee
Add loading tab to discourage selecting another measure which argumen…
macumber Jul 5, 2024
657bf47
Fix cppcheck and clang format issues
macumber Jul 5, 2024
7ed4df8
Fix clang format
macumber Jul 5, 2024
203fd59
Implement support for further grouping HVAC library by category (#713)
manuvarkey Jul 11, 2024
995c143
Merge branch 'develop' into 612_displayName
jmarrec Jul 11, 2024
1a621c5
Redupdate translations
jmarrec Jul 11, 2024
7fc6f69
Merge remote-tracking branch 'remotes/origin/develop' into measure_fixes
macumber Jul 11, 2024
57d0a60
Update openstudio_results to version compatible with OS CLI 3.8.0
macumber Jul 12, 2024
2ddc96e
Add Example->Shoebox Model
macumber Jul 12, 2024
d242c14
Add model and measures for shoebox example
macumber Jul 12, 2024
05f8f2c
Catch exceptions if measures in upgraded model have measures that no …
macumber Jul 12, 2024
3eac9db
Clang format
macumber Jul 12, 2024
243ea30
Update measures from BCL
macumber Jul 14, 2024
6ae468f
Remove unused/duplicate method downloadUpdatedBCLMeasures
macumber Jul 14, 2024
65d6505
Move standardReportMeasure to MeasureManager, test updates to measure…
macumber Jul 14, 2024
223964d
Clang format
macumber Jul 14, 2024
65af11b
Remove unused m_useClassicCLI, cannot use classic CLI for MeasureMana…
macumber Jul 14, 2024
5f8d3b9
Merge remote-tracking branch 'origin/v1.7.2-patch' into measure_fixes
macumber Jul 14, 2024
ddc371f
Update translations
macumber Jul 14, 2024
df63e23
Remove measure from disk when deleting last step using it
macumber Jul 14, 2024
3289bee
Facility Shading: use name line edit to avoid icon
jmarrec Jul 15, 2024
c670790
Merge remote-tracking branch 'remotes/origin/master' into measure_fixes
macumber Jul 15, 2024
43dd06b
Merge pull request #715 from openstudiocoalition/612_displayName
jmarrec Jul 15, 2024
d0f8a3b
Set Xcode version to 15.0.1 to avoid boost 1.79.0 error
jmarrec Jul 15, 2024
0feb782
Remove workarounds now that https://github.com/NREL/OpenStudio/pull/5…
macumber Jul 20, 2024
f83e1cb
Remove Shoebox Model from repo, fetch at configure time
macumber Jul 21, 2024
49e8cc2
Remove openstudio_results measure from repo, install from the openstu…
macumber Jul 21, 2024
06a3a6b
Find openstudio_results and ShoeboxModel when running in build dir
macumber Jul 21, 2024
53cfba1
Add measure type badges to workflow steps
macumber Jul 21, 2024
ba11995
Measure manager changed argument to update_measures from measure_dir …
macumber Jul 21, 2024
2fd41ec
Merging master into develop
macumber Jul 21, 2024
94e5e12
Merge remote-tracking branch 'origin/develop' into measure_fixes
macumber Jul 21, 2024
dcbdb87
Merge remote-tracking branch 'origin/develop' into measure_fixes
macumber Jul 21, 2024
da2d1ed
Clang format
macumber Jul 21, 2024
55f5cc3
Merge pull request #720 from openstudiocoalition/measure_fixes
jmarrec Aug 2, 2024
a3314ec
Bump to 1.8.0
macumber Aug 2, 2024
a9b540f
Update scripts to Ruby 3.2 (#724)
macumber Aug 7, 2024
bcae7d2
Configure compressed ext for different builds (#725)
macumber Aug 8, 2024
76ffef6
Disable all workflows, but the app build for mac, and make it upload …
jmarrec Aug 23, 2024
f8b8b0b
Setup codesigning & notarization of the DMG installer itself
jmarrec Aug 23, 2024
6ef322f
Codesign OpenStudioApp.app only (not the OpenStudio / EnergyPlus stuf…
jmarrec Aug 23, 2024
6353789
Setup GHA codesigning
jmarrec Aug 23, 2024
366c5bc
Need the arch variable to get qtifw + self hosted mac does not have a…
jmarrec Aug 23, 2024
088e796
Start codesigning inner libraries and exes
jmarrec Aug 23, 2024
97e71e2
Cannot sign RubyAPI files from top level CMakeLists
jmarrec Aug 23, 2024
0fc02c8
Verify signature: for the CPACK package + on a clean machine too
jmarrec Aug 23, 2024
c16559a
Add Path.is_relative_to for python 3.8...
jmarrec Aug 23, 2024
cd0af8a
Try to get correct artifact for testing
jmarrec Aug 24, 2024
03d5594
Forgot a step id... see you in 45min
jmarrec Aug 24, 2024
5434291
typo in path in test step
jmarrec Aug 24, 2024
2775b2a
Allow assigning a SpaceInfiltration object directly to a space
jmarrec Jul 15, 2024
5476037
Another typo
jmarrec Aug 26, 2024
4dd03b7
Can't use sudo on the self hosted runner
jmarrec Aug 26, 2024
1085ed0
Use move semantics for concatenating vectors
jmarrec Aug 26, 2024
dcd2323
K, put back the sudo
jmarrec Aug 26, 2024
45674eb
sudoers didn't appear to work...
jmarrec Aug 26, 2024
6558fc1
GRRRRRRRR
jmarrec Aug 26, 2024
e23b6c0
Disable test step on self hosted, can't figure out how to use sudo
jmarrec Aug 26, 2024
6b28918
geeez
jmarrec Aug 26, 2024
a32d25c
For the test step, use the GHA macos-14 (arm64)
jmarrec Aug 27, 2024
4ed3f1f
For the TGZ package, I was signing and resigning over and over again.…
jmarrec Aug 27, 2024
7510b06
Revert "Disable all workflows, but the app build for mac, and make it…
jmarrec Aug 27, 2024
5cfb71b
Don't try to upload otool info on non mac
jmarrec Aug 27, 2024
dcf5438
#728 Fixing the ERV crash
jmarrec Aug 26, 2024
4936cbd
WIP adding charts for SPMs OATempReset and FollowOATemp + add views f…
jmarrec Aug 27, 2024
78c31c9
Add a bunch more SPMs, and when there IS a SPM, display at least the …
jmarrec Aug 28, 2024
5c8ade4
aqt install qtcharts
jmarrec Aug 29, 2024
72b0bda
cppcheck: mark ctor explicit
jmarrec Aug 29, 2024
d4fbeda
Merge pull request #729 from openstudiocoalition/721_SpaceInfiltratio…
jmarrec Aug 29, 2024
a78a443
Merge pull request #727 from openstudiocoalition/codesigning
jmarrec Aug 29, 2024
17faff0
Move SchedulesView colors from a vector to a constexpr array
jmarrec Aug 29, 2024
26558fa
Fix #162 - Display ScheduleConstant, ScheduleCompact and ScheduleFile
jmarrec Aug 29, 2024
19d6761
Allow creating a ScheduleFile from the App too
jmarrec Aug 29, 2024
150656e
Display first few lines of the Schedule:File's External File for context
jmarrec Aug 29, 2024
4bb816c
TODO get m_minutesPerItem to work
jmarrec Aug 29, 2024
af82f25
Fixup the Minutes Per Item one... so weird
jmarrec Aug 29, 2024
b302450
Display content of schedule file for ease of use and fixup refreshCon…
jmarrec Aug 29, 2024
1d4233f
Add a button to let user decide if they want to show all ScheduleFile…
jmarrec Aug 29, 2024
e3b4ebf
Add a QA/QC Label: compute the expected records versus currently sele…
jmarrec Aug 29, 2024
ff6440f
Remove the "Fixed" option, E+ doesn't support it
jmarrec Aug 29, 2024
13a5be5
Style per column!
jmarrec Aug 29, 2024
6c3f2cb
refreshContent on column separator change
jmarrec Aug 29, 2024
604adc0
clang-format-14 (I have 17...)
jmarrec Aug 29, 2024
3d72472
cppcheck
jmarrec Aug 29, 2024
93e16ba
Merge remote-tracking branch 'remotes/origin/162_DisplayMoreSchedules…
macumber Sep 1, 2024
80af9d4
Update src/openstudio_lib/ScheduleOthersController.cpp
jmarrec Sep 2, 2024
fef3b9c
Fix a race condition during CPack packaging
jmarrec Sep 2, 2024
ced0efb
Merge pull request #731 from openstudiocoalition/162_DisplayMoreSched…
jmarrec Sep 2, 2024
2d13a50
Merge pull request #732 from openstudiocoalition/fix_cpack
jmarrec Sep 2, 2024
9c0bf5f
Merge pull request #730 from openstudiocoalition/708_Improve_SPM_Views
jmarrec Sep 3, 2024
38e0307
Hotfix #730 - QtCharts not needed by modeleditor
jmarrec Sep 3, 2024
82183e6
Merge pull request #734 from openstudiocoalition/hotfix/730
jmarrec Sep 3, 2024
8d50667
Fix #671 - Mark Python Measures as in Error if use classic CLI to run…
jmarrec Sep 3, 2024
f43dd7a
Merge pull request #733 from openstudiocoalition/671_MarkPythonErrorC…
jmarrec Sep 3, 2024
cd925a1
Bump to rc2
jmarrec Sep 3, 2024
40c32db
Install directories without adding extra directory
macumber Sep 4, 2024
e4d1fee
Merge remote-tracking branch 'origin/develop' into fix_resources_install
macumber Sep 4, 2024
636b46c
Install OpenGLWidgets on Windows
macumber Sep 4, 2024
e99e5ee
Merge pull request #737 from openstudiocoalition/fix_resources_install
jmarrec Sep 4, 2024
a2999af
Ubuntu 24.04: set available libwxgtk3
jmarrec Sep 4, 2024
9eed191
Try to fixup Icon on Ubuntu 24.04 by adding StartupWMClass and move t…
jmarrec Sep 4, 2024
291243a
#633 - Modernize ApplyCopyright to use a short license string
jmarrec Sep 4, 2024
17f8dfa
Update AboutBoxes to have a configurable Year so it doesn't fall out …
jmarrec Sep 4, 2024
c8c0ff6
[chore] Apply short-style copyright, hopefully for the last time
jmarrec Sep 4, 2024
ad6556e
Add to .git-blame-ignore-revs
jmarrec Sep 4, 2024
074738c
Revert a whitespace change
jmarrec Sep 4, 2024
2277fd5
Merge pull request #740 from openstudiocoalition/739_Ubuntu2404
jmarrec Sep 4, 2024
58ecf75
Merge pull request #741 from openstudiocoalition/633_ShortStyleCopyright
jmarrec Sep 4, 2024
44f381f
bump to rc3
jmarrec Sep 4, 2024
beaf89e
Fix #744 - Update os.icns to the new icon
jmarrec Sep 4, 2024
4db37ff
Use ${CURRENT_YEAR} in OpenStudioApp.rc.in
jmarrec Sep 4, 2024
f804c9a
Try to fix #745 by signing QtWengineProcess with `com.apple.security.…
jmarrec Sep 4, 2024
288291e
Try to fix #745 in the right spot (previous attempt, qtwebenginecore …
jmarrec Sep 4, 2024
0d4e255
#745 - sign the right exe
jmarrec Sep 4, 2024
2084dc9
Try more entitlements
jmarrec Sep 4, 2024
665e77b
Use the Qt install QtWebEngineProcess.entitlements directly
jmarrec Sep 4, 2024
46ffa59
Merge pull request #746 from openstudiocoalition/744_fixup_icon
jmarrec Sep 4, 2024
02903e2
#747 - fixup crash when loading ShoeboxModel from the measures/workfl…
jmarrec Sep 5, 2024
35a87ec
Avoid trying to loadModel when you can check if file exists first
jmarrec Sep 5, 2024
c658cda
Merge pull request #748 from openstudiocoalition/747_CrashShoebox
jmarrec Sep 5, 2024
be76dfb
Add icon, product url, and "Launch OpenStudioApp" at end of install f…
jmarrec Sep 5, 2024
b7146fc
Add a license component for IFW (hidden, required, but will trigger t…
jmarrec Sep 5, 2024
88693b8
Make OpenStudioApp component required...
jmarrec Sep 5, 2024
53e271e
Set IFW title [skip ci]
jmarrec Sep 5, 2024
fee5274
Merge pull request #749 from openstudiocoalition/improve_installer
jmarrec Sep 5, 2024
5aad610
Set Version to OpenStudioApp 1.8.0
jmarrec Sep 5, 2024
2722e3e
Add an Ubuntu-2404 runner (#754)
jmarrec Sep 18, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
3 changes: 3 additions & 0 deletions .git-blame-ignore-revs
Original file line number Diff line number Diff line change
Expand Up @@ -280,3 +280,6 @@ c25573f81282ad7aa0eb72ac24e31c57308cb038

# [chore] Bump copyright to 2023 + about box [Julien Marrec, 2023-03-30]
917bcb5e6576379fe6babb44f46a7f964ef581c6

# [chore] Apply short-style copyright, hopefully for the last time [Julien Marrec, 2024-09-04]
c8c0ff69b8d8e96661d2e5f7384816c09ab3d5ad
520 changes: 354 additions & 166 deletions .github/workflows/app_build.yml

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion .github/workflows/clangformat.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ jobs:
run: |
echo "GITHUB_REF=$GITHUB_REF GITHUB_BASE_REF=$GITHUB_BASE_REF GITHUB_HEAD_REF=$GITHUB_HEAD_REF"
git fetch --all
./ci/clang-format.sh remotes/origin/$GITHUB_HEAD_REF remotes/origin/$GITHUB_BASE_REF
echo "Using clang-format: $(clang-format --version)"
./ci/clang-format.sh HEAD remotes/origin/$GITHUB_BASE_REF

- name: Upload clang-format patch as artifact
if: ${{ failure() }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release_notes.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:

- uses: ruby/setup-ruby@v1
with:
ruby-version: 2.7
ruby-version: 3.2

- uses: actions/setup-python@v5
with:
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -41,3 +41,4 @@ cppcheck.txt*
clang_format.patch
conan-cache
.ccache
CMakeUserPresets.json
135 changes: 135 additions & 0 deletions BUILDING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,135 @@
# Building with conan v2

Check you have `conan >= 2`, and add the `nrel-v2` remote to grab `ruby` and `swig/4.1.1`.

```shell
conan --version
conan remote add -f nrel-v2 http://conan.openstudio.net/artifactory/api/conan/conan-v2
```

## Install the conan dependencies into a build folder

```shell
conan install . --output-folder=../OSApp-build-release --build=missing -c tools.cmake.cmaketoolchain:generator=Ninja -s compiler.cppstd=20 -s build_type=Release
```

You can also do another configuration, such as `Debug`, `RelWithDeb`, etc

```shell
conan install . --output-folder=../OSApp-build --build=missing -c tools.cmake.cmaketoolchain:generator=Ninja -s compiler.cppstd=20 -s build_type=Debug
```

You'll have the `conan-release` and `conan-debug` CMake Presets in the root folder. Do `cmake --list-presets` to list the available presets (which are in `CMakeUserPresets.json`)

*Side note:* If you want a specific configure option (such as a build folder in Release mode where you build with `-DBUILD_CSHARP_BINDINGS:BOOL=ON`) in a different build dir for the same source dir, you probably will need to go and edit the `<build_dir>/CMakePresets.json` to rename it to another configuration name so it does not clash with the preset `conan-release`

## CMake Configure and build

### With presets

#### Why are Presets recommended

The recommend flow is to use [CMake Presets](https://cmake.org/cmake/help/latest/manual/cmake-presets.7.html).

If you notice the messages printed to the console when you run the `conan install` command from above,
you'll see that the `conanfile` actually defines common build variables for you already,
such as defining which `CPack` Generators to use depending on your target platform, trying to infer the `Python_ROOT_DIR` etc

<pre><font color="#75507B"><b>conanfile.py:</b></font> <font color="#75507B"><b>Calling generate()</b></font>
conanfile.py: Generators folder: /path/to/OSApp-build-release
conanfile.py: Setting PYTHON_VERSION and Python_ROOT_DIR from your current python: 3.8.13, &apos;/home/julien/.pyenv/versions/3.8.13&apos;
conanfile.py: CMakeToolchain generated: conan_toolchain.cmake
conanfile.py: Preset &apos;conan-release&apos; added to CMakePresets.json. Invoke it manually using &apos;cmake --preset conan-release&apos; if using CMake&gt;=3.23
conanfile.py: If your CMake version is not compatible with CMakePresets (&lt;3.23) call cmake like:
cmake &lt;path&gt; -G Ninja -DCMAKE_TOOLCHAIN_FILE=/path/to/OSApp-build-release/conan_toolchain.cmake \
-DBUILD_CLI=ON -DBUILD_RUBY_BINDINGS=ON -DBUILD_PYTHON_BINDINGS=ON \
-DBUILD_PYTHON_PIP_PACKAGE=OFF -DBUILD_TESTING=ON -DBUILD_BENCHMARK=ON \
-DCPACK_BINARY_TGZ=ON -DCPACK_BINARY_IFW=OFF -DCPACK_BINARY_DEB=ON -DCPACK_BINARY_NSIS=OFF \
-DCPACK_BINARY_RPM=OFF -DCPACK_BINARY_STGZ=OFF -DCPACK_BINARY_TBZ2=OFF \
-DCPACK_BINARY_TXZ=OFF -DCPACK_BINARY_TZ=OFF \
-DPYTHON_VERSION=3.8.13 -DPython_ROOT_DIR=/home/julien/.pyenv/versions/3.8.13 \
-DCMAKE_POLICY_DEFAULT_CMP0091=NEW -DCMAKE_BUILD_TYPE=Release
conanfile.py: CMakeToolchain generated: CMakePresets.json
conanfile.py: CMakeToolchain generated: ../OpenStudio/CMakeUserPresets.json
<font color="#75507B"><b>conanfile.py:</b></font> <font color="#75507B"><b>Generating aggregated env files</b></font>
conanfile.py: Generated aggregated env files: [&apos;conanbuild.sh&apos;, &apos;conanrun.sh&apos;]
<font color="#4E9A06"><b>Install finished successfully</b></font>
</pre>

**Note that this is also supported by Visual Studio (MSVC)**.

#### Configure and build with Presets

Run these commands from the **source** directory (`OpenStudio/`).

```shell
cmake --preset conan-release [any_futher_configuration_options]
```

Example:

```
cmake --preset conan-release \
-DQT_INSTALL_DIR:PATH=/opt/Qt/6.6.3/gcc_64 \
-DBUILD_PACKAGE:BOOL=ON
```

Building

```
cmake --build --preset conan-release
```

### Atlernatively: manual CMake

First, go to the **build** directory, and **activate the conan build environment**.

```shell
cd ../OSApp-build-release
# Unix
. ./conanbuild.sh
# Windows
call conanbuild.bat
```

Still in the build directory, run cmake, but do pass the `CMAKE_TOOLCHAIN_FILE`

```
cmake -G Ninja -DCMAKE_TOOLCHAIN_FILE=conan_toolchain.cmake -DCMAKE_BUILD_TYPE:STRING=Release \
-DQT_INSTALL_DIR:PATH=/opt/Qt/6.6.3/gcc_64 \
-DBUILD_TESTING:BOOL=ON -DCPACK_BINARY_TGZ:BOOL=ON -DCPACK_BINARY_DEB:BOOL=ON \
-DCPACK_BINARY_IFW:BOOL=OFF -DCPACK_BINARY_NSIS:BOOL=OFF -DCPACK_BINARY_RPM:BOOL=OFF -DCPACK_BINARY_STGZ:BOOL=OFF \
-DCPACK_BINARY_TBZ2:BOOL=OFF -DCPACK_BINARY_TXZ:BOOL=OFF -DCPACK_BINARY_TZ:BOOL=OFF \
-DCMAKE_EXPORT_COMPILE_COMMANDS:BOOL=ON \
../OpenStudio
```

You can deactivate now if you want

```
# Unix
. ./deactivate_conanbuild.sh
# Windows
call deactivate_conanbuild.bat
```

# Full Example

```
git clone git@github.com/NREL/OpenStudio.git
cd OpenStudio
conan install . --output-folder=../OSApp-build-release --build=missing -c tools.cmake.cmaketoolchain:generator=Ninja -s compiler.cppstd=20 -s build_type=Release
cmake --preset conan-release
cmake --build --preset conan-release
```

# Updating the Conan Lockfile

If you want to update a dependency in the `conan.lock`, just delete the line, and use this:


```shell
conan install . --output-folder=../OSApp-build-release --build=missing \
-c tools.cmake.cmaketoolchain:generator=Ninja -s compiler.cppstd=20 -s build_type=Release \
--lockfile-partial --lockfile-out=conan.lock
```
53 changes: 53 additions & 0 deletions CMake/CPackSignAndNotarizeDmg.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
#[=======================================================================[.rst:
CPackSignAndNotarizeDmg
-----------------------

This file is meant to be used up as a ``CPACK_POST_BUILD_SCRIPTS``

It will run only on ``APPLE`` when the generator is ``IFW`` to codesign the resulting .dmg and notarize it.

To do so, it uses the `CodeSigning`_ functions :cmake:command:`codesign_files_macos`

It requires that this be set: :cmake:variable:`CPACK_CODESIGNING_DEVELOPPER_ID_APPLICATION`

And it will only notarize if this is set: :cmake:variable:`CPACK_CODESIGNING_NOTARY_PROFILE_NAME`

#]=======================================================================]
message(STATUS "The message from ${CMAKE_CURRENT_LIST_FILE} and generator ${CPACK_GENERATOR}")
message(STATUS "Built packages: ${CPACK_PACKAGE_FILES}")

if(APPLE AND CPACK_GENERATOR STREQUAL "IFW")

message(DEBUG "CPACK_CODESIGNING_DEVELOPPER_ID_APPLICATION=${CPACK_CODESIGNING_DEVELOPPER_ID_APPLICATION}")
message(DEBUG "CPACK_CODESIGNING_NOTARY_PROFILE_NAME=${CPACK_CODESIGNING_NOTARY_PROFILE_NAME}")
message(DEBUG "CPACK_IFW_PACKAGE_SIGNING_IDENTITY=${CPACK_IFW_PACKAGE_SIGNING_IDENTITY}")
message(DEBUG "CPACK_CODESIGNING_MACOS_IDENTIFIER=${CPACK_CODESIGNING_MACOS_IDENTIFIER}")

include(${CMAKE_CURRENT_LIST_DIR}/CodeSigning.cmake)

if(NOT CPACK_CODESIGNING_DEVELOPPER_ID_APPLICATION)
message(FATAL_ERROR "CPACK_CODESIGNING_DEVELOPPER_ID_APPLICATION is required, this should not have happened")
endif()
if(NOT CPACK_CODESIGNING_MACOS_IDENTIFIER)
message(FATAL_ERROR "CPACK_CODESIGNING_MACOS_IDENTIFIER is required, this should not have happened")
endif()

codesign_files_macos(
FILES ${CPACK_PACKAGE_FILES}
SIGNING_IDENTITY ${CPACK_CODESIGNING_DEVELOPPER_ID_APPLICATION}
IDENTIFIER "${CPACK_CODESIGNING_MACOS_IDENTIFIER}.DmgInstaller"
FORCE
VERBOSE
)

if(CPACK_CODESIGNING_NOTARY_PROFILE_NAME)
notarize_files_macos(
FILES ${CPACK_PACKAGE_FILES}
NOTARY_PROFILE_NAME ${CPACK_CODESIGNING_NOTARY_PROFILE_NAME}
STAPLE
VERIFY
VERBOSE
)
endif()

endif()
Loading