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
parent
c4732994e5
commit
101502c438
|
@ -41,10 +41,14 @@ set( CMAKE_VISIBILITY_INLINES_HIDDEN 1)
|
||||||
set( CMAKE_POLICY_DEFAULT_CMP0079 NEW)
|
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}
|
||||||
|
@ -83,4 +87,4 @@ endif (UNIX)
|
||||||
|
|
||||||
# Wrap up feedback on setup
|
# Wrap up feedback on setup
|
||||||
message(STATUS "Version : " ${CMAKE_PROJECT_VERSION} )
|
message(STATUS "Version : " ${CMAKE_PROJECT_VERSION} )
|
||||||
message(STATUS "Build type : " ${CMAKE_BUILD_TYPE} )
|
message(STATUS "Build type : " ${CMAKE_BUILD_TYPE} )
|
||||||
|
|
Loading…
Reference in New Issue