Update CMakeLists.txt

Issue #25 solved. 
Added if at line 45, based on this question:
https://stackoverflow.com/questions/2274006/cmake-invalid-numeric-argument-wextra

After that, a new error popped up concerning "m.lib" file not found.
Removed "m" at line 61, based on this question:
https://stackoverflow.com/questions/19333898/lnk1181-cannot-open-input-file-m-lib

Now the project can be built successfully and the example runs correctly.

PS: I'm not a computer scientist so I do not assure what I did is wrong, consider this pull request as a hint to solve Issue #25.
fixes-turtlebasket
wilwal23 2022-07-17 12:52:03 +02:00 committed by GitHub
parent c4732994e5
commit 101502c438
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 10 additions and 6 deletions

View File

@ -42,9 +42,13 @@ set( CMAKE_POLICY_DEFAULT_CMP0079 NEW)
set( CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON) set( CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON)
set( CMAKE_INCLUDE_CURRENT_DIR TRUE) set( CMAKE_INCLUDE_CURRENT_DIR TRUE)
set( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -pedantic -Wunused-macros") # Set default compile flags for GCC
set( CMAKE_C_FLAGS_DEBUG "-O0 -g -Wall -Wno-unused-command-line-argument") if(CMAKE_COMPILER_IS_GNUC)
set( CMAKE_C_FLAGS_RELEASE "-O3 -Werror -Wno-unused-command-line-argument") message(STATUS "GCC detected, adding compile flags")
set( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -pedantic -Wunused-macros")
set( CMAKE_C_FLAGS_DEBUG "-O0 -g -Wall -Wno-unused-command-line-argument")
set( CMAKE_C_FLAGS_RELEASE "-O3 -Werror -Wno-unused-command-line-argument")
endif(CMAKE_COMPILER_IS_GNUC)
set( GK_PUBLIC_HEADER_DIR ${CMAKE_CURRENT_SOURCE_DIR}/include) set( GK_PUBLIC_HEADER_DIR ${CMAKE_CURRENT_SOURCE_DIR}/include)
@ -54,7 +58,7 @@ add_library(${PROJECT_NAME}
${GK_PUBLIC_HEADER_DIR}/openGJK/openGJK.h ${GK_PUBLIC_HEADER_DIR}/openGJK/openGJK.h
) )
target_link_libraries(${PROJECT_NAME} m) target_link_libraries(${PROJECT_NAME})
target_include_directories( target_include_directories(
${PROJECT_NAME} ${PROJECT_NAME}