From b89d56001e42f78546a4ec5723beaa82d3fba27d Mon Sep 17 00:00:00 2001 From: Dhanya Thattil Date: Fri, 8 Feb 2019 16:02:05 +0100 Subject: [PATCH] CMake: prefixing the options with SLS_ --- CMakeLists.txt | 24 +++++++++---------- README.md | 4 ++-- cmk.sh | 12 +++++----- .../Directly_using_cmake.html | 4 ++-- manual/manual-main/slsDetectorInstall.tex | 4 ++-- recipe/build.sh | 8 +++---- slsReceiverSoftware/CMakeLists.txt | 4 ++-- 7 files changed, 30 insertions(+), 30 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 34e34c329..4c62ad7a2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -8,10 +8,10 @@ if (CMAKE_CURRENT_SOURCE_DIR STREQUAL CMAKE_SOURCE_DIR) set(SLS_MASTER_PROJECT ON) endif() -option (USE_HDF5 "HDF5 File format" OFF) -option (USE_TEXTCLIENT "Text Client" OFF) -option (USE_RECEIVER "Receiver" OFF) -option (USE_GUI "GUI" OFF) +option (SLS_USE_HDF5 "HDF5 File format" OFF) +option (SLS_USE_TEXTCLIENT "Text Client" OFF) +option (SLS_USE_RECEIVER "Receiver" OFF) +option (SLS_USE_GUI "GUI" OFF) if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang") # clang does not support -Wno-misleading-indentation @@ -29,9 +29,9 @@ find_package(CBF) find_package(Doxygen) # find_package(PNG REQUIRED) -if (USE_HDF5) +if (SLS_USE_HDF5) find_package(HDF5 1.10 COMPONENTS CXX) -endif (USE_HDF5) +endif (SLS_USE_HDF5) set(CMAKE_POSITION_INDEPENDENT_CODE ON) @@ -39,21 +39,21 @@ set(CMAKE_INSTALL_RPATH "$ORIGIN") set(CMAKE_BUILD_WITH_INSTALL_RPATH TRUE) -if (USE_TEXTCLIENT) +if (SLS_USE_TEXTCLIENT) add_subdirectory(slsDetectorSoftware) -endif (USE_TEXTCLIENT) +endif (SLS_USE_TEXTCLIENT) -if (USE_RECEIVER) +if (SLS_USE_RECEIVER) add_subdirectory(slsReceiverSoftware) add_subdirectory(manual/manual-api) -endif (USE_RECEIVER) +endif (SLS_USE_RECEIVER) -if (USE_GUI) +if (SLS_USE_GUI) if (QT4_FOUND AND QWT_FOUND) add_subdirectory(slsDetectorGui) endif() -endif (USE_GUI) +endif (SLS_USE_GUI) if (SLS_MASTER_PROJECT) # Set targets export name (otherwise set by upstream project) diff --git a/README.md b/README.md index 51b764d82..e142ff84b 100644 --- a/README.md +++ b/README.md @@ -75,13 +75,13 @@ Use cmake to create out-of-source builds, by creating a build folder parallel to $ cd .. $ mkdir slsDetectorPackage-build $ cd slsDetectorPackage-build - $ cmake ../slsDetectorPackage -DCMAKE_BUILD_TYPE=Debug -DUSE_HDF5=OFF + $ cmake ../slsDetectorPackage -DCMAKE_BUILD_TYPE=Debug -DSLS_USE_HDF5=OFF $ make ``` Use the following as an example to compile statically and using specific hdf5 folder ``` - $ HDF5_ROOT=/opt/hdf5v1.10.0 cmake ../slsDetectorPackage -DCMAKE_BUILD_TYPE=Debug -DUSE_HDF5=ON + $ HDF5_ROOT=/opt/hdf5v1.10.0 cmake ../slsDetectorPackage -DCMAKE_BUILD_TYPE=Debug -DSLS_USE_HDF5=ON ``` After compiling, the libraries and executables will be found at `bin` directory ``` diff --git a/cmk.sh b/cmk.sh index 7f4c7fda1..d73649f99 100755 --- a/cmk.sh +++ b/cmk.sh @@ -116,20 +116,20 @@ done if [ $TEXTCLIENT -eq 0 ] && [ $RECEIVER -eq 0 ] && [ $GUI -eq 0 ]; then - CMAKE_POST+=" -DUSE_TEXTCLIENT=ON -DUSE_RECEIVER=ON -DUSE_GUI=ON " + CMAKE_POST+=" -DSLS_USE_TEXTCLIENT=ON -DSLS_USE_RECEIVER=ON -DSLS_USE_GUI=ON " echo "Compile Option: TextClient, Receiver and GUI" else if [ $TEXTCLIENT -eq 1 ]; then - CMAKE_POST+=" -DUSE_TEXTCLIENT=ON " + CMAKE_POST+=" -DSLS_USE_TEXTCLIENT=ON " echo "Compile Option: TextClient" fi if [ $RECEIVER -eq 1 ]; then - CMAKE_POST+=" -DUSE_RECEIVER=ON " + CMAKE_POST+=" -DSLS_USE_RECEIVER=ON " echo "Compile Option: Receiver" fi if [ $GUI -eq 1 ]; then - CMAKE_POST+=" -DUSE_GUI=ON " + CMAKE_POST+=" -DSLS_USE_GUI=ON " echo "Compile Option: GUI" fi fi @@ -161,10 +161,10 @@ fi #hdf5 rebuild if [ $HDF5 -eq 1 ]; then CMAKE_PRE+="HDF5_ROOT="$HDF5DIR - CMAKE_POST+=" -DUSE_HDF5=ON " + CMAKE_POST+=" -DSLS_USE_HDF5=ON " #normal mode rebuild else - CMAKE_POST+=" -DUSE_HDF5=OFF " + CMAKE_POST+=" -DSLS_USE_HDF5=OFF " fi diff --git a/manual/docs/html/slsDetectorInstall/Directly_using_cmake.html b/manual/docs/html/slsDetectorInstall/Directly_using_cmake.html index da620b424..9085aed51 100644 --- a/manual/docs/html/slsDetectorInstall/Directly_using_cmake.html +++ b/manual/docs/html/slsDetectorInstall/Directly_using_cmake.html @@ -33,7 +33,7 @@ source directory. $ cd .. $ mkdir slsDetectorPackage-build $ cd slsDetectorPackage-build - $ cmake ../slsDetectorPackage -DCMAKE_BUILD_TYPE=Debug -DUSE_HDF5=OFF + $ cmake ../slsDetectorPackage -DCMAKE_BUILD_TYPE=Debug -DSLS_USE_HDF5=OFF $ make @@ -42,7 +42,7 @@ Use the following as an example to compile statically and using specific hdf5 folder
  $ HDF5_ROOT=/opt/hdf5v1.10.0 cmake ../slsDetectorPackage
--DCMAKE_BUILD_TYPE=Debug -DUSE_HDF5=ON
+-DCMAKE_BUILD_TYPE=Debug -DSLS_USE_HDF5=ON
 

diff --git a/manual/manual-main/slsDetectorInstall.tex b/manual/manual-main/slsDetectorInstall.tex index 243d783ef..dcf7fc84e 100644 --- a/manual/manual-main/slsDetectorInstall.tex +++ b/manual/manual-main/slsDetectorInstall.tex @@ -369,7 +369,7 @@ source directory. $ cd .. $ mkdir slsDetectorPackage-build $ cd slsDetectorPackage-build - $ cmake ../slsDetectorPackage -DCMAKE_BUILD_TYPE=Debug -DUSE_HDF5=OFF + $ cmake ../slsDetectorPackage -DCMAKE_BUILD_TYPE=Debug -DSLS_USE_HDF5=OFF $ make \end{verbatim} @@ -377,7 +377,7 @@ Use the following as an example to compile statically and using specific hdf5 folder \begin{verbatim} $ HDF5_ROOT=/opt/hdf5v1.10.0 cmake ../slsDetectorPackage --DCMAKE_BUILD_TYPE=Debug -DUSE_HDF5=ON +-DCMAKE_BUILD_TYPE=Debug -DSLS_USE_HDF5=ON \end{verbatim} After compiling, the libraries and executables will be found at `bin` directory diff --git a/recipe/build.sh b/recipe/build.sh index ccaa0f3d1..fba3f4626 100644 --- a/recipe/build.sh +++ b/recipe/build.sh @@ -4,11 +4,11 @@ cd build cmake .. \ -DCMAKE_PREFIX_PATH=$CONDA_PREFIX \ -DCMAKE_INSTALL_PREFIX=install \ - -DUSE_TEXTCLIENT=ON \ - -DUSE_RECEIVER=ON \ - -DUSE_GUI=ON \ + -DSLS_USE_TEXTCLIENT=ON \ + -DSLS_USE_RECEIVER=ON \ + -DSLS_USE_GUI=ON \ -DCMAKE_BUILD_TYPE=Release \ - -DUSE_HDF5=OFF\ + -DSLS_USE_HDF5=OFF\ cmake --build . -- -j10 diff --git a/slsReceiverSoftware/CMakeLists.txt b/slsReceiverSoftware/CMakeLists.txt index 4fb691c21..63311c5ef 100644 --- a/slsReceiverSoftware/CMakeLists.txt +++ b/slsReceiverSoftware/CMakeLists.txt @@ -18,7 +18,7 @@ set(SOURCES # HDF5 -if (USE_HDF5) +if (SLS_USE_HDF5) if (HDF5_FOUND) include_directories( ${HDF5_INCLUDE_DIRS} @@ -30,7 +30,7 @@ if (USE_HDF5) src/HDF5File.cpp ) endif () -endif (USE_HDF5) +endif (SLS_USE_HDF5) add_definitions(