aboutsummaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2018-06-26 11:53:44 +0200
committerThomas White <taw@physics.org>2018-06-26 14:07:42 +0200
commit946ee4bc4a0bc13a965d170ab959cfe7a2cf1b27 (patch)
treeda7397b4df4346724115023c5ac04ed50358b37b /CMakeLists.txt
parenta604828f8a21399574a39d9b3ce38b116fd98ee6 (diff)
Embed diffraction.cl and hdfsee.ui into executables
Having to install these causes problems, e.g. you can't run from build directory nor run tests without installing. For hdfsee.ui, the XML is now embedded in the code just as it is for cell_explorer. diffraction.cl is a bit too long and complicated for that. There are a number of nasty ways to embed such files. This one seems to be the overall least nasty, although it requires data/gen-resources to be run whenever diffraction.cl is changed.
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt12
1 files changed, 2 insertions, 10 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 63ef99f2..8f5f82f0 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -23,7 +23,7 @@ pkg_search_module(GDKPIXBUF gdk-pixbuf-2.0)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fdiagnostics-color=always")
include_directories(${CMAKE_CURRENT_SOURCE_DIR})
-add_definitions(-DHAVE_CONFIG_H -DDATADIR=\"${CMAKE_INSTALL_FULL_DATADIR}\")
+add_definitions(-DHAVE_CONFIG_H)
set(CMAKE_C_STANDARD 99)
# Common include directories and libraries
@@ -120,7 +120,6 @@ set(PATTERN_SIM_SOURCES src/pattern_sim.c src/diffraction.c)
if(HAVE_OPENCL)
set(PATTERN_SIM_OPENCL_SOURCES src/cl-utils.c src/diffraction-gpu.c)
- set(PATTERN_SIM_RESOURCE_FILES data/diffraction.cl)
endif(HAVE_OPENCL)
add_executable(pattern_sim ${PATTERN_SIM_SOURCES} ${PATTERN_SIM_OPENCL_SOURCES})
@@ -132,9 +131,6 @@ if(HAVE_OPENCL)
target_link_libraries(pattern_sim ${OpenCL_LIBRARIES})
endif(HAVE_OPENCL)
-set_target_properties(pattern_sim PROPERTIES
- RESOURCE "${PATTERN_SIM_RESOURCE_FILES}")
-
list(APPEND CRYSTFEL_EXECUTABLES pattern_sim)
# ----------------------------------------------------------------------
@@ -143,7 +139,6 @@ list(APPEND CRYSTFEL_EXECUTABLES pattern_sim)
if (GTK2_FOUND)
set(HDFSEE_SOURCES src/hdfsee.c src/dw-hdfsee.c src/hdfsee-render.c)
- set(HDFSEE_RESOURCE_FILES data/hdfsee.ui)
add_executable(hdfsee ${HDFSEE_SOURCES})
target_include_directories(hdfsee PRIVATE ${COMMON_INCLUDES} ${GTK2_INCLUDE_DIRS})
@@ -154,8 +149,6 @@ if (GTK2_FOUND)
target_link_libraries(hdfsee ${TIFF_LIBRARIES})
endif (TIFF_FOUND)
- set_target_properties(hdfsee PROPERTIES RESOURCE "${HDFSEE_RESOURCE_FILES}")
-
list(APPEND CRYSTFEL_EXECUTABLES hdfsee)
endif (GTK2_FOUND)
@@ -319,8 +312,7 @@ if("${isSystemDir}" STREQUAL "-1")
endif("${isSystemDir}" STREQUAL "-1")
install(TARGETS ${CRYSTFEL_EXECUTABLES}
- RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
- RESOURCE DESTINATION share/crystfel)
+ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
install(FILES
doc/man/ambigator.1