Skip to content

Commit

Permalink
fixed windows build data dir copy
Browse files Browse the repository at this point in the history
  • Loading branch information
nathancrews committed Dec 2, 2023
1 parent 933c85f commit 68ff598
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 11 deletions.
3 changes: 2 additions & 1 deletion LandXML2glTF/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
cmake_minimum_required(VERSION 3.5)

set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DDEBUG -D_DEBUG -DFEATURE_ASSERTS_ENABLED")

set(CMAKE_OSX_DEPLOYMENT_TARGET 11.0)

set (CMAKE_LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin")
Expand Down
20 changes: 17 additions & 3 deletions LandXML2glTF/LXML2glTF/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
cmake_minimum_required(VERSION 3.5)
project(LXML2GLTF)

set(CMAKE_CXX_STANDARD 17)
project(LXML2GLTF)

add_compile_definitions(LANDXML2GLTFDLLAPI_IMPORT)

Expand All @@ -10,8 +9,23 @@ include_directories("../LandXML2glTFDll/Inc")

add_executable(LXML2GLTF "${CMAKE_CURRENT_SOURCE_DIR}/Source/LXML2glTF.cpp")

if (MSVC)
set_target_properties(LXML2GLTF PROPERTIES COMPILE_PDB_NAME "LXML2GLTF" COMPILE_PDB_OUTPUT_DIRECTORY "${LIBRARY_OUTPUT_DIRECTORY}")
elseif (CMAKE_CXX_COMPILER_ID MATCHES "Clang")
target_compile_options(LXML2GLTF
PRIVATE "-fpic"
PRIVATE "-Wunguarded-availability"
PRIVATE "-Wall"
PRIVATE "-Werror"
PRIVATE "-Wunused-but-set-variable"
PUBLIC "-Wno-unknown-pragmas")
elseif (CMAKE_CXX_COMPILER_ID MATCHES "GNU")
target_compile_options(LXML2GLTF
PRIVATE "-fPIC")
endif()

add_custom_command(TARGET LXML2GLTF POST_BUILD
COMMAND "${CMAKE_COMMAND}" -E copy_if_different "${CMAKE_CURRENT_LIST_DIR}/data" "${CMAKE_BINARY_DIR}/bin/$<CONFIG>/"
COMMAND "${CMAKE_COMMAND}" -E copy_directory "${CMAKE_CURRENT_LIST_DIR}/data" "${CMAKE_BINARY_DIR}/bin/$<CONFIG>/data"
)

target_link_libraries(LXML2GLTF PRIVATE LandXML2glTFDLL)
8 changes: 1 addition & 7 deletions LandXML2glTF/LandXML2glTFDll/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,11 @@ cmake_minimum_required(VERSION 3.5)

project(LandXML2glTFDLL)

set(CMAKE_CXX_STANDARD 17)
add_compile_definitions(LANDXML2GLTFDLLAPI_EXPORT)

if (WIN32)
add_compile_definitions(
_CRT_SECURE_NO_WARNINGS _SILENCE_EXPERIMENTAL_FILESYSTEM_DEPRECATION_WARNING
)
add_compile_options(
/MP
_CRT_SECURE_NO_WARNINGS
)
endif()

Expand All @@ -30,8 +26,6 @@ include_directories("../3rdparty/GLTFSDK/GLTFSDK/Inc/")
add_library(LandXML2glTFDLL SHARED ${PROJECT_SRCS})

if (MSVC)
target_compile_options(LandXML2glTFDLL PRIVATE "/Zi;/W4;/EHsc")

set_target_properties(LandXML2glTFDLL PROPERTIES COMPILE_PDB_NAME "LandXML2glTFDLL" COMPILE_PDB_OUTPUT_DIRECTORY "${LIBRARY_OUTPUT_DIRECTORY}")
elseif (CMAKE_CXX_COMPILER_ID MATCHES "Clang")
target_compile_options(LandXML2glTFDLL
Expand Down

0 comments on commit 68ff598

Please sign in to comment.