-
Notifications
You must be signed in to change notification settings - Fork 98
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improvements to SHTfile project inclusion.
Will now look for SHTfile inside of EMSoft/ExternalProjects. If it is not found then it will clone it from github.com/emsoft-org/SHTfile Signed-off-by: Michael Jackson <[email protected]>
- Loading branch information
1 parent
a9d8ccd
commit 4f6f972
Showing
3 changed files
with
97 additions
and
60 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -99,6 +99,43 @@ if (NOT DEFINED CMP_SOURCE_DIR) | |
endif() | ||
include (${CMP_SOURCE_DIR}/cmpCMakeMacros.cmake ) | ||
|
||
#get_filename_component(EMsoft_PARENT ${CMAKE_CURRENT_SOURCE_DIR} DIRECTORY CACHE) | ||
|
||
find_package(Git REQUIRED) | ||
|
||
#------------------------------------------------------------------------------ | ||
# If the developer has set another EMsoft directory then use that, otherwise look | ||
# for the EMsoft directory at the same level as the EMsoftPrivate directory | ||
if("${SHTfile_SOURCE_DIR}" STREQUAL "") | ||
if(NOT EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/ExternalProjects") | ||
file(MAKE_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/ExternalProjects") | ||
endif() | ||
set(SHTfile_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/ExternalProjects/SHTfile") | ||
message(STATUS "Locating EMsoft Source directory at ${SHTfile_SOURCE_DIR}") | ||
if(EXISTS "${SHTfile_SOURCE_DIR}") | ||
message(STATUS "SHTfile_SOURCE_DIR: ${SHTfile_SOURCE_DIR}") | ||
else() | ||
|
||
if(Git_FOUND) | ||
message(STATUS "SHTfile_SOURCE_DIR does not exist at ${SHTfile_SOURCE_DIR}. Attempting to clone it from Github....") | ||
execute_process(COMMAND ${GIT_EXECUTABLE} clone [email protected]:EMsoft-org/SHTfile.git ${SHTfile_SOURCE_DIR} | ||
OUTPUT_VARIABLE CLONE_OUTPUT | ||
RESULT_VARIABLE did_run | ||
ERROR_VARIABLE git_error | ||
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/ExternalProjects) | ||
endif() | ||
# One last check. If it does not exist at this point then we simply Abort CMake | ||
if(NOT EXISTS "${SHTfile_SOURCE_DIR}") | ||
message(FATAL_ERROR "SHTfile_SOURCE_DIR does not exist. We attempted to clone it from the GitHub repo but that also seemed\ | ||
to fail. EMsoft can not proceed without the SHTfile directory. Please ask a EMsoft developer for more\ | ||
information about this error. Can you access http://github.com/EMsoft-org/SHTfile.git is\ | ||
a firewall blocking the 'git' protocol? ") | ||
endif() | ||
|
||
endif() | ||
endif() | ||
|
||
|
||
# Next up, Set the version of EMsoft that is used through out the project. | ||
|
||
set(EMsoft_VER_MAJOR "5") | ||
|
@@ -180,9 +217,6 @@ if("${EMsoftSearchDirs}" STREQUAL "") | |
|
||
endif() | ||
|
||
|
||
|
||
|
||
# Set the Application Name to with the correct icons and badges | ||
set(CMP_HEADER_DIR ${EMsoft_BINARY_DIR}) | ||
set(PROJECT_RESOURCES_DIR "${EMsoft_SOURCE_DIR}/resources") | ||
|
@@ -270,6 +304,10 @@ OPTION(EMsoft_ENABLE_TESTING "Compile the test programs" ON) | |
set(EMsoft_TESTING_DIR "${EMsoft_BINARY_DIR}/Testing") | ||
|
||
|
||
# ----------------------------------------------------------------------- | ||
# Build SHTfile Project | ||
# ----------------------------------------------------------------------- | ||
add_subdirectory(${SHTfile_SOURCE_DIR} ${EMsoft_BINARY_DIR}/SHTfile) | ||
|
||
# ----------------------------------------------------------------------- | ||
# Set a Global Prefix where everthing is going to get intalled. For OS X we are | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,36 +1,31 @@ | ||
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * | ||
* * | ||
* Copyright (c) 2019-2019, De Graef Group, Carnegie Mellon University * | ||
* All rights reserved. * | ||
* * | ||
* Author: William C. Lenthe * | ||
* * | ||
* This package is free software; you can redistribute it and/or * | ||
* modify it under the terms of the GNU General Public License as * | ||
* published by the Free Software Foundation; either version 2 of the * | ||
* License, or (at your option) any later version. * | ||
* * | ||
* This program is distributed in the hope that it will be useful, * | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of * | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * | ||
* GNU General Public License for more details. * | ||
* * | ||
* You should have received a copy of the GNU General Public License * | ||
* along with this program; if not, check the Free Software Foundation * | ||
* website: <https://www.gnu.org/licenses/old-licenses/gpl-2.0.html> * | ||
* * | ||
* * | ||
* Interested in a commercial license? Contact: * | ||
* * | ||
* Center for Technology Transfer and Enterprise Creation * | ||
* 4615 Forbes Avenue, Suite 302 * | ||
* Pittsburgh, PA 15213 * | ||
* * | ||
* phone. : 412.268.7393 * | ||
* email : [email protected] * | ||
* website: https://www.cmu.edu/cttec/ * | ||
* * | ||
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ | ||
/* | ||
* Copyright (c) 2018-2019, Marc De Graef Research Group/Carnegie Mellon University * | ||
* All rights reserved. * | ||
* * | ||
* 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 copyright holder 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 "sht_file.hpp" | ||
|
||
|
@@ -48,10 +43,10 @@ extern "C" { | |
//@param iprm: integer parameters {# electrons, electron multiplier, numsx, npx, latgridtype} | ||
//@param bw : bandwidth | ||
//@param alm: actual harmonics (uncompressed format) | ||
int writeSHTfile_(char * fn, char const * nt, char const * doi, | ||
int32_t * sgN, int32_t * sgS, int32_t * nAt, int32_t * aTy, float * aCd, float * lat, | ||
float * fprm, int32_t * iprm, | ||
int32_t * bw,double * alm) { | ||
int writeSHTfile_(char* fn, const char* nt, const char* doi, | ||
int32_t* sgN, int32_t* sgS, int32_t* nAt, int32_t* aTy, float* aCd, float* lat, | ||
float* fprm, int32_t* iprm, | ||
int32_t* bw,double* alm) { | ||
return sht::File::EMsoftEBSDRet(fn, nt, doi, *sgN, *sgS, *nAt, aTy, aCd, lat, fprm, iprm, *bw, alm); | ||
} | ||
} |