Skip to content

Commit

Permalink
Merge pull request #6 from LBNL-ETA/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
StephenCzarnecki authored Mar 16, 2022
2 parents 1070590 + e332cb1 commit 696c93e
Show file tree
Hide file tree
Showing 23 changed files with 3,706 additions and 798 deletions.
18 changes: 18 additions & 0 deletions CMakeLists-xmlParser.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
cmake_minimum_required( VERSION 2.8.7 )

# Create include directories that will connect to library itself. This must be created before downloading
# xmlParser library or otherwise connections will not be created

set(xmlParser_INCLUDE_DIRS "${CMAKE_BINARY_DIR}/xmlParser-src/include")

include_directories(${xmlParser_INCLUDE_DIRS})

# Download and create Windows Calculation Engine library
configure_file(CMakeLists-xmlParser.txt.in ${CMAKE_BINARY_DIR}/xmlParser-download/CMakeLists.txt)
execute_process(COMMAND ${CMAKE_COMMAND} -G "${CMAKE_GENERATOR}" .
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/xmlParser-download)
execute_process(COMMAND ${CMAKE_COMMAND} --build .
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/xmlParser-download)

add_subdirectory(${CMAKE_BINARY_DIR}/xmlParser-src "${CMAKE_CURRENT_BINARY_DIR}/xmlParser-src")
set(xmlParser_LIB "${CMAKE_SHARED_LIBRARY_PREFIX}xmlParser${CMAKE_SHARED_LIBRARY_SUFFIX}")
19 changes: 19 additions & 0 deletions CMakeLists-xmlParser.txt.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
cmake_minimum_required( VERSION 2.8.7 )

include(ExternalProject)

ExternalProject_Add(xmlParser
GIT_REPOSITORY https://github.com/LBNL-ETA/XMLParser.git
GIT_TAG "main"

UPDATE_COMMAND ""
PATCH_COMMAND ""

SOURCE_DIR "${CMAKE_BINARY_DIR}/xmlParser-src"
BINARY_DIR "${CMAKE_BINARY_DIR}/xmlParser-build"

CONFIGURE_COMMAND ""
BUILD_COMMAND ""
TEST_COMMAND ""
INSTALL_COMMAND ""
)
3 changes: 2 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
cmake_minimum_required(VERSION 3.8)

project( OpticalMeasurementParser VERSION 1.0.1 LANGUAGES CXX )
project( OpticalMeasurementParser VERSION 1.2.0 LANGUAGES CXX )
set(LIB_NAME ${PROJECT_NAME})

if(NOT "${CMAKE_CXX_STANDARD}")
Expand Down Expand Up @@ -36,6 +36,7 @@ endif()
set( JSON_BuildTests OFF CACHE BOOL "")

include(CMakeLists-nlohmann_json.txt)
include(CMakeLists-xmlParser.txt)

add_subdirectory( src )

Expand Down
5 changes: 3 additions & 2 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ add_library( ${LIB_NAME}
ProductData.cpp)

target_link_libraries(${LIB_NAME} PUBLIC nlohmann_json::nlohmann_json)
target_link_libraries(${LIB_NAME} PUBLIC xmlParser)

if(NOT "${fPIC}")
set(fPIC ON)
Expand All @@ -18,10 +19,10 @@ endif()


if (CMAKE_COMPILER_IS_GNUCC)
target_compile_options(${LIB_NAME} PRIVATE -Wall -Wextra -pedantic -Werror)
target_compile_options(${LIB_NAME} PRIVATE -Wall -Wextra -pedantic -Werror)
endif()
if(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
target_compile_options(${LIB_NAME} PRIVATE -Wall -Wextra -pedantic -Werror)
target_compile_options(${LIB_NAME} PRIVATE -Wall -Wextra -pedantic -Werror )
endif()
if (MSVC)
target_compile_options(${LIB_NAME} PRIVATE /W4 /WX)
Expand Down
Loading

0 comments on commit 696c93e

Please sign in to comment.