
All of our executables need resources; e.g. the vector font is a resource and it is necessary for generation. Before this commit, the GUI executable loaded the resources in a nice way, and everything else did it in a very ad-hoc, fragile way. After this commit, all executables are placed in <build>/bin and follow the same algorithm: * On Windows, resources are compiled and linked into every executable. * On Linux, resources are copied into <build>/res (which is tried first) and <prefix>/share/solvespace (which is tried second). * On macOS, resources are copied into <build>/res (which is tried first) and <build>/bin/solvespace.app/Contents/Resources (which is tried second). In practice this means that we can add as many executables as we want without duplicating lots of code. In addition, on macOS, we can place supplementary executables into the bundle, and they can use resources from the bundle transparently.
17 lines
402 B
CMake
17 lines
402 B
CMake
# benchmark runner
|
|
|
|
foreach(pkg_config_lib CAIRO)
|
|
include_directories(${${pkg_config_lib}_INCLUDE_DIRS})
|
|
link_directories(${${pkg_config_lib}_LIBRARY_DIRS})
|
|
endforeach()
|
|
|
|
add_executable(solvespace_benchmark
|
|
harness.cpp
|
|
$<TARGET_PROPERTY:resources,EXTRA_SOURCES>)
|
|
|
|
target_link_libraries(solvespace_benchmark
|
|
solvespace_headless)
|
|
|
|
add_dependencies(solvespace_benchmark
|
|
resources)
|